ARTEMIS-2320 Assorted small code fixes, mostly from IntelliJ autofixes

This commit is contained in:
Jiri Danek 2019-03-25 14:09:25 +01:00 committed by Michael Andre Pearce
parent bd6d5ecd72
commit b33874488b
11 changed files with 17 additions and 18 deletions

View File

@ -123,7 +123,7 @@ public final class PasswordMaskingUtil {
}
private static boolean isEncoded(String storedPassword) {
return storedPassword == null || (isEncMasked(storedPassword));
return storedPassword == null || isEncMasked(storedPassword);
}
public static HashProcessor getHashProcessor() {
@ -164,7 +164,7 @@ public final class PasswordMaskingUtil {
try {
// Service load the codec, if a service is available
for (SensitiveDataCodec<String> codec : serviceLoader) {
if ((codec.getClass().getCanonicalName()).equals(codecClassName)) {
if (codec.getClass().getCanonicalName().equals(codecClassName)) {
return codec.getClass().newInstance();
}
}

View File

@ -49,7 +49,7 @@ public class ConcurrentAppendOnlyChunkedListTest {
final int messages = ELEMENTS;
for (int i = 0; i < messages; i++) {
Assert.assertEquals(i, chunkedList.size());
chunkedList.add((i));
chunkedList.add(i);
}
Assert.assertEquals(messages, chunkedList.size());
}

View File

@ -56,9 +56,7 @@ public class InflaterReader extends InputStream {
}
pointer = 0;
} catch (DataFormatException e) {
IOException e2 = new IOException(e.getMessage());
e2.initCause(e);
throw e2;
throw new IOException(e.getMessage(), e);
}
}

View File

@ -37,7 +37,7 @@ public class SharedEventLoopGroupTest {
Thread t1 = new Thread(new Runnable() {
@Override
public void run() {
sharedEventLoopGroup1.set(SharedEventLoopGroup.getInstance((threadFactory -> customNioEventLoopGroup)));
sharedEventLoopGroup1.set(SharedEventLoopGroup.getInstance(threadFactory -> customNioEventLoopGroup));
customNioEventLoopGroup.setCyclicBarrier(barrier);
sharedEventLoopGroup1.get().shutdownGracefully();
customNioEventLoopGroup.setCyclicBarrier(null);
@ -51,7 +51,7 @@ public class SharedEventLoopGroupTest {
public void run() {
try {
barrier.await();
sharedEventLoopGroup2.set(SharedEventLoopGroup.getInstance((threadFactory -> new NioEventLoopGroup(2, threadFactory))));
sharedEventLoopGroup2.set(SharedEventLoopGroup.getInstance(threadFactory -> new NioEventLoopGroup(2, threadFactory)));
} catch (InterruptedException e) {
e.printStackTrace();
} catch (BrokenBarrierException e) {

View File

@ -82,7 +82,7 @@ rect.graphbox.frame {
path.link {
fill: none;
stroke: #666;
stroke-width: 1.5px; b
stroke-width: 1.5px;
}
marker.broker {

View File

@ -212,7 +212,7 @@ public class ConnectionFactoryURITest {
populateConnectorParams(props3, allowableConnectorKeys, sb);
sb.append(")?ha=true&clientID=myID");
ActiveMQConnectionFactory factory = parser.newObject(parser.expandURI((sb.toString())), null);
ActiveMQConnectionFactory factory = parser.newObject(parser.expandURI(sb.toString()), null);
TransportConfiguration[] staticConnectors = factory.getStaticConnectors();
Assert.assertEquals(3, staticConnectors.length);

View File

@ -3,7 +3,6 @@
<head>
<!-- $Id: package.html 71554 2008-04-01 13:25:40Z adrian@jboss.org $ -->
<!--
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.

View File

@ -14,7 +14,8 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import httplib, urlparse
import httplib
import urlparse
conn = httplib.HTTPConnection("localhost:8080")
conn.request("HEAD", "/queues/orders")

View File

@ -14,7 +14,8 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
import httplib, urlparse
import httplib
import urlparse
conn = httplib.HTTPConnection("localhost:8080")
conn.request("HEAD", "/queues/orders")
@ -49,7 +50,7 @@ try:
else:
raise Exception('failed')
finally:
if session != None:
if session is not None:
print "deleting activemq session..."
createParsed = urlparse.urlparse(session)
conn = httplib.HTTPConnection(createParsed.netloc)

View File

@ -250,7 +250,7 @@ public class IdGenerator {
*/
protected static String getLocalHostName() throws UnknownHostException {
try {
return (InetAddress.getLocalHost()).getHostName();
return InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException uhe) {
String host = uhe.getMessage(); // host = "hostname: hostname"
if (host != null) {

View File

@ -180,7 +180,7 @@ public class TokenBucketLimiterImplTest extends ActiveMQTestBase {
if (lastRun != 0) {
int consumed = tmpValue - lastRun;
double calculatedRate = consumed * window * 1000 / ((System.currentTimeMillis() - lastTime));
double calculatedRate = consumed * window * 1000 / (System.currentTimeMillis() - lastTime);
if (calculatedRate > rate * error) {
System.out.println("got more than " + rate + " tokens / second");