| @@ -394,7 +394,7 @@ public final class IntrospectionHelper { | |||||
| dc.setDynamicAttribute(attributeName.toLowerCase(Locale.ENGLISH), value.toString()); | dc.setDynamicAttribute(attributeName.toLowerCase(Locale.ENGLISH), value.toString()); | ||||
| return; | return; | ||||
| } | } | ||||
| if (attributeName.indexOf(':') >= 0) { | |||||
| if (attributeName.contains(":")) { | |||||
| return; // Ignore attribute from unknown uri's | return; // Ignore attribute from unknown uri's | ||||
| } | } | ||||
| final String msg = getElementName(p, element) | final String msg = getElementName(p, element) | ||||
| @@ -154,7 +154,7 @@ public class RuntimeConfigurable implements Serializable { | |||||
| * @return AttributeComponentInformation instance | * @return AttributeComponentInformation instance | ||||
| */ | */ | ||||
| private AttributeComponentInformation isRestrictedAttribute(String name, ComponentHelper componentHelper) { | private AttributeComponentInformation isRestrictedAttribute(String name, ComponentHelper componentHelper) { | ||||
| if (name.indexOf(':') == -1) { | |||||
| if (!name.contains(":")) { | |||||
| return new AttributeComponentInformation(null, false); | return new AttributeComponentInformation(null, false); | ||||
| } | } | ||||
| String componentName = attrToComponent(name); | String componentName = attrToComponent(name); | ||||
| @@ -184,16 +184,15 @@ public class RuntimeConfigurable implements Serializable { | |||||
| ComponentHelper componentHelper = ComponentHelper | ComponentHelper componentHelper = ComponentHelper | ||||
| .getComponentHelper(owner.getProject()); | .getComponentHelper(owner.getProject()); | ||||
| IntrospectionHelper ih | |||||
| = IntrospectionHelper.getHelper( | |||||
| owner.getProject(), EnableAttributeConsumer.class); | |||||
| for (int i = 0; i < attributeMap.keySet().size(); ++i) { | |||||
| String name = (String) attributeMap.keySet().toArray()[i]; | |||||
| AttributeComponentInformation attributeComponentInformation = isRestrictedAttribute(name, componentHelper); | |||||
| IntrospectionHelper ih = IntrospectionHelper.getHelper(owner.getProject(), | |||||
| EnableAttributeConsumer.class); | |||||
| for (Map.Entry<String, Object> entry : attributeMap.entrySet()) { | |||||
| AttributeComponentInformation attributeComponentInformation | |||||
| = isRestrictedAttribute(entry.getKey(), componentHelper); | |||||
| if (!attributeComponentInformation.isRestricted()) { | if (!attributeComponentInformation.isRestricted()) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| String value = (String) attributeMap.get(name); | |||||
| String value = (String) entry.getValue(); | |||||
| EnableAttribute enable = null; | EnableAttribute enable = null; | ||||
| try { | try { | ||||
| enable = (EnableAttribute) | enable = (EnableAttribute) | ||||
| @@ -287,7 +286,7 @@ public class RuntimeConfigurable implements Serializable { | |||||
| * @param value the attribute's value. | * @param value the attribute's value. | ||||
| */ | */ | ||||
| public synchronized void setAttribute(String name, String value) { | public synchronized void setAttribute(String name, String value) { | ||||
| if (name.indexOf(':') != -1) { | |||||
| if (name.contains(":")) { | |||||
| namespacedAttribute = true; | namespacedAttribute = true; | ||||
| } | } | ||||
| setAttribute(name, (Object) value); | setAttribute(name, (Object) value); | ||||
| @@ -253,9 +253,8 @@ public class ProjectHelper2 extends ProjectHelper { | |||||
| inputStream = Files.newInputStream(buildFile.toPath()); | inputStream = Files.newInputStream(buildFile.toPath()); | ||||
| } else { | } else { | ||||
| uri = url.toString(); | uri = url.toString(); | ||||
| int pling = -1; | |||||
| if (uri.startsWith("jar:file") | |||||
| && (pling = uri.indexOf("!/")) > -1) { | |||||
| int pling = uri.indexOf("!/"); | |||||
| if (uri.startsWith("jar:file") && pling > -1) { | |||||
| zf = new ZipFile(org.apache.tools.ant.launch.Locator | zf = new ZipFile(org.apache.tools.ant.launch.Locator | ||||
| .fromJarURI(uri), "UTF-8"); | .fromJarURI(uri), "UTF-8"); | ||||
| inputStream = | inputStream = | ||||
| @@ -139,7 +139,7 @@ public class Launcher { | |||||
| while (tokenizer.hasMoreElements()) { | while (tokenizer.hasMoreElements()) { | ||||
| final String elementName = tokenizer.nextToken(); | final String elementName = tokenizer.nextToken(); | ||||
| final File element = new File(elementName); | final File element = new File(elementName); | ||||
| if (elementName.indexOf('%') != -1 && !element.exists()) { | |||||
| if (elementName.contains("%") && !element.exists()) { | |||||
| continue; | continue; | ||||
| } | } | ||||
| if (getJars && element.isDirectory()) { | if (getJars && element.isDirectory()) { | ||||
| @@ -282,7 +282,7 @@ public final class Locator { | |||||
| * @since Ant 1.7 | * @since Ant 1.7 | ||||
| */ | */ | ||||
| public static String decodeUri(String uri) throws UnsupportedEncodingException { | public static String decodeUri(String uri) throws UnsupportedEncodingException { | ||||
| if (uri.indexOf('%') == -1) { | |||||
| if (!uri.contains("%")) { | |||||
| return uri; | return uri; | ||||
| } | } | ||||
| ByteArrayOutputStream sb = new ByteArrayOutputStream(uri.length()); | ByteArrayOutputStream sb = new ByteArrayOutputStream(uri.length()); | ||||
| @@ -458,7 +458,6 @@ public abstract class AbstractCvsTask extends Task { | |||||
| int startproto = cmdLine.indexOf(':', start); | int startproto = cmdLine.indexOf(':', start); | ||||
| int startuser = cmdLine.indexOf(':', startproto + 1); | int startuser = cmdLine.indexOf(':', startproto + 1); | ||||
| int startpass = cmdLine.indexOf(':', startuser + 1); | int startpass = cmdLine.indexOf(':', startuser + 1); | ||||
| stop = cmdLine.indexOf('@', start); | |||||
| if (stop >= 0 && startpass > startproto && startpass < stop) { | if (stop >= 0 && startpass > startproto && startpass < stop) { | ||||
| for (int i = startpass + 1; i < stop; i++) { | for (int i = startpass + 1; i < stop; i++) { | ||||
| buf.replace(i, i + 1, "*"); | buf.replace(i, i + 1, "*"); | ||||
| @@ -136,17 +136,9 @@ public class Execute { | |||||
| return procEnvironment; | return procEnvironment; | ||||
| } | } | ||||
| StringBuilder var = null; | StringBuilder var = null; | ||||
| String line, lineSep = StringUtils.LINE_SEP; | |||||
| String line; | |||||
| while ((line = in.readLine()) != null) { | while ((line = in.readLine()) != null) { | ||||
| if (line.indexOf('=') == -1) { | |||||
| // Chunk part of previous env var (UNIX env vars can | |||||
| // contain embedded new lines). | |||||
| if (var == null) { | |||||
| var = new StringBuilder(lineSep + line); | |||||
| } else { | |||||
| var.append(lineSep).append(line); | |||||
| } | |||||
| } else { | |||||
| if (line.contains("=")) { | |||||
| // New env var...append the previous one if we have it. | // New env var...append the previous one if we have it. | ||||
| if (var != null) { | if (var != null) { | ||||
| int eq = var.toString().indexOf('='); | int eq = var.toString().indexOf('='); | ||||
| @@ -154,6 +146,14 @@ public class Execute { | |||||
| var.substring(eq + 1)); | var.substring(eq + 1)); | ||||
| } | } | ||||
| var = new StringBuilder(line); | var = new StringBuilder(line); | ||||
| } else { | |||||
| // Chunk part of previous env var (UNIX env vars can | |||||
| // contain embedded new lines). | |||||
| if (var == null) { | |||||
| var = new StringBuilder(StringUtils.LINE_SEP + line); | |||||
| } else { | |||||
| var.append(StringUtils.LINE_SEP).append(line); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| // Since we "look ahead" before adding, there's one last env var. | // Since we "look ahead" before adding, there's one last env var. | ||||
| @@ -671,7 +671,7 @@ public class Jar extends Zip { | |||||
| + " be replaced by a newly generated one.", | + " be replaced by a newly generated one.", | ||||
| Project.MSG_WARN); | Project.MSG_WARN); | ||||
| } else { | } else { | ||||
| if (index && vPath.indexOf('/') == -1) { | |||||
| if (index && !vPath.contains("/")) { | |||||
| rootEntries.add(vPath); | rootEntries.add(vPath); | ||||
| } | } | ||||
| super.zipFile(is, zOut, vPath, lastModified, fromArchive, mode); | super.zipFile(is, zOut, vPath, lastModified, fromArchive, mode); | ||||
| @@ -1083,7 +1083,7 @@ public class Jar extends Zip { | |||||
| String name = ze.getName(); | String name = ze.getName(); | ||||
| if (ze.isDirectory()) { | if (ze.isDirectory()) { | ||||
| dirSet.add(name); | dirSet.add(name); | ||||
| } else if (name.indexOf('/') == -1) { | |||||
| } else if (!name.contains("/")) { | |||||
| files.add(name); | files.add(name); | ||||
| } else { | } else { | ||||
| // a file, not in the root | // a file, not in the root | ||||
| @@ -2203,7 +2203,7 @@ public class Javadoc extends Task { | |||||
| if (useExternalFile) { | if (useExternalFile) { | ||||
| // TODO what is the following doing? | // TODO what is the following doing? | ||||
| // should it run if !javadoc4 && executable != null? | // should it run if !javadoc4 && executable != null? | ||||
| if (sourceFileName.indexOf(' ') > -1) { | |||||
| if (sourceFileName.contains(" ")) { | |||||
| String name = sourceFileName; | String name = sourceFileName; | ||||
| if (File.separatorChar == '\\') { | if (File.separatorChar == '\\') { | ||||
| name = sourceFileName.replace(File.separatorChar, '/'); | name = sourceFileName.replace(File.separatorChar, '/'); | ||||
| @@ -2227,11 +2227,10 @@ public class Javadoc extends Task { | |||||
| */ | */ | ||||
| private String quoteString(final String str) { | private String quoteString(final String str) { | ||||
| if (!containsWhitespace(str) | if (!containsWhitespace(str) | ||||
| && str.indexOf('\'') == -1 | |||||
| && str.indexOf('"') == -1) { | |||||
| && !str.contains("'") && !str.contains("\"")) { | |||||
| return str; | return str; | ||||
| } | } | ||||
| if (str.indexOf('\'') == -1) { | |||||
| if (!str.contains("'")) { | |||||
| return quoteString(str, '\''); | return quoteString(str, '\''); | ||||
| } | } | ||||
| return quoteString(str, '"'); | return quoteString(str, '"'); | ||||
| @@ -548,7 +548,7 @@ public abstract class DefaultCompilerAdapter | |||||
| try (BufferedWriter out = | try (BufferedWriter out = | ||||
| new BufferedWriter(new FileWriter(tmpFile))) { | new BufferedWriter(new FileWriter(tmpFile))) { | ||||
| for (int i = firstFileName; i < args.length; i++) { | for (int i = firstFileName; i < args.length; i++) { | ||||
| if (quoteFiles && args[i].indexOf(' ') > -1) { | |||||
| if (quoteFiles && args[i].contains(" ")) { | |||||
| args[i] = | args[i] = | ||||
| args[i].replace(File.separatorChar, '/'); | args[i].replace(File.separatorChar, '/'); | ||||
| out.write("\"" + args[i] + "\""); | out.write("\"" + args[i] + "\""); | ||||
| @@ -483,12 +483,12 @@ public class Depend extends MatchingTask { | |||||
| // without closure we may delete an inner class but not the | // without closure we may delete an inner class but not the | ||||
| // top level class which would not trigger a recompile. | // top level class which would not trigger a recompile. | ||||
| if (affectedClass.indexOf('$') == -1) { | |||||
| int aci = affectedClass.indexOf('$'); | |||||
| if (aci == -1) { | |||||
| continue; | continue; | ||||
| } | } | ||||
| // need to delete the main class | // need to delete the main class | ||||
| String topLevelClassName | |||||
| = affectedClass.substring(0, affectedClass.indexOf('$')); | |||||
| String topLevelClassName = affectedClass.substring(0, aci); | |||||
| log("Top level class = " + topLevelClassName, | log("Top level class = " + topLevelClassName, | ||||
| Project.MSG_VERBOSE); | Project.MSG_VERBOSE); | ||||
| ClassFileInfo topLevelClassInfo | ClassFileInfo topLevelClassInfo | ||||
| @@ -269,7 +269,7 @@ public class FailureRecorder extends ProjectComponent implements JUnitResultForm | |||||
| private void createClassHeader() throws IOException { | private void createClassHeader() throws IOException { | ||||
| String className = getLocationName().replace('\\', '/'); | String className = getLocationName().replace('\\', '/'); | ||||
| if (className.indexOf('/') > -1) { | |||||
| if (className.contains("/")) { | |||||
| className = className.substring(className.lastIndexOf('/') + 1); | className = className.substring(className.lastIndexOf('/') + 1); | ||||
| } | } | ||||
| SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss,SSS"); | SimpleDateFormat sdf = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss,SSS"); | ||||
| @@ -352,8 +352,8 @@ public class FailureRecorder extends ProjectComponent implements JUnitResultForm | |||||
| */ | */ | ||||
| public TestInfos(Test test) { | public TestInfos(Test test) { | ||||
| className = test.getClass().getName(); | className = test.getClass().getName(); | ||||
| String _methodName = test.toString(); | |||||
| methodName = _methodName.substring(0, _methodName.indexOf('(')); | |||||
| String methodName = test.toString(); | |||||
| this.methodName = methodName.substring(0, methodName.indexOf('(')); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -457,12 +457,7 @@ public class Scp extends SSHBase { | |||||
| } | } | ||||
| private static boolean isRemoteUri(final String uri) { | private static boolean isRemoteUri(final String uri) { | ||||
| boolean isRemote = true; | |||||
| final int indexOfAt = uri.indexOf('@'); | |||||
| if (indexOfAt < 0) { | |||||
| isRemote = false; | |||||
| } | |||||
| return isRemote; | |||||
| return uri.contains("@"); | |||||
| } | } | ||||
| private Directory createDirectory(final FileSet set) { | private Directory createDirectory(final FileSet set) { | ||||
| @@ -437,7 +437,7 @@ public class Commandline implements Cloneable { | |||||
| } | } | ||||
| if (argument.contains("\'") || argument.contains(" ") | if (argument.contains("\'") || argument.contains(" ") | ||||
| // WIN9x uses a bat file for executing commands | // WIN9x uses a bat file for executing commands | ||||
| || (IS_WIN_9X && argument.indexOf(';') != -1)) { | |||||
| || (IS_WIN_9X && argument.contains(";"))) { | |||||
| return '\"' + argument + '\"'; | return '\"' + argument + '\"'; | ||||
| } | } | ||||
| return argument; | return argument; | ||||
| @@ -774,8 +774,7 @@ public class Path extends DataType implements Cloneable, ResourceCollection { | |||||
| * @since Ant 1.8.2 | * @since Ant 1.8.2 | ||||
| */ | */ | ||||
| private static boolean containsWildcards(String path) { | private static boolean containsWildcards(String path) { | ||||
| return path != null | |||||
| && (path.indexOf('*') > -1 || path.indexOf('?') > -1); | |||||
| return path != null && (path.contains("*") || path.contains("?")); | |||||
| } | } | ||||
| } | } | ||||
| @@ -231,8 +231,7 @@ public class ResourceList extends DataType implements ResourceCollection { | |||||
| return (Resource) expanded; | return (Resource) expanded; | ||||
| } | } | ||||
| String expandedLine = expanded.toString(); | String expandedLine = expanded.toString(); | ||||
| int colon = expandedLine.indexOf(':'); | |||||
| if (colon >= 0) { | |||||
| if (expandedLine.contains(":")) { | |||||
| // could be an URL or an absolute file on an OS with drives | // could be an URL or an absolute file on an OS with drives | ||||
| try { | try { | ||||
| return new URLResource(expandedLine); | return new URLResource(expandedLine); | ||||
| @@ -142,7 +142,7 @@ public class Name implements ResourceSelector { | |||||
| } | } | ||||
| private String modify(String s) { | private String modify(String s) { | ||||
| if (s == null || !handleDirSep || s.indexOf('\\') < 0) { | |||||
| if (s == null || !handleDirSep || !s.contains("\\")) { | |||||
| return s; | return s; | ||||
| } | } | ||||
| return s.replace('\\', '/'); | return s.replace('\\', '/'); | ||||
| @@ -647,7 +647,7 @@ public final class SelectorUtils { | |||||
| * @return true if the string contains at least a star or a question mark | * @return true if the string contains at least a star or a question mark | ||||
| */ | */ | ||||
| public static boolean hasWildcards(String input) { | public static boolean hasWildcards(String input) { | ||||
| return input.indexOf('*') != -1 || input.indexOf('?') != -1; | |||||
| return input.contains("*") || input.contains("?"); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -199,7 +199,7 @@ public class GlobPatternMapper implements FileNameMapper { | |||||
| name = name.toLowerCase(); | name = name.toLowerCase(); | ||||
| } | } | ||||
| if (handleDirSep) { | if (handleDirSep) { | ||||
| if (name.indexOf('\\') != -1) { | |||||
| if (name.contains("\\")) { | |||||
| name = name.replace('\\', '/'); | name = name.replace('\\', '/'); | ||||
| } | } | ||||
| } | } | ||||
| @@ -62,10 +62,10 @@ public class RegexpUtil { | |||||
| public static int asOptions(String flags) { | public static int asOptions(String flags) { | ||||
| int options = RegexpMatcher.MATCH_DEFAULT; | int options = RegexpMatcher.MATCH_DEFAULT; | ||||
| if (flags != null) { | if (flags != null) { | ||||
| options = asOptions(flags.indexOf('i') == -1, | |||||
| flags.indexOf('m') != -1, | |||||
| flags.indexOf('s') != -1); | |||||
| if (flags.indexOf('g') != -1) { | |||||
| options = asOptions(!flags.contains("i"), | |||||
| flags.contains("m"), | |||||
| flags.contains("s")); | |||||
| if (flags.contains("g")) { | |||||
| options |= Regexp.REPLACE_ALL; | options |= Regexp.REPLACE_ALL; | ||||
| } | } | ||||
| } | } | ||||
| @@ -343,22 +343,22 @@ public class ZipOutputStream extends FilterOutputStream { | |||||
| */ | */ | ||||
| public ZipOutputStream(File file) throws IOException { | public ZipOutputStream(File file) throws IOException { | ||||
| super(null); | super(null); | ||||
| RandomAccessFile _raf = null; | |||||
| RandomAccessFile ranf = null; | |||||
| try { | try { | ||||
| _raf = new RandomAccessFile(file, "rw"); | |||||
| _raf.setLength(0); | |||||
| ranf = new RandomAccessFile(file, "rw"); | |||||
| ranf.setLength(0); | |||||
| } catch (IOException e) { | } catch (IOException e) { | ||||
| if (_raf != null) { | |||||
| if (ranf != null) { | |||||
| try { | try { | ||||
| _raf.close(); | |||||
| ranf.close(); | |||||
| } catch (IOException inner) { // NOPMD | } catch (IOException inner) { // NOPMD | ||||
| // ignore | // ignore | ||||
| } | } | ||||
| _raf = null; | |||||
| ranf = null; | |||||
| } | } | ||||
| out = Files.newOutputStream(file.toPath()); | out = Files.newOutputStream(file.toPath()); | ||||
| } | } | ||||
| raf = _raf; | |||||
| raf = ranf; | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -289,12 +289,16 @@ public class JarTest { | |||||
| String line = r.readLine(); | String line = r.readLine(); | ||||
| while (line != null) { | while (line != null) { | ||||
| if (line.equals("foo")) { | |||||
| foundFoo = true; | |||||
| } else if (line.equals("sub")) { | |||||
| foundSub = true; | |||||
| } else if (line.equals("sub/foo")) { | |||||
| foundSubFoo = true; | |||||
| switch (line) { | |||||
| case "foo": | |||||
| foundFoo = true; | |||||
| break; | |||||
| case "sub": | |||||
| foundSub = true; | |||||
| break; | |||||
| case "sub/foo": | |||||
| foundSubFoo = true; | |||||
| break; | |||||
| } | } | ||||
| line = r.readLine(); | line = r.readLine(); | ||||
| } | } | ||||
| @@ -36,6 +36,7 @@ import org.junit.Test; | |||||
| import static org.apache.tools.ant.AntAssert.assertContains; | import static org.apache.tools.ant.AntAssert.assertContains; | ||||
| import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
| import static org.junit.Assert.assertFalse; | |||||
| import static org.junit.Assert.assertNotNull; | import static org.junit.Assert.assertNotNull; | ||||
| import static org.junit.Assert.assertTrue; | import static org.junit.Assert.assertTrue; | ||||
| import static org.junit.Assert.fail; | import static org.junit.Assert.fail; | ||||
| @@ -398,8 +399,8 @@ public class ManifestTest { | |||||
| assertNotNull(mf); | assertNotNull(mf); | ||||
| mfAsString = mf.toString(); | mfAsString = mf.toString(); | ||||
| assertNotNull(mfAsString); | assertNotNull(mfAsString); | ||||
| assertEquals(-1, mfAsString.indexOf("Foo: Bar")); | |||||
| assertTrue(mfAsString.contains("Foo: Baz")); | assertTrue(mfAsString.contains("Foo: Baz")); | ||||
| assertFalse(mfAsString.contains("Foo: Bar")); | |||||
| } | } | ||||
| @Test | @Test | ||||
| @@ -35,6 +35,7 @@ import org.junit.Test; | |||||
| import static org.apache.tools.ant.AntAssert.assertContains; | import static org.apache.tools.ant.AntAssert.assertContains; | ||||
| import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
| import static org.junit.Assert.assertFalse; | |||||
| import static org.junit.Assert.assertNotNull; | import static org.junit.Assert.assertNotNull; | ||||
| import static org.junit.Assert.assertNull; | import static org.junit.Assert.assertNull; | ||||
| import static org.junit.Assert.fail; | import static org.junit.Assert.fail; | ||||
| @@ -149,7 +150,7 @@ public class ZipTest { | |||||
| @Test | @Test | ||||
| public void testUpdateNotNecessary() { | public void testUpdateNotNecessary() { | ||||
| buildRule.executeTarget("testUpdateNotNecessary"); | buildRule.executeTarget("testUpdateNotNecessary"); | ||||
| assertEquals(-1, buildRule.getLog().indexOf("Updating")); | |||||
| assertFalse(buildRule.getLog().contains("Updating")); | |||||
| } | } | ||||
| @Test | @Test | ||||
| @@ -36,6 +36,7 @@ import org.apache.tools.ant.util.FileUtils; | |||||
| import static org.apache.tools.ant.AntAssert.assertContains; | import static org.apache.tools.ant.AntAssert.assertContains; | ||||
| import static org.junit.Assert.assertEquals; | import static org.junit.Assert.assertEquals; | ||||
| import static org.junit.Assert.assertFalse; | |||||
| import static org.junit.Assert.assertNotNull; | import static org.junit.Assert.assertNotNull; | ||||
| import static org.junit.Assert.assertTrue; | import static org.junit.Assert.assertTrue; | ||||
| @@ -268,7 +269,7 @@ public class DefaultCompilerAdapterTest { | |||||
| assertNotNull(cmd[0]); | assertNotNull(cmd[0]); | ||||
| final List<String> cmdLine = Arrays.asList(cmd[0].getCommandline()); | final List<String> cmdLine = Arrays.asList(cmd[0].getCommandline()); | ||||
| //No modulesourcepath | //No modulesourcepath | ||||
| assertEquals(-1, cmdLine.indexOf("--module-source-path")); | |||||
| assertFalse(cmdLine.contains("--module-source-path")); | |||||
| //The -sourcepath has to be followed by src | //The -sourcepath has to be followed by src | ||||
| int index = cmdLine.indexOf("-sourcepath"); | int index = cmdLine.indexOf("-sourcepath"); | ||||
| assertTrue(index != -1 && index < cmdLine.size() - 1); | assertTrue(index != -1 && index < cmdLine.size() - 1); | ||||
| @@ -326,7 +327,7 @@ public class DefaultCompilerAdapterTest { | |||||
| assertNotNull(cmd[0]); | assertNotNull(cmd[0]); | ||||
| final List<String> cmdLine = Arrays.asList(cmd[0].getCommandline()); | final List<String> cmdLine = Arrays.asList(cmd[0].getCommandline()); | ||||
| //No sourcepath | //No sourcepath | ||||
| assertEquals(-1, cmdLine.indexOf("-sourcepath")); | |||||
| assertFalse(cmdLine.contains("-sourcepath")); | |||||
| //The --module-source-path has to be followed by the pattern | //The --module-source-path has to be followed by the pattern | ||||
| int index = cmdLine.indexOf("--module-source-path"); | int index = cmdLine.indexOf("--module-source-path"); | ||||
| assertTrue(index != -1 && index < cmdLine.size() - 1); | assertTrue(index != -1 && index < cmdLine.size() - 1); | ||||