Use StringBuilder instead of StringBuffer 40/20640/1
authorRobert Varga <rovarga@cisco.com>
Mon, 18 May 2015 11:33:43 +0000 (13:33 +0200)
committerRobert Varga <rovarga@cisco.com>
Mon, 18 May 2015 11:33:43 +0000 (13:33 +0200)
StringBuffer is overly synchronized, use a StringBuilder instead.

Change-Id: Ifb18d3ebb2ae464f5e634aaee8c7d969a98256de
Signed-off-by: Robert Varga <rovarga@cisco.com>
renderers/ofoverlay/src/main/java/org/opendaylight/groupbasedpolicy/renderer/ofoverlay/flow/DestinationMapper.java
renderers/opflex/src/main/java/org/opendaylight/groupbasedpolicy/renderer/opflex/mit/PolicyUri.java

index dc8e608c1a371ee0d863380c992e32ad531de8ab..9f8e5a328ba07d17ad262ef76cf88420e14ed8e8 100644 (file)
@@ -216,10 +216,7 @@ public class DestinationMapper extends FlowTable {
     // group on the node
 
     private Flow createBroadcastFlow(EndpointFwdCtxOrdinals epOrd) {
-        FlowId flowId = new FlowId(new StringBuilder().
-                                    append("broadcast|").
-                                    append(epOrd.getFdId()).
-                                    toString());
+        FlowId flowId = new FlowId("broadcast|" + epOrd.getFdId());
         MatchBuilder mb = new MatchBuilder()
                             .setEthernetMatch(new EthernetMatchBuilder()
                             .setEthernetDestination(new EthernetDestinationBuilder().
index 471fc5be953cce940edf4bd44341ac0a17ba7c1f..672dd3458feed4745f94917b7fb20a53c7039a48 100644 (file)
@@ -227,7 +227,7 @@ public class PolicyUri {
     public String toString() {
         if (uri.size() == 0)
             return "";
-        StringBuffer sb = new StringBuffer();
+        StringBuilder sb = new StringBuilder();
 
         for (String s : uri) {
             sb.append(s);