| @@ -164,57 +164,6 @@ public final class Locator { | |||||
| * @since Ant 1.6 | * @since Ant 1.6 | ||||
| */ | */ | ||||
| public static String fromURI(String uri) { | public static String fromURI(String uri) { | ||||
| return fromURIJava13(uri); | |||||
| // #buzilla8031: first try Java 1.4. | |||||
| // TODO should use java.net.URI now that we can rely on 1.4... | |||||
| // but check for UNC-related regressions, e.g. #42275 | |||||
| // (and remember that \\server\share\file -> file:////server/share/file | |||||
| // rather than -> file://server/share/file as it should; | |||||
| // fixed only in JDK 7's java.nio.file.Path.toUri) | |||||
| // return fromUriJava14(uri); | |||||
| } | |||||
| /** | |||||
| * Java1.4+ code to extract the path from the URI. | |||||
| * @param uri | |||||
| * @return null if a conversion was not possible | |||||
| */ | |||||
| /* currently unused: | |||||
| private static String fromUriJava14(String uri) { | |||||
| // Also check for properly formed URIs. Ant formerly recommended using | |||||
| // nonsense URIs such as "file:./foo.xml" in XML includes. You shouldn't | |||||
| // do that (just "foo.xml" is correct) but for compatibility we special-case | |||||
| // things when the path is not absolute, and fall back to the old parsing behavior. | |||||
| if (uri.startsWith("file:/")) { | |||||
| try { | |||||
| File f = new File(URI.create(encodeURI(uri))); | |||||
| //bug #42227 forgot to decode before returning | |||||
| return decodeUri(f.getAbsolutePath()); | |||||
| } catch (IllegalArgumentException e) { | |||||
| // Bad URI, pass this on. | |||||
| // no, this is downgraded to a warning after various | |||||
| // JRE bugs surfaced. Hand off | |||||
| // to our built in code on a failure | |||||
| //throw new IllegalArgumentException( | |||||
| // "Bad URI " + uri + ":" + e.getMessage(), e); | |||||
| e.printStackTrace(); | |||||
| } catch (Exception e) { | |||||
| // Unexpected exception? Should not happen. | |||||
| e.printStackTrace(); | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| */ | |||||
| /** | |||||
| * @param uri uri to expand | |||||
| * @return the decoded URI | |||||
| * @since Ant1.7.1 | |||||
| */ | |||||
| private static String fromURIJava13(String uri) { | |||||
| // Fallback method for Java 1.3 or earlier. | |||||
| URL url = null; | URL url = null; | ||||
| try { | try { | ||||
| url = new URL(uri); | url = new URL(uri); | ||||
| @@ -1846,7 +1846,11 @@ public class Javadoc extends Task { | |||||
| doDocFilesSubDirs(toExecute); // docfilessubdir attribute | doDocFilesSubDirs(toExecute); // docfilessubdir attribute | ||||
| doModuleArguments(toExecute); | doModuleArguments(toExecute); | ||||
| doJava14(toExecute); | |||||
| doTags(toExecute); | |||||
| doSource(toExecute); | |||||
| doLinkSource(toExecute); | |||||
| doNoqualifier(toExecute); | |||||
| if (breakiterator) { | if (breakiterator) { | ||||
| toExecute.createArgument().setValue("-breakiterator"); | toExecute.createArgument().setValue("-breakiterator"); | ||||
| } | } | ||||
| @@ -2207,9 +2211,30 @@ public class Javadoc extends Task { | |||||
| } | } | ||||
| } | } | ||||
| // Do java1.4 arguments | |||||
| private void doJava14(final Commandline toExecute) { | |||||
| for (final Object element : tags) { | |||||
| private void doNoqualifier(final Commandline toExecute) { | |||||
| if (noqualifier != null && doclet == null) { | |||||
| toExecute.createArgument().setValue("-noqualifier"); | |||||
| toExecute.createArgument().setValue(noqualifier); | |||||
| } | |||||
| } | |||||
| private void doLinkSource(final Commandline toExecute) { | |||||
| if (linksource && doclet == null) { | |||||
| toExecute.createArgument().setValue("-linksource"); | |||||
| } | |||||
| } | |||||
| private void doSource(final Commandline toExecute) { | |||||
| final String sourceArg = source != null ? source | |||||
| : getProject().getProperty(MagicNames.BUILD_JAVAC_SOURCE); | |||||
| if (sourceArg != null) { | |||||
| toExecute.createArgument().setValue("-source"); | |||||
| toExecute.createArgument().setValue(sourceArg); | |||||
| } | |||||
| } | |||||
| private void doTags(final Commandline toExecute) { | |||||
| for (final Object element : tags) { | |||||
| if (element instanceof TagArgument) { | if (element instanceof TagArgument) { | ||||
| final TagArgument ta = (TagArgument) element; | final TagArgument ta = (TagArgument) element; | ||||
| final File tagDir = ta.getDir(getProject()); | final File tagDir = ta.getDir(getProject()); | ||||
| @@ -2254,22 +2279,7 @@ public class Javadoc extends Task { | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| final String sourceArg = source != null ? source | |||||
| : getProject().getProperty(MagicNames.BUILD_JAVAC_SOURCE); | |||||
| if (sourceArg != null) { | |||||
| toExecute.createArgument().setValue("-source"); | |||||
| toExecute.createArgument().setValue(sourceArg); | |||||
| } | |||||
| if (linksource && doclet == null) { | |||||
| toExecute.createArgument().setValue("-linksource"); | |||||
| } | |||||
| if (noqualifier != null && doclet == null) { | |||||
| toExecute.createArgument().setValue("-noqualifier"); | |||||
| toExecute.createArgument().setValue(noqualifier); | |||||
| } | |||||
| } | |||||
| } | |||||
| private void doDocFilesSubDirs(final Commandline toExecute) { | private void doDocFilesSubDirs(final Commandline toExecute) { | ||||
| if (docFilesSubDirs) { | if (docFilesSubDirs) { | ||||
| @@ -64,12 +64,13 @@ public class JavacExternal extends DefaultCompilerAdapter { | |||||
| String[] commandLine = cmd.getCommandline(); | String[] commandLine = cmd.getCommandline(); | ||||
| int firstFileName; | int firstFileName; | ||||
| if (assumeJava11()) { | |||||
| firstFileName = -1; | |||||
| } else { | |||||
| firstFileName = moveJOptionsToBeginning(commandLine); | |||||
| } | |||||
| if (assumeJava1_2Plus()) { | |||||
| firstFileName = moveJOptionsToBeginning(commandLine); | |||||
| } else { | |||||
| firstFileName = -1; | |||||
| } | |||||
| return executeExternalCompile(commandLine, firstFileName, | return executeExternalCompile(commandLine, firstFileName, | ||||
| true) | true) | ||||
| == 0; | == 0; | ||||