Author: pmouawad
Date: Thu Feb 18 13:27:49 2016
New Revision: 1731070
URL: http://svn.apache.org/viewvc?rev=1731070&view=rev
Log:
Removing unnecessary modifiers
Contributed by Graham Russel Part 3
https://github.com/apache/jmeter/pull/122
Modified:
jmeter/trunk/src/jorphan/org/apache/commons/cli/avalon/CLUtil.java
jmeter/trunk/src/jorphan/org/apache/jorphan/collections/HashTree.java
jmeter/trunk/src/jorphan/org/apache/jorphan/gui/MenuScroller.java
jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/Utils.java
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java
jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java
Modified: jmeter/trunk/src/jorphan/org/apache/commons/cli/avalon/CLUtil.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/commons/cli/avalon/CLUtil.java?rev=1731070&r1=1731069&r2=1731070&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/commons/cli/avalon/CLUtil.java
(original)
+++ jmeter/trunk/src/jorphan/org/apache/commons/cli/avalon/CLUtil.java Thu Feb
18 13:27:49 2016
@@ -42,7 +42,7 @@ public final class CLUtil {
* the option descriptors
* @return the formatted description/help for options
*/
- public static final StringBuilder describeOptions(final
CLOptionDescriptor[] options) {
+ public static StringBuilder describeOptions(final CLOptionDescriptor[]
options) {
final String lSep = System.getProperty("line.separator");
final StringBuilder sb = new StringBuilder();
Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/collections/HashTree.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/collections/HashTree.java?rev=1731070&r1=1731069&r2=1731070&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/collections/HashTree.java
(original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/collections/HashTree.java Thu
Feb 18 13:27:49 2016
@@ -113,7 +113,7 @@ public class HashTree implements Seriali
* @see java.util.Map#putAll(Map)
*/
@Override
- public void putAll(Map<? extends Object, ? extends HashTree> map) {
+ public void putAll(Map<?, ? extends HashTree> map) {
if (map instanceof HashTree) {
this.add((HashTree) map);
} else {
Modified: jmeter/trunk/src/jorphan/org/apache/jorphan/gui/MenuScroller.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/jorphan/org/apache/jorphan/gui/MenuScroller.java?rev=1731070&r1=1731069&r2=1731070&view=diff
==============================================================================
--- jmeter/trunk/src/jorphan/org/apache/jorphan/gui/MenuScroller.java (original)
+++ jmeter/trunk/src/jorphan/org/apache/jorphan/gui/MenuScroller.java Thu Feb
18 13:27:49 2016
@@ -664,7 +664,7 @@ public class MenuScroller {
}
}
- private static enum MenuIcon implements Icon {
+ private enum MenuIcon implements Icon {
UP(9, 1, 9), DOWN(1, 9, 1);
final int[] xPoints = { 1, 5, 9 };
Modified:
jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/Utils.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/Utils.java?rev=1731070&r1=1731069&r2=1731070&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/Utils.java
(original)
+++ jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/Utils.java Thu
Feb 18 13:27:49 2016
@@ -160,7 +160,7 @@ public final class Utils {
* @throws NamingException
* if a naming problem occurs while getting the environment
*/
- public static final String getFromEnvironment(Context context, String key)
throws NamingException {
+ public static String getFromEnvironment(Context context, String key)
throws NamingException {
try {
Hashtable<?,?> env = context.getEnvironment();
if(env != null) {
@@ -216,7 +216,7 @@ public final class Utils {
* @throws JMSException when <code>msg</code> throws a {@link
JMSException} while the properties get set
*/
public static void addJMSProperties(Message msg, Map<String, Object> map)
throws JMSException {
- if(map == null) {
+ if (map == null) {
return;
}
for (Map.Entry<String, Object> me : map.entrySet()) {
@@ -227,7 +227,7 @@ public final class Utils {
}
// WebsphereMQ does not allow corr. id. to be set using
setStringProperty()
- if("JMSCorrelationID".equalsIgnoreCase(name)) { // $NON-NLS-1$
+ if ("JMSCorrelationID".equalsIgnoreCase(name)) { // $NON-NLS-1$
msg.setJMSCorrelationID((String)value);
} else {
msg.setObjectProperty(name, value);
@@ -242,7 +242,7 @@ public final class Utils {
* @param args {@link Arguments} to be converted
* @return jmsProperties The converted {@link JMSProperties}
*/
- public static final JMSProperties
convertArgumentsToJmsProperties(Arguments args) {
+ public static JMSProperties convertArgumentsToJmsProperties(Arguments
args) {
JMSProperties jmsProperties = new JMSProperties();
Map<String,String> map = args.getArgumentsAsMap();
for (Map.Entry<String, String> entry : map.entrySet()) {
Modified:
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java?rev=1731070&r1=1731069&r2=1731070&view=diff
==============================================================================
---
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
(original)
+++
jmeter/trunk/src/protocol/tcp/org/apache/jmeter/protocol/tcp/sampler/BinaryTCPClientImpl.java
Thu Feb 18 13:27:49 2016
@@ -64,7 +64,7 @@ public class BinaryTCPClientImpl extends
* @return Byte array containing binary representation of input
hex-encoded string
* @throws IllegalArgumentException if string is not an even number of hex
digits
*/
- public static final byte[] hexStringToByteArray(String hexEncodedBinary) {
+ public static byte[] hexStringToByteArray(String hexEncodedBinary) {
if (hexEncodedBinary.length() % 2 == 0) {
char[] sc = hexEncodedBinary.toCharArray();
byte[] ba = new byte[sc.length / 2];
Modified: jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java?rev=1731070&r1=1731069&r2=1731070&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java (original)
+++ jmeter/trunk/test/src/org/apache/jmeter/junit/JMeterTest.java Thu Feb 18
13:27:49 2016
@@ -251,7 +251,7 @@ public class JMeterTest extends JMeterTe
private static Test suiteBeanComponents() throws Exception {
TestSuite suite = new TestSuite("BeanComponents");
for (Object o : getObjects(TestBean.class)) {
- Class<? extends Object> c = o.getClass();
+ Class<?> c = o.getClass();
try {
JMeterGUIComponent item = new TestBeanGUI(c);
TestSuite ts = new TestSuite(item.getClass().getName());
@@ -279,8 +279,8 @@ public class JMeterTest extends JMeterTe
String name = guiItem.getClass().getName();
if (// Is this a work in progress or an internal GUI component?
(title != null && title.length() > 0) // Will be "" for
internal components
- &&
(title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(ALPHA") == -1)
- &&
(title.toUpperCase(java.util.Locale.ENGLISH).indexOf("(BETA") == -1)
+ && (!title.toUpperCase(Locale.ENGLISH).contains("(ALPHA"))
+ && (!title.toUpperCase(Locale.ENGLISH).contains("(BETA"))
&& (!title.matches("Example\\d+")) // Skip the example
samplers ...
&& (!name.startsWith("org.apache.jmeter.examples.")))
{// No, not a work in progress ...
@@ -293,7 +293,6 @@ public class JMeterTest extends JMeterTe
}
}
-
/*
* Test GUI elements - run for all components
*/
Modified: jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java
URL:
http://svn.apache.org/viewvc/jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java?rev=1731070&r1=1731069&r2=1731070&view=diff
==============================================================================
--- jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java
(original)
+++ jmeter/trunk/test/src/org/apache/jmeter/resources/PackageTest.java Thu Feb
18 13:27:49 2016
@@ -90,20 +90,21 @@ public class PackageTest extends TestCas
// Read resource into ResourceBundle and store in List
private PropertyResourceBundle getRAS(String res) throws Exception {
InputStream ras = this.getClass().getResourceAsStream(res);
- if (ras == null){
+ if (ras == null) {
return null;
}
return new PropertyResourceBundle(ras);
}
- private static final Object[] DUMMY_PARAMS = new Object[] { "1", "2", "3",
"4", "5", "6", "7", "8", "9" };
+ private static final Object[] DUMMY_PARAMS =
+ new Object[] { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
// Read resource file saving the keys
private int readRF(String res, List<String> l) throws Exception {
int fails = 0;
InputStream ras = this.getClass().getResourceAsStream(res);
- if (ras==null){
- if (MESSAGES.equals(resourcePrefix)|| lang.length() == 0 ){
+ if (ras == null){
+ if (MESSAGES.equals(resourcePrefix)|| lang.length() == 0 ) {
throw new IOException("Cannot open resource file "+res);
} else {
return 0;
@@ -232,26 +233,25 @@ public class PackageTest extends TestCas
/**
* Find I18N resources in classpath
- * @param srcFiledir directory in which the files reside
+ * @param srcFileDir directory in which the files reside
* @return list of properties files subject to I18N
*/
- public static final String[] getResources(File srcFiledir) {
+ public static String[] getResources(File srcFileDir) {
Set<String> set = new TreeSet<>();
- findFile(srcFiledir, set, new FilenameFilter() {
+ findFile(srcFileDir, set, new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
- return new File(dir, name).isDirectory()
- || (
- name.equals("messages.properties") ||
- (name.endsWith("Resources.properties")
- &&
!name.matches("Example\\d+Resources\\.properties")));
+ return (name.equals("messages.properties") ||
+ (name.endsWith("Resources.properties")
+ &&
!name.matches("Example\\d+Resources\\.properties")))
+ || new File(dir, name).isDirectory();
}
});
return set.toArray(new String[set.size()]);
}
-
+
/**
- * Find resources matching filenamefiler and adds them to set removing
+ * Find resources matching filenameFiler and adds them to set removing
* everything before "/org"
*
* @param file
@@ -267,7 +267,7 @@ public class PackageTest extends TestCas
File[] foundFiles = file.listFiles(filenameFilter);
assertNotNull("Not a directory: "+file, foundFiles);
for (File file2 : foundFiles) {
- if(file2.isDirectory()) {
+ if (file2.isDirectory()) {
findFile(file2, set, filenameFilter);
} else {
String absPath2 = file2.getAbsolutePath().replace('\\', '/');
// Fix up Windows paths
@@ -386,22 +386,28 @@ public class PackageTest extends TestCas
}
}
}
- if(!missingLabels.isEmpty()) {
+ if (!missingLabels.isEmpty()) {
missingLabelsPerBundle.put(languageBundle, missingLabels);
}
}
/**
- * Build message with misssing labels per bundle
+ * Build message with missing labels per bundle.
+ *
* @param missingLabelsPerBundle
* @return String
*/
private String printLabels(Map<String, Map<String, String>>
missingLabelsPerBundle) {
StringBuilder builder = new StringBuilder();
for (Map.Entry<String, Map<String, String>> entry :
missingLabelsPerBundle.entrySet()) {
- builder.append("Missing labels in bundle:" + entry.getKey() +
"\r\n");
+ builder.append("Missing labels in bundle:")
+ .append(entry.getKey())
+ .append("\r\n");
for (Map.Entry<String, String> entry2 :
entry.getValue().entrySet()) {
- builder.append(entry2.getKey() + "=" + entry2.getValue() +
"\r\n");
+ builder.append(entry2.getKey())
+ .append("=")
+ .append(entry2.getValue())
+ .append("\r\n");
}
builder.append("======================================================\r\n");
}