You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by pm...@apache.org on 2016/12/29 21:18:36 UTC

svn commit: r1776485 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java

Author: pmouawad
Date: Thu Dec 29 21:18:36 2016
New Revision: 1776485

URL: http://svn.apache.org/viewvc?rev=1776485&view=rev
Log:
sonar: fix errors and better format

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java?rev=1776485&r1=1776484&r2=1776485&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java Thu Dec 29 21:18:36 2016
@@ -115,6 +115,7 @@ public class SessionFilter implements Fi
      */
     @Override
     public void excludeFiles(String[] filenames) {
+        // NOOP
     }
 
     /**
@@ -122,6 +123,7 @@ public class SessionFilter implements Fi
      */
     @Override
     public void excludePattern(String[] regexp) {
+        // NOOP
     }
 
     /**
@@ -137,6 +139,7 @@ public class SessionFilter implements Fi
      */
     @Override
     public void includeFiles(String[] filenames) {
+        // NOOP
     }
 
     /**
@@ -144,6 +147,7 @@ public class SessionFilter implements Fi
      */
     @Override
     public void includePattern(String[] regexp) {
+        // NOOP
     }
 
     /**
@@ -162,37 +166,32 @@ public class SessionFilter implements Fi
         CookieManager cm;
         // First have to release the cookie we were using so other
         // threads stuck in wait can move on
-        synchronized(LOCK)
-        {
-            if(lastUsed != null)
-            {
+        synchronized(LOCK) {
+            if(lastUsed != null) {
                 managersInUse.remove(lastUsed);
                 LOCK.notifyAll();
             }
         }
         // let notified threads move on and get lock on managersInUse
-        if(lastUsed != null)
-        {
+        if(lastUsed != null) {
             Thread.yield();
         }
         // here is the core routine to find appropriate cookie manager and
         // check it's not being used.  If used, wait until whoever's using it gives
         // it up
-        synchronized(LOCK)
-        {
+        synchronized(LOCK) {
             cm = cookieManagers.get(ipAddr);
-            if(cm == null)
-            {
+            if(cm == null) {
                 cm = new CookieManager();
                 cm.testStarted();
                 cookieManagers.put(ipAddr,cm);
             }
-            while(managersInUse.contains(cm))
-            {
+            while(managersInUse.contains(cm)) {
                 try {
                     LOCK.wait();
                 } catch (InterruptedException e) {
                     log.info("SessionFilter wait interrupted");
+                    Thread.currentThread().interrupt();
                 }
             }
             managersInUse.add(cm);
@@ -206,6 +205,7 @@ public class SessionFilter implements Fi
      */
     @Override
     public void setReplaceExtension(String oldextension, String newextension) {
+        // NOOP
     }
 
     /**
@@ -213,8 +213,7 @@ public class SessionFilter implements Fi
      */
     @Override
     public void threadFinished() {
-        synchronized(LOCK)
-        {
+        synchronized(LOCK) {
             managersInUse.remove(lastUsed);
             LOCK.notifyAll();
         }
@@ -225,5 +224,6 @@ public class SessionFilter implements Fi
      */
     @Override
     public void threadStarted() {
+        // NOOP
     }
 }