diff options
Diffstat (limited to 'org.eclipse.jdt.core/batch/org/eclipse/jdt')
14 files changed, 89 insertions, 89 deletions
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/BasicModule.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/BasicModule.java index 1dcfc2231..1bf653f86 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/BasicModule.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/BasicModule.java @@ -103,7 +103,7 @@ public class BasicModule implements ISourceModule { Service[] provides; IModule.IPackageExport[] opens; private ICompilationUnit compilationUnit; - + public BasicModule(ModuleDeclaration descriptor, IModulePathEntry root) { this.compilationUnit = descriptor.compilationResult().compilationUnit; this.name = descriptor.moduleName; diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java index e2c2a951f..3d6cc5409 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathDirectory.java @@ -135,13 +135,13 @@ private NameEnvironmentAnswer findClassInternal(char[] typeName, String qualifie int adjustedMode = this.mode; if (Config.getSourceTypeRequired()) adjustedMode = SOURCE; -// SH} - +// SH} + String fileName = new String(typeName); //{ObjectTeams: was "this.mode" instead of adjustedMode boolean binaryExists = ((adjustedMode & BINARY) != 0) && doesFileExist(fileName + SUFFIX_STRING_class, qualifiedPackageName); boolean sourceExists = ((adjustedMode & SOURCE) != 0) && doesFileExist(fileName + SUFFIX_STRING_java, qualifiedPackageName); -// SH} +// SH} if (sourceExists && !asBinaryOnly) { String fullSourcePath = this.path + qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length() - 6) + SUFFIX_STRING_java; CompilationUnit unit = new CompilationUnit(null, fullSourcePath, this.encoding, this.destinationPath); @@ -160,7 +160,7 @@ private NameEnvironmentAnswer findClassInternal(char[] typeName, String qualifie try { ClassFileReader reader = ClassFileReader.read(this.path + qualifiedBinaryFileName); // https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115, package names are to be treated case sensitive. - String typeSearched = qualifiedPackageName.length() > 0 ? + String typeSearched = qualifiedPackageName.length() > 0 ? qualifiedPackageName.replace(File.separatorChar, '/') + "/" + fileName //$NON-NLS-1$ : fileName; if (!CharOperation.equals(reader.getName(), typeSearched.toCharArray())) { @@ -219,8 +219,8 @@ private Hashtable<String, String> getSecondaryTypes(String qualifiedPackageName) Hashtable<String, String> packageEntry = new Hashtable<>(); String[] dirList = (String[]) this.directoryCache.get(qualifiedPackageName); - if (dirList == this.missingPackageHolder // package exists in another classpath directory or jar - || dirList == null) + if (dirList == this.missingPackageHolder // package exists in another classpath directory or jar + || dirList == null) return packageEntry; File dir = new File(this.path + qualifiedPackageName); @@ -235,7 +235,7 @@ private Hashtable<String, String> getSecondaryTypes(String qualifiedPackageName) if (!(s.endsWith(SUFFIX_STRING_java) || s.endsWith(SUFFIX_STRING_JAVA))) continue; CompilationUnit cu = new CompilationUnit(null, s, this.encoding, this.destinationPath); CompilationResult compilationResult = new CompilationResult(s.toCharArray(), 1, 1, 10); - ProblemReporter problemReporter = + ProblemReporter problemReporter = new ProblemReporter( DefaultErrorHandlingPolicies.proceedWithAllProblems(), new CompilerOptions(this.options), @@ -249,14 +249,14 @@ private Hashtable<String, String> getSecondaryTypes(String qualifiedPackageName) for (int j = 0, k = types.length; j < k; j++) { TypeDeclaration type = types[j]; char[] name = type.isSecondary() ? type.name : null; // add only secondary types - if (name != null) + if (name != null) packageEntry.put(new String(name), s); } } return packageEntry; } private NameEnvironmentAnswer findSourceSecondaryType(String typeName, String qualifiedPackageName, String qualifiedBinaryFileName) { - + if (this.packageSecondaryTypes == null) this.packageSecondaryTypes = new Hashtable<>(); Hashtable<String, String> packageEntry = this.packageSecondaryTypes.get(qualifiedPackageName); if (packageEntry == null) { diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java index 0f85ef512..1fcce4bee 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJar.java @@ -156,7 +156,7 @@ public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageN } @Override public boolean hasAnnotationFileFor(String qualifiedTypeName) { - return this.zipFile.getEntry(qualifiedTypeName+ExternalAnnotationProvider.ANNOTATION_FILE_SUFFIX) != null; + return this.zipFile.getEntry(qualifiedTypeName+ExternalAnnotationProvider.ANNOTATION_FILE_SUFFIX) != null; } @Override public char[][][] findTypeNames(final String qualifiedPackageName, String moduleName) { @@ -205,7 +205,7 @@ void acceptModule(ClassFileReader reader) { } } void acceptModule(byte[] content) { - if (content == null) + if (content == null) return; ClassFileReader reader = null; try { @@ -235,7 +235,7 @@ public synchronized char[][] getModulesDeclaringPackage(String qualifiedPackageN this.packageCache = new HashSet<>(41); this.packageCache.add(Util.EMPTY_STRING); - + for (Enumeration e = this.zipFile.entries(); e.hasMoreElements(); ) { String fileName = ((ZipEntry) e.nextElement()).getName(); addToPackageCache(fileName, false); @@ -254,7 +254,7 @@ public boolean hasCompilationUnit(String qualifiedPackageName, String moduleName if (tail.toLowerCase().endsWith(SUFFIX_STRING_class)) return true; } - } + } return false; } diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java index c3a28d023..d49d5f74f 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJep247Jdk12.java @@ -172,7 +172,7 @@ public class ClasspathJep247Jdk12 extends ClasspathJep247 { @Override public FileVisitResult visitFile(java.nio.file.Path f, BasicFileAttributes attrs) throws IOException { - if (attrs.isDirectory() || f.getNameCount() < 3) + if (attrs.isDirectory() || f.getNameCount() < 3) return FileVisitResult.CONTINUE; if (f.getFileName().toString().equals(MODULE_INFO) && Files.exists(f)) { byte[] content = JRTUtil.safeReadBytes(f); @@ -222,7 +222,7 @@ public class ClasspathJep247Jdk12 extends ClasspathJep247 { return null; } void acceptModule(String name, byte[] content, Map<String, IModule> cache) { - if (content == null) + if (content == null) return; if (cache.containsKey(name)) diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJmod.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJmod.java index 09786d668..7334d2bec 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJmod.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJmod.java @@ -39,7 +39,7 @@ public class ClasspathJmod extends ClasspathJar { public static char[] CLASSES = "classes".toCharArray(); //$NON-NLS-1$ public static char[] CLASSES_FOLDER = "classes/".toCharArray(); //$NON-NLS-1$ - + public ClasspathJmod(File file, boolean closeZipFileAtEnd, AccessRuleSet accessRuleSet, String destinationPath) { super(file, closeZipFileAtEnd, accessRuleSet, destinationPath); @@ -97,7 +97,7 @@ public NameEnvironmentAnswer findClass(char[] typeName, String qualifiedPackageN @Override public boolean hasAnnotationFileFor(String qualifiedTypeName) { qualifiedTypeName = new String(CharOperation.append(CLASSES_FOLDER, qualifiedTypeName.toCharArray())); - return this.zipFile.getEntry(qualifiedTypeName+ExternalAnnotationProvider.ANNOTATION_FILE_SUFFIX) != null; + return this.zipFile.getEntry(qualifiedTypeName+ExternalAnnotationProvider.ANNOTATION_FILE_SUFFIX) != null; } @SuppressWarnings({ "rawtypes", "unchecked" }) @Override @@ -142,7 +142,7 @@ public synchronized char[][] getModulesDeclaringPackage(String qualifiedPackageN this.packageCache = new HashSet<>(41); this.packageCache.add(Util.EMPTY_STRING); - + for (Enumeration<? extends ZipEntry> e = this.zipFile.entries(); e.hasMoreElements(); ) { char[] entryName = e.nextElement().getName().toCharArray(); int index = CharOperation.indexOf('/', entryName); @@ -175,7 +175,7 @@ public boolean hasCompilationUnit(String qualifiedPackageName, String moduleName } } } - } + } return false; } @Override diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJrt.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJrt.java index 03cdb86f2..104a9f0c0 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJrt.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathJrt.java @@ -128,14 +128,14 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry return null; // most common case final char[] packageArray = qualifiedPackageName.toCharArray(); final ArrayList answers = new ArrayList(); - + try { JRTUtil.walkModuleImage(this.file, new JRTUtil.JrtFileVisitor<java.nio.file.Path>() { @Override public FileVisitResult visitPackage(java.nio.file.Path dir, java.nio.file.Path modPath, BasicFileAttributes attrs) throws IOException { if (qualifiedPackageName.startsWith(dir.toString())) { - return FileVisitResult.CONTINUE; + return FileVisitResult.CONTINUE; } return FileVisitResult.SKIP_SUBTREE; } @@ -168,7 +168,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry } catch (IOException e) { // Ignore and move on } - + int size = answers.size(); if (size != 0) { char[][][] result = new char[size][][]; @@ -193,7 +193,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry loadModules(); } // public void acceptModule(IModuleDeclaration mod) { -// if (this.isJrt) +// if (this.isJrt) // return; // this.module = mod; // } @@ -252,7 +252,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry } void acceptModule(byte[] content, Map<String, IModule> cache) { - if (content == null) + if (content == null) return; ClassFileReader reader = null; try { @@ -264,7 +264,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry acceptModule(reader, cache); } } - + @Override public Collection<String> getModuleNames(Collection<String> limitModule, Function<String, IModule> getModule) { Map<String, IModule> cache = ModulesCache.get(this.file.getPath()); @@ -288,7 +288,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry boolean isPotentialRoot = !isJavaDotStart; // always include non-java.* if (!hasJavaDotSE) isPotentialRoot |= isJavaDotStart; // no java.se => add all java.* - + if (isPotentialRoot) { IModule m = getModule.apply(mod); if (m != null) { @@ -320,7 +320,7 @@ public class ClasspathJrt extends ClasspathLocation implements IMultiModuleEntry // // this.packageCache = new HashSet<>(41); // this.packageCache.add(Util.EMPTY_STRING); -// +// // try { // JRTUtil.walkModuleImage(this.file, new JRTUtil.JrtFileVisitor<java.nio.file.Path>() { // diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java index ac693db11..e2c3c7ca3 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathLocation.java @@ -35,7 +35,7 @@ public abstract class ClasspathLocation implements FileSystem.Classpath, public static final int SOURCE = 1; public static final int BINARY = 2; - + String path; char[] normalizedPath; public AccessRuleSet accessRuleSet; @@ -45,14 +45,14 @@ public abstract class ClasspathLocation implements FileSystem.Classpath, // destination path for compilation units that are reached through this // classpath location; the coding is consistent with the one of // Main.destinationPath: - // == null: unspecified, use whatever value is set by the enclosing + // == null: unspecified, use whatever value is set by the enclosing // context, id est Main; // == Main.NONE: absorbent element, do not output class files; // else: use as the path of the directory into which class files must // be written. - // potentially carried by any entry that contains to be compiled files - - protected ClasspathLocation(AccessRuleSet accessRuleSet, + // potentially carried by any entry that contains to be compiled files + + protected ClasspathLocation(AccessRuleSet accessRuleSet, String destinationPath) { this.accessRuleSet = accessRuleSet; this.destinationPath = destinationPath; @@ -61,11 +61,11 @@ public abstract class ClasspathLocation implements FileSystem.Classpath, /** * Return the first access rule which is violated when accessing a given * type, or null if no 'non accessible' access rule applies. - * + * * @param qualifiedBinaryFileName * tested type specification, formed as: * "org/eclipse/jdt/core/JavaCore.class"; on systems that - * use \ as File.separator, the + * use \ as File.separator, the * "org\eclipse\jdt\core\JavaCore.class" is accepted as well * @return the first access rule which is violated when accessing a given * type, or null if none applies @@ -75,13 +75,13 @@ public abstract class ClasspathLocation implements FileSystem.Classpath, return null; char [] qualifiedTypeName = qualifiedBinaryFileName. substring(0, qualifiedBinaryFileName.length() - SUFFIX_CLASS.length) - .toCharArray(); + .toCharArray(); if (File.separatorChar == '\\') { CharOperation.replace(qualifiedTypeName, File.separatorChar, '/'); } return this.accessRuleSet.getViolatedRestriction(qualifiedTypeName); } - + public int getMode() { return SOURCE | BINARY; } @@ -121,7 +121,7 @@ public abstract class ClasspathLocation implements FileSystem.Classpath, public String getDestinationPath() { return this.destinationPath; } - + @Override public void acceptModule(IModule mod) { this.module = mod; @@ -191,9 +191,9 @@ public abstract class ClasspathLocation implements FileSystem.Classpath, return new char[][] { this.module.name() }; return new char[][] { ModuleBinding.UNNAMED }; } - + @Override public void reset() { - this.module = null; + this.module = null; } } diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathMultiReleaseJar.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathMultiReleaseJar.java index 41756884e..2a108c0e9 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathMultiReleaseJar.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathMultiReleaseJar.java @@ -72,7 +72,7 @@ public class ClasspathMultiReleaseJar extends ClasspathJar { this.packageCache = new HashSet<>(41); this.packageCache.add(Util.EMPTY_STRING); - + for (Enumeration e = this.zipFile.entries(); e.hasMoreElements(); ) { String fileName = ((ZipEntry) e.nextElement()).getName(); addToPackageCache(fileName, false); @@ -159,8 +159,8 @@ public class ClasspathMultiReleaseJar extends ClasspathJar { } if (this.accessRuleSet == null) return new NameEnvironmentAnswer(reader, null, modName); - return new NameEnvironmentAnswer(reader, - this.accessRuleSet.getViolatedRestriction(fileNameWithoutExtension.toCharArray()), + return new NameEnvironmentAnswer(reader, + this.accessRuleSet.getViolatedRestriction(fileNameWithoutExtension.toCharArray()), modName); } } catch (IOException | ClassFormatException e) { diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.java index 8e85825ca..126409d44 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ClasspathSourceJar.java @@ -25,8 +25,8 @@ import org.eclipse.jdt.internal.compiler.util.Util; public class ClasspathSourceJar extends ClasspathJar { private String encoding; - public ClasspathSourceJar(File file, boolean closeZipFileAtEnd, - AccessRuleSet accessRuleSet, String encoding, + public ClasspathSourceJar(File file, boolean closeZipFileAtEnd, + AccessRuleSet accessRuleSet, String encoding, String destinationPath) { super(file, closeZipFileAtEnd, accessRuleSet, destinationPath); this.encoding = encoding; @@ -41,7 +41,7 @@ public class ClasspathSourceJar extends ClasspathJar { if (sourceEntry != null) { try { InputStream stream = null; - char[] contents = null; + char[] contents = null; try { stream = this.zipFile.getInputStream(sourceEntry); contents = Util.getInputStreamAsCharArray(stream, -1, this.encoding); diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java index 4981e9c1b..80d9d1d20 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/CompilationUnit.java @@ -32,7 +32,7 @@ public class CompilationUnit implements ICompilationUnit { public char[] module; // a specific destination path for this compilation unit; coding is // aligned with Main.destinationPath: - // == null: unspecified, use whatever value is set by the enclosing + // == null: unspecified, use whatever value is set by the enclosing // context, id est Main; // == Main.NONE: absorbent element, do not output class files; // else: use as the path of the directory into which class files must @@ -65,7 +65,7 @@ public CompilationUnit(char[] contents, String fileName, String encoding, } } this.fileName = fileNameCharArray; - int start = CharOperation.lastIndexOf(File.separatorChar, fileNameCharArray) + 1; + int start = CharOperation.lastIndexOf(File.separatorChar, fileNameCharArray) + 1; int end = CharOperation.lastIndexOf('.', fileNameCharArray); if (end == -1) { diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java index 6bcbfade9..247c0c49c 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileFinder.java @@ -20,10 +20,10 @@ import java.util.List; import org.eclipse.jdt.internal.compiler.env.IModule; public class FileFinder { - + /** * Although the file finder is meant to be generic for any file name patters, - * at the moment it is used only for *.java files. This method handles the + * at the moment it is used only for *.java files. This method handles the * module-info.java in a special way by always placing it as the first element * of the resulting array. */ diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java index 85c172f91..7eca744e2 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/FileSystem.java @@ -159,7 +159,7 @@ public class FileSystem implements IModuleAwareNameEnvironment, SuffixConstants return normalizedClasspath; } } - + protected Classpath[] classpaths; // Used only in single-module mode when the module descriptor is // provided via command line. @@ -238,7 +238,7 @@ protected FileSystem(Classpath[] paths, String[] initialFileNames, boolean annot } private void initializeModuleLocations(Set<String> limitedModules) { // First create the mapping of all module/Classpath - // since the second iteration of getModuleNames() can't be relied on for + // since the second iteration of getModuleNames() can't be relied on for // to get the right origin of module if (limitedModules == null) { for (Classpath c : this.classpaths) { @@ -273,7 +273,7 @@ public static Classpath getJrtClasspath(String jdkHome, String encoding, AccessR return new ClasspathJrt(new File(convertPathSeparators(jdkHome)), true, accessRuleSet, null); } public static Classpath getOlderSystemRelease(String jdkHome, String release, AccessRuleSet accessRuleSet) { - return isJRE12Plus ? + return isJRE12Plus ? new ClasspathJep247Jdk12(new File(convertPathSeparators(jdkHome)), release, accessRuleSet) : new ClasspathJep247(new File(convertPathSeparators(jdkHome)), release, accessRuleSet); } @@ -320,7 +320,7 @@ public static Classpath getClasspath(String classpathName, String encoding, JRT_CLASSPATH_CACHE.put(file, result); } } else { - result = + result = (release == null) ? new ClasspathJar(file, true, accessRuleSet, null) : new ClasspathMultiReleaseJar(file, true, accessRuleSet, destinationPath, release); @@ -431,7 +431,7 @@ private NameEnvironmentAnswer findClass(String qualifiedTypeName, char[] typeNam zip = ExternalAnnotationDecorator.getAnnotationZipFile(classpathEntry.getPath(), null); shouldClose = true; } - answer.setBinaryType(ExternalAnnotationDecorator.create(answer.getBinaryType(), classpathEntry.getPath(), + answer.setBinaryType(ExternalAnnotationDecorator.create(answer.getBinaryType(), classpathEntry.getPath(), qualifiedTypeName, zip)); return answer; } catch (IOException e) { @@ -641,7 +641,7 @@ public boolean hasCompilationUnit(char[][] qualifiedPackageName, char[] moduleNa LookupStrategy strategy = LookupStrategy.get(moduleName); Parser parser = checkCUs ? getParser() : null; Function<CompilationUnit, String> pkgNameExtractor = (sourceUnit) -> { - String pkgName = null; + String pkgName = null; CompilationResult compilationResult = new CompilationResult(sourceUnit, 0, 0, 1); char[][] name = parser.parsePackageDeclaration(sourceUnit.getContents(), compilationResult); if (name != null) { diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java index 7afb89187..dca4dcb82 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java @@ -15,7 +15,7 @@ * Benjamin Muskalla - Contribution for bug 239066 * Fraunhofer FIRST - extended API and implementation * Technical University Berlin - extended API and implementation - * Stephan Herrmann - Contributions for + * Stephan Herrmann - Contributions for * bug 236385 - [compiler] Warn for potential programming problem if an object is created but not used * bug 295551 - Add option to automatically promote all warnings to errors * bug 359721 - [options] add command line option for new warning token "resource" @@ -29,7 +29,7 @@ * Bug 408815 - [batch][null] Add CLI option for COMPILER_PB_SYNTACTIC_NULL_ANALYSIS_FOR_FIELDS * Jesper S Moller - Contributions for * bug 407297 - [1.8][compiler] Control generation of parameter names by option - * Mat Booth - Contribution for bug 405176 + * Mat Booth - Contribution for bug 405176 * Frits Jalvingh - fix for bug 533830. *******************************************************************************/ package org.eclipse.jdt.internal.compiler.batch; @@ -240,7 +240,7 @@ public class Main implements ProblemSeverities, SuffixConstants { this.parameters = new HashMap<>(); this.main = main; } - + //{ObjectTeams /* lists of IProblem objects */ public ArrayList<IProblem> globalProblems; @@ -863,17 +863,17 @@ public class Main implements ProblemSeverities, SuffixConstants { } this.printlnErr("----------"); //$NON-NLS-1$ } -//{ObjectTeams +//{ObjectTeams this.globalProblems.add(problem); if (problem.isError()) { - // make exceptions distinguishable: + // make exceptions distinguishable: this.globalErrors.add(problem); if (problem.getID() == IProblem.Unclassified) this.errorCode = -2; // signal an exception occurred. } else if (problem.isWarning()) { this.globalWarnings.add(problem); } -//carp+SH} +//carp+SH} } public int logProblems(CategorizedProblem[] problems, char[] unitSource, Main currentMain) { @@ -985,7 +985,7 @@ public class Main implements ProblemSeverities, SuffixConstants { if (globalInfoCount == 1) { infoMessage = this.main.bind("compile.oneInfo"); //$NON-NLS-1$ } else if (globalInfoCount > 1) { - infoMessage = this.main.bind("compile.severalInfos", String.valueOf(warningsNumber)); //$NON-NLS-1$ + infoMessage = this.main.bind("compile.severalInfos", String.valueOf(warningsNumber)); //$NON-NLS-1$ } if (globalProblemsCount == globalInfoCount || globalProblemsCount == globalErrorsCount || globalProblemsCount == globalWarningsCount) { String msg = errorMessage != null ? errorMessage : warningMessage != null ? warningMessage : infoMessage; @@ -1107,12 +1107,12 @@ public class Main implements ProblemSeverities, SuffixConstants { this.main.bind("compiler.name"), //$NON-NLS-1$ this.main.bind("compiler.version"), //$NON-NLS-1$ this.main.bind("compiler.copyright") //$NON-NLS-1$ -//{ObjectTeams: more version info +//{ObjectTeams: more version info , this.main.bind("otdtc.name"), //$NON-NLS-1$ this.main.bind("otdtc.version"), //$NON-NLS-1$ this.main.bind("otdtc.copyright") //$NON-NLS-1$ -// SH} +// SH} } ); @@ -1132,7 +1132,7 @@ public class Main implements ProblemSeverities, SuffixConstants { this.main.bind("otdtc.name"), //$NON-NLS-1$ this.main.bind("otdtc.version"), //$NON-NLS-1$ this.main.bind("otdtc.copyright") //$NON-NLS-1$ -// SH} +// SH} } ); @@ -1278,7 +1278,7 @@ public class Main implements ProblemSeverities, SuffixConstants { logTiming(compilerStats); } if (this.main.globalProblemsCount > 0) { - logProblemsSummary(this.main.globalProblemsCount, this.main.globalErrorsCount, this.main.globalWarningsCount, + logProblemsSummary(this.main.globalProblemsCount, this.main.globalErrorsCount, this.main.globalWarningsCount, this.main.globalInfoCount, this.main.globalTasksCount); } if (this.main.exportedClassFilesCounter != 0 @@ -1688,7 +1688,7 @@ protected void addNewEntry(ArrayList<FileSystem.Classpath> paths, String current if (NONE.equals(destPath)) { destPath = NONE; // keep == comparison valid } - + if (rejectDestinationPathOnJars && destPath != null && Util.archiveFormat(currentClasspathName) > -1) { throw new IllegalArgumentException( @@ -1700,7 +1700,7 @@ protected void addNewEntry(ArrayList<FileSystem.Classpath> paths, String current customEncoding, isSourceOnly, accessRuleSet, - destPath, + destPath, this.options, this.releaseVersion); if (currentClasspath != null) { @@ -1771,7 +1771,7 @@ public String bind(String id, String[] arguments) { * <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK9</code></li> * <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK10</code></li> * <li><code>org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants.JDK11</code></li> - * + * * </ul> * @param minimalSupportedVersion the given minimal version * @return true if and only if the running VM supports the given minimal version, false otherwise @@ -1934,7 +1934,7 @@ public void configure(String[] argv) { String currentSourceDirectory = null; String currentArg = Util.EMPTY_STRING; String moduleName = null; - + Set<String> specifiedEncodings = null; // expand the command line if necessary @@ -2899,7 +2899,7 @@ public void configure(String[] argv) { continue; case INSIDE_RELEASE: // If release is < 9, the following are disallowed: - // bootclasspath, -Xbootclasspath, -Xbootclasspath/a:, -Xbootclasspath/p:, + // bootclasspath, -Xbootclasspath, -Xbootclasspath/a:, -Xbootclasspath/p:, // -endorseddirs, -Djava.endorsed.dirs, -extdirs, -Djava.ext.dirs // If release >= 9, the following are disallowed @@ -3356,7 +3356,7 @@ private String validateModuleVersion(String versionString) { } private Parser getNewParser() { - return new Parser(new ProblemReporter(getHandlingPolicy(), + return new Parser(new ProblemReporter(getHandlingPolicy(), new CompilerOptions(this.options), getProblemFactory()), false); } private IModule extractModuleDesc(String fileName) { @@ -3365,10 +3365,10 @@ private IModule extractModuleDesc(String fileName) { // validated. Make sure the source level is set for the parser Map<String,String> opts = new HashMap<String, String>(this.options); opts.put(CompilerOptions.OPTION_Source, this.options.get(CompilerOptions.OPTION_Compliance)); - Parser parser = new Parser(new ProblemReporter(getHandlingPolicy(), + Parser parser = new Parser(new ProblemReporter(getHandlingPolicy(), new CompilerOptions(opts), getProblemFactory()), false); if (fileName.toLowerCase().endsWith(IModule.MODULE_INFO_JAVA)) { - + ICompilationUnit cu = new CompilationUnit(null, fileName, null); CompilationResult compilationResult = new CompilationResult(cu, 0, 1, 10); CompilationUnitDeclaration unit = parser.parse(cu, compilationResult); @@ -3530,7 +3530,7 @@ public String extractDestinationPathFromSourceFile(CompilationResult result) { :giro */ String outputPathName = new String(fileName, 0, lastIndex); outputPathName= result.stripTeamPackagesFromPath(outputPathName); -// SH} +// SH} final File output = new File(outputPathName); if (output.exists() && output.isDirectory()) { return outputPathName; @@ -3556,7 +3556,7 @@ public CompilationUnit[] getCompilationUnits() { String defaultEncoding = this.options.get(CompilerOptions.OPTION_Encoding); if (Util.EMPTY_STRING.equals(defaultEncoding)) defaultEncoding = null; - + for (int round = 0; round < 2; round++) { for (int i = 0; i < fileCount; i++) { char[] charName = this.filenames[i].toCharArray(); @@ -3579,7 +3579,7 @@ public CompilationUnit[] getCompilationUnits() { fileName = this.filenames[i]; } units[i] = new CompilationUnit(null, fileName, encoding, this.destinationPaths[i], - shouldIgnoreOptionalProblems(this.ignoreOptionalProblemsFromFolders, fileName.toCharArray()), + shouldIgnoreOptionalProblems(this.ignoreOptionalProblemsFromFolders, fileName.toCharArray()), this.modNames[i]); } } @@ -3634,7 +3634,7 @@ public File getJavaHome() { } public FileSystem getLibraryAccess() { - FileSystem nameEnvironment = new FileSystem(this.checkedClasspaths, this.filenames, + FileSystem nameEnvironment = new FileSystem(this.checkedClasspaths, this.filenames, this.annotationsFromClasspath && CompilerOptions.ENABLED.equals(this.options.get(CompilerOptions.OPTION_AnnotationBasedNullAnalysis)), this.limitedModules); nameEnvironment.module = this.module; @@ -3954,7 +3954,7 @@ protected ArrayList<FileSystem.Classpath> handleExtdirs(ArrayList<String> extdir } } } - return result; + return result; } return FileSystem.EMPTY_CLASSPATH; @@ -4158,7 +4158,7 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev default: // no severity update } } - this.options.put(CompilerOptions.OPTION_ReportMissingEnumCaseDespiteDefault, + this.options.put(CompilerOptions.OPTION_ReportMissingEnumCaseDespiteDefault, isEnabling ? CompilerOptions.ENABLED : CompilerOptions.DISABLED); return; } else if (token.equals("emptyBlock")) {//$NON-NLS-1$ @@ -4493,10 +4493,10 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev setSeverity(CompilerOptions.OPTION_ReportNonnullParameterAnnotationDropped, severity, isEnabling); return; } - + break; case 'o' : - if (token.equals("over-sync") /*|| token.equals("syncOverride")*/) { //$NON-NLS-1$ + if (token.equals("over-sync") /*|| token.equals("syncOverride")*/) { //$NON-NLS-1$ setSeverity(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, severity, isEnabling); return; } else if (token.equals("over-ann")) { //$NON-NLS-1$ @@ -4564,7 +4564,7 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev } else if (token.equals("staticReceiver")) { //$NON-NLS-1$ setSeverity(CompilerOptions.OPTION_ReportNonStaticAccessToStatic, severity, isEnabling); return; - } else if (/*token.equals("over-sync") ||*/ token.equals("syncOverride")) { //$NON-NLS-1$ + } else if (/*token.equals("over-sync") ||*/ token.equals("syncOverride")) { //$NON-NLS-1$ setSeverity(CompilerOptions.OPTION_ReportMissingSynchronizedOnInheritedMethod, severity, isEnabling); return; } else if (token.equals("semicolon")) {//$NON-NLS-1$ @@ -4627,7 +4627,7 @@ private void handleErrorOrWarningToken(String token, boolean isEnabling, int sev this.options.put( CompilerOptions.OPTION_TaskTags, isEnabling ? taskTags : Util.EMPTY_STRING); - + setSeverity(CompilerOptions.OPTION_ReportTasks, severity, isEnabling); return; } else if (token.equals("typeHiding")) { //$NON-NLS-1$ diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ModuleFinder.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ModuleFinder.java index fd89bd892..bfb46da22 100644 --- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ModuleFinder.java +++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/ModuleFinder.java @@ -53,14 +53,14 @@ public class ModuleFinder { } return modulePath; } - protected static void scanForModules(String destinationPath, Parser parser, Map<String, String> options, boolean isModulepath, + protected static void scanForModules(String destinationPath, Parser parser, Map<String, String> options, boolean isModulepath, boolean thisAnAutomodule, List<FileSystem.Classpath> collector, final File file, String release) { FileSystem.Classpath entry = FileSystem.getClasspath( file.getAbsolutePath(), null, !isModulepath, null, - destinationPath == null ? null : (destinationPath + File.separator + file.getName()), + destinationPath == null ? null : (destinationPath + File.separator + file.getName()), options, release); if (entry != null) { @@ -140,10 +140,10 @@ public class ModuleFinder { * Extracts the single reads clause from the given * command line option (--add-reads). The result is a String[] with two * element, first being the source module and second being the target module. - * The expected format is: + * The expected format is: * --add-reads <source-module>=<target-module> * @param option - * @return a String[] with source and target module of the "reads" clause. + * @return a String[] with source and target module of the "reads" clause. */ protected static String[] extractAddonRead(String option) { StringTokenizer tokenizer = new StringTokenizer(option, "="); //$NON-NLS-1$ |