Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core/model/org/eclipse/jdt/internal')
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Assert.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BasicCompilationUnit.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Buffer.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java20
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitVisitor.java282
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyElementsOperation.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateFieldOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateImportOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateInitializerOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateMethodOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainer.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportDeclaration.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Initializer.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarEntryFile.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDelta.java44
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModel.java17
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java426
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java86
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java224
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MoveElementsOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NonVoidMethodRequestor.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Openable.java7
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/OverflowingLRUCache.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java18
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentInfo.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Problem.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Region.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/RenameElementsOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java561
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java48
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetOutputLocationOperation.java59
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceField.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java968
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRange.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRefElement.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeVector.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Util.java34
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/WorkingCopy.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/DeltaKey.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMemberHandle.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMethodCollaboratorIndictment.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractNode.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ArrayTypeHandleImpl.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/BatchImageBuilder.java11
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/BuildNotifier.java24
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ClassOrInterfaceHandleImplSWH.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/CompilerCompilationUnit.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConstructorImpl.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConvertedCompilationResult.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DeltaImpl.java40
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DependencyGraph.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldCollaboratorIndictment.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldImpl.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageBuilderInternalException.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageContextImpl.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageImpl.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageImplSWH.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/IncrementalImageBuilder.java37
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/IndictmentSet.java18
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JCUNode.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaBuilder.java28
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaDevelopmentContextImpl.java34
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MarkerProblemReporter.java47
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MethodCollaboratorIndictment.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MethodImpl.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ModifiedBuilderType.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NamespaceNode.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NewBuilderType.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NonStateSpecificHandleImpl.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/OldBuilderType.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/OrderedSet.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImpl.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImplSWH.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageMap.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageMapEntry.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PathMap.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PrimitiveTypeHandleImpl.java38
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemDetailImpl.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemFactory.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemTable.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectBinaryOutput.java7
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectResourceCopier.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ReportCardImpl.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceElementTable.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceEntry.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceFragmentImpl.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateImpl.java200
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnap.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapConstantPool.java58
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapV5.java36
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeCollaboratorIndictment.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeHierarchyIndictment.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeImpl.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeImplSWH.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeNode.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeStructureEntry.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/UnmodifiedBuilderType.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/WorkQueue.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ZipNode.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java24
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java19
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java20
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/CompilationUnit.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMImport.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMInitializer.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMMember.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMMethod.java26
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMNode.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMPackage.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMType.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/lookup/ReferenceInfo.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/messages.properties (renamed from org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Messages.properties)3
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/AnonymousFileSource.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCache.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Dumper.java34
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/LRUCache.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/LookupTable.java24
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringHashtableOfInt.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringMatcher.java4
152 files changed, 2088 insertions, 2084 deletions
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Assert.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Assert.java
index 8ad8792f2f..707494cf7b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Assert.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Assert.java
@@ -19,7 +19,7 @@ private Assert() {
* @exception IllegalArgumentException if the legality test failed
*/
public static boolean isLegal(boolean expression) {
- return isLegal(expression, ""); //$NON-NLS-1$
+ return isLegal(expression, ""/*nonNLS*/);
}
/** Asserts that an argument is legal. If the given boolean is
* not <code>true</code>, an <code>IllegalArgumentException</code>
@@ -44,7 +44,7 @@ public static boolean isLegal(boolean expression, String message) {
* @exception IllegalArgumentException if the object is <code>null</code>
*/
public static void isNotNull(Object object) {
- isNotNull(object, ""); //$NON-NLS-1$
+ isNotNull(object, ""/*nonNLS*/);
}
/** Asserts that the given object is not <code>null</code>. If this
* is not the case, some kind of unchecked exception is thrown.
@@ -56,7 +56,7 @@ public static void isNotNull(Object object) {
*/
public static void isNotNull(Object object, String message) {
if (object == null)
- throw new AssertionFailedException(Util.bind("assert.nullArgument",message)); //$NON-NLS-1$
+ throw new AssertionFailedException(Util.bind("assert.nullArgument"/*nonNLS*/,message));
}
/** Asserts that the given boolean is <code>true</code>. If this
* is not the case, some kind of unchecked exception is thrown.
@@ -66,7 +66,7 @@ public static void isNotNull(Object object, String message) {
* if the check fails)
*/
public static boolean isTrue(boolean expression) {
- return isTrue(expression, ""); //$NON-NLS-1$
+ return isTrue(expression, ""/*nonNLS*/);
}
/** Asserts that the given boolean is <code>true</code>. If this
* is not the case, some kind of unchecked exception is thrown.
@@ -79,7 +79,7 @@ public static boolean isTrue(boolean expression) {
*/
public static boolean isTrue(boolean expression, String message) {
if (!expression)
- throw new AssertionFailedException(Util.bind("assert.failed", message)); //$NON-NLS-1$
+ throw new AssertionFailedException(Util.bind("assert.failed"/*nonNLS*/, message));
return expression;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BasicCompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BasicCompilationUnit.java
index c1972e9062..7f9ec6723d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BasicCompilationUnit.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BasicCompilationUnit.java
@@ -21,11 +21,11 @@ public BasicCompilationUnit(char[] contents, String fileName) {
this.contents = contents;
this.fileName = fileName.toCharArray();
- int start = fileName.lastIndexOf("/") + 1; //$NON-NLS-1$
- if (start == 0 || start < fileName.lastIndexOf("\\")) //$NON-NLS-1$
- start = fileName.lastIndexOf("\\") + 1; //$NON-NLS-1$
+ int start = fileName.lastIndexOf("/"/*nonNLS*/) + 1;
+ if (start == 0 || start < fileName.lastIndexOf("\\"/*nonNLS*/))
+ start = fileName.lastIndexOf("\\"/*nonNLS*/) + 1;
- int end = fileName.lastIndexOf("."); //$NON-NLS-1$
+ int end = fileName.lastIndexOf("."/*nonNLS*/);
if (end == -1)
end = fileName.length();
@@ -75,6 +75,6 @@ public char[] getMainTypeName() {
return mainTypeName;
}
public String toString(){
- return "CompilationUnit: "+new String(fileName); //$NON-NLS-1$
+ return "CompilationUnit: "/*nonNLS*/+new String(fileName);
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
index 2bf473bf2a..0616e24f54 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java
@@ -110,7 +110,7 @@ public String[] getParameterNames() throws JavaModelException {
int paramCount = Signature.getParameterCount(new String(info.getMethodDescriptor()));
fParameterNames = new String[paramCount];
for (int i = 0; i < paramCount; i++) {
- fParameterNames[i] = "arg" + i; //$NON-NLS-1$
+ fParameterNames[i] = "arg"/*nonNLS*/ + i;
}
}
return fParameterNames;
@@ -151,18 +151,18 @@ public boolean isConstructor() throws JavaModelException {
public String readableName() {
StringBuffer buffer = new StringBuffer(super.readableName());
- buffer.append("("); //$NON-NLS-1$
+ buffer.append("("/*nonNLS*/);
String[] parameterTypes = this.getParameterTypes();
int length;
if (parameterTypes != null && (length = parameterTypes.length) > 0) {
for (int i = 0; i < length; i++) {
buffer.append(Signature.toString(parameterTypes[i]));
if (i < length - 1) {
- buffer.append(", "); //$NON-NLS-1$
+ buffer.append(", "/*nonNLS*/);
}
}
}
- buffer.append(")"); //$NON-NLS-1$
+ buffer.append(")"/*nonNLS*/);
return buffer.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java
index d71ce8ed06..49dbcaf257 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryType.java
@@ -109,7 +109,7 @@ public IType getDeclaringType() {
return null;
}
enclosingTypeName = ClassFile.unqualifiedName(enclosingTypeName);
- return getPackageFragment().getClassFile(new String(enclosingTypeName) + ".class").getType(); //$NON-NLS-1$
+ return getPackageFragment().getClassFile(new String(enclosingTypeName) + ".class"/*nonNLS*/).getType();
} catch (JavaModelException npe) {
return null;
}
@@ -231,7 +231,7 @@ public String[] getSuperInterfaceNames() throws JavaModelException {
* @see IType#getType
*/
public IType getType(String name) {
- IClassFile classFile= getPackageFragment().getClassFile(getTypeQualifiedName() + "$" + name + ".class"); //$NON-NLS-2$ //$NON-NLS-1$
+ IClassFile classFile= getPackageFragment().getClassFile(getTypeQualifiedName() + "$"/*nonNLS*/ + name + ".class"/*nonNLS*/);
return new BinaryType(classFile, name);
}
/**
@@ -302,7 +302,7 @@ public ITypeHierarchy newTypeHierarchy(IProgressMonitor monitor) throws JavaMode
*/
public ITypeHierarchy newTypeHierarchy(IJavaProject project, IProgressMonitor monitor) throws JavaModelException {
if (project == null) {
- throw new IllegalArgumentException(Util.bind("hierarchy.nullProject")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("hierarchy.nullProject"/*nonNLS*/));
}
CreateTypeHierarchyOperation op= new CreateTypeHierarchyOperation(
this,
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Buffer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Buffer.java
index 85b4c44149..150909f0e4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Buffer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Buffer.java
@@ -166,8 +166,8 @@ private String findLineSeparator(char[] text) {
char currentChar = nextChar;
nextChar = i < length-1 ? text[i+1] : ' ';
switch (currentChar) {
- case '\n': return "\n"; //$NON-NLS-1$
- case '\r': return nextChar == '\n' ? "\r\n" : "\r"; //$NON-NLS-1$ //$NON-NLS-2$
+ case '\n': return "\n"/*nonNLS*/;
+ case '\r': return nextChar == '\n' ? "\r\n"/*nonNLS*/ : "\r"/*nonNLS*/;
}
}
}
@@ -208,7 +208,7 @@ public char[] getCharacters() {
*/
public String getContents() {
if (fContents == null)
- return ""; //$NON-NLS-1$
+ return ""/*nonNLS*/;
synchronized (fLock) {
if (fGapStart < 0) {
return new String(fContents);
@@ -261,7 +261,7 @@ public IOpenable getOwner() {
*/
public String getText(int offset, int length) {
if (fContents == null)
- return ""; //$NON-NLS-1$
+ return ""/*nonNLS*/;
synchronized (fLock) {
if (offset + length < fGapStart)
return new String(fContents, offset, length);
@@ -616,19 +616,19 @@ public String toString() {
char[] contents = this.getCharacters();
int length = contents.length;
StringBuffer buffer = new StringBuffer(length);
- buffer.append("Buffer:\n"); //$NON-NLS-1$
+ buffer.append("Buffer:\n"/*nonNLS*/);
for (int i = 0; i < length; i++) {
char car = contents[i];
switch (car) {
case '\n':
- buffer.append("\\n\n"); //$NON-NLS-1$
+ buffer.append("\\n\n"/*nonNLS*/);
break;
case '\r':
if (i < length-1 && contents[i+1] == '\n') {
- buffer.append("\\r\\n\n"); //$NON-NLS-1$
+ buffer.append("\\r\\n\n"/*nonNLS*/);
i++;
} else {
- buffer.append("\\r\n"); //$NON-NLS-1$
+ buffer.append("\\r\n"/*nonNLS*/);
}
break;
default:
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java
index d4c5da52e2..a956b0d46b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFile.java
@@ -33,7 +33,7 @@ public class ClassFile extends Openable implements IClassFile {
protected ClassFile(IPackageFragment parent, String name) {
super(CLASS_FILE, parent, name);
if (!Util.isClassFileName(name)) {
- throw new IllegalArgumentException(Util.bind("element.invalidClassFileName")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.invalidClassFileName"/*nonNLS*/));
}
}
/**
@@ -42,7 +42,7 @@ protected ClassFile(IPackageFragment parent, String name) {
public void codeComplete(int offset, ICodeCompletionRequestor requestor) throws JavaModelException {
String source = getSource();
if (source != null) {
- BasicCompilationUnit cu = new BasicCompilationUnit(getSource().toCharArray(), getElementName() + ".java"); //$NON-NLS-1$
+ BasicCompilationUnit cu = new BasicCompilationUnit(getSource().toCharArray(), getElementName() + ".java"/*nonNLS*/);
codeComplete(cu, cu, offset, requestor);
}
}
@@ -56,7 +56,7 @@ public IJavaElement[] codeSelect(int offset, int length) throws JavaModelExcepti
contents = buffer.getCharacters();
String name = getElementName();
name = name.substring(0, name.length() - 6); // remove ".class"
- name = name + ".java"; //$NON-NLS-1$
+ name = name + ".java"/*nonNLS*/;
BasicCompilationUnit cu = new BasicCompilationUnit(contents, name);
return super.codeSelect(cu, offset, length);
} else {
@@ -141,7 +141,7 @@ private IBinaryType getBinaryTypeInfo(IFile file) throws JavaModelException {
zip = root.getJar();
String entryName = getParent().getElementName();
entryName = entryName.replace('.', '/');
- if (entryName.equals("")) { //$NON-NLS-1$
+ if (entryName.equals(""/*nonNLS*/)) {
entryName += getElementName();
} else {
entryName += '/' + getElementName();
@@ -278,7 +278,7 @@ public IType getType() throws JavaModelException {
public WorkingCopy getWorkingCopy() {
String name = getElementName();
name = name.substring(0, name.length() - 6); // remove ".class"
- name = name + ".java"; //$NON-NLS-1$
+ name = name + ".java"/*nonNLS*/;
return new WorkingCopy((IPackageFragment) getParent(), name);
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
index 35ca099896..2db5ba76dd 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClassFileInfo.java
@@ -73,7 +73,7 @@ private void generateInnerClassInfos(IType type, IBinaryType typeInfo, Hashtable
for (int i = 0, typeCount = innerTypes.length; i < typeCount; i++) {
IBinaryNestedType binaryType = innerTypes[i];
String innerQualifiedName = new String(binaryType.getName());
- IClassFile classFile= ((IPackageFragment)fClassFile.getParent()).getClassFile(new String(ClassFile.unqualifiedName(binaryType.getName())) + ".class"); //$NON-NLS-1$
+ IClassFile classFile= ((IPackageFragment)fClassFile.getParent()).getClassFile(new String(ClassFile.unqualifiedName(binaryType.getName())) + ".class"/*nonNLS*/);
IType innerType = new BinaryType(classFile, new String(ClassFile.simpleName(binaryType.getName())));
children.addElement(innerType);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
index d0a65fd757..8ec95adbbd 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java
@@ -170,38 +170,38 @@ public String toString() {
buffer.append('[');
switch (getEntryKind()) {
case IClasspathEntry.CPE_LIBRARY:
- buffer.append("CPE_LIBRARY"); //$NON-NLS-1$
+ buffer.append("CPE_LIBRARY"/*nonNLS*/);
break;
case IClasspathEntry.CPE_PROJECT:
- buffer.append("CPE_PROJECT"); //$NON-NLS-1$
+ buffer.append("CPE_PROJECT"/*nonNLS*/);
break;
case IClasspathEntry.CPE_SOURCE:
- buffer.append("CPE_SOURCE"); //$NON-NLS-1$
+ buffer.append("CPE_SOURCE"/*nonNLS*/);
break;
case IClasspathEntry.CPE_VARIABLE:
- buffer.append("CPE_VARIABLE"); //$NON-NLS-1$
+ buffer.append("CPE_VARIABLE"/*nonNLS*/);
break;
}
- buffer.append("]["); //$NON-NLS-1$
+ buffer.append("]["/*nonNLS*/);
switch (getContentKind()) {
case IPackageFragmentRoot.K_BINARY:
- buffer.append("K_BINARY"); //$NON-NLS-1$
+ buffer.append("K_BINARY"/*nonNLS*/);
break;
case IPackageFragmentRoot.K_SOURCE:
- buffer.append("K_SOURCE"); //$NON-NLS-1$
+ buffer.append("K_SOURCE"/*nonNLS*/);
break;
case ClasspathEntry.K_OUTPUT:
- buffer.append("K_OUTPUT"); //$NON-NLS-1$
+ buffer.append("K_OUTPUT"/*nonNLS*/);
break;
}
buffer.append(']');
if (getSourceAttachmentPath() != null){
- buffer.append("[sourcePath:"); //$NON-NLS-1$
+ buffer.append("[sourcePath:"/*nonNLS*/);
buffer.append(getSourceAttachmentPath());
buffer.append(']');
}
if (getSourceAttachmentRootPath() != null){
- buffer.append("[rootPath:"); //$NON-NLS-1$
+ buffer.append("[rootPath:"/*nonNLS*/);
buffer.append(getSourceAttachmentRootPath());
buffer.append(']');
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.java
index b42b95fc1d..28d5127d25 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CommitWorkingCopyOperation.java
@@ -86,7 +86,7 @@ private void checkPackageDeclaration(ICompilationUnit cu)
* of the original compilation unit fails
*/
protected void executeOperation() throws JavaModelException {
- beginTask(Util.bind("workingCopy.commit"), 2); //$NON-NLS-1$
+ beginTask(Util.bind("workingCopy.commit"/*nonNLS*/), 2);
ICompilationUnit copy = getCompilationUnit();
ICompilationUnit original = (ICompilationUnit) copy.getOriginalElement();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java
index 266d4a93c5..8372504636 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java
@@ -34,7 +34,7 @@ public class CompilationUnit extends Openable implements ICompilationUnit, org.e
protected CompilationUnit(IPackageFragment parent, String name) {
super(COMPILATION_UNIT, parent, name);
if (!Util.isJavaFileName(name)) {
- throw new IllegalArgumentException(Util.bind("convention.unit.notJavaName")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("convention.unit.notJavaName"/*nonNLS*/));
}
}
/**
@@ -77,7 +77,7 @@ public void commit(boolean force, IProgressMonitor monitor) throws JavaModelExce
*/
public void copy(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {
if (container == null) {
- throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));
}
IJavaElement[] elements = new IJavaElement[] {this};
IJavaElement[] containers = new IJavaElement[] {container};
@@ -120,10 +120,10 @@ public IType createType(String content, IJavaElement sibling, boolean force, IPr
if (!exists()) {
//autogenerate this compilation unit
IPackageFragment pkg = (IPackageFragment) getParent();
- String source = ""; //$NON-NLS-1$
+ String source = ""/*nonNLS*/;
if (pkg.getElementName().length() > 0) {
//not the default package...add the package declaration
- source = "package " + pkg.getElementName() + ";" + JavaModelManager.LINE_SEPARATOR; //$NON-NLS-1$ //$NON-NLS-2$
+ source = "package "/*nonNLS*/ + pkg.getElementName() + ";"/*nonNLS*/ + JavaModelManager.LINE_SEPARATOR;
}
CreateCompilationUnitOperation op = new CreateCompilationUnitOperation(pkg, fName, source, force);
runOperation(op, monitor);
@@ -173,7 +173,7 @@ protected boolean equalsDOMNode(IDOMNode node) throws JavaModelException {
} else {
// iterate through all the types inside the receiver and see if one of them can fit
IType[] types = getTypes();
- String typeNodeName = nodeName.substring(0, nodeName.indexOf(".java")); //$NON-NLS-1$
+ String typeNodeName = nodeName.substring(0, nodeName.indexOf(".java"/*nonNLS*/));
for (int i = 0, max = types.length; i < max; i++) {
if (types[i].getElementName().equals(typeNodeName)) {
return true;
@@ -378,7 +378,7 @@ public ReferenceInfo getReferenceInfo() throws JavaModelException {
*/
public String getSource() throws JavaModelException {
IBuffer buffer = getBuffer();
- if (buffer == null) return ""; //$NON-NLS-1$
+ if (buffer == null) return ""/*nonNLS*/;
return buffer.getContents();
}
/**
@@ -470,7 +470,7 @@ public void makeConsistent(IProgressMonitor pm) throws JavaModelException {
*/
public void move(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {
if (container == null) {
- throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));
}
IJavaElement[] elements= new IJavaElement[] {this};
IJavaElement[] containers= new IJavaElement[] {container};
@@ -540,7 +540,7 @@ public IMarker[] reconcile() throws JavaModelException {
*/
public void rename(String name, boolean force, IProgressMonitor monitor) throws JavaModelException {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("operation.nullName")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("operation.nullName"/*nonNLS*/));
}
IJavaElement[] elements= new IJavaElement[] {this};
IJavaElement[] dests= new IJavaElement[] {this.getParent()};
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
index db6f62978d..acecc72b22 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitStructureRequestor.java
@@ -148,7 +148,7 @@ public void acceptConstructorReference(char[] typeName, int argCount, int source
addReference(ReferenceInfo.REFTYPE_call, name);
}
else {
- String name = "<" + new String(typeName) + ">/" + argCount; //$NON-NLS-2$ //$NON-NLS-1$
+ String name = "<"/*nonNLS*/ + new String(typeName) + ">/"/*nonNLS*/ + argCount;
addReference(ReferenceInfo.REFTYPE_call, name.toCharArray());
}
}
@@ -178,7 +178,7 @@ public void acceptImport(int declarationStart, int declarationEnd, char[] name,
// tack on the '.*' if it is onDemand
String importName;
if (onDemand) {
- importName= new String(name) + ".*"; //$NON-NLS-1$
+ importName= new String(name) + ".*"/*nonNLS*/;
} else {
importName= new String(name);
}
@@ -239,7 +239,7 @@ public void acceptMethodReference(char[] methodName, int argCount, int sourcePos
addReference(ReferenceInfo.REFTYPE_call, name);
}
else {
- String name = new String(methodName) + "/" + argCount; //$NON-NLS-1$
+ String name = new String(methodName) + "/"/*nonNLS*/ + argCount;
addReference(ReferenceInfo.REFTYPE_call, name.toCharArray());
}
}
@@ -559,13 +559,13 @@ protected void enterType(
if (fPackageName == null) {
qualifiedName= nameString.toCharArray();
} else {
- qualifiedName= (new String(fPackageName) + "." + nameString).toCharArray(); //$NON-NLS-1$
+ qualifiedName= (new String(fPackageName) + "."/*nonNLS*/ + nameString).toCharArray();
}
}
else if (parentHandle.getElementType() == IJavaElement.TYPE) {
handle = ((IType) parentHandle).getType(nameString);
enclosingTypeName= ((SourceTypeElementInfo)parentInfo).getName();
- qualifiedName= (new String(((SourceTypeElementInfo)parentInfo).getQualifiedName()) + "." + nameString).toCharArray(); //$NON-NLS-1$
+ qualifiedName= (new String(((SourceTypeElementInfo)parentInfo).getQualifiedName()) + "."/*nonNLS*/ + nameString).toCharArray();
}
else {
Assert.isTrue(false); // Should not happen
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitVisitor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitVisitor.java
index 27c55071fd..8a3b8ec22f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitVisitor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnitVisitor.java
@@ -19,164 +19,138 @@ import java.io.*;
import java.util.*;
public class CompilationUnitVisitor extends Compiler {
-
- /**
- * Answer a new CompilationUnitVisitor using the given name environment and compiler options.
- * The environment and options will be in effect for the lifetime of the compiler.
- * When the compiler is run, compilation results are sent to the given requestor.
- *
- * @param environment org.eclipse.jdt.internal.compiler.api.env.INameEnvironment
- * Environment used by the compiler in order to resolve type and package
- * names. The name environment implements the actual connection of the compiler
- * to the outside world (e.g. in batch mode the name environment is performing
- * pure file accesses, reuse previous build state or connection to repositories).
- * Note: the name environment is responsible for implementing the actual classpath
- * rules.
- *
- * @param policy org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy
- * Configurable part for problem handling, allowing the compiler client to
- * specify the rules for handling problems (stop on first error or accumulate
- * them all) and at the same time perform some actions such as opening a dialog
- * in UI when compiling interactively.
- * @see org.eclipse.jdt.internal.compiler.api.problem.DefaultErrorHandlingPolicies
- *
- * @param requestor org.eclipse.jdt.internal.compiler.api.ICompilerRequestor
- * Component which will receive and persist all compilation results and is intended
- * to consume them as they are produced. Typically, in a batch compiler, it is
- * responsible for writing out the actual .class files to the file system.
- * @see org.eclipse.jdt.internal.compiler.api.CompilationResult
- *
- * @param problemFactory org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory
- * Factory used inside the compiler to create problem descriptors. It allows the
- * compiler client to supply its own representation of compilation problems in
- * order to avoid object conversions. Note that the factory is not supposed
- * to accumulate the created problems, the compiler will gather them all and hand
- * them back as part of the compilation unit result.
- */
- public CompilationUnitVisitor(
- INameEnvironment environment,
- IErrorHandlingPolicy policy,
- ConfigurableOption[] settings,
- ICompilerRequestor requestor,
- IProblemFactory problemFactory) {
-
- super(environment, policy, settings, requestor, problemFactory);
+/**
+ * Answer a new CompilationUnitVisitor using the given name environment and compiler options.
+ * The environment and options will be in effect for the lifetime of the compiler.
+ * When the compiler is run, compilation results are sent to the given requestor.
+ *
+ * @param environment org.eclipse.jdt.internal.compiler.api.env.INameEnvironment
+ * Environment used by the compiler in order to resolve type and package
+ * names. The name environment implements the actual connection of the compiler
+ * to the outside world (e.g. in batch mode the name environment is performing
+ * pure file accesses, reuse previous build state or connection to repositories).
+ * Note: the name environment is responsible for implementing the actual classpath
+ * rules.
+ *
+ * @param policy org.eclipse.jdt.internal.compiler.api.problem.IErrorHandlingPolicy
+ * Configurable part for problem handling, allowing the compiler client to
+ * specify the rules for handling problems (stop on first error or accumulate
+ * them all) and at the same time perform some actions such as opening a dialog
+ * in UI when compiling interactively.
+ * @see org.eclipse.jdt.internal.compiler.api.problem.DefaultErrorHandlingPolicies
+ *
+ * @param requestor org.eclipse.jdt.internal.compiler.api.ICompilerRequestor
+ * Component which will receive and persist all compilation results and is intended
+ * to consume them as they are produced. Typically, in a batch compiler, it is
+ * responsible for writing out the actual .class files to the file system.
+ * @see org.eclipse.jdt.internal.compiler.api.CompilationResult
+ *
+ * @param problemFactory org.eclipse.jdt.internal.compiler.api.problem.IProblemFactory
+ * Factory used inside the compiler to create problem descriptors. It allows the
+ * compiler client to supply its own representation of compilation problems in
+ * order to avoid object conversions. Note that the factory is not supposed
+ * to accumulate the created problems, the compiler will gather them all and hand
+ * them back as part of the compilation unit result.
+ */
+public CompilationUnitVisitor(
+ INameEnvironment environment,
+ IErrorHandlingPolicy policy,
+ ConfigurableOption[] settings,
+ ICompilerRequestor requestor,
+ IProblemFactory problemFactory) {
+
+ super(environment, policy, settings, requestor, problemFactory);
+}
+/**
+ * Add an additional source type
+ */
+public void accept(ISourceType sourceType, PackageBinding packageBinding) {
+ CompilationResult result = new CompilationResult(sourceType.getFileName(), 1, 1); // need to hold onto this
+ CompilationUnitDeclaration unit =
+ SourceTypeConverter.buildCompilationUnit(sourceType, true, true, lookupEnvironment.problemReporter, result);
+
+ if (unit != null) {
+ this.lookupEnvironment.buildTypeBindings(unit);
+ this.lookupEnvironment.completeTypeBindings(unit, true);
}
+}
+/*
+ * Low-level API performing the actual compilation
+ */
+protected static IErrorHandlingPolicy getHandlingPolicy() {
- /**
- * Add additional source types
- */
- public void accept(ISourceType[] sourceTypes, PackageBinding packageBinding) {
- CompilationResult result =
- new CompilationResult(sourceTypes[0].getFileName(), 1, 1);
- // need to hold onto this
- CompilationUnitDeclaration unit =
- SourceTypeConverter.buildCompilationUnit(
- sourceTypes,
- true,
- true,
- lookupEnvironment.problemReporter,
- result);
+ // passes the initial set of files to the batch oracle (to avoid finding more than once the same units when case insensitive match)
+ return new IErrorHandlingPolicy() {
+ public boolean stopOnFirstError() {
+ return false;
+ }
+ public boolean proceedOnErrors() {
+ return false; // stop if there are some errors
+ }
+ };
+}
+protected static INameEnvironment getNameEnvironment(ICompilationUnit sourceUnit) throws JavaModelException {
+ return (SearchableEnvironment) ((JavaProject) sourceUnit.getJavaProject())
+ .getSearchableNameEnvironment();
+}
+/*
+ * Low-level API performing the actual compilation
+ */
+protected static ConfigurableOption[] getOptions() {
+ CompilerOptions options = new CompilerOptions();
+ return options.getConfigurableOptions(Locale.getDefault());
+}
+/*
+ * Answer the component to which will be handed back compilation results from the compiler
+ */
+protected static ICompilerRequestor getRequestor() {
+ return new ICompilerRequestor() {
+ public void acceptResult(CompilationResult compilationResult) {
+ }
+ };
+}
+public static void visit(ICompilationUnit unitElement, IAbstractSyntaxTreeVisitor visitor) throws JavaModelException {
+
+ CompilationUnitVisitor compilationUnitVisitor = new CompilationUnitVisitor(
+ getNameEnvironment(unitElement),
+ getHandlingPolicy(),
+ getOptions(),
+ getRequestor(),
+ getProblemFactory(visitor));
+
+ CompilationUnitDeclaration unit = null;
+ try {
+ unit = compilationUnitVisitor.resolve(
+ new BasicCompilationUnit(
+ unitElement.getSource().toCharArray(),
+ unitElement.getElementName()));
if (unit != null) {
- this.lookupEnvironment.buildTypeBindings(unit);
- this.lookupEnvironment.completeTypeBindings(unit, true);
+ unit.traverse(visitor, unit.scope);
+ }
+ } finally {
+ if (unit != null) {
+ unit.cleanUp();
}
}
-
- /*
- * Low-level API performing the actual compilation
- */
- protected static IErrorHandlingPolicy getHandlingPolicy() {
-
- // passes the initial set of files to the batch oracle (to avoid finding more than once the same units when case insensitive match)
- return new IErrorHandlingPolicy() {
- public boolean stopOnFirstError() {
- return false;
- }
- public boolean proceedOnErrors() {
- return false; // stop if there are some errors
- }
- };
- }
-
- protected static INameEnvironment getNameEnvironment(ICompilationUnit sourceUnit)
- throws JavaModelException {
- return (SearchableEnvironment) ((JavaProject) sourceUnit.getJavaProject())
- .getSearchableNameEnvironment();
- }
-
- /*
- * Low-level API performing the actual compilation
- */
- protected static ConfigurableOption[] getOptions() {
- return JavaModelManager.getOptions();
- }
-
- /*
- * Answer the component to which will be handed back compilation results from the compiler
- */
- protected static ICompilerRequestor getRequestor() {
- return new ICompilerRequestor() {
- public void acceptResult(CompilationResult compilationResult) {
- }
- };
- }
-
- public static void visit(
- ICompilationUnit unitElement,
- IAbstractSyntaxTreeVisitor visitor)
- throws JavaModelException {
-
- CompilationUnitVisitor compilationUnitVisitor =
- new CompilationUnitVisitor(
- getNameEnvironment(unitElement),
- getHandlingPolicy(),
- getOptions(),
- getRequestor(),
- getProblemFactory(visitor));
-
- CompilationUnitDeclaration unit = null;
- try {
- unit =
- compilationUnitVisitor.resolve(
- new BasicCompilationUnit(
- unitElement.getSource().toCharArray(),
- unitElement.getElementName()));
- if (unit != null) {
- unit.traverse(visitor, unit.scope);
- }
- } finally {
- if (unit != null) {
- unit.cleanUp();
- }
+}
+
+protected static IProblemFactory getProblemFactory(final IAbstractSyntaxTreeVisitor visitor) {
+
+ return new DefaultProblemFactory(Locale.getDefault()){
+ public IProblem createProblem(char[] originatingFileName, int problemId, String[] arguments, int severity, int startPosition, int endPosition, int lineNumber) {
+
+ IProblem problem = super.createProblem(
+ originatingFileName,
+ problemId,
+ arguments,
+ severity,
+ startPosition,
+ endPosition,
+ lineNumber);
+ visitor.acceptProblem(problem);
+ return problem;
}
- }
-
- protected static IProblemFactory getProblemFactory(final IAbstractSyntaxTreeVisitor visitor) {
-
- return new DefaultProblemFactory(Locale.getDefault()) {
- public IProblem createProblem(
- char[] originatingFileName,
- int problemId,
- String[] arguments,
- int severity,
- int startPosition,
- int endPosition,
- int lineNumber) {
-
- IProblem problem =
- super.createProblem(
- originatingFileName,
- problemId,
- arguments,
- severity,
- startPosition,
- endPosition,
- lineNumber);
- visitor.acceptProblem(problem);
- return problem;
- }
- };
- }
-} \ No newline at end of file
+ };
+}
+}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyElementsOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyElementsOperation.java
index 724206ef5b..4858baf980 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyElementsOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyElementsOperation.java
@@ -68,7 +68,7 @@ public CopyElementsOperation(IJavaElement[] elementsToCopy, IJavaElement destCon
* for progress monitoring.
*/
protected String getMainTaskName() {
- return Util.bind("operation.copyElementProgress"); //$NON-NLS-1$
+ return Util.bind("operation.copyElementProgress"/*nonNLS*/);
}
/**
* Returns the nested operation to use for processing this element
@@ -83,7 +83,7 @@ protected JavaModelOperation getNestedOperation(IJavaElement element) {
return new CreateImportOperation(element.getElementName(), (ICompilationUnit) dest);
case IJavaElement.TYPE :
if (isRenamingMainType(element, dest)) {
- return new RenameResourceElementsOperation(new IJavaElement[] {dest}, new IJavaElement[] {dest.getParent()}, new String[]{getNewNameFor(element) + ".java"}, fForce); //$NON-NLS-1$
+ return new RenameResourceElementsOperation(new IJavaElement[] {dest}, new IJavaElement[] {dest.getParent()}, new String[]{getNewNameFor(element) + ".java"/*nonNLS*/}, fForce);
} else {
return new CreateTypeOperation(dest, getSourceFor(element) + JavaModelManager.LINE_SEPARATOR, fForce);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java
index 4c4ae12c1c..3fe95cd814 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java
@@ -159,7 +159,7 @@ private JavaElementDelta getDeltaFor(IJavaProject javaProject) {
* @see MultiOperation
*/
protected String getMainTaskName() {
- return Util.bind("operation.copyResourceProgress"); //$NON-NLS-1$
+ return Util.bind("operation.copyResourceProgress"/*nonNLS*/);
}
/**
* Sets the deltas to register the changes resulting from this operation
@@ -342,7 +342,7 @@ private void processPackageFragmentResource(IPackageFragment source, IPackageFra
}
if (!newFrag.getElementName().equals(source.getElementName())) { // if package has been renamed, update the compilation units
for (int i = 0; i < resources.length; i++) {
- if (resources[i].getName().endsWith(".java")) { //$NON-NLS-1$
+ if (resources[i].getName().endsWith(".java"/*nonNLS*/)) {
// we only consider potential compilation units
ICompilationUnit cu = newFrag.getCompilationUnit(resources[i].getName());
IDOMCompilationUnit domCU = fFactory.createCompilationUnit(cu.getSource(), cu.getElementName());
@@ -428,7 +428,7 @@ private void updatePackageStatement(IDOMCompilationUnit domCU, String pkgName) t
if (!seenPackageNode && !defaultPackage) {
//the cu was in a default package...no package declaration
//create the new package declaration as the first child of the cu
- IDOMPackage pkg = fFactory.createPackage("package " + pkgName + ";" + JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$ //$NON-NLS-2$
+ IDOMPackage pkg = fFactory.createPackage("package "/*nonNLS*/ + pkgName + ";"/*nonNLS*/ + JavaModelManager.LINE_SEPARATOR);
domCU.getFirstChild().insertSibling(pkg);
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.java
index 8cf623a0e1..2a8ce5ffbe 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateCompilationUnitOperation.java
@@ -54,7 +54,7 @@ public CreateCompilationUnitOperation(IPackageFragment parentElement, String nam
* @exception JavaModelException if unable to create the compilation unit.
*/
protected void executeOperation() throws JavaModelException {
- beginTask(Util.bind("operation.createUnitProgress"), 2); //$NON-NLS-1$
+ beginTask(Util.bind("operation.createUnitProgress"/*nonNLS*/), 2);
JavaElementDelta delta = newJavaElementDelta();
ICompilationUnit unit = getCompilationUnit();
IPackageFragment pkg = (IPackageFragment) getParentElement();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateFieldOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateFieldOperation.java
index ff09cc85a8..79ab766ce7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateFieldOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateFieldOperation.java
@@ -55,7 +55,7 @@ protected IJavaElement generateResultHandle() {
* @see CreateElementInCUOperation#getMainTaskName
*/
public String getMainTaskName(){
- return Util.bind("operation.createFieldProgress"); //$NON-NLS-1$
+ return Util.bind("operation.createFieldProgress"/*nonNLS*/);
}
/**
* By default the new field is positioned after the last existing field
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateImportOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateImportOperation.java
index 9111d8d0a8..f40b1fb73a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateImportOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateImportOperation.java
@@ -72,7 +72,7 @@ protected IJavaElement generateResultHandle() {
* @see CreateElementInCUOperation#getMainTaskName
*/
public String getMainTaskName(){
- return Util.bind("operation.createImportsProgress"); //$NON-NLS-1$
+ return Util.bind("operation.createImportsProgress"/*nonNLS*/);
}
/**
* Sets the correct position for the new import:<ul>
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateInitializerOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateInitializerOperation.java
index b16e479082..436ee5ad48 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateInitializerOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateInitializerOperation.java
@@ -78,7 +78,7 @@ protected IJavaElement generateResultHandle() {
* @see CreateElementInCUOperation#getMainTaskName
*/
public String getMainTaskName(){
- return Util.bind("operation.createInitializerProgress"); //$NON-NLS-1$
+ return Util.bind("operation.createInitializerProgress"/*nonNLS*/);
}
/**
* By default the new initializer is positioned after the last existing initializer
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateMethodOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateMethodOperation.java
index 9ce66ac772..d99a852b86 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateMethodOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateMethodOperation.java
@@ -79,7 +79,7 @@ protected IJavaElement generateResultHandle() {
* @see CreateElementInCUOperation#getMainTaskName
*/
public String getMainTaskName(){
- return Util.bind("operation.createMethodProgress"); //$NON-NLS-1$
+ return Util.bind("operation.createMethodProgress"/*nonNLS*/);
}
/**
* @see CreateTypeMemberOperation#verifyNameCollision
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.java
index 4d90298755..14fd9662ab 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreatePackageDeclarationOperation.java
@@ -72,7 +72,7 @@ protected IJavaElement generateResultHandle() {
* @see CreateElementInCUOperation#getMainTaskName
*/
public String getMainTaskName(){
- return Util.bind("operation.createPackageProgress"); //$NON-NLS-1$
+ return Util.bind("operation.createPackageProgress"/*nonNLS*/);
}
/**
* Sets the correct position for new package declaration:<ul>
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.java
index 3be9920f1f..8e9c69ec77 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreatePackageFragmentOperation.java
@@ -54,9 +54,9 @@ protected void executeOperation() throws JavaModelException {
JavaElementDelta delta = newJavaElementDelta();
IPackageFragmentRoot root = (IPackageFragmentRoot) getParentElement();
String[] names = Signature.getSimpleNames(fName);
- beginTask(Util.bind("operation.createPackageFragmentProgress"), names.length); //$NON-NLS-1$
+ beginTask(Util.bind("operation.createPackageFragmentProgress"/*nonNLS*/), names.length);
IContainer parentFolder = (IContainer) root.getUnderlyingResource();
- String sideEffectPackageName = ""; //$NON-NLS-1$
+ String sideEffectPackageName = ""/*nonNLS*/;
Vector resultElements = new Vector(names.length);
int i;
for (i = 0; i < names.length; i++) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java
index a0b02ced12..58e4d3c878 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeMemberOperation.java
@@ -64,11 +64,11 @@ protected void generateNewCompilationUnitDOM(ICompilationUnit cu) throws JavaMod
protected IDOMNode generateSyntaxIncorrectDOM() throws JavaModelException {
//create some dummy source to generate a dom node
StringBuffer buff = new StringBuffer();
- buff.append(JavaModelManager.LINE_SEPARATOR + " public class A {" + JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$
+ buff.append(JavaModelManager.LINE_SEPARATOR + " public class A {"/*nonNLS*/ + JavaModelManager.LINE_SEPARATOR);
buff.append(fSource);
buff.append(JavaModelManager.LINE_SEPARATOR).append('}');
- IDOMCompilationUnit domCU = (new DOMFactory()).createCompilationUnit(buff.toString(), "A.java"); //$NON-NLS-1$
- IDOMNode node = (IDOMNode) domCU.getChild("A").getChildren().nextElement(); //$NON-NLS-1$
+ IDOMCompilationUnit domCU = (new DOMFactory()).createCompilationUnit(buff.toString(), "A.java"/*nonNLS*/);
+ IDOMNode node = (IDOMNode) domCU.getChild("A"/*nonNLS*/).getChildren().nextElement();
if (node != null) {
node.remove();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeOperation.java
index d3ac4f5a9f..9a1a08d0bc 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CreateTypeOperation.java
@@ -58,7 +58,7 @@ protected IJavaElement generateResultHandle() {
* @see CreateElementInCUOperation#getMainTaskName
*/
public String getMainTaskName(){
- return Util.bind("operation.createTypeProgress"); //$NON-NLS-1$
+ return Util.bind("operation.createTypeProgress"/*nonNLS*/);
}
/**
* Returns the <code>IType</code> the member is to be created in.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java
index 9b8474e228..1f1a2e7b71 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteElementsOperation.java
@@ -60,7 +60,7 @@ protected void commitChanges(IDOMCompilationUnit cuDOM, ICompilationUnit cu) thr
* @see MultiOperation
*/
protected String getMainTaskName() {
- return Util.bind("operation.deleteElementProgress"); //$NON-NLS-1$
+ return Util.bind("operation.deleteElementProgress"/*nonNLS*/);
}
/**
* Groups the elements to be processed by their compilation unit.
@@ -112,7 +112,7 @@ protected void processElement(IJavaElement element) throws JavaModelException {
if (e.exists()) {
IDOMNode node = ((JavaElement) e).findNode(cuDOM);
// TBD
- Assert.isTrue(node != null, Util.bind("element.cannotLocate", e.getElementName(), cuDOM.getName())); //$NON-NLS-1$
+ Assert.isTrue(node != null, Util.bind("element.cannotLocate"/*nonNLS*/, e.getElementName(), cuDOM.getName()));
node.remove();
delta.removed(e);
if (e.getElementType() == IJavaElement.IMPORT_DECLARATION) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.java
index 3bff201047..01cf6dbaf0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeleteResourceElementsOperation.java
@@ -87,7 +87,7 @@ private void deletePackageFragment(IPackageFragment frag)
* @see MultiOperation
*/
protected String getMainTaskName() {
- return Util.bind("operation.deleteResourceProgress"); //$NON-NLS-1$
+ return Util.bind("operation.deleteResourceProgress"/*nonNLS*/);
}
/**
* @see MultiOperation. This method delegate to <code>deleteResource</code> or
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
index 1e25eb503c..5b36f6f281 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/DeltaProcessor.java
@@ -314,7 +314,7 @@ protected Openable[] createElements(IResource resource) {
if (resource == null) return null;
String extension = resource.getFileExtension();
extension = extension == null ? null : extension.toLowerCase();
- if ("jar".equals(extension) || "zip".equals(extension)) { //$NON-NLS-2$ //$NON-NLS-1$
+ if ("jar"/*nonNLS*/.equals(extension) || "zip"/*nonNLS*/.equals(extension)) {
IJavaProject[] projects = null;
try {
projects = JavaModelManager.getJavaModel(resource.getWorkspace()).getJavaProjects();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainer.java
index c78edf90dd..99db352704 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainer.java
@@ -13,7 +13,7 @@ import org.eclipse.jdt.core.*;
*/
public class ImportContainer extends SourceRefElement implements IImportContainer {
protected ImportContainer(ICompilationUnit parent) {
- super(IMPORT_CONTAINER, parent, ""); //$NON-NLS-1$
+ super(IMPORT_CONTAINER, parent, ""/*nonNLS*/);
}
/**
* @see JavaElement#getHandleMemento()
@@ -25,7 +25,7 @@ public String getHandleMemento(){
* @see JavaElement#getHandleMemento()
*/
protected char getHandleMementoDelimiter() {
- Assert.isTrue(false, Util.bind("assert.shouldNotImplement")); //$NON-NLS-1$
+ Assert.isTrue(false, Util.bind("assert.shouldNotImplement"/*nonNLS*/));
return 0;
}
/**
@@ -65,7 +65,7 @@ protected void toString(int tab, StringBuffer buffer) {
if (info == null || !(info instanceof JavaElementInfo)) return;
IJavaElement[] children = ((JavaElementInfo)info).getChildren();
for (int i = 0; i < children.length; i++) {
- if (i > 0) buffer.append("\n"); //$NON-NLS-1$
+ if (i > 0) buffer.append("\n"/*nonNLS*/);
((JavaElement)children[i]).toString(tab, buffer);
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportDeclaration.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportDeclaration.java
index bf4d453f20..bd6f12069c 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportDeclaration.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportDeclaration.java
@@ -39,7 +39,7 @@ protected char getHandleMementoDelimiter() {
* Returns true if the import is on-demand (ends with ".*")
*/
public boolean isOnDemand() {
- return fName.endsWith(".*"); //$NON-NLS-1$
+ return fName.endsWith(".*"/*nonNLS*/);
}
/**
*/
@@ -51,10 +51,10 @@ public String readableName() {
* @private Debugging purposes
*/
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
- buffer.append("import "); //$NON-NLS-1$
+ buffer.append("import "/*nonNLS*/);
buffer.append(getElementName());
if (info == null) {
- buffer.append(" (not open)"); //$NON-NLS-1$
+ buffer.append(" (not open)"/*nonNLS*/);
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Initializer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Initializer.java
index 9ac3a7dbc3..9bcbca58d5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Initializer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Initializer.java
@@ -18,7 +18,7 @@ import org.eclipse.jdt.core.jdom.IDOMNode;
/* package */ class Initializer extends Member implements IInitializer {
protected Initializer(IType parent, int occurrenceCount) {
- super(INITIALIZER, parent, ""); //$NON-NLS-1$
+ super(INITIALIZER, parent, ""/*nonNLS*/);
// 0 is not valid: this first occurrence is occurrence 1.
if (occurrenceCount <= 0)
throw new IllegalArgumentException();
@@ -70,16 +70,16 @@ public void rename(String name, boolean force, IProgressMonitor monitor) throws
*/
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
if (info == null) {
- buffer.append("<initializer>"); //$NON-NLS-1$
- buffer.append(" (not open)"); //$NON-NLS-1$
+ buffer.append("<initializer>"/*nonNLS*/);
+ buffer.append(" (not open)"/*nonNLS*/);
} else {
try {
if (Flags.isStatic(this.getFlags())) {
- buffer.append("static "); //$NON-NLS-1$
+ buffer.append("static "/*nonNLS*/);
}
- buffer.append("initializer"); //$NON-NLS-1$
+ buffer.append("initializer"/*nonNLS*/);
} catch (JavaModelException e) {
- buffer.append("<JavaModelException in toString of " + getElementName()); //$NON-NLS-1$
+ buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarEntryFile.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarEntryFile.java
index 147314e3ed..72d09145f5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarEntryFile.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarEntryFile.java
@@ -62,6 +62,6 @@ public boolean isReadOnly() {
* @see IStorage#isReadOnly()
*/
public String toString() {
- return "JarEntryFile["+this.zipName+"::"+this.entryName+"]"; //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$
+ return "JarEntryFile["/*nonNLS*/+this.zipName+"::"/*nonNLS*/+this.entryName+"]"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
index 00a545db43..945ac02508 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JarPackageFragmentRoot.java
@@ -65,7 +65,7 @@ public class JarPackageFragmentRoot extends PackageFragmentRoot {
try {
verifyAttachSource(zipPath);
if (monitor != null) {
- monitor.beginTask(Util.bind("element.attachingSource"), 2); //$NON-NLS-1$
+ monitor.beginTask(Util.bind("element.attachingSource"/*nonNLS*/), 2);
}
SourceMapper mapper= null;
SourceMapper oldMapper= getSourceMapper();
@@ -377,14 +377,14 @@ public IClasspathEntry findSourceAttachmentRecommendation() {
Object target = JavaModel.getTarget(workspaceRoot, entry.getSourceAttachmentPath(), true);
if (target instanceof IFile){
IFile file = (IFile) target;
- if ("jar".equalsIgnoreCase(file.getFileExtension()) || "zip".equalsIgnoreCase(file.getFileExtension())){ //$NON-NLS-2$ //$NON-NLS-1$
+ if ("jar"/*nonNLS*/.equalsIgnoreCase(file.getFileExtension()) || "zip"/*nonNLS*/.equalsIgnoreCase(file.getFileExtension())){
return entry;
}
}
if (target instanceof java.io.File){
java.io.File file = (java.io.File) target;
String name = file.getName();
- if (Util.endsWithIgnoreCase(name, ".jar") || Util.endsWithIgnoreCase(name, ".zip")){ //$NON-NLS-2$ //$NON-NLS-1$
+ if (Util.endsWithIgnoreCase(name, ".jar"/*nonNLS*/) || Util.endsWithIgnoreCase(name, ".zip"/*nonNLS*/)){
return entry;
}
}
@@ -405,14 +405,14 @@ public IClasspathEntry findSourceAttachmentRecommendation() {
if (target instanceof IFile){
IFile file = (IFile) target;
String name = file.getName();
- if (Util.endsWithIgnoreCase(name, ".jar") || Util.endsWithIgnoreCase(name, ".zip")){ //$NON-NLS-2$ //$NON-NLS-1$
+ if (Util.endsWithIgnoreCase(name, ".jar"/*nonNLS*/) || Util.endsWithIgnoreCase(name, ".zip"/*nonNLS*/)){
return entry;
}
}
if (target instanceof java.io.File){
java.io.File file = (java.io.File) target;
String name = file.getName();
- if (Util.endsWithIgnoreCase(name, ".jar") || Util.endsWithIgnoreCase(name, ".zip")){ //$NON-NLS-2$ //$NON-NLS-1$
+ if (Util.endsWithIgnoreCase(name, ".jar"/*nonNLS*/) || Util.endsWithIgnoreCase(name, ".zip"/*nonNLS*/)){
return entry;
}
}
@@ -503,7 +503,7 @@ public IClasspathEntry findSourceAttachmentRecommendation() {
if (recommendation != null){
propertyString = recommendation.getSourceAttachmentPath().toString()
+ ATTACHMENT_PROPERTY_DELIMITER
- + (recommendation.getSourceAttachmentRootPath() == null ? "" : recommendation.getSourceAttachmentRootPath().toString()); //$NON-NLS-1$
+ + (recommendation.getSourceAttachmentRootPath() == null ? ""/*nonNLS*/ : recommendation.getSourceAttachmentRootPath().toString());
getWorkspace().getRoot().setPersistentProperty(qName, propertyString);
}
}
@@ -520,7 +520,7 @@ public IClasspathEntry findSourceAttachmentRecommendation() {
ZipFile jarFile = null;
try {
jarFile = getJar();
- return new QualifiedName(JavaCore.PLUGIN_ID, "sourceattachment: " + jarFile.getName()); //$NON-NLS-1$
+ return new QualifiedName(JavaCore.PLUGIN_ID, "sourceattachment: "/*nonNLS*/ + jarFile.getName());
} catch (CoreException e) {
throw new JavaModelException(e);
} finally {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java
index bc883d4625..286bcd3f32 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElement.java
@@ -77,7 +77,7 @@ public abstract class JavaElement extends PlatformObject implements IJavaElement
*/
protected JavaElement(int type, IJavaElement parent, String name) throws IllegalArgumentException {
if (type < JAVA_MODEL || type > IMPORT_DECLARATION) {
- throw new IllegalArgumentException(Util.bind("element.invalidType")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.invalidType"/*nonNLS*/));
}
fLEType= type;
fParent= parent;
@@ -254,7 +254,7 @@ public ICompilationUnit getCompilationUnit() {
*
* @exception JavaModelException if the element is not present or not accessible
*/
-public JavaElementInfo getElementInfo() throws JavaModelException {
+protected JavaElementInfo getElementInfo() throws JavaModelException {
synchronized(fgJavaModelManager){
Object info = fgJavaModelManager.getInfo(this);
if (info == null) {
@@ -516,7 +516,7 @@ protected void setOccurrenceCount(int count) {
protected String tabString(int tab) {
StringBuffer buffer = new StringBuffer();
for (int i = tab; i > 0; i--)
- buffer.append(" "); //$NON-NLS-1$
+ buffer.append(" "/*nonNLS*/);
return buffer.toString();
}
/**
@@ -554,11 +554,11 @@ protected void toString(int tab, StringBuffer buffer) {
protected void toStringAncestors(StringBuffer buffer) {
JavaElement parent = (JavaElement)this.getParent();
if (parent != null) {
- buffer.append(" [in "); //$NON-NLS-1$
+ buffer.append(" [in "/*nonNLS*/);
Object parentInfo = fgJavaModelManager.getInfo(parent);
parent.toStringInfo(0, buffer, parentInfo);
parent.toStringAncestors(buffer);
- buffer.append("]"); //$NON-NLS-1$
+ buffer.append("]"/*nonNLS*/);
}
}
/**
@@ -568,7 +568,7 @@ protected void toStringChildren(int tab, StringBuffer buffer, Object info) {
if (info == null || !(info instanceof JavaElementInfo)) return;
IJavaElement[] children = ((JavaElementInfo)info).getChildren();
for (int i = 0; i < children.length; i++) {
- buffer.append("\n"); //$NON-NLS-1$
+ buffer.append("\n"/*nonNLS*/);
((JavaElement)children[i]).toString(tab + 1, buffer);
}
}
@@ -578,7 +578,7 @@ protected void toStringChildren(int tab, StringBuffer buffer, Object info) {
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
buffer.append(getElementName());
if (info == null) {
- buffer.append(" (not open)"); //$NON-NLS-1$
+ buffer.append(" (not open)"/*nonNLS*/);
}
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDelta.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDelta.java
index 4722567ab2..35fd0e08dc 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDelta.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDelta.java
@@ -477,7 +477,7 @@ public String toDebugString(int depth) {
buffer.append('\t');
}
buffer.append(((JavaElement)getElement()).toDebugString());
- buffer.append("["); //$NON-NLS-1$
+ buffer.append("["/*nonNLS*/);
switch (getKind()) {
case IJavaElementDelta.ADDED :
buffer.append('+');
@@ -492,68 +492,68 @@ public String toDebugString(int depth) {
buffer.append('?');
break;
}
- buffer.append("]: {"); //$NON-NLS-1$
+ buffer.append("]: {"/*nonNLS*/);
int changeFlags = getFlags();
boolean prev = false;
if ((changeFlags & IJavaElementDelta.F_CHILDREN) != 0) {
if (prev)
- buffer.append(" | "); //$NON-NLS-1$
- buffer.append("CHILDREN"); //$NON-NLS-1$
+ buffer.append(" | "/*nonNLS*/);
+ buffer.append("CHILDREN"/*nonNLS*/);
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_CONTENT) != 0) {
if (prev)
- buffer.append(" | "); //$NON-NLS-1$
- buffer.append("CONTENT"); //$NON-NLS-1$
+ buffer.append(" | "/*nonNLS*/);
+ buffer.append("CONTENT"/*nonNLS*/);
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_MOVED_FROM) != 0) {
if (prev)
- buffer.append(" | "); //$NON-NLS-1$
- buffer.append("MOVED_FROM(" + ((JavaElement)getMovedFromElement()).toDebugString() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append(" | "/*nonNLS*/);
+ buffer.append("MOVED_FROM("/*nonNLS*/ + ((JavaElement)getMovedFromElement()).toDebugString() + ")"/*nonNLS*/);
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_MOVED_TO) != 0) {
if (prev)
- buffer.append(" | "); //$NON-NLS-1$
- buffer.append("MOVED_TO(" + ((JavaElement)getMovedToElement()).toDebugString() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
+ buffer.append(" | "/*nonNLS*/);
+ buffer.append("MOVED_TO("/*nonNLS*/ + ((JavaElement)getMovedToElement()).toDebugString() + ")"/*nonNLS*/);
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0) {
if (prev)
- buffer.append(" | "); //$NON-NLS-1$
- buffer.append("ADDED TO CLASSPATH"); //$NON-NLS-1$
+ buffer.append(" | "/*nonNLS*/);
+ buffer.append("ADDED TO CLASSPATH"/*nonNLS*/);
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) {
if (prev)
- buffer.append(" | "); //$NON-NLS-1$
- buffer.append("REMOVED FROM CLASSPATH"); //$NON-NLS-1$
+ buffer.append(" | "/*nonNLS*/);
+ buffer.append("REMOVED FROM CLASSPATH"/*nonNLS*/);
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_CLASSPATH_REORDER) != 0) {
if (prev)
- buffer.append(" | "); //$NON-NLS-1$
- buffer.append("REORDERED IN CLASSPATH"); //$NON-NLS-1$
+ buffer.append(" | "/*nonNLS*/);
+ buffer.append("REORDERED IN CLASSPATH"/*nonNLS*/);
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_MODIFIERS) != 0) {
if (prev)
- buffer.append(" | "); //$NON-NLS-1$
- buffer.append("MODIFIERS CHANGED"); //$NON-NLS-1$
+ buffer.append(" | "/*nonNLS*/);
+ buffer.append("MODIFIERS CHANGED"/*nonNLS*/);
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_SUPER_TYPES) != 0) {
if (prev)
- buffer.append(" | "); //$NON-NLS-1$
- buffer.append("SUPER TYPES CHANGED"); //$NON-NLS-1$
+ buffer.append(" | "/*nonNLS*/);
+ buffer.append("SUPER TYPES CHANGED"/*nonNLS*/);
prev = true;
}
- buffer.append("}"); //$NON-NLS-1$
+ buffer.append("}"/*nonNLS*/);
IJavaElementDelta[] children = getAffectedChildren();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
- buffer.append("\n"); //$NON-NLS-1$
+ buffer.append("\n"/*nonNLS*/);
buffer.append(((JavaElementDelta) children[i]).toDebugString(depth + 1));
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
index d9621d5d84..3a9be1d0d8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaElementDeltaBuilder.java
@@ -422,7 +422,7 @@ private void removeElementInfo(IJavaElement element) {
}
public String toString() {
StringBuffer buffer = new StringBuffer();
- buffer.append("Built delta:\n"); //$NON-NLS-1$
+ buffer.append("Built delta:\n"/*nonNLS*/);
buffer.append(this.delta.toString());
return buffer.toString();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModel.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModel.java
index 37685b6849..a359be8acc 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModel.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModel.java
@@ -35,7 +35,7 @@ public class JavaModel extends Openable implements IJavaModel {
* @exception Error if called more than once
*/
protected JavaModel(IWorkspace workspace) throws Error {
- super(JAVA_MODEL, null, "" /*workspace has empty name*/); //$NON-NLS-1$
+ super(JAVA_MODEL, null, ""/*nonNLS*/ /*workspace has empty name*/);
this.workspace = workspace;
}
private void cleanupCycleMarkers() {
@@ -102,9 +102,10 @@ protected int computeDepth(String projectName, StringHashtableOfInt depthTable,
if (generateMarkerOnError) {
try {
IMarker marker = this.workspace.getRoot().getProject(dependentProjectName).createMarker(IJavaModelMarker.TRANSIENT_PROBLEM);
- marker.setAttributes(
- new String[]{ IMarker.MESSAGE, IMarker.PRIORITY, IMarker.LOCATION, IJavaModelMarker.CYCLE_DETECTED},
- new Object[]{ Util.bind("classpath.cycle"), new Integer(IMarker.PRIORITY_HIGH), dependentProjectName, dependentProjectName}); //$NON-NLS-1$
+ marker.setAttribute(IMarker.MESSAGE, Util.bind("classpath.cycle"/*nonNLS*/));
+ marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
+ marker.setAttribute(IMarker.LOCATION, dependentProjectName);
+ marker.setAttribute(IJavaModelMarker.CYCLE_DETECTED, dependentProjectName);
} catch (CoreException e) {
e.printStackTrace();
}
@@ -373,7 +374,7 @@ public String getHandleMemento(){
* contribution to a memento.
*/
protected char getHandleMementoDelimiter(){
- Assert.isTrue(false, Util.bind("assert.shouldNotImplement")); //$NON-NLS-1$
+ Assert.isTrue(false, Util.bind("assert.shouldNotImplement"/*nonNLS*/));
return 0;
}
/**
@@ -410,7 +411,7 @@ public IJavaProject getJavaProject(IResource resource) {
} else if (resource.getType() == IResource.PROJECT) {
return new JavaProject((IProject)resource, this);
} else {
- throw new IllegalArgumentException(Util.bind("element.invalidResourceForProject")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.invalidResourceForProject"/*nonNLS*/));
}
}
/**
@@ -480,9 +481,9 @@ protected void runOperation(MultiOperation op, IJavaElement[] elements, IJavaEle
* @private Debugging purposes
*/
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
- buffer.append("Java Model"); //$NON-NLS-1$
+ buffer.append("Java Model"/*nonNLS*/);
if (info == null) {
- buffer.append(" (not open)"); //$NON-NLS-1$
+ buffer.append(" (not open)"/*nonNLS*/);
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
index 480efcba7f..7a88eb0ed6 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java
@@ -39,15 +39,6 @@ import org.eclipse.jdt.internal.core.builder.NotPresentException;
* the static method <code>JavaModelManager.getJavaModelManager()</code>.
*/
public class JavaModelManager implements IResourceChangeListener, ISaveParticipant {
- /**
- * JavaCore options (don't use this field to add an new option,
- * use JavaModelManager#addOption method.
- */
- public static Hashtable fOptions;
- /**
- * JavaCore options IDs
- */
- private static ArrayList fOptionIDs;
/**
* The singleton manager
@@ -102,12 +93,12 @@ public class JavaModelManager implements IResourceChangeListener, ISaveParticipa
/**
* Local Java workspace properties file name (generated inside JavaCore plugin state location)
*/
- private static final String WKS_PROP_FILENAME= "workspace.properties"; //$NON-NLS-1$
+ private static final String WKS_PROP_FILENAME= "workspace.properties"/*nonNLS*/;
/**
* Name of the handle id attribute in a Java marker
*/
- private static final String ATT_HANDLE_ID= "org.eclipse.jdt.internal.core.JavaModelManager.handleId"; //$NON-NLS-1$
+ private static final String ATT_HANDLE_ID= "org.eclipse.jdt.internal.core.JavaModelManager.handleId"/*nonNLS*/;
/**
* Table from IProject to PerProjectInfo.
@@ -138,7 +129,7 @@ public class JavaModelManager implements IResourceChangeListener, ISaveParticipa
/**
* Line separator to use throughout the JavaModel for any source edit operation
*/
- public static String LINE_SEPARATOR = System.getProperty("line.separator"); //$NON-NLS-1$
+ public static String LINE_SEPARATOR = System.getProperty("line.separator"/*nonNLS*/);
/**
* Constructs a new JavaModelManager
*/
@@ -177,7 +168,212 @@ public void checkProjectBeingAdded(IResourceDelta delta) {
public void closeAffectedElements(IResourceDelta delta) {
fDeltaProcessor.closeAffectedElements(delta);
}
+/**
+ * Convert options Map into ConfigurableOption understood by the infrastructure
+ *
+ * Should be revisited
+ */
+public static ConfigurableOption[] convertConfigurableOptions(Hashtable optionMap) {
+
+ Enumeration optionNames = optionMap.keys();
+ CompilerOptions compilerOptions = new CompilerOptions();
+ int index = 0;
+
+ while (optionNames.hasMoreElements()){
+
+ String optionName = (String)optionNames.nextElement();
+ String optionValue = (String)optionMap.get(optionName);
+
+ if (optionName.equals(JavaCore.COMPILER_LOCAL_VARIABLE_ATTR)){
+
+ if (optionValue.equals(JavaCore.GENERATE)){
+ compilerOptions.produceDebugAttributes(
+ compilerOptions.getDebugAttributesMask() | CompilerOptions.Vars);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.DO_NOT_GENERATE)){
+ compilerOptions.produceDebugAttributes(
+ compilerOptions.getDebugAttributesMask() & ~CompilerOptions.Vars);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_LINE_NUMBER_ATTR)){
+
+ if (optionValue.equals(JavaCore.GENERATE)){
+ compilerOptions.produceDebugAttributes(
+ compilerOptions.getDebugAttributesMask() | CompilerOptions.Lines);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.DO_NOT_GENERATE)){
+ compilerOptions.produceDebugAttributes(
+ compilerOptions.getDebugAttributesMask() & ~CompilerOptions.Lines);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_SOURCE_FILE_ATTR)){
+
+ if (optionValue.equals(JavaCore.GENERATE)){
+ compilerOptions.produceDebugAttributes(
+ compilerOptions.getDebugAttributesMask() | CompilerOptions.Source);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.DO_NOT_GENERATE)){
+ compilerOptions.produceDebugAttributes(
+ compilerOptions.getDebugAttributesMask() & ~CompilerOptions.Source);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_CODEGEN_UNUSED_LOCAL)){
+ if (optionValue.equals(JavaCore.PRESERVE)){
+ compilerOptions.preserveAllLocalVariables(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.OPTIMIZE_OUT)){
+ compilerOptions.preserveAllLocalVariables(false);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM)){
+
+ if (optionValue.equals(JavaCore.VERSION_1_1)){
+ compilerOptions.setTargetJDK(CompilerOptions.JDK1_1);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.VERSION_1_2)){
+ compilerOptions.setTargetJDK(CompilerOptions.JDK1_2);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_PB_UNREACHABLE_CODE)){
+
+ if (optionValue.equals(JavaCore.ERROR)){
+ compilerOptions.handleUnreachableCodeAsError(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.WARNING)){
+ compilerOptions.handleUnreachableCodeAsError(false);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_PB_INVALID_IMPORT)){
+
+ if (optionValue.equals(JavaCore.ERROR)){
+ compilerOptions.handleImportProblemAsError(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.WARNING)){
+ compilerOptions.handleImportProblemAsError(false);
+ continue;
+ }
+ continue;
+ }
+
+ if (optionName.equals(JavaCore.COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD)){
+
+ if (optionValue.equals(JavaCore.WARNING)){
+ compilerOptions.handleOverriddenPackageDefaultMethodAsWarning(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.IGNORE)){
+ compilerOptions.handleOverriddenPackageDefaultMethodAsWarning(false);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME)){
+
+ if (optionValue.equals(JavaCore.WARNING)){
+ compilerOptions.handleMethodWithConstructorNameAsWarning(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.IGNORE)){
+ compilerOptions.handleMethodWithConstructorNameAsWarning(false);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_PB_DEPRECATION)){
+
+ if (optionValue.equals(JavaCore.WARNING)){
+ compilerOptions.handleDeprecationUseAsWarning(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.IGNORE)){
+ compilerOptions.handleDeprecationUseAsWarning(false);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_PB_HIDDEN_CATCH_BLOCK)){
+
+ if (optionValue.equals(JavaCore.WARNING)){
+ compilerOptions.handleMaskedCatchBlockAsWarning(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.IGNORE)){
+ compilerOptions.handleMaskedCatchBlockAsWarning(false);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_PB_UNUSED_LOCAL)){
+
+ if (optionValue.equals(JavaCore.WARNING)){
+ compilerOptions.handleUnusedLocalVariableAsWarning(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.IGNORE)){
+ compilerOptions.handleUnusedLocalVariableAsWarning(false);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_PB_UNUSED_PARAMETER)){
+
+ if (optionValue.equals(JavaCore.WARNING)){
+ compilerOptions.handleUnusedArgumentAsWarning(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.IGNORE)){
+ compilerOptions.handleUnusedArgumentAsWarning(false);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_PB_SYNTHETIC_ACCESS_EMULATION)){
+
+ if (optionValue.equals(JavaCore.WARNING)){
+ compilerOptions.handleAccessEmulationAsWarning(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.IGNORE)){
+ compilerOptions.handleAccessEmulationAsWarning(false);
+ continue;
+ }
+ continue;
+ }
+ if (optionName.equals(JavaCore.COMPILER_PB_NON_EXTERNALIZED_STRING_LITERAL)){
+
+ if (optionValue.equals(JavaCore.WARNING)){
+ compilerOptions.handleNonExternalizedStringLiteralAsWarning(true);
+ continue;
+ }
+ if (optionValue.equals(JavaCore.IGNORE)){
+ compilerOptions.handleNonExternalizedStringLiteralAsWarning(false);
+ continue;
+ }
+ continue;
+ }
+ }
+ return compilerOptions.getConfigurableOptions(Locale.getDefault());
+}
/**
* Note that the project is now deleted.
*
@@ -287,7 +483,7 @@ public void doneSaving(ISaveContext context){
return null;
}
JavaModel model= (JavaModel) getJavaModel(workspace);
- if (memento.equals("")){ // workspace memento //$NON-NLS-1$
+ if (memento.equals(""/*nonNLS*/)){ // workspace memento
return model;
}
int modelEnd= memento.indexOf(JavaElement.JEM_JAVAPROJECT);
@@ -388,7 +584,7 @@ public void doneSaving(ISaveContext context){
try {
modelInfo.fJavaModel.close();
} catch (JavaModelException e) {
- Assert.isTrue(false, Util.bind("element.onlyOneJavaModel")); //$NON-NLS-1$
+ Assert.isTrue(false, Util.bind("element.onlyOneJavaModel"/*nonNLS*/));
return null;
}
}
@@ -396,7 +592,7 @@ public void doneSaving(ISaveContext context){
if (modelInfo == null || modelInfo.workspace.equals(workspace)) {
return new JavaModel(workspace);
} else {
- Assert.isTrue(false, Util.bind("element.onlyOneJavaModel")); //$NON-NLS-1$
+ Assert.isTrue(false, Util.bind("element.onlyOneJavaModel"/*nonNLS*/));
return null;
}
@@ -422,7 +618,7 @@ public void doneSaving(ISaveContext context){
if (state == null && JavaBuilder.SAVE_ENABLED && !info.triedRead) {
info.triedRead= true;
try {
- if (monitor != null) monitor.subTask(Util.bind("build.readStateProgress", project.getName())); //$NON-NLS-1$
+ if (monitor != null) monitor.subTask(Util.bind("build.readStateProgress"/*nonNLS*/, project.getName()));
state= readState(info);
info.setLastBuiltState(state);
} catch (CoreException e) {
@@ -467,12 +663,12 @@ public void doneSaving(ISaveContext context){
if (!project.exists()) return null;
IPluginDescriptor descr= JavaCore.getJavaCore().getDescriptor();
IPath workingLocation= project.getPluginWorkingLocation(descr);
- return workingLocation.append("state.dat").toFile(); //$NON-NLS-1$
+ return workingLocation.append("state.dat"/*nonNLS*/).toFile();
}
public String getVariablesAsXMLString() throws CoreException {
Document document = new DocumentImpl();
- Element rootElement = document.createElement("variables"); //$NON-NLS-1$
+ Element rootElement = document.createElement("variables"/*nonNLS*/);
document.appendChild(rootElement);
String[] variables = JavaCore.getClasspathVariableNames();
@@ -480,9 +676,9 @@ public void doneSaving(ISaveContext context){
for (int i= 0; i < variables.length; ++i) {
String var = variables[i];
IPath varPath = JavaCore.getClasspathVariable(var);
- Element varElement= document.createElement("variable"); //$NON-NLS-1$
- varElement.setAttribute("name", var); //$NON-NLS-1$
- varElement.setAttribute("path", varPath.toString()); //$NON-NLS-1$
+ Element varElement= document.createElement("variable"/*nonNLS*/);
+ varElement.setAttribute("name"/*nonNLS*/, var);
+ varElement.setAttribute("path"/*nonNLS*/, varPath.toString());
rootElement.appendChild(varElement);
}
@@ -499,42 +695,6 @@ public void doneSaving(ISaveContext context){
return writer.toString();
}
-
- public String getOptionsAsXMLString() throws CoreException {
-
- Document document = new DocumentImpl();
- Element rootElement = document.createElement("options"); //$NON-NLS-1$
- document.appendChild(rootElement);
-
- String[] ids = JavaCore.getOptionIDs();
-
- for (int i= 0; i < ids.length; ++i) {
- ConfigurableOption option = (ConfigurableOption)fOptions.get(ids[i]);
-
- Element optionElement= document.createElement("option"); //$NON-NLS-1$
- optionElement.setAttribute("id", ids[i]); //$NON-NLS-1$
- if(option.getPossibleValues() == ConfigurableOption.NoDiscreteValue){
- optionElement.setAttribute("value", option.getValue()); //$NON-NLS-1$
- }
- else{
- optionElement.setAttribute("index", String.valueOf(option.getValueIndex())); //$NON-NLS-1$
- }
- rootElement.appendChild(optionElement);
- }
-
- // produce a String output
- StringWriter writer = new StringWriter();
- try {
- OutputFormat format = new OutputFormat();
- format.setIndenting(true);
- Serializer serializer = SerializerFactory.getSerializerFactory(Method.XML).makeSerializer(writer, format);
- serializer.asDOMSerializer().serialize(document);
- } catch (IOException e) {
- throw new JavaModelException(e, IJavaModelStatusConstants.IO_EXCEPTION);
- }
- return writer.toString();
-
- }
/**
* Returns the open ZipFile at the given location. If the ZipFile
* does not yet exist, it is created, opened, and added to the cache
@@ -560,7 +720,7 @@ public void doneSaving(ISaveContext context){
} else if (!path.isAbsolute()) {
file= root.getFile(path);
if (file == null || file.getType() != IResource.FILE) {
- throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("file.notFound"), null)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("file.notFound"/*nonNLS*/), null));
}
ensureLocal(file);
fileSystemPath= file.getLocation().toOSString();
@@ -571,7 +731,7 @@ public void doneSaving(ISaveContext context){
try {
return new ZipFile(fileSystemPath);
} catch (IOException e) {
- throw new CoreException(new Status(Status.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("status.IOException"), e)); //$NON-NLS-1$
+ throw new CoreException(new Status(Status.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("status.IOException"/*nonNLS*/), e));
}
}
/**
@@ -591,23 +751,13 @@ public void doneSaving(ISaveContext context){
public void loadVariables() throws CoreException {
String xmlString = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(
- new QualifiedName(JavaCore.PLUGIN_ID, "variables")); //$NON-NLS-1$
+ new QualifiedName(JavaCore.PLUGIN_ID, "variables"/*nonNLS*/));
try {
if (xmlString != null) readVariables(xmlString);
} catch(IOException e){
return;
}
}
-
- public void loadOptions() throws CoreException {
- String xmlString = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(
- new QualifiedName(JavaCore.PLUGIN_ID, "options")); //$NON-NLS-1$
- try {
- if (xmlString != null) readOptions(xmlString);
- } catch(IOException e){
- return;
- }
- }
/**
* Merged all awaiting deltas.
*/
@@ -696,13 +846,13 @@ public void prepareToSave(ISaveContext context) throws CoreException {
try {
String pluginID= in.readUTF();
if (!pluginID.equals(JavaCore.PLUGIN_ID))
- throw new IOException(Util.bind("build.wrongFileFormat")); //$NON-NLS-1$
+ throw new IOException(Util.bind("build.wrongFileFormat"/*nonNLS*/));
String kind= in.readUTF();
- if (!kind.equals("STATE")) //$NON-NLS-1$
- throw new IOException(Util.bind("build.wrongFileFormat")); //$NON-NLS-1$
+ if (!kind.equals("STATE"/*nonNLS*/))
+ throw new IOException(Util.bind("build.wrongFileFormat"/*nonNLS*/));
int version= in.readInt();
if (version != 0x0001)
- throw new IOException(Util.bind("build.unhandledVersionFormat")); //$NON-NLS-1$
+ throw new IOException(Util.bind("build.unhandledVersionFormat"/*nonNLS*/));
boolean hasState= in.readBoolean();
IState state= null;
if (hasState) {
@@ -726,15 +876,15 @@ public void prepareToSave(ISaveContext context) throws CoreException {
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
cpElement = parser.parse(new InputSource(reader)).getDocumentElement();
} catch(SAXException e) {
- return;
+ throw new IOException(Util.bind("variable.badFormat"/*nonNLS*/));
} catch(ParserConfigurationException e){
- return;
+ reader.close();
+ throw new IOException(Util.bind("variable.badFormat"/*nonNLS*/));
} finally {
reader.close();
}
- if (cpElement == null) return;
- if (!cpElement.getNodeName().equalsIgnoreCase("variables")) { //$NON-NLS-1$
- return;
+ if (!cpElement.getNodeName().equalsIgnoreCase("variables"/*nonNLS*/)) {
+ throw new IOException(Util.bind("variable.badFormat"/*nonNLS*/));
}
NodeList list= cpElement.getChildNodes();
Vector variables = new Vector();
@@ -744,9 +894,9 @@ public void prepareToSave(ISaveContext context) throws CoreException {
short type= node.getNodeType();
if (type == Node.ELEMENT_NODE) {
Element element= (Element) node;
- if (element.getNodeName().equalsIgnoreCase("variable")) { //$NON-NLS-1$
- String varName = element.getAttribute("name"); //$NON-NLS-1$
- String varPath = element.getAttribute("path"); //$NON-NLS-1$
+ if (element.getNodeName().equalsIgnoreCase("variable"/*nonNLS*/)) {
+ String varName = element.getAttribute("name"/*nonNLS*/);
+ String varPath = element.getAttribute("path"/*nonNLS*/);
try {
JavaCore.setClasspathVariable(varName, new Path(varPath), null);
} catch(JavaModelException e){
@@ -756,57 +906,7 @@ public void prepareToSave(ISaveContext context) throws CoreException {
}
}
- }
-
- public void readOptions(String xmlString) throws IOException {
- if(fOptions == null)
- JavaCore.resetOptions();
-
- StringReader reader = new StringReader(xmlString);
- Element cpElement;
- try {
- DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- cpElement = parser.parse(new InputSource(reader)).getDocumentElement();
- } catch(SAXException e) {
- return;
- } catch(ParserConfigurationException e){
- return;
- } finally {
- reader.close();
- }
- if (cpElement == null) return;
- if (!cpElement.getNodeName().equalsIgnoreCase("options")) { //$NON-NLS-1$
- return;
- }
- NodeList list= cpElement.getChildNodes();
- int length= list.getLength();
- for (int i= 0; i < length; ++i) {
- Node node= list.item(i);
- short type= node.getNodeType();
- if (type == Node.ELEMENT_NODE) {
- Element element= (Element) node;
- if (element.getNodeName().equalsIgnoreCase("option")) { //$NON-NLS-1$
- String id = element.getAttribute("id"); //$NON-NLS-1$
- ConfigurableOption option = (ConfigurableOption) fOptions.get(id);
-
- String[] possible = option.getPossibleValues();
- if(possible == ConfigurableOption.NoDiscreteValue){
- String value = element.getAttribute("value"); //$NON-NLS-1$
- option.setValue(value);
- }
- else {
- try {
- int valueIndex = Integer.parseInt(element.getAttribute("index")); //$NON-NLS-1$
- option.setValueIndex(valueIndex);
- } catch(NumberFormatException e){
- }
- }
-
- }
-
- }
- }
- }
+ }
/**
* Registers the given delta with this manager. This API is to be
* used to registerd deltas that are created explicitly by the Java
@@ -957,7 +1057,7 @@ public void rollback(ISaveContext context){
if (vStats != null) {
IStatus[] stats= new IStatus[vStats.size()];
vStats.copyInto(stats);
- throw new CoreException(new MultiStatus(JavaCore.PLUGIN_ID, IStatus.ERROR, stats, Util.bind("build.cannotSaveStates"), null)); //$NON-NLS-1$
+ throw new CoreException(new MultiStatus(JavaCore.PLUGIN_ID, IStatus.ERROR, stats, Util.bind("build.cannotSaveStates"/*nonNLS*/), null));
}
}
/**
@@ -965,7 +1065,7 @@ public void rollback(ISaveContext context){
*/
private void saveState(PerProjectInfo info) throws CoreException {
- if (VERBOSE) System.out.println(Util.bind("build.saveStateProgress", info.project.getName())); //$NON-NLS-1$
+ if (VERBOSE) System.out.println(Util.bind("build.saveStateProgress"/*nonNLS*/, info.project.getName()));
long t= System.currentTimeMillis();
File file= getSerializationFile(info.project);
if (file == null) return;
@@ -973,7 +1073,7 @@ public void rollback(ISaveContext context){
DataOutputStream out= new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
try {
out.writeUTF(JavaCore.PLUGIN_ID);
- out.writeUTF("STATE"); //$NON-NLS-1$
+ out.writeUTF("STATE"/*nonNLS*/);
out.writeInt(0x0001);
IState state= info.getLastBuiltState();
if (state == null) {
@@ -990,16 +1090,16 @@ public void rollback(ISaveContext context){
file.delete();
} catch(SecurityException se){
}
- throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("build.cannotSaveState", info.project.getName()), e)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("build.cannotSaveState"/*nonNLS*/, info.project.getName()), e));
} catch (IOException e) {
try {
file.delete();
} catch(SecurityException se){
}
- throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("build.cannotSaveState", info.project.getName()), e)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("build.cannotSaveState"/*nonNLS*/, info.project.getName()), e));
}
t= System.currentTimeMillis() - t;
- if (VERBOSE) System.out.println(Util.bind("build.saveStateComplete", String.valueOf(t))); //$NON-NLS-1$
+ if (VERBOSE) System.out.println(Util.bind("build.saveStateComplete"/*nonNLS*/, String.valueOf(t)));
}
/**
* Saves the built state for the project if it has been changed since last save.
@@ -1019,22 +1119,15 @@ public void rollback(ISaveContext context){
}
public void saveVariables() throws CoreException {
ResourcesPlugin.getWorkspace().getRoot().setPersistentProperty(
- new QualifiedName(JavaCore.PLUGIN_ID, "variables"), //$NON-NLS-1$
+ new QualifiedName(JavaCore.PLUGIN_ID, "variables"/*nonNLS*/),
getVariablesAsXMLString());
}
-
- public void saveOptions() throws CoreException {
- ResourcesPlugin.getWorkspace().getRoot().setPersistentProperty(
- new QualifiedName(JavaCore.PLUGIN_ID, "options"), //$NON-NLS-1$
- getOptionsAsXMLString());
- }
/**
* @see ISaveParticipant
*/
public void saving(ISaveContext context) throws CoreException {
this.saveVariables();
- this.saveOptions();
if (context.getKind() == ISaveContext.FULL_SAVE){
this.saveBuildState(); // build state
@@ -1047,9 +1140,8 @@ public void saving(ISaveContext context) throws CoreException {
protected void setBuildOrder(String[] javaBuildOrder) throws JavaModelException {
// optional behaviour
- // possible value of index 0 is Compute
- if (!JavaCore.getOptionPossibleValues(JavaCore.OPTION_ComputeBuildOrder)[0].equals(JavaCore.getOptionValue(JavaCore.OPTION_ComputeBuildOrder))) return;
-
+ if (!JavaCore.COMPUTE.equals(JavaCore.getOptions().get(JavaCore.CORE_JAVA_BUILD_ORDER))) return;
+
if (javaBuildOrder == null || javaBuildOrder.length <= 1) return;
IWorkspace workspace = ResourcesPlugin.getWorkspace();
@@ -1129,38 +1221,4 @@ public void saving(ISaveContext context) throws CoreException {
public void stopDeltas() {
fFire= false;
}
-
- /**
- * Answers a copy of the current set of options supported by the Java core.
- * These options allow to configure the behavior of the underlying components.
- *
- * Changes on the set of options are not committed until invoking <code>JavaCore.setOptionValue</code>
- */
- public static ConfigurableOption[] getOptions(){
- if(fOptions == null)
- JavaCore.resetOptions();
-
- return (ConfigurableOption[])fOptions.values().toArray(new ConfigurableOption[0]);
- }
-
- /**
- * Answers a set of option'IDs which are in option set of JavaCore
- */
- public static String[] getOptionIDs(){
- if(fOptionIDs == null)
- JavaCore.resetOptions();
-
- return (String [])fOptionIDs.toArray(new String[0]);
- }
-
- public static void initializeOptions(){
- fOptions = new Hashtable(10);
- fOptionIDs = new ArrayList(10);
- }
-
- public static void addOption(ConfigurableOption option){
- String id = option.getID();
- fOptions.put(id,option);
- fOptionIDs.add(id);
- }
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelOperation.java
index ea18ad69d2..822686bbcd 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelOperation.java
@@ -135,7 +135,7 @@ public void beginTask(String name, int totalWork) {
*/
protected void checkCanceled() {
if (isCanceled()) {
- throw new OperationCanceledException(Util.bind("operation.cancelled")); //$NON-NLS-1$
+ throw new OperationCanceledException(Util.bind("operation.cancelled"/*nonNLS*/));
}
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
index b63aa41778..c868e21682 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelStatus.java
@@ -52,13 +52,13 @@ public class JavaModelStatus extends Status implements IJavaModelStatus, IJavaMo
*/
public JavaModelStatus() {
// no code for an multi-status
- super(ERROR, JavaCore.PLUGIN_ID, 0, "JavaModelStatus", null); //$NON-NLS-1$
+ super(ERROR, JavaCore.PLUGIN_ID, 0, "JavaModelStatus"/*nonNLS*/, null);
}
/**
* Constructs an Java model status with no corresponding elements.
*/
public JavaModelStatus(int code) {
- super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", null); //$NON-NLS-1$
+ super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, null);
fElements= JavaElementInfo.fgEmptyChildren;
}
/**
@@ -66,7 +66,7 @@ public JavaModelStatus(int code) {
* elements.
*/
public JavaModelStatus(int code, IJavaElement[] elements) {
- super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", null); //$NON-NLS-1$
+ super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, null);
fElements= elements;
fPath= null;
}
@@ -74,7 +74,7 @@ public JavaModelStatus(int code, IJavaElement[] elements) {
* Constructs an Java model status with no corresponding elements.
*/
public JavaModelStatus(int code, String string) {
- super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", null); //$NON-NLS-1$
+ super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, null);
fElements= JavaElementInfo.fgEmptyChildren;
fPath= null;
fString = string;
@@ -83,14 +83,14 @@ public JavaModelStatus(int code, String string) {
* Constructs an Java model status with no corresponding elements.
*/
public JavaModelStatus(int code, Throwable throwable) {
- super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", throwable); //$NON-NLS-1$
+ super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, throwable);
fElements= JavaElementInfo.fgEmptyChildren;
}
/**
* Constructs an Java model status with no corresponding elements.
*/
public JavaModelStatus(int code, IPath path) {
- super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", null); //$NON-NLS-1$
+ super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, null);
fElements= JavaElementInfo.fgEmptyChildren;
fPath= path;
}
@@ -113,7 +113,7 @@ public JavaModelStatus(int code, IJavaElement element, String string) {
* Constructs an Java model status with no corresponding elements.
*/
public JavaModelStatus(CoreException coreException) {
- super(ERROR, JavaCore.PLUGIN_ID, CORE_EXCEPTION, "JavaModelStatus", coreException); //$NON-NLS-1$
+ super(ERROR, JavaCore.PLUGIN_ID, CORE_EXCEPTION, "JavaModelStatus"/*nonNLS*/, coreException);
fElements= JavaElementInfo.fgEmptyChildren;
}
protected int getBits() {
@@ -140,89 +140,89 @@ public String getMessage() {
if (getException() == null) {
switch (getCode()) {
case CORE_EXCEPTION :
- return Util.bind("status.coreException"); //$NON-NLS-1$
+ return Util.bind("status.coreException"/*nonNLS*/);
case BUILDER_INITIALIZATION_ERROR:
- return Util.bind("build.initializationError"); //$NON-NLS-1$
+ return Util.bind("build.initializationError"/*nonNLS*/);
case BUILDER_SERIALIZATION_ERROR:
- return Util.bind("build.serializationError"); //$NON-NLS-1$
+ return Util.bind("build.serializationError"/*nonNLS*/);
case DEVICE_PATH:
- return Util.bind("status.cannotUseDeviceOnPath", getPath().toString()); //$NON-NLS-1$
+ return Util.bind("status.cannotUseDeviceOnPath"/*nonNLS*/, getPath().toString());
case DOM_EXCEPTION:
- return Util.bind("status.JDOMError"); //$NON-NLS-1$
+ return Util.bind("status.JDOMError"/*nonNLS*/);
case ELEMENT_DOES_NOT_EXIST:
- return Util.bind("element.doesNotExist",fElements[0].getElementName()); //$NON-NLS-1$
+ return Util.bind("element.doesNotExist"/*nonNLS*/,fElements[0].getElementName());
case EVALUATION_ERROR:
- return Util.bind("status.evaluationError", getString()); //$NON-NLS-1$
+ return Util.bind("status.evaluationError"/*nonNLS*/, getString());
case INDEX_OUT_OF_BOUNDS:
- return Util.bind("status.indexOutOfBounds"); //$NON-NLS-1$
+ return Util.bind("status.indexOutOfBounds"/*nonNLS*/);
case INVALID_CONTENTS:
- return Util.bind("status.invalidContents"); //$NON-NLS-1$
+ return Util.bind("status.invalidContents"/*nonNLS*/);
case INVALID_DESTINATION:
- return Util.bind("status.invalidDestination", fElements[0].getElementName()); //$NON-NLS-1$
+ return Util.bind("status.invalidDestination"/*nonNLS*/, fElements[0].getElementName());
case INVALID_ELEMENT_TYPES:
- StringBuffer buff= new StringBuffer(Util.bind("operation.notSupported")); //$NON-NLS-1$
+ StringBuffer buff= new StringBuffer(Util.bind("operation.notSupported"/*nonNLS*/));
for (int i= 0; i < fElements.length; i++) {
if (i > 0) {
- buff.append(", "); //$NON-NLS-1$
+ buff.append(", "/*nonNLS*/);
}
buff.append(fElements[0].getElementName());
}
return buff.toString();
case INVALID_NAME:
- return Util.bind("status.invalidName", getString()); //$NON-NLS-1$
+ return Util.bind("status.invalidName"/*nonNLS*/, getString());
case INVALID_PACKAGE:
- return Util.bind("status.invalidPackage", getString()); //$NON-NLS-1$
+ return Util.bind("status.invalidPackage"/*nonNLS*/, getString());
case INVALID_PATH:
- return Util.bind("status.invalidPath", getPath() == null ? "null" : getPath().toString()); //$NON-NLS-1$ //$NON-NLS-2$
+ return Util.bind("status.invalidPath"/*nonNLS*/, getPath() == null ? "null"/*nonNLS*/ : getPath().toString());
case INVALID_PROJECT:
- return Util.bind("status.invalidProject", getString()); //$NON-NLS-1$
+ return Util.bind("status.invalidProject"/*nonNLS*/, getString());
case INVALID_RESOURCE:
- return Util.bind("status.invalidResource", getString()); //$NON-NLS-1$
+ return Util.bind("status.invalidResource"/*nonNLS*/, getString());
case INVALID_RESOURCE_TYPE:
- return Util.bind("status.invalidResourceType", getString()); //$NON-NLS-1$
+ return Util.bind("status.invalidResourceType"/*nonNLS*/, getString());
case INVALID_SIBLING:
- return Util.bind("status.invalidSibling", fElements[0].getElementName()); //$NON-NLS-1$
+ return Util.bind("status.invalidSibling"/*nonNLS*/, fElements[0].getElementName());
case IO_EXCEPTION:
- return Util.bind("status.IOException"); //$NON-NLS-1$
+ return Util.bind("status.IOException"/*nonNLS*/);
case NAME_COLLISION:
if (fElements != null && fElements.length > 0) {
IJavaElement element = fElements[0];
String name = element.getElementName();
if (element instanceof IPackageFragment && name.equals(IPackageFragment.DEFAULT_PACKAGE_NAME)) {
- return Util.bind("operation.cannotRenameDefaultPackage"); //$NON-NLS-1$
+ return Util.bind("operation.cannotRenameDefaultPackage"/*nonNLS*/);
}
}
- return Util.bind("status.nameCollision"); //$NON-NLS-1$
+ return Util.bind("status.nameCollision"/*nonNLS*/);
case NO_ELEMENTS_TO_PROCESS:
- return Util.bind("operation.needElements"); //$NON-NLS-1$
+ return Util.bind("operation.needElements"/*nonNLS*/);
case NULL_NAME:
- return Util.bind("operation.needName"); //$NON-NLS-1$
+ return Util.bind("operation.needName"/*nonNLS*/);
case NULL_PATH:
- return Util.bind("operation.needPath"); //$NON-NLS-1$
+ return Util.bind("operation.needPath"/*nonNLS*/);
case NULL_STRING:
- return Util.bind("operation.needString"); //$NON-NLS-1$
+ return Util.bind("operation.needString"/*nonNLS*/);
case PATH_OUTSIDE_PROJECT:
- return Util.bind("operation.pathOutsideProject", getString(), fElements[0].getElementName()); //$NON-NLS-1$
+ return Util.bind("operation.pathOutsideProject"/*nonNLS*/, getString(), fElements[0].getElementName());
case READ_ONLY:
IJavaElement element = fElements[0];
String name = element.getElementName();
if (element instanceof IPackageFragment && name.equals(IPackageFragment.DEFAULT_PACKAGE_NAME)) {
- return Util.bind("status.defaultPackageReadOnly"); //$NON-NLS-1$
+ return Util.bind("status.defaultPackageReadOnly"/*nonNLS*/);
}
- return Util.bind("status.readOnly", name); //$NON-NLS-1$
+ return Util.bind("status.readOnly"/*nonNLS*/, name);
case RELATIVE_PATH:
- return Util.bind("operation.needAbsolutePath", getPath().toString()); //$NON-NLS-1$
+ return Util.bind("operation.needAbsolutePath"/*nonNLS*/, getPath().toString());
case TARGET_EXCEPTION:
- return Util.bind("status.targetException"); //$NON-NLS-1$
+ return Util.bind("status.targetException"/*nonNLS*/);
case UPDATE_CONFLICT:
- return Util.bind("status.updateConflict"); //$NON-NLS-1$
+ return Util.bind("status.updateConflict"/*nonNLS*/);
case NO_LOCAL_CONTENTS :
- return Util.bind("status.noLocalContents", getPath().toString()); //$NON-NLS-1$
+ return Util.bind("status.noLocalContents"/*nonNLS*/, getPath().toString());
}
return getString();
} else {
if (getCode() == CORE_EXCEPTION){
- return Util.bind("status.coreExceptionWithArg", getException().getMessage()); //$NON-NLS-1$
+ return Util.bind("status.coreExceptionWithArg"/*nonNLS*/, getException().getMessage());
}
return getException().getMessage();
}
@@ -311,9 +311,9 @@ public static IJavaModelStatus newMultiStatus(IJavaModelStatus[] children) {
*/
public String toString() {
StringBuffer buffer = new StringBuffer();
- buffer.append("Java Model Status ["); //$NON-NLS-1$
+ buffer.append("Java Model Status ["/*nonNLS*/);
buffer.append(getMessage());
- buffer.append("]"); //$NON-NLS-1$
+ buffer.append("]"/*nonNLS*/);
return buffer.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
index c3b890234a..0dda92591e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaProject.java
@@ -202,7 +202,7 @@ public static IPath canonicalizedPath(IPath externalPath) {
* This is the project bin folder
*/
protected IPath defaultOutputLocation() throws JavaModelException {
- return getProject().getFullPath().append("bin"); //$NON-NLS-1$
+ return getProject().getFullPath().append("bin"/*nonNLS*/);
}
/**
* Returns true if this handle represents the same Java project
@@ -245,14 +245,14 @@ public static IPath canonicalizedPath(IPath externalPath) {
// default to the first one
return pkgFragments[0];
}
- } else if (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class")) { //$NON-NLS-1$ //$NON-NLS-2$
+ } else if (extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/)) {
IPath packagePath= path.removeLastSegments(1);
String packageName= packagePath.toString().replace(IPath.SEPARATOR, '.');
String typeName= path.lastSegment();
typeName= typeName.substring(0, typeName.length() - extension.length() - 1);
String qualifiedName= null;
if (packageName.length() > 0) {
- qualifiedName= packageName + "." + typeName; //$NON-NLS-1$
+ qualifiedName= packageName + "."/*nonNLS*/ + typeName;
} else {
qualifiedName= typeName;
}
@@ -437,11 +437,18 @@ public static IPath canonicalizedPath(IPath externalPath) {
return getPackageFragmentRoots();
}
/**
+ * @see IJavaProject
+ * @deprecated
+ */
+ public IClasspathEntry[] getClasspath() throws JavaModelException {
+ return getRawClasspath();
+ }
+ /**
* Returns the XML String encoding of the class path.
*/
protected String getClasspathAsXMLString(IClasspathEntry[] classpath, IPath outputLocation) throws JavaModelException {
Document doc= new DocumentImpl();
- Element cpElement= doc.createElement("classpath"); //$NON-NLS-1$
+ Element cpElement= doc.createElement("classpath"/*nonNLS*/);
doc.appendChild(cpElement);
for (int i= 0; i < classpath.length; ++i) {
@@ -452,9 +459,9 @@ public static IPath canonicalizedPath(IPath externalPath) {
if (outputLocation != null) {
outputLocation= outputLocation.removeFirstSegments(1);
outputLocation= outputLocation.makeRelative();
- Element oElement= doc.createElement("classpathentry"); //$NON-NLS-1$
- oElement.setAttribute("kind", kindToString(ClasspathEntry.K_OUTPUT)); //$NON-NLS-1$
- oElement.setAttribute("path", outputLocation.toOSString()); //$NON-NLS-1$
+ Element oElement= doc.createElement("classpathentry"/*nonNLS*/);
+ oElement.setAttribute("kind"/*nonNLS*/, kindToString(ClasspathEntry.K_OUTPUT));
+ oElement.setAttribute("path"/*nonNLS*/, outputLocation.toOSString());
cpElement.appendChild(oElement);
}
@@ -488,15 +495,15 @@ public static IPath canonicalizedPath(IPath externalPath) {
* of this project
*/
public QualifiedName getClasspathPropertyName() {
- return new QualifiedName(JavaCore.PLUGIN_ID, "classpath"); //$NON-NLS-1$
+ return new QualifiedName(JavaCore.PLUGIN_ID, "classpath"/*nonNLS*/);
}
/**
* Returns the XML String encoding of the class path.
*/
protected static Element getEntryAsXMLElement(Document document, IClasspathEntry entry, IPath prefixPath) throws JavaModelException {
- Element element= document.createElement("classpathentry"); //$NON-NLS-1$
- element.setAttribute("kind", kindToString(entry.getEntryKind())); //$NON-NLS-1$
+ Element element= document.createElement("classpathentry"/*nonNLS*/);
+ element.setAttribute("kind"/*nonNLS*/, kindToString(entry.getEntryKind()));
IPath path= entry.getPath();
if (entry.getEntryKind() != IClasspathEntry.CPE_VARIABLE){
// translate to project relative from absolute (unless a device path)
@@ -511,12 +518,12 @@ public static IPath canonicalizedPath(IPath externalPath) {
}
}
}
- element.setAttribute("path", path.toString()); //$NON-NLS-1$
+ element.setAttribute("path"/*nonNLS*/, path.toString());
if (entry.getSourceAttachmentPath() != null){
- element.setAttribute("sourcepath", entry.getSourceAttachmentPath().toString()); //$NON-NLS-1$
+ element.setAttribute("sourcepath"/*nonNLS*/, entry.getSourceAttachmentPath().toString());
}
if (entry.getSourceAttachmentRootPath() != null){
- element.setAttribute("rootpath", entry.getSourceAttachmentRootPath().toString()); //$NON-NLS-1$
+ element.setAttribute("rootpath"/*nonNLS*/, entry.getSourceAttachmentRootPath().toString());
}
return element;
}
@@ -590,7 +597,7 @@ public static IPath canonicalizedPath(IPath externalPath) {
*/
public IPackageFragmentRoot getPackageFragmentRoot(IResource resource) {
String name= resource.getName();
- if (Util.endsWithIgnoreCase(name,".jar") || Util.endsWithIgnoreCase(name,".zip")) { //$NON-NLS-2$ //$NON-NLS-1$
+ if (Util.endsWithIgnoreCase(name,".jar"/*nonNLS*/) || Util.endsWithIgnoreCase(name,".zip"/*nonNLS*/)) {
return new JarPackageFragmentRoot(resource, this);
} else {
return new PackageFragmentRoot(resource, this);
@@ -676,7 +683,7 @@ public static IPath canonicalizedPath(IPath externalPath) {
if (entry.getContentKind() == IPackageFragmentRoot.K_BINARY) {
String ext= path.getFileExtension();
IPackageFragmentRoot root= null;
- if (ext != null && (ext.equalsIgnoreCase("zip") || ext.equalsIgnoreCase("jar"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (ext != null && (ext.equalsIgnoreCase("zip"/*nonNLS*/) || ext.equalsIgnoreCase("jar"/*nonNLS*/))) {
// jar
// removeFirstSegment removes the part relative to the project which is retrieve
// through workspace.getDefaultContentLocation
@@ -931,15 +938,15 @@ public String[] getRequiredProjectNames() throws JavaModelException {
* Returns the kind of a <code>PackageFragmentRoot</code> from its <code>String</code> form.
*/
static int kindFromString(String kindStr) {
- if (kindStr.equalsIgnoreCase("prj")) //$NON-NLS-1$
+ if (kindStr.equalsIgnoreCase("prj"/*nonNLS*/))
return IClasspathEntry.CPE_PROJECT;
- if (kindStr.equalsIgnoreCase("var")) //$NON-NLS-1$
+ if (kindStr.equalsIgnoreCase("var"/*nonNLS*/))
return IClasspathEntry.CPE_VARIABLE;
- if (kindStr.equalsIgnoreCase("src")) //$NON-NLS-1$
+ if (kindStr.equalsIgnoreCase("src"/*nonNLS*/))
return IClasspathEntry.CPE_SOURCE;
- if (kindStr.equalsIgnoreCase("lib")) //$NON-NLS-1$
+ if (kindStr.equalsIgnoreCase("lib"/*nonNLS*/))
return IClasspathEntry.CPE_LIBRARY;
- if (kindStr.equalsIgnoreCase("output")) //$NON-NLS-1$
+ if (kindStr.equalsIgnoreCase("output"/*nonNLS*/))
return ClasspathEntry.K_OUTPUT;
return -1;
}
@@ -951,17 +958,17 @@ public String[] getRequiredProjectNames() throws JavaModelException {
static String kindToString(int kind) {
switch (kind) {
case IClasspathEntry.CPE_PROJECT :
- return "src"; // backward compatibility //$NON-NLS-1$
+ return "src"/*nonNLS*/; // backward compatibility
case IClasspathEntry.CPE_SOURCE :
- return "src"; //$NON-NLS-1$
+ return "src"/*nonNLS*/;
case IClasspathEntry.CPE_LIBRARY :
- return "lib"; //$NON-NLS-1$
+ return "lib"/*nonNLS*/;
case IClasspathEntry.CPE_VARIABLE :
- return "var"; //$NON-NLS-1$
+ return "var"/*nonNLS*/;
case ClasspathEntry.K_OUTPUT :
- return "output"; //$NON-NLS-1$
+ return "output"/*nonNLS*/;
default :
- return "unknown"; //$NON-NLS-1$
+ return "unknown"/*nonNLS*/;
}
}
/**
@@ -983,10 +990,31 @@ public String[] getRequiredProjectNames() throws JavaModelException {
}
/**
* @see IJavaProject
+ * @deprecated
+ */
+ public IClasspathEntry newLibraryEntry(IPath path) {
+ return JavaCore.newLibraryEntry(path, null, null);
+ }
+ /**
+ * @see IJavaProject
+ * @deprecated
+ */
+ public IClasspathEntry newProjectEntry(IPath path) {
+ return JavaCore.newProjectEntry(path);
+ }
+ /**
+ * @see IJavaProject
+ * @deprecated
+ */
+ public IClasspathEntry newSourceEntry(IPath path) {
+ return JavaCore.newSourceEntry(path);
+ }
+ /**
+ * @see IJavaProject
*/
public ITypeHierarchy newTypeHierarchy(IRegion region, IProgressMonitor monitor) throws JavaModelException {
if (region == null) {
- throw new IllegalArgumentException(Util.bind("hierarchy.nullRegion")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("hierarchy.nullRegion"/*nonNLS*/));
}
CreateTypeHierarchyOperation op= new CreateTypeHierarchyOperation(null, region, this, true);
runOperation(op, monitor);
@@ -997,10 +1025,10 @@ public String[] getRequiredProjectNames() throws JavaModelException {
*/
public ITypeHierarchy newTypeHierarchy(IType type, IRegion region, IProgressMonitor monitor) throws JavaModelException {
if (type == null) {
- throw new IllegalArgumentException(Util.bind("hierarchy.nullFocusType")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("hierarchy.nullFocusType"/*nonNLS*/));
}
if (region == null) {
- throw new IllegalArgumentException(Util.bind("hierarchy.nullRegion")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("hierarchy.nullRegion"/*nonNLS*/));
}
CreateTypeHierarchyOperation op= new CreateTypeHierarchyOperation(type, region, this, true);
runOperation(op, monitor);
@@ -1067,15 +1095,15 @@ public String[] getRequiredProjectNames() throws JavaModelException {
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
cpElement = parser.parse(new InputSource(reader)).getDocumentElement();
} catch(SAXException e) {
- throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$
+ throw new IOException(Util.bind("file.badFormat"/*nonNLS*/));
} catch(ParserConfigurationException e){
reader.close();
- throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$
+ throw new IOException(Util.bind("file.badFormat"/*nonNLS*/));
} finally {
reader.close();
}
- if (!cpElement.getNodeName().equalsIgnoreCase("classpath")) { //$NON-NLS-1$
- throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$
+ if (!cpElement.getNodeName().equalsIgnoreCase("classpath"/*nonNLS*/)) {
+ throw new IOException(Util.bind("file.badFormat"/*nonNLS*/));
}
NodeList list= cpElement.getChildNodes();
Vector paths= new Vector();
@@ -1085,9 +1113,9 @@ public String[] getRequiredProjectNames() throws JavaModelException {
short type= node.getNodeType();
if (type == Node.ELEMENT_NODE) {
Element cpeElement= (Element) node;
- if (cpeElement.getNodeName().equalsIgnoreCase("classpathentry")) { //$NON-NLS-1$
- String cpeElementKind = cpeElement.getAttribute("kind"); //$NON-NLS-1$
- String pathStr = cpeElement.getAttribute("path"); //$NON-NLS-1$
+ if (cpeElement.getNodeName().equalsIgnoreCase("classpathentry"/*nonNLS*/)) {
+ String cpeElementKind = cpeElement.getAttribute("kind"/*nonNLS*/);
+ String pathStr = cpeElement.getAttribute("path"/*nonNLS*/);
// ensure path is absolute
IPath path= new Path(pathStr);
int kind= kindFromString(cpeElementKind);
@@ -1095,10 +1123,10 @@ public String[] getRequiredProjectNames() throws JavaModelException {
path= projectPath.append(path);
}
// source attachment info (optional)
- String sourceAttachmentPathStr = cpeElement.getAttribute("sourcepath"); //$NON-NLS-1$
- IPath sourceAttachmentPath = sourceAttachmentPathStr.equals("") ? null : new Path(sourceAttachmentPathStr); //$NON-NLS-1$
- String sourceAttachmentRootPathStr = cpeElement.getAttribute("rootpath"); //$NON-NLS-1$
- IPath sourceAttachmentRootPath = sourceAttachmentRootPathStr.equals("") ? null : new Path(sourceAttachmentRootPathStr); //$NON-NLS-1$
+ String sourceAttachmentPathStr = cpeElement.getAttribute("sourcepath"/*nonNLS*/);
+ IPath sourceAttachmentPath = sourceAttachmentPathStr.equals(""/*nonNLS*/) ? null : new Path(sourceAttachmentPathStr);
+ String sourceAttachmentRootPathStr = cpeElement.getAttribute("rootpath"/*nonNLS*/);
+ IPath sourceAttachmentRootPath = sourceAttachmentRootPathStr.equals(""/*nonNLS*/) ? null : new Path(sourceAttachmentRootPathStr);
IClasspathEntry entry= createClasspathEntry(path, kind, sourceAttachmentPath, sourceAttachmentRootPath);
if (entry == null) return null;
@@ -1223,6 +1251,13 @@ protected void resetNonJavaResourcesForPackageFragmentRoots() throws JavaModelEx
}
}
/**
+ * @see IJavaProject
+ * @deprecated
+ */
+ public void setClasspath(IClasspathEntry[] entries, IProgressMonitor monitor) throws JavaModelException {
+ setRawClasspath(entries, monitor, true);
+ }
+ /**
* Update the Java command in the build spec (replace existing one if present,
* add one first if none).
*/
@@ -1257,7 +1292,7 @@ protected void resetNonJavaResourcesForPackageFragmentRoots() throws JavaModelEx
*/
public void setOutputLocation(IPath outputLocation, IProgressMonitor monitor) throws JavaModelException {
if (outputLocation == null) {
- throw new IllegalArgumentException(Util.bind("path.nullpath")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("path.nullpath"/*nonNLS*/));
}
if (outputLocation.equals(getOutputLocation())) {
return;
@@ -1426,9 +1461,9 @@ protected void resetNonJavaResourcesForPackageFragmentRoots() throws JavaModelEx
private void createClasspathProblemMarker(IClasspathEntry entry, String message){
try {
IMarker marker = getProject().createMarker(IJavaModelMarker.BUILDPATH_PROBLEM_MARKER);
- marker.setAttributes(
- new String[]{ IMarker.MESSAGE, IMarker.SEVERITY, IMarker.LOCATION},
- new Object[]{message, new Integer(IMarker.SEVERITY_WARNING), Util.bind("classpath.buildPath")}); //$NON-NLS-1$
+ marker.setAttribute(IMarker.MESSAGE, message);
+ marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
+ marker.setAttribute(IMarker.LOCATION, Util.bind("classpath.buildPath"/*nonNLS*/));
} catch (CoreException e) {
}
}
@@ -1447,6 +1482,98 @@ protected void resetNonJavaResourcesForPackageFragmentRoots() throws JavaModelEx
}
/**
+ * Returns a message describing the problem related to this classpath entry if any, or null if entry is fine
+ * (i.e. if the given classpath entry denotes a valid element to be referenced onto a classpath).
+ */
+ private String getClasspathEntryErrorMessage(IClasspathEntry entry, boolean checkSourceAttachment){
+ IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+ IPath path = entry.getPath();
+
+ switch(entry.getEntryKind()){
+
+ // variable entry check
+ case IClasspathEntry.CPE_VARIABLE :
+ entry = JavaCore.getResolvedClasspathEntry(entry);
+ if (entry == null){
+ return Util.bind("classpath.unboundVariablePath"/*nonNLS*/, path.toString());
+ }
+ return getClasspathEntryErrorMessage(entry, checkSourceAttachment);
+
+
+ // library entry check
+ case IClasspathEntry.CPE_LIBRARY :
+ if (path != null && path.isAbsolute() && !path.isEmpty()) {
+ IPath sourceAttachment = entry.getSourceAttachmentPath();
+ Object target = JavaModel.getTarget(workspaceRoot, path, true);
+ if (target instanceof IResource){
+ IResource resolvedResource = (IResource) target;
+ switch(resolvedResource.getType()){
+ case IResource.FILE :
+ String extension = resolvedResource.getFileExtension();
+ if ("jar"/*nonNLS*/.equalsIgnoreCase(extension) || "zip"/*nonNLS*/.equalsIgnoreCase(extension)){ // internal binary archive
+ if (checkSourceAttachment
+ && sourceAttachment != null
+ && !sourceAttachment.isEmpty()
+ && JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){
+ return Util.bind("classpath.unboundSourceAttachment"/*nonNLS*/, sourceAttachment.toString());
+ }
+ }
+ break;
+ case IResource.FOLDER : // internal binary folder
+ if (checkSourceAttachment
+ && sourceAttachment != null
+ && !sourceAttachment.isEmpty()
+ && JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){
+ return Util.bind("classpath.unboundSourceAttachment"/*nonNLS*/, sourceAttachment.toString());
+ }
+ }
+ } else if (target instanceof File){
+ if (checkSourceAttachment
+ && sourceAttachment != null
+ && !sourceAttachment.isEmpty()
+ && JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){
+ return Util.bind("classpath.unboundSourceAttachment"/*nonNLS*/, sourceAttachment.toString());
+ }
+ } else {
+ return Util.bind("classpath.unboundLibrary"/*nonNLS*/, path.toString());
+ }
+ } else {
+ return Util.bind("classpath.illegalLibraryPath"/*nonNLS*/, path.toString());
+ }
+ break;
+
+ // project entry check
+ case IClasspathEntry.CPE_PROJECT :
+ if (path != null && path.isAbsolute() && !path.isEmpty()) {
+ IProject project = workspaceRoot.getProject(path.segment(0));
+ try {
+ if (!project.exists() || !project.hasNature(JavaCore.NATURE_ID)){
+ return Util.bind("classpath.unboundProject"/*nonNLS*/, path.segment(0).toString());
+ }
+ } catch (CoreException e){
+ return Util.bind("classpath.unboundProject"/*nonNLS*/, path.segment(0).toString());
+ }
+ } else {
+ return Util.bind("classpath.illegalProjectPath"/*nonNLS*/, path.segment(0).toString());
+ }
+ break;
+
+ // project source folder
+ case IClasspathEntry.CPE_SOURCE :
+ if (path != null && path.isAbsolute() && !path.isEmpty()) {
+ IPath projectPath= getProject().getFullPath();
+ if (!projectPath.isPrefixOf(path) || JavaModel.getTarget(workspaceRoot, path, true) == null){
+ return Util.bind("classpath.unboundSourceFolder"/*nonNLS*/, path.toString());
+ }
+ } else {
+ return Util.bind("classpath.illegalSourceFolderPath"/*nonNLS*/, path.toString());
+ }
+ break;
+ }
+ return null;
+ }
+
+ /**
* Internal variant which can create marker on project for invalid entries
*/
public IClasspathEntry[] getResolvedClasspath(boolean ignoreUnresolvedVariable, boolean generateMarkerOnError) throws JavaModelException {
@@ -1460,12 +1587,6 @@ protected void resetNonJavaResourcesForPackageFragmentRoots() throws JavaModelEx
IClasspathEntry entry = classpath[i];
- /* validation if needed */
- if (generateMarkerOnError){
- IJavaModelStatus status = JavaConventions.validateClasspathEntry(this, entry, false);
- if (!status.isOK()) createClasspathProblemMarker(entry, status.getMessage());
- }
-
/* resolve variables if any, unresolved ones are ignored */
if (entry.getEntryKind() == IClasspathEntry.CPE_VARIABLE){
@@ -1477,12 +1598,15 @@ protected void resetNonJavaResourcesForPackageFragmentRoots() throws JavaModelEx
IPath variablePath = entry.getPath(); // for error reporting
entry = JavaCore.getResolvedClasspathEntry(entry);
if (entry == null){
+ if (generateMarkerOnError) createClasspathProblemMarker(classpath[i], Util.bind("classpath.unboundVariablePath"/*nonNLS*/, variablePath.toString()));
if (!ignoreUnresolvedVariable){
throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.CP_VARIABLE_PATH_UNBOUND, variablePath.toString()));
}
}
}
if (entry != null){
+ String msg;
+ if (generateMarkerOnError && (msg = getClasspathEntryErrorMessage(entry, false)) != null) createClasspathProblemMarker(classpath[i], msg);
resolvedPath[index++] = entry;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MoveElementsOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MoveElementsOperation.java
index c405379d48..e9cbfbf3f1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MoveElementsOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MoveElementsOperation.java
@@ -28,7 +28,7 @@ public MoveElementsOperation(IJavaElement[] elementsToMove, IJavaElement[] destC
* for progress monitoring.
*/
protected String getMainTaskName() {
- return Util.bind("operation.moveElementProgress"); //$NON-NLS-1$
+ return Util.bind("operation.moveElementProgress"/*nonNLS*/);
}
/**
* @see CopyElementsOperation#isMove()
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.java
index cfbf9ae9ea..895def8ebd 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/MoveResourceElementsOperation.java
@@ -27,7 +27,7 @@ public MoveResourceElementsOperation(IJavaElement[] elementsToMove, IJavaElement
* @see MultiOperation
*/
protected String getMainTaskName() {
- return Util.bind("operation.moveResourceProgress"); //$NON-NLS-1$
+ return Util.bind("operation.moveResourceProgress"/*nonNLS*/);
}
/**
* @see CopyResourceElementsOperation#isMove()
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java
index 9b0c5b6359..8ebdbe1ca6 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NameLookup.java
@@ -152,7 +152,7 @@ public class NameLookup implements INameLookup {
if (index != -1) {
cuName= cuName.substring(0, index);
}
- cuName += ".java"; //$NON-NLS-1$
+ cuName += ".java"/*nonNLS*/;
IPackageFragment[] frags= (IPackageFragment[]) fPackageFragments.get(pkgName);
if (frags != null) {
@@ -173,7 +173,7 @@ public class NameLookup implements INameLookup {
*/
public IPackageFragment findPackageFragment(IPath path) {
if (!path.isAbsolute()) {
- throw new IllegalArgumentException(Util.bind("path.mustBeAbsolute")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("path.mustBeAbsolute"/*nonNLS*/));
}
IResource possibleFragment = workspace.getRoot().findMember(path);
if (possibleFragment == null) {
@@ -244,7 +244,7 @@ public IPackageFragment findPackageFragment(IPath path) {
*/
public IPackageFragmentRoot findPackageFragmentRoot(IPath path) {
if (!path.isAbsolute()) {
- throw new IllegalArgumentException(Util.bind("path.mustBeAbsolute")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("path.mustBeAbsolute"/*nonNLS*/));
}
for (int i= 0; i < fPackageFragmentRoots.length; i++) {
IPackageFragmentRoot classpathRoot= fPackageFragmentRoots[i];
@@ -532,7 +532,7 @@ public IPackageFragment findPackageFragment(IPath path) {
* the compilationUnits always will. So add it if we're looking for
* an exact match.
*/
- String unitName= partialMatch ? matchName.toLowerCase() : matchName + ".java"; //$NON-NLS-1$
+ String unitName= partialMatch ? matchName.toLowerCase() : matchName + ".java"/*nonNLS*/;
for (int i= 0; i < length; i++) {
if (requestor.isCanceled())
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NonVoidMethodRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NonVoidMethodRequestor.java
index ea97f45c28..e79947fcca 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NonVoidMethodRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/NonVoidMethodRequestor.java
@@ -25,7 +25,7 @@ public NonVoidMethodRequestor(ISearchRequestor requestor) {
}
public void acceptMethod(IMethod method) {
try {
- if (!Signature.getReturnType(method.getSignature()).equals("V")) { //$NON-NLS-1$
+ if (!Signature.getReturnType(method.getSignature()).equals("V"/*nonNLS*/)) {
super.acceptMethod(method);
}
} catch (JavaModelException npe) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Openable.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Openable.java
index a36fb8c1fd..cc6944b475 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Openable.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Openable.java
@@ -21,7 +21,6 @@ import org.eclipse.jdt.internal.core.*;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Locale;
-import java.util.Map;
/**
@@ -96,7 +95,7 @@ protected void closing(Object info) throws JavaModelException {
*/
protected void codeComplete(org.eclipse.jdt.internal.compiler.env.ICompilationUnit cu, org.eclipse.jdt.internal.compiler.env.ICompilationUnit unitToSkip, int position, ICodeCompletionRequestor requestor) throws JavaModelException {
if (requestor == null) {
- throw new IllegalArgumentException(Util.bind("codeAssist.nullRequestor")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("codeAssist.nullRequestor"/*nonNLS*/));
}
if (position < -1 || position > getBuffer().getLength()) {
throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INDEX_OUT_OF_BOUNDS));
@@ -104,7 +103,7 @@ protected void codeComplete(org.eclipse.jdt.internal.compiler.env.ICompilationUn
SearchableEnvironment environment = (SearchableEnvironment) ((JavaProject) getJavaProject()).getSearchableNameEnvironment();
environment.unitToSkip = unitToSkip;
- CompletionEngine engine = new CompletionEngine(environment, new CompletionRequestorWrapper(requestor), JavaModelManager.getOptions());
+ CompletionEngine engine = new CompletionEngine(environment, new CompletionRequestorWrapper(requestor), JavaModelManager.convertConfigurableOptions(JavaCore.getOptions()));
engine.complete(cu, position);
environment.unitToSkip = null;
}
@@ -135,7 +134,7 @@ protected void codeSelect(org.eclipse.jdt.internal.compiler.env.ICompilationUnit
ISearchableNameEnvironment environment = ((JavaProject)getJavaProject()).getSearchableNameEnvironment();
// fix for 1FVXGDK
- SelectionEngine engine = new SelectionEngine(environment, requestor, JavaModelManager.getOptions());
+ SelectionEngine engine = new SelectionEngine(environment, requestor, JavaModelManager.convertConfigurableOptions(JavaCore.getOptions()));
engine.select(cu, offset, offset + length - 1);
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/OverflowingLRUCache.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/OverflowingLRUCache.java
index 6f1cd7884f..2d49198720 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/OverflowingLRUCache.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/OverflowingLRUCache.java
@@ -212,7 +212,7 @@ public void printStats() {
forwardListLength++;
entry = entry._fNext;
}
- System.out.println("Forward length: " + forwardListLength); //$NON-NLS-1$
+ System.out.println("Forward length: "/*nonNLS*/ + forwardListLength);
int backwardListLength = 0;
entry = fEntryQueueTail;
@@ -220,7 +220,7 @@ public void printStats() {
backwardListLength++;
entry = entry._fPrevious;
}
- System.out.println("Backward length: " + backwardListLength); //$NON-NLS-1$
+ System.out.println("Backward length: "/*nonNLS*/ + backwardListLength);
Enumeration keys = fEntryTable.keys();
java.util.Vector v = new java.util.Vector();
@@ -232,7 +232,7 @@ public void printStats() {
fCount = 1;
}
public String toString() {
- return "Class: " + fClass + " has " + fCount + " entries."; //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$
+ return "Class: "/*nonNLS*/ + fClass + " has "/*nonNLS*/ + fCount + " entries."/*nonNLS*/;
}
}
java.util.Hashtable h = new java.util.Hashtable();
@@ -369,7 +369,7 @@ public void setLoadFactor(double newLoadFactor) throws IllegalArgumentException
if(newLoadFactor <= 1.0 && newLoadFactor > 0.0)
fLoadFactor = newLoadFactor;
else
- throw new IllegalArgumentException(Util.bind("cache.invalidLoadFactor")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("cache.invalidLoadFactor"/*nonNLS*/));
}
/**
* Sets the maximum amount of space that the cache can store
@@ -397,7 +397,7 @@ public void setLoadFactor(double newLoadFactor) throws IllegalArgumentException
*/
public String toString() {
return
- "OverflowingLRUCache " + ((fCurrentSpace + fOverflow) * 100.0 / fSpaceLimit) + "% full\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ "OverflowingLRUCache "/*nonNLS*/ + ((fCurrentSpace + fOverflow) * 100.0 / fSpaceLimit) + "% full\n"/*nonNLS*/ +
this.toStringContents();
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageDeclaration.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageDeclaration.java
index c046e5180f..c774187aab 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageDeclaration.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageDeclaration.java
@@ -33,10 +33,10 @@ protected char getHandleMementoDelimiter() {
* @private Debugging purposes
*/
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
- buffer.append("package "); //$NON-NLS-1$
+ buffer.append("package "/*nonNLS*/);
buffer.append(getElementName());
if (info == null) {
- buffer.append(" (not open)"); //$NON-NLS-1$
+ buffer.append(" (not open)"/*nonNLS*/);
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java
index 9cec2b6735..9ab3bb1c45 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragment.java
@@ -45,9 +45,9 @@ protected boolean computeChildren(OpenableElementInfo info, IResource resource)
int kind = getKind();
String extType;
if (kind == IPackageFragmentRoot.K_SOURCE) {
- extType = "java"; //$NON-NLS-1$
+ extType = "java"/*nonNLS*/;
} else {
- extType = "class"; //$NON-NLS-1$
+ extType = "class"/*nonNLS*/;
}
try {
IResource[] members = ((IContainer) resource).members();
@@ -89,7 +89,7 @@ public boolean containsJavaResources() throws JavaModelException {
*/
public void copy(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {
if (container == null) {
- throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));
}
IJavaElement[] elements= new IJavaElement[] {this};
IJavaElement[] containers= new IJavaElement[] {container};
@@ -229,7 +229,7 @@ public boolean hasSubpackages() throws JavaModelException {
IJavaElement[] packages= ((IPackageFragmentRoot)getParent()).getChildren();
String name = getElementName();
int nameLength = name.length();
- String packageName = isDefaultPackage() ? name : name+"."; //$NON-NLS-1$
+ String packageName = isDefaultPackage() ? name : name+"."/*nonNLS*/;
for (int i= 0; i < packages.length; i++) {
String otherName = packages[i].getElementName();
if (otherName.length() > nameLength && otherName.startsWith(packageName)) {
@@ -249,7 +249,7 @@ public boolean isDefaultPackage() {
*/
public void move(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {
if (container == null) {
- throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));
}
IJavaElement[] elements= new IJavaElement[] {this};
IJavaElement[] containers= new IJavaElement[] {container};
@@ -280,7 +280,7 @@ public void refreshChildren() {
*/
public void rename(String name, boolean force, IProgressMonitor monitor) throws JavaModelException {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));
}
IJavaElement[] elements= new IJavaElement[] {this};
IJavaElement[] dests= new IJavaElement[] {this.getParent()};
@@ -300,15 +300,15 @@ protected void toStringChildren(int tab, StringBuffer buffer, Object info) {
*/
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
if (getElementName().length() == 0) {
- buffer.append("[default]"); //$NON-NLS-1$
+ buffer.append("[default]"/*nonNLS*/);
} else {
buffer.append(getElementName());
}
if (info == null) {
- buffer.append(" (not open)"); //$NON-NLS-1$
+ buffer.append(" (not open)"/*nonNLS*/);
} else {
if (tab > 0) {
- buffer.append(" (...)"); //$NON-NLS-1$
+ buffer.append(" (...)"/*nonNLS*/);
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentInfo.java
index d34c2cc0f5..6dc504d686 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentInfo.java
@@ -43,7 +43,7 @@ private Object[] computeNonJavaResources(IResource resource) {
IResource child = members[i];
if (child.getType() != IResource.FOLDER) {
String extension = child.getProjectRelativePath().getFileExtension();
- if (!"java".equalsIgnoreCase(extension) && !"class".equalsIgnoreCase(extension)) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (!"java"/*nonNLS*/.equalsIgnoreCase(extension) && !"class"/*nonNLS*/.equalsIgnoreCase(extension)) {
if (nonJavaResources.length == nonJavaResourcesCounter) {
// resize
System.arraycopy(
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java
index 4fd6366a53..5de8071e79 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRoot.java
@@ -55,7 +55,7 @@ protected boolean computeChildren(OpenableElementInfo info) throws JavaModelExce
// is actually the package fragment root)
if (fResource.getType() == IResource.FOLDER || fResource.getType() == IResource.PROJECT) {
Vector vChildren = new Vector(5);
- computeFolderChildren((IContainer) fResource, "", vChildren); //$NON-NLS-1$
+ computeFolderChildren((IContainer) fResource, ""/*nonNLS*/, vChildren);
IJavaElement[] children = new IJavaElement[vChildren.size()];
vChildren.copyInto(children);
info.setChildren(children);
@@ -86,7 +86,7 @@ protected void computeFolderChildren(IContainer folder, String prefix, Vector vC
if (prefix.length() == 0) {
newPrefix = member.getName();
} else {
- newPrefix = prefix + "." + member.getName(); //$NON-NLS-1$
+ newPrefix = prefix + "."/*nonNLS*/ + member.getName();
}
// eliminate binary output only if nested inside direct subfolders
if (!member.getFullPath().equals(outputLocationPath)) {
@@ -296,12 +296,12 @@ public void refreshChildren() {
*/
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
if (getElementName().length() == 0) {
- buffer.append("[project root]"); //$NON-NLS-1$
+ buffer.append("[project root]"/*nonNLS*/);
} else {
buffer.append(getElementName());
}
if (info == null) {
- buffer.append(" (not open)"); //$NON-NLS-1$
+ buffer.append(" (not open)"/*nonNLS*/);
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.java
index 083ce1d6e8..ff1c197991 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/PackageFragmentRootInfo.java
@@ -52,7 +52,7 @@ private Object[] computeFolderNonJavaResources(IJavaProject project, IContainer
IResource member = members[i];
if (member.getType() == IResource.FILE) {
String extension = member.getProjectRelativePath().getFileExtension();
- if (!"java".equalsIgnoreCase(extension) && !"class".equalsIgnoreCase(extension)) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (!"java"/*nonNLS*/.equalsIgnoreCase(extension) && !"class"/*nonNLS*/.equalsIgnoreCase(extension)) {
if (project.findPackageFragmentRoot(member.getFullPath()) == null) {
if (nonJavaResources.length == nonJavaResourcesCounter) {
// resize
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Problem.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Problem.java
index e7fed9615d..cbcafc5f4f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Problem.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Problem.java
@@ -137,13 +137,13 @@ public void setSourceStart(int sourceStart) {
public String toString() {
- String s = "Pb(" + (id & IgnoreCategoriesMask) + ") "; //$NON-NLS-1$ //$NON-NLS-2$
+ String s = "Pb("/*nonNLS*/ + (id & IgnoreCategoriesMask) + ") "/*nonNLS*/;
if (message != null) {
s += message;
} else {
if (arguments != null)
for (int i = 0; i < arguments.length; i++)
- s += " " + arguments[i]; //$NON-NLS-1$
+ s += " "/*nonNLS*/ + arguments[i];
}
return s;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Region.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Region.java
index 848fd31990..15b66de75b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Region.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Region.java
@@ -137,7 +137,7 @@ public String toString() {
for (int i= 0; i < roots.length; i++) {
buffer.append(roots[i].getElementName());
if (i < (roots.length - 1)) {
- buffer.append(", "); //$NON-NLS-1$
+ buffer.append(", "/*nonNLS*/);
}
}
buffer.append(']');
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/RenameElementsOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/RenameElementsOperation.java
index b2f6e7d91e..50a35bf09e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/RenameElementsOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/RenameElementsOperation.java
@@ -38,7 +38,7 @@ public RenameElementsOperation(IJavaElement[] elements, IJavaElement[] destinati
* @see MultiOperation
*/
protected String getMainTaskName() {
- return Util.bind("operation.renameElementProgress"); //$NON-NLS-1$
+ return Util.bind("operation.renameElementProgress"/*nonNLS*/);
}
/**
* @see CopyElementsOperation#isRename()
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.java
index d1dea29ed4..f26666bfec 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/RenameResourceElementsOperation.java
@@ -34,7 +34,7 @@ public RenameResourceElementsOperation(IJavaElement[] elements, IJavaElement[] d
* @see MultiOperation
*/
protected String getMainTaskName() {
- return Util.bind("operation.renameResourceProgress"); //$NON-NLS-1$
+ return Util.bind("operation.renameResourceProgress"/*nonNLS*/);
}
/**
* @see CopyResourceElementsOperation#isRename()
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
index d69cbf5e26..745ff1af97 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SearchableEnvironment.java
@@ -6,373 +6,282 @@ package org.eclipse.jdt.internal.core;
*/
import org.eclipse.core.runtime.*;
import org.eclipse.core.resources.*;
-import org.eclipse.jdt.core.*;
import org.eclipse.jdt.core.search.*;
-import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.eclipse.jdt.internal.compiler.env.*;
import org.eclipse.jdt.internal.compiler.util.*;
import org.eclipse.jdt.internal.codeassist.*;
-import org.eclipse.jdt.internal.core.SourceTypeElementInfo;;
+import org.eclipse.jdt.core.*;
+import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
/**
* This class provides a <code>SearchableBuilderEnvironment</code> for code assist which
* uses the Java model as a search tool.
*/
-public class SearchableEnvironment
- implements ISearchableNameEnvironment, IJavaSearchConstants {
+
+public class SearchableEnvironment implements ISearchableNameEnvironment, IJavaSearchConstants {
protected NameLookup nameLookup;
protected ICompilationUnit unitToSkip;
public CompilationUnit unitToLookInside;
protected IJavaProject project;
-
- /**
- * Creates a SearchableEnvironment on the given project
- */
- public SearchableEnvironment(IJavaProject project) throws JavaModelException {
- this.project = project;
- this.nameLookup = (NameLookup) ((JavaProject) project).getNameLookup();
- }
-
- /**
- * Returns the given type in the the given package if it exists,
- * otherwise <code>null</code>.
- */
- protected NameEnvironmentAnswer find(String typeName, String packageName) {
- if (packageName == null)
- packageName = IPackageFragment.DEFAULT_PACKAGE_NAME;
- IType type =
- this.nameLookup.findType(
- typeName,
- packageName,
- false,
- INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);
- if (type == null) {
- // look inside the compilation unit that is being searched currently
- //for a non-public or inner type.
- if (this.unitToLookInside != null) {
- if (this.unitToLookInside.getParent().getElementName().equals(packageName)) {
- try {
- IType[] allTypes = this.unitToLookInside.getTypes();
- for (int i = 0; i < allTypes.length; i++) {
- if (allTypes[i].getElementName().equals(typeName)) {
- type = allTypes[i];
- break;
- }
+/**
+ * Creates a SearchableEnvironment on the given project
+ */
+public SearchableEnvironment(IJavaProject project) throws JavaModelException {
+ this.project = project;
+ this.nameLookup = (NameLookup)((JavaProject)project).getNameLookup();
+}
+/**
+ * Returns the given type in the the given package if it exists,
+ * otherwise <code>null</code>.
+ */
+protected NameEnvironmentAnswer find(String typeName, String packageName) {
+ if (packageName == null)
+ packageName = IPackageFragment.DEFAULT_PACKAGE_NAME;
+ IType type = this.nameLookup.findType(typeName, packageName, false, INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);
+ if (type == null) {
+ // look inside the compilation unit that is being searched currently
+ //for a non-public or inner type.
+ if (this.unitToLookInside != null) {
+ if (this.unitToLookInside.getParent().getElementName().equals(packageName)) {
+ try {
+ IType[] allTypes = this.unitToLookInside.getTypes();
+ for (int i= 0; i < allTypes.length; i++) {
+ if (allTypes[i].getElementName().equals(typeName)) {
+ type = allTypes[i];
+ break;
}
- } catch (JavaModelException e) {
}
+ } catch (JavaModelException e) {
}
}
}
- if (type != null) {
- if (type instanceof BinaryType) {
- try {
- return new NameEnvironmentAnswer(
- (IBinaryType) ((BinaryType) type).getRawInfo());
- } catch (JavaModelException npe) {
- return null;
- }
- } else { //SourceType
- try {
- // retrieve the requested type
- SourceTypeElementInfo sourceType = (SourceTypeElementInfo)((SourceType)type).getRawInfo();
- ISourceType topLevelType = sourceType;
- while (topLevelType.getEnclosingType() != null) {
- topLevelType = topLevelType.getEnclosingType();
- }
- // find all siblings (other types declared in same unit, since may be used for name resolution)
- IType[] types = sourceType.getHandle().getCompilationUnit().getTypes();
- ISourceType[] sourceTypes = new ISourceType[types.length];
-
- // in the resulting collection, ensure the requested type is the first one
- sourceTypes[0] = sourceType;
- for (int i = 0, index = 1; i < types.length; i++) {
- ISourceType otherType =
- (ISourceType) ((JavaElement) types[i]).getRawInfo();
- if (!otherType.equals(topLevelType))
- sourceTypes[index++] = otherType;
- }
- return new NameEnvironmentAnswer(sourceTypes);
- } catch (JavaModelException npe) {
- return null;
- }
+ }
+ if (type != null) {
+ if (type instanceof BinaryType) {
+ try {
+ return new NameEnvironmentAnswer((IBinaryType) ((BinaryType) type).getRawInfo());
+ } catch (JavaModelException npe) {
+ return null;
+ }
+ } else { //SourceType
+ try {
+ return new NameEnvironmentAnswer((ISourceType)((SourceType)type).getRawInfo());
+ } catch (JavaModelException npe) {
+ return null;
}
}
- return null;
}
-
- /**
- * @see SearchableBuilderEnvironment
- */
- public void findPackages(char[] prefix, ISearchRequestor requestor) {
- this.nameLookup.seekPackageFragments(
- new String(prefix),
- true,
- new SearchableEnvironmentRequestor(requestor));
+ return null;
+}
+/**
+ * @see SearchableBuilderEnvironment
+ */
+public void findPackages(char[] prefix, ISearchRequestor requestor) {
+ this.nameLookup.seekPackageFragments(new String(prefix), true, new SearchableEnvironmentRequestor(requestor));
+}
+/**
+ * @see INameEnvironment
+ */
+public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
+ if (compoundTypeName == null)
+ return null;
+ int length = compoundTypeName.length;
+ if (length == 1)
+ return find(new String(compoundTypeName[0]), null);
+ StringBuffer buffer = new StringBuffer(length * 6);
+ int lengthM1 = length - 1;
+ for(int i = 0; i < lengthM1; i++) {
+ buffer.append(compoundTypeName[i]);
+ if (i + 1 != lengthM1)
+ buffer.append('.');
}
+ String className = new String(compoundTypeName[lengthM1]);
+ return find(className, buffer.toString());
+}
+/**
+ * @see INameEnvironment
+ */
+public NameEnvironmentAnswer findType(char[] name, char[][] packages) {
+ if (name == null)
+ return null;
- /**
- * @see INameEnvironment
- */
- public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
- if (compoundTypeName == null)
- return null;
- int length = compoundTypeName.length;
- if (length == 1)
- return find(new String(compoundTypeName[0]), null);
- StringBuffer buffer = new StringBuffer(length * 6);
- int lengthM1 = length - 1;
- for (int i = 0; i < lengthM1; i++) {
- buffer.append(compoundTypeName[i]);
- if (i + 1 != lengthM1)
- buffer.append('.');
- }
- String className = new String(compoundTypeName[lengthM1]);
- return find(className, buffer.toString());
+ if (packages == null || packages.length == 0)
+ return find(new String(name), null);
+
+ int length = packages.length;
+ StringBuffer buffer = new StringBuffer(length * 6);
+ for(int i = 0; i < length; i++) {
+ buffer.append(packages[i]);
+ if (i + 1 != length)
+ buffer.append('.');
}
+ String className = new String(name);
+ return find(className, buffer.toString());
+}
+/**
+ * @see ISearchableNameEnvironment
+ */
+public void findTypes(char[] prefix, final ISearchRequestor storage) {
- /**
- * @see INameEnvironment
- */
- public NameEnvironmentAnswer findType(char[] name, char[][] packages) {
- if (name == null)
- return null;
-
- if (packages == null || packages.length == 0)
- return find(new String(name), null);
-
- int length = packages.length;
- StringBuffer buffer = new StringBuffer(length * 6);
- for (int i = 0; i < length; i++) {
- buffer.append(packages[i]);
- if (i + 1 != length)
- buffer.append('.');
- }
- String className = new String(name);
- return find(className, buffer.toString());
+/*
+ if (true){
+ findTypes(new String(prefix), storage, INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);
+ return;
}
-
- /**
- * @see ISearchableNameEnvironment
- */
- public void findTypes(char[] prefix, final ISearchRequestor storage) {
-
- /*
- if (true){
+*/
+ try {
+ final String excludePath;
+ if (this.unitToSkip != null){
+ if (!(this.unitToSkip instanceof IJavaElement)){ // revert to model investigation
findTypes(new String(prefix), storage, INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);
return;
}
- */
- try {
- final String excludePath;
- if (this.unitToSkip != null) {
- if (!(this.unitToSkip instanceof IJavaElement)) {
- // revert to model investigation
- findTypes(
- new String(prefix),
- storage,
- INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);
- return;
- }
- excludePath =
- ((IJavaElement) this.unitToSkip)
- .getUnderlyingResource()
- .getFullPath()
- .toString();
- } else {
- excludePath = null;
- }
- int lastDotIndex = CharOperation.lastIndexOf('.', prefix);
- char[] qualification, simpleName;
- if (lastDotIndex < 0) {
- qualification = null;
- simpleName = CharOperation.toLowerCase(prefix);
- } else {
- qualification = CharOperation.subarray(prefix, 0, lastDotIndex);
- simpleName =
- CharOperation.toLowerCase(
- CharOperation.subarray(prefix, lastDotIndex + 1, prefix.length));
- }
-
- SearchEngine searchEngine = new SearchEngine();
+ excludePath = ((IJavaElement)this.unitToSkip).getUnderlyingResource().getFullPath().toString();
+ } else {
+ excludePath = null;
+ }
+ int lastDotIndex = CharOperation.lastIndexOf('.', prefix);
+ char[] qualification, simpleName;
+ if (lastDotIndex < 0){
+ qualification = null;
+ simpleName = CharOperation.toLowerCase(prefix);
+ } else {
+ qualification = CharOperation.subarray(prefix, 0, lastDotIndex);
+ simpleName = CharOperation.toLowerCase(CharOperation.subarray(prefix, lastDotIndex+1, prefix.length));
+ }
+
+ SearchEngine searchEngine = new SearchEngine();
- IProject projectRsc = (IProject) this.project.getUnderlyingResource();
- IJavaSearchScope scope =
- searchEngine.createJavaSearchScope(new IResource[] { projectRsc });
+ IProject projectRsc = (IProject) this.project.getUnderlyingResource();
+ IJavaSearchScope scope = searchEngine.createJavaSearchScope(new IResource[]{ projectRsc});
- IProgressMonitor progressMonitor = new IProgressMonitor() {
- boolean isCanceled = false;
- public void beginTask(String name, int totalWork) {
- }
- public void done() {
- }
- public void internalWorked(double work) {
- }
- public boolean isCanceled() {
- return isCanceled;
- }
- public void setCanceled(boolean value) {
- isCanceled = value;
- }
- public void setTaskName(String name) {
- }
- public void subTask(String name) {
- }
- public void worked(int work) {
- }
- };
- ITypeNameRequestor nameRequestor = new ITypeNameRequestor() {
- public void acceptClass(
- char[] packageName,
- char[] simpleTypeName,
- char[][] enclosingTypeNames,
- String path) {
- if (excludePath != null && excludePath.equals(path))
- return;
- if (enclosingTypeNames != null && enclosingTypeNames.length > 0)
- return; // accept only top level types
- storage.acceptClass(packageName, simpleTypeName, IConstants.AccPublic);
- }
- public void acceptInterface(
- char[] packageName,
- char[] simpleTypeName,
- char[][] enclosingTypeNames,
- String path) {
- if (excludePath != null && excludePath.equals(path))
- return;
- if (enclosingTypeNames != null && enclosingTypeNames.length > 0)
- return; // accept only top level types
- storage.acceptInterface(packageName, simpleTypeName, IConstants.AccPublic);
- }
- };
- try {
- searchEngine.searchAllTypeNames(
- projectRsc.getWorkspace(),
- qualification,
- simpleName,
- PREFIX_MATCH,
- CASE_INSENSITIVE,
- IJavaSearchConstants.TYPE,
- scope,
- nameRequestor,
- CANCEL_IF_NOT_READY_TO_SEARCH,
- progressMonitor);
- } catch (OperationCanceledException e) {
- findTypes(
- new String(prefix),
- storage,
- INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);
+ IProgressMonitor progressMonitor = new IProgressMonitor(){
+ boolean isCanceled = false;
+ public void beginTask(String name, int totalWork){}
+ public void done(){}
+ public void internalWorked(double work){}
+ public boolean isCanceled(){ return isCanceled; }
+ public void setCanceled(boolean value){ isCanceled = value; }
+ public void setTaskName(String name){}
+ public void subTask(String name){}
+ public void worked(int work){}
+ };
+ ITypeNameRequestor nameRequestor = new ITypeNameRequestor(){
+ public void acceptClass(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path){
+ if (excludePath != null && excludePath.equals(path)) return;
+ if (enclosingTypeNames != null && enclosingTypeNames.length > 0) return; // accept only top level types
+ storage.acceptClass(packageName, simpleTypeName, 0);
}
- } catch (JavaModelException e) {
- findTypes(
- new String(prefix),
- storage,
- INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);
- }
- }
-
- /**
- * Returns all types whose name starts with the given (qualified) <code>prefix</code>.
- *
- * If the <code>prefix</code> is unqualified, all types whose simple name matches
- * the <code>prefix</code> are returned.
- */
- private void findTypes(String prefix, ISearchRequestor storage, int type) {
- SearchableEnvironmentRequestor requestor =
- new SearchableEnvironmentRequestor(storage, this.unitToSkip);
- int index = prefix.lastIndexOf('.');
- if (index == -1) {
- this.nameLookup.seekTypes(prefix, null, true, type, requestor);
- } else {
- String packageName = prefix.substring(0, index);
- String className = prefix.substring(index + 1);
- JavaElementRequestor javaElementRequestor = new JavaElementRequestor();
- this.nameLookup.seekPackageFragments(packageName, false, javaElementRequestor);
- IPackageFragment[] packageFragments =
- javaElementRequestor.getPackageFragments();
- if (packageFragments == null)
- return;
- for (int i = 0, packagesLength = packageFragments.length;
- i < packagesLength;
- i++) {
- if (packageFragments[i] == null)
- continue;
- this.nameLookup.seekTypes(
- className,
- packageFragments[i],
- true,
- type,
- requestor);
+ public void acceptInterface(char[] packageName, char[] simpleTypeName, char[][] enclosingTypeNames, String path){
+ if (excludePath != null && excludePath.equals(path)) return;
+ if (enclosingTypeNames != null && enclosingTypeNames.length > 0) return; // accept only top level types
+ storage.acceptInterface(packageName, simpleTypeName, 0);
}
+ };
+ try {
+ searchEngine.searchAllTypeNames(
+ projectRsc.getWorkspace(),
+ qualification,
+ simpleName,
+ PREFIX_MATCH,
+ CASE_INSENSITIVE,
+ IJavaSearchConstants.TYPE,
+ scope,
+ nameRequestor,
+ CANCEL_IF_NOT_READY_TO_SEARCH,
+ progressMonitor);
+ } catch (OperationCanceledException e) {
+ findTypes(new String(prefix), storage, INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);
}
+ } catch(JavaModelException e){
+ findTypes(new String(prefix), storage, INameLookup.ACCEPT_CLASSES | INameLookup.ACCEPT_INTERFACES);
}
-
- /**
- * @see SearchableBuilderEnvironment
- */
- public boolean isPackage(char[][] parentPackageName, char[] subPackageName) {
- if (parentPackageName == null || parentPackageName.length == 0)
- return isTopLevelPackage(subPackageName);
- if (subPackageName == null)
- return false;
- int length = parentPackageName.length;
- StringBuffer buffer = new StringBuffer((length + 1) * 6);
- for (int i = 0; i < length; i++) {
- if (parentPackageName[i] == null || isQualified(parentPackageName[i]))
- return false;
- buffer.append(parentPackageName[i]);
- buffer.append('.');
- }
- if (isQualified(subPackageName)) {
- return false;
+}
+/**
+ * Returns all types whose name starts with the given (qualified) <code>prefix</code>.
+ *
+ * If the <code>prefix</code> is unqualified, all types whose simple name matches
+ * the <code>prefix</code> are returned.
+ */
+private void findTypes(String prefix, ISearchRequestor storage, int type) {
+ SearchableEnvironmentRequestor requestor = new SearchableEnvironmentRequestor(storage, this.unitToSkip);
+ int index = prefix.lastIndexOf('.');
+ if (index == -1) {
+ this.nameLookup.seekTypes(prefix, null, true, type, requestor);
+ } else {
+ String packageName = prefix.substring(0, index);
+ String className = prefix.substring(index + 1);
+ JavaElementRequestor javaElementRequestor = new JavaElementRequestor();
+ this.nameLookup.seekPackageFragments(packageName, false, javaElementRequestor);
+ IPackageFragment[] packageFragments = javaElementRequestor.getPackageFragments();
+ if (packageFragments == null)
+ return;
+ for (int i = 0, packagesLength = packageFragments.length; i < packagesLength; i++) {
+ if (packageFragments[i] == null)
+ continue;
+ this.nameLookup.seekTypes(className, packageFragments[i], true, type, requestor);
}
- buffer.append(subPackageName);
- boolean result =
- this.nameLookup.findPackageFragments(buffer.toString(), false) != null;
- return result;
-
}
-
- /**
- * Returns true if there are no '.' characters in the given name.
- */
- protected boolean isQualified(char[] name) {
- if (name != null) {
- return CharOperation.indexOf('.', name) > -1;
- }
+}
+/**
+ * @see SearchableBuilderEnvironment
+ */
+public boolean isPackage(char[][] parentPackageName, char[] subPackageName) {
+ if (parentPackageName == null || parentPackageName.length == 0)
+ return isTopLevelPackage(subPackageName);
+ if (subPackageName == null)
return false;
- }
-
- /**
- * @see SearchableBuilderEnvironment
- */
- public boolean isTopLevelPackage(char[] packageName) {
- if (packageName == null)
+ int length = parentPackageName.length;
+ StringBuffer buffer = new StringBuffer((length + 1) * 6);
+ for(int i = 0; i < length; i++) {
+ if (parentPackageName[i] == null || isQualified(parentPackageName[i]))
return false;
- boolean result =
- !isQualified(packageName)
- && this.nameLookup.findPackageFragments(new String(packageName), false) != null;
- return result;
-
+ buffer.append(parentPackageName[i]);
+ buffer.append('.');
}
-
- /**
- * Returns a printable string for the array.
- */
- protected String toStringChar(char[] name) {
- return "[" //$NON-NLS-1$
- + new String(name) + "]" ; //$NON-NLS-1$
+ if (isQualified(subPackageName)) {
+ return false;
+ }
+ buffer.append(subPackageName);
+ boolean result= this.nameLookup.findPackageFragments(buffer.toString(), false) != null;
+ return result;
+
+}
+/**
+ * Returns true if there are no '.' characters in the given name.
+ */
+protected boolean isQualified(char[] name) {
+ if (name != null) {
+ return CharOperation.indexOf('.', name) > -1;
}
+ return false;
+}
+/**
+ * @see SearchableBuilderEnvironment
+ */
+public boolean isTopLevelPackage(char[] packageName) {
+ if (packageName == null)
+ return false;
+ boolean result= !isQualified(packageName)
+ && this.nameLookup.findPackageFragments(new String(packageName), false) != null;
+ return result;
- /**
- * Returns a printable string for the array.
- */
- protected String toStringCharChar(char[][] names) {
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < names.length; i++) {
- result.append(toStringChar(names[i]));
- }
- return result.toString();
+}
+/**
+ * Returns a printable string for the array.
+ */
+protected String toStringChar(char[] name) {
+ return "["/*nonNLS*/ + new String(name) + "]"/*nonNLS*/;
+}
+/**
+ * Returns a printable string for the array.
+ */
+protected String toStringCharChar(char[][] names) {
+ StringBuffer result= new StringBuffer();
+ for (int i= 0; i < names.length; i++) {
+ result.append(toStringChar(names[i]));
}
-} \ No newline at end of file
+ return result.toString();
+}
+}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
index cbbe9420fc..bc94fbc0b3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SelectionRequestor.java
@@ -60,7 +60,7 @@ protected void acceptBinaryMethod(IType type, char[] selector, char[][] paramete
for (int i= 0, max = parameterTypeNames.length; i < max; i++) {
String pkg = IPackageFragment.DEFAULT_PACKAGE_NAME;
if (parameterPackageNames[i] != null && parameterPackageNames[i].length > 0) {
- pkg = new String(parameterPackageNames[i]) + "."; //$NON-NLS-1$
+ pkg = new String(parameterPackageNames[i]) + "."/*nonNLS*/;
}
parameterTypes[i]= Signature.createTypeSignature(
pkg + new String(parameterTypeNames[i]), true);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
index 2cd405cff7..a945598be8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetClasspathOperation.java
@@ -57,7 +57,7 @@ public SetClasspathOperation(IJavaProject project, IClasspathEntry[] oldResolved
* Sets the classpath of the pre-specified project.
*/
protected void executeOperation() throws JavaModelException {
- beginTask(Util.bind("classpath.settingProgress"), 2); //$NON-NLS-1$
+ beginTask(Util.bind("classpath.settingProgress"/*nonNLS*/), 2);
JavaProject project= ((JavaProject) getElementsToProcess()[0]);
project.setRawClasspath0(this.newRawPath);
@@ -164,7 +164,9 @@ public IJavaModelStatus verify() {
if (!status.isOK()) {
return status;
}
+ IClasspathEntry[] classpath = this.newRawPath;
IJavaProject javaProject = (IJavaProject)getElementToProcess();
+ IPath projectPath= javaProject.getProject().getFullPath();
// retrieve output location
IPath outputLocation;
@@ -174,7 +176,49 @@ public IJavaModelStatus verify() {
return e.getJavaModelStatus();
}
- return JavaConventions.validateClasspath(javaProject, this.newRawPath, outputLocation);
+ // check if any source entries coincidates with binary output - in which case nesting inside output is legal
+ boolean allowNestingInOutput = false;
+ boolean hasSource = false;
+ for (int i = 0 ; i < classpath.length; i++) {
+ if (classpath[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) hasSource = true;
+ if (classpath[i].getPath().equals(outputLocation)){
+ allowNestingInOutput = true;
+ break;
+ }
+ }
+ if (!hasSource) allowNestingInOutput = true; // if no source, then allowed
+
+ // check all entries
+ for (int i = 0 ; i < classpath.length; i++) {
+ IClasspathEntry entry = classpath[i];
+ IPath entryPath = entry.getPath();
+
+ // no further check if entry coincidates with project or output location
+ if (entryPath.equals(projectPath)) continue;
+ if (entryPath.equals(outputLocation)) continue;
+
+ // prevent nesting source entries in each other
+ if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE){
+ for (int j = 0; j < classpath.length; j++){
+ IClasspathEntry otherEntry = classpath[j];
+ if (entry != otherEntry && otherEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE){
+ if (entryPath.isPrefixOf(otherEntry.getPath())){
+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryPath);
+ }
+ }
+ }
+ }
+ // prevent nesting output location inside entry
+ if (entryPath.isPrefixOf(outputLocation)) {
+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryPath);
+ }
+
+ // prevent nesting entry inside output location - when distinct from project or a source folder
+ if (!allowNestingInOutput && outputLocation.isPrefixOf(entryPath)) {
+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, entryPath);
+ }
+ }
+ return JavaModelStatus.VERIFIED_OK;
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetOutputLocationOperation.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetOutputLocationOperation.java
index 591a6cf085..3ea30489fc 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetOutputLocationOperation.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetOutputLocationOperation.java
@@ -85,7 +85,7 @@ protected Vector determineAffectedPackageFragments(IPath location) throws JavaMo
IPath relativePath = f.getFullPath().removeFirstSegments(segments);
String name = relativePath.toOSString();
name = name.replace(File.pathSeparatorChar, '.');
- if (name.endsWith(".")) { //$NON-NLS-1$
+ if (name.endsWith("."/*nonNLS*/)) {
name = name.substring(0, name.length() - 1);
}
IPackageFragment pkg = root.getPackageFragment(name);
@@ -104,7 +104,7 @@ protected Vector determineAffectedPackageFragments(IPath location) throws JavaMo
* a package fragment.
*/
protected void executeOperation() throws JavaModelException {
- beginTask(Util.bind("classpath.settingOutputLocationProgress"), 2); //$NON-NLS-1$
+ beginTask(Util.bind("classpath.settingOutputLocationProgress"/*nonNLS*/), 2);
JavaProject project= ((JavaProject) getElementsToProcess()[0]);
IPath oldLocation= project.getOutputLocation();
@@ -166,6 +166,27 @@ public IJavaModelStatus verify() {
if (!status.isOK()) {
return status;
}
+ if (fOutputLocation == null) {
+ return new JavaModelStatus(IJavaModelStatusConstants.NULL_PATH);
+ }
+
+ if (fOutputLocation.isAbsolute()) {
+ IProject project = ((IJavaProject) fElementsToProcess[0]).getProject();
+
+ if (project.getFullPath().isPrefixOf(fOutputLocation)) {
+ //project relative path
+ String projectName = fOutputLocation.segment(0);
+ if (!projectName.equals(fElementsToProcess[0].getElementName())) {
+ //a workspace relative path outside of this project
+ return new JavaModelStatus(IJavaModelStatusConstants.PATH_OUTSIDE_PROJECT, fOutputLocation);
+ }
+ } else {
+ return new JavaModelStatus(IJavaModelStatusConstants.DEVICE_PATH, fOutputLocation);
+ }
+ } else {
+ return new JavaModelStatus(IJavaModelStatusConstants.RELATIVE_PATH, fOutputLocation);
+ }
+
// retrieve classpath
IClasspathEntry[] classpath = null;
IJavaProject javaProject= (IJavaProject)getElementToProcess();
@@ -175,6 +196,38 @@ public IJavaModelStatus verify() {
} catch (JavaModelException e) {
return e.getJavaModelStatus();
}
- return JavaConventions.validateClasspath((IJavaProject) fElementsToProcess[0], classpath, fOutputLocation);
+
+ // check if any source entries coincidates with binary output - in which case nesting inside output is legal
+ boolean allowNestingInOutput = false;
+ boolean hasSource = false;
+ for (int i = 0 ; i < classpath.length; i++) {
+ if (classpath[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) hasSource = true;
+ if (classpath[i].getPath().equals(fOutputLocation)){
+ allowNestingInOutput = true;
+ break;
+ }
+ }
+ if (!hasSource) allowNestingInOutput = true; // if no source, then allowed
+
+ // check all entries
+ for (int i = 0 ; i < classpath.length; i++) {
+ IClasspathEntry entry = classpath[i];
+ IPath entryPath = entry.getPath();
+
+ // no further check if entry coincidates with project or output location
+ if (entryPath.equals(projectPath)) continue;
+ if (entryPath.equals(fOutputLocation)) continue;
+
+ // prevent nesting output location inside entry
+ if (entryPath.isPrefixOf(fOutputLocation)) {
+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, fOutputLocation);
+ }
+
+ // prevent nesting entry inside output location - when distinct from project or a source folder
+ if (!allowNestingInOutput && fOutputLocation.isPrefixOf(entryPath)) {
+ return new JavaModelStatus(IJavaModelStatusConstants.INVALID_PATH, fOutputLocation);
+ }
+ }
+ return JavaModelStatus.VERIFIED_OK;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceField.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceField.java
index 388b019eb2..00d5b06bd1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceField.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceField.java
@@ -53,14 +53,14 @@ public String getTypeSignature() throws JavaModelException {
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
if (info == null) {
buffer.append(getElementName());
- buffer.append(" (not open)"); //$NON-NLS-1$
+ buffer.append(" (not open)"/*nonNLS*/);
} else {
try {
buffer.append(Signature.toString(this.getTypeSignature()));
- buffer.append(" "); //$NON-NLS-1$
+ buffer.append(" "/*nonNLS*/);
buffer.append(this.getElementName());
} catch (JavaModelException e) {
- buffer.append("<JavaModelException in toString of " + getElementName()); //$NON-NLS-1$
+ buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java
index 5272368335..ffeceb9999 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java
@@ -31,9 +31,7 @@ import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
* @see AttachSourceOperation
* @see JarPackageFragment
*/
-public class SourceMapper
- extends ReferenceInfoAdapter
- implements ISourceElementRequestor {
+public class SourceMapper extends ReferenceInfoAdapter implements ISourceElementRequestor {
/**
* The binary type source is being mapped for
@@ -72,7 +70,7 @@ public class SourceMapper
/**
* The unknown source range {-1, 0}
*/
- protected static SourceRange fgUnknownRange = new SourceRange(-1, 0);
+ protected static SourceRange fgUnknownRange= new SourceRange(-1, 0);
/**
* The position within the source of the start of the
@@ -98,602 +96,420 @@ public class SourceMapper
protected IJavaElement searchedElement;
/**
- * imports references
- */
- private Hashtable importsTable;
- private Hashtable importsCounterTable;
-
- /**
* Enclosing type information
*/
- IType[] types;
- int[] typeDeclarationStarts;
- SourceRange[] typeNameRanges;
- int typeDepth;
- /**
- * Creates a <code>SourceMapper</code> that locates source in the zip file
- * at the given location in the specified package fragment root.
- */
- public SourceMapper(IPath zipPath, String rootPath, JavaModel model) {
- fZipPath = zipPath;
- fRootPath = rootPath.replace('\\', '/');
- if (fRootPath.endsWith("/" )) { //$NON-NLS-1$
- fRootPath = fRootPath.substring(0, fRootPath.lastIndexOf('/'));
- }
- fJavaModel = model;
- fSourceRanges = new Hashtable();
- importsTable = new Hashtable();
- importsCounterTable = new Hashtable();
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void acceptImport(
- int declarationStart,
- int declarationEnd,
- char[] name,
- boolean onDemand) {
- char[][] imports = (char[][]) this.importsTable.get(fType);
- int importsCounter;
- if (imports == null) {
- imports = new char[5][];
- importsCounter = 0;
- } else {
- importsCounter = ((Integer) this.importsCounterTable.get(fType)).intValue();
- }
- if (imports.length == importsCounter) {
- System.arraycopy(
- imports,
- 0,
- (imports = new char[importsCounter * 2][]),
- 0,
- importsCounter);
- }
- imports[importsCounter++] = name;
- this.importsTable.put(fType, imports);
- this.importsCounterTable.put(fType, new Integer(importsCounter));
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void acceptInitializer(
- int modifiers,
- int declarationSourceStart,
- int declarationSourceEnd) {
- //do nothing
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void acceptLineSeparatorPositions(int[] positions) {
- //do nothing
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void acceptPackage(
- int declarationStart,
- int declarationEnd,
- char[] name) {
- //do nothing
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void acceptProblem(IProblem problem) {
- //do nothing
- }
-
- /**
- * Closes this <code>SourceMapper</code>'s zip file. Once this is done, this
- * <code>SourceMapper</code> cannot be used again.
- */
- public void close() throws JavaModelException {
- fSourceRanges = null;
- }
-
- /**
- * Converts these type names to signatures.
- * @see Signature.
- */
- public String[] convertTypeNamesToSigs(char[][] typeNames) {
- if (typeNames == null)
- return fgEmptyStringArray;
- int n = typeNames.length;
- if (n == 0)
- return fgEmptyStringArray;
- String[] typeSigs = new String[n];
- for (int i = 0; i < n; ++i) {
- typeSigs[i] = Signature.createTypeSignature(typeNames[i], false);
- }
- return typeSigs;
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void enterClass(
- int declarationStart,
- int modifiers,
- char[] name,
- int nameSourceStart,
- int nameSourceEnd,
- char[] superclass,
- char[][] superinterfaces) {
+ IType[] types;
+ int[] typeDeclarationStarts;
+ SourceRange[] typeNameRanges;
+ int typeDepth;
+/**
+ * Creates a <code>SourceMapper</code> that locates source in the zip file
+ * at the given location in the specified package fragment root.
+ */
+public SourceMapper(IPath zipPath, String rootPath, JavaModel model) {
+ fZipPath= zipPath;
+ fRootPath= rootPath.replace('\\', '/');
+ if (fRootPath.endsWith("/"/*nonNLS*/)) {
+ fRootPath = fRootPath.substring(0, fRootPath.lastIndexOf('/'));
+ }
+ fJavaModel= model;
+ fSourceRanges= new Hashtable();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptImport(int declarationStart, int declarationEnd, char[] name, boolean onDemand) {
+ //do nothing
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptInitializer(int modifiers, int declarationSourceStart, int declarationSourceEnd) {
+ //do nothing
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptLineSeparatorPositions(int[] positions) {
+ //do nothing
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptPackage(int declarationStart, int declarationEnd, char[] name) {
+ //do nothing
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptProblem(IProblem problem) {
+ //do nothing
+}
+/**
+ * Closes this <code>SourceMapper</code>'s zip file. Once this is done, this
+ * <code>SourceMapper</code> cannot be used again.
+ */
+public void close() throws JavaModelException {
+ fSourceRanges= null;
+}
+/**
+ * Converts these type names to signatures.
+ * @see Signature.
+ */
+public String[] convertTypeNamesToSigs(char[][] typeNames) {
+ if (typeNames == null)
+ return fgEmptyStringArray;
+ int n = typeNames.length;
+ if (n == 0)
+ return fgEmptyStringArray;
+ String[] typeSigs = new String[n];
+ for (int i = 0; i < n; ++i) {
+ typeSigs[i] = Signature.createTypeSignature(typeNames[i], false);
+ }
+ return typeSigs;
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterClass(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[] superclass, char[][] superinterfaces) {
- this.typeDepth++;
- if (this.typeDepth == this.types.length) { // need to grow
- System.arraycopy(
- this.types,
- 0,
- this.types = new IType[this.typeDepth * 2],
- 0,
- this.typeDepth);
- System.arraycopy(
- this.typeNameRanges,
- 0,
- this.typeNameRanges = new SourceRange[this.typeDepth * 2],
- 0,
- this.typeDepth);
- System.arraycopy(
- this.typeDeclarationStarts,
- 0,
- this.typeDeclarationStarts = new int[this.typeDepth * 2],
- 0,
- this.typeDepth);
- }
- this.types[typeDepth] = this.getType(new String(name));
- this.typeNameRanges[typeDepth] =
- new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);
- this.typeDeclarationStarts[typeDepth] = declarationStart;
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void enterCompilationUnit() {
- // do nothing
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void enterConstructor(
- int declarationStart,
- int modifiers,
- char[] name,
- int nameSourceStart,
- int nameSourceEnd,
- char[][] parameterTypes,
- char[][] parameterNames,
- char[][] exceptionTypes) {
- enterMethod(
- declarationStart,
- modifiers,
- null,
- name,
- nameSourceStart,
- nameSourceEnd,
- parameterTypes,
- parameterNames,
- exceptionTypes);
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void enterField(
- int declarationStart,
- int modifiers,
- char[] type,
- char[] name,
- int nameSourceStart,
- int nameSourceEnd) {
- if (typeDepth >= 0
- && fMemberDeclarationStart == -1) {
- // don't allow nested member (can only happen with anonymous inner classes)
- fMemberDeclarationStart = declarationStart;
- fMemberNameRange =
- new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);
- fMemberName = new String(name);
- }
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void enterInterface(
- int declarationStart,
- int modifiers,
- char[] name,
- int nameSourceStart,
- int nameSourceEnd,
- char[][] superinterfaces) {
- enterClass(
- declarationStart,
- modifiers,
- name,
- nameSourceStart,
- nameSourceEnd,
- null,
- superinterfaces);
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void enterMethod(
- int declarationStart,
- int modifiers,
- char[] returnType,
- char[] name,
- int nameSourceStart,
- int nameSourceEnd,
- char[][] parameterTypes,
- char[][] parameterNames,
- char[][] exceptionTypes) {
- if (typeDepth >= 0
- && fMemberDeclarationStart == -1) {
- // don't allow nested member (can only happen with anonymous inner classes)
- fMemberName = new String(name);
- fMemberNameRange =
- new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);
- fMemberDeclarationStart = declarationStart;
- fMethodParameterTypes = parameterTypes;
- }
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void exitClass(int declarationEnd) {
- if (typeDepth >= 0) {
- IType currentType = this.types[typeDepth];
- setSourceRange(
- currentType,
- new SourceRange(
- this.typeDeclarationStarts[typeDepth],
- declarationEnd - this.typeDeclarationStarts[typeDepth] + 1),
- this.typeNameRanges[typeDepth]);
- this.typeDepth--;
- }
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void exitCompilationUnit(int declarationEnd) {
- //do nothing
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void exitConstructor(int declarationEnd) {
- exitMethod(declarationEnd);
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void exitField(int declarationEnd) {
- if (typeDepth >= 0 && fMemberDeclarationStart != -1) {
- IType currentType = this.types[typeDepth];
- setSourceRange(
- currentType.getField(fMemberName),
- new SourceRange(
- fMemberDeclarationStart,
- declarationEnd - fMemberDeclarationStart + 1),
- fMemberNameRange);
- fMemberDeclarationStart = -1;
- }
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void exitInterface(int declarationEnd) {
- exitClass(declarationEnd);
- }
-
- /**
- * @see ISourceElementRequestor
- */
- public void exitMethod(int declarationEnd) {
- if (typeDepth >= 0 && fMemberDeclarationStart != -1) {
- IType currentType = this.types[typeDepth];
- SourceRange sourceRange =
- new SourceRange(
- fMemberDeclarationStart,
- declarationEnd - fMemberDeclarationStart + 1);
- setSourceRange(
- currentType.getMethod(
- fMemberName,
- convertTypeNamesToSigs(fMethodParameterTypes)),
- sourceRange,
- fMemberNameRange);
- fMemberDeclarationStart = -1;
- }
- }
-
- /**
- * Locates and returns source code for the given (binary) type, in this
- * SourceMapper's ZIP file, or returns <code>null</code> if source
- * code cannot be found.
- */
- public char[] findSource(IType type) {
- if (!type.isBinary()) {
- return null;
- }
- BinaryType parent = (BinaryType) type.getDeclaringType();
- BinaryType declType = (BinaryType) type;
- while (parent != null) {
- declType = parent;
- parent = (BinaryType) declType.getDeclaringType();
- }
- IBinaryType info = null;
- try {
- info = (IBinaryType) declType.getRawInfo();
- } catch (JavaModelException e) {
- return null;
- }
- return this.findSource(type, info);
+ this.typeDepth++;
+ if (this.typeDepth == this.types.length){ // need to grow
+ System.arraycopy(this.types, 0, this.types = new IType[this.typeDepth*2], 0, this.typeDepth);
+ System.arraycopy(this.typeNameRanges, 0, this.typeNameRanges = new SourceRange[this.typeDepth*2], 0, this.typeDepth);
+ System.arraycopy(this.typeDeclarationStarts, 0, this.typeDeclarationStarts = new int[this.typeDepth*2], 0, this.typeDepth);
+ }
+ this.types[typeDepth] = this.getType(new String(name));
+ this.typeNameRanges[typeDepth] = new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);
+ this.typeDeclarationStarts[typeDepth] = declarationStart;
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterCompilationUnit() {
+ // do nothing
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterConstructor(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[][] parameterTypes, char[][] parameterNames, char[][] exceptionTypes) {
+ enterMethod(declarationStart, modifiers, null, name, nameSourceStart, nameSourceEnd, parameterTypes, parameterNames, exceptionTypes);
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterField(int declarationStart, int modifiers, char[] type, char[] name, int nameSourceStart, int nameSourceEnd) {
+ if (typeDepth >= 0 && fMemberDeclarationStart == -1) { // don't allow nested member (can only happen with anonymous inner classes)
+ fMemberDeclarationStart= declarationStart;
+ fMemberNameRange= new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);
+ fMemberName= new String(name);
+ }
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterInterface(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[][] superinterfaces) {
+ enterClass(declarationStart, modifiers, name, nameSourceStart, nameSourceEnd, null, superinterfaces);
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterMethod(int declarationStart, int modifiers, char[] returnType, char[] name, int nameSourceStart, int nameSourceEnd, char[][] parameterTypes, char[][] parameterNames, char[][] exceptionTypes) {
+ if (typeDepth >= 0 && fMemberDeclarationStart == -1) { // don't allow nested member (can only happen with anonymous inner classes)
+ fMemberName= new String(name);
+ fMemberNameRange= new SourceRange(nameSourceStart, nameSourceEnd - nameSourceStart + 1);
+ fMemberDeclarationStart= declarationStart;
+ fMethodParameterTypes= parameterTypes;
+ }
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitClass(int declarationEnd) {
+ if (typeDepth >= 0) {
+ IType currentType = this.types[typeDepth];
+ setSourceRange(
+ currentType,
+ new SourceRange(
+ this.typeDeclarationStarts[typeDepth] ,
+ declarationEnd - this.typeDeclarationStarts[typeDepth] + 1),
+ this.typeNameRanges[typeDepth]);
+ this.typeDepth--;
+ }
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitCompilationUnit(int declarationEnd) {
+ //do nothing
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitConstructor(int declarationEnd) {
+ exitMethod(declarationEnd);
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitField(int declarationEnd) {
+ if (typeDepth >= 0 && fMemberDeclarationStart != -1) {
+ IType currentType = this.types[typeDepth];
+ setSourceRange(currentType.getField(fMemberName), new SourceRange(fMemberDeclarationStart, declarationEnd - fMemberDeclarationStart + 1), fMemberNameRange);
+ fMemberDeclarationStart = -1;
}
-
- /**
- * Locates and returns source code for the given (binary) type, in this
- * SourceMapper's ZIP file, or returns <code>null</code> if source
- * code cannot be found.
- */
- public char[] findSource(IType type, IBinaryType info) {
- char[] sourceFileName = info.sourceFileName();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitInterface(int declarationEnd) {
+ exitClass(declarationEnd);
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitMethod(int declarationEnd) {
+ if (typeDepth >= 0 && fMemberDeclarationStart != -1) {
+ IType currentType = this.types[typeDepth];
+ SourceRange sourceRange= new SourceRange(fMemberDeclarationStart, declarationEnd - fMemberDeclarationStart + 1);
+ setSourceRange(currentType.getMethod(fMemberName, convertTypeNamesToSigs(fMethodParameterTypes)), sourceRange, fMemberNameRange);
+ fMemberDeclarationStart = -1;
+ }
+}
+/**
+ * Locates and returns source code for the given (binary) type, in this
+ * SourceMapper's ZIP file, or returns <code>null</code> if source
+ * code cannot be found.
+ */
+public char[] findSource(IType type) {
+ if (!type.isBinary()) {
+ return null;
+ }
+ BinaryType parent= (BinaryType)type.getDeclaringType();
+ BinaryType declType= (BinaryType)type;
+ while (parent != null) {
+ declType= parent;
+ parent= (BinaryType)declType.getDeclaringType();
+ }
+ IBinaryType info= null;
+ try {
+ info= (IBinaryType)declType.getRawInfo();
+ } catch (JavaModelException e) {
+ return null;
+ }
+ return this.findSource(type, info);
+}
+/**
+ * Locates and returns source code for the given (binary) type, in this
+ * SourceMapper's ZIP file, or returns <code>null</code> if source
+ * code cannot be found.
+ */
+public char[] findSource(IType type, IBinaryType info) {
+ String name = null;
+ // see 1FVVWZT
+ if (info instanceof ClassFileReader) {
+ char[] sourceFileName = ((ClassFileReader) info).sourceFileName();
if (sourceFileName == null)
return null; // no source file attribute
- String name = new String(sourceFileName);
+ name = new String(sourceFileName);
+ } else {
+ return null;
+ }
- IPackageFragment pkgFrag = type.getPackageFragment();
- if (!pkgFrag.isDefaultPackage()) {
- String pkg = type.getPackageFragment().getElementName().replace('.', '/');
- name = pkg + '/' + name;
+ IPackageFragment pkgFrag = type.getPackageFragment();
+ if (!pkgFrag.isDefaultPackage()) {
+ String pkg= type.getPackageFragment().getElementName().replace('.', '/');
+ name= pkg + '/' + name;
+ }
+ // try to get the entry
+ ZipEntry entry= null;
+ ZipFile zip = null;
+ char[] source= null;
+ try {
+ String fullName;
+ //add the root path if specified
+ if (!fRootPath.equals(IPackageFragmentRoot.DEFAULT_PACKAGEROOT_PATH)) {
+ fullName= fRootPath + '/' + name;
+ } else {
+ fullName= name;
}
- // try to get the entry
- ZipEntry entry = null;
- ZipFile zip = null;
- char[] source = null;
- try {
- String fullName;
- //add the root path if specified
- if (!fRootPath.equals(IPackageFragmentRoot.DEFAULT_PACKAGEROOT_PATH)) {
- fullName = fRootPath + '/' + name;
- } else {
- fullName = name;
- }
- zip = getZip();
- entry = zip.getEntry(fullName);
- if (entry != null) {
- // now read the source code
- byte[] bytes = readEntry(zip, entry);
- if (bytes != null) {
- try {
- source = BufferManager.bytesToChar(bytes);
- } catch (JavaModelException e) {
- source = null;
- }
- }
- }
- } catch (CoreException e) {
- return null;
- } finally {
- if (zip != null) {
+ zip = getZip();
+ entry= zip.getEntry(fullName);
+ if (entry != null) {
+ // now read the source code
+ byte[] bytes= readEntry(zip, entry);
+ if (bytes != null) {
try {
- zip.close();
- } catch (IOException e) {
+ source= BufferManager.bytesToChar(bytes);
+ } catch (JavaModelException e) {
+ source= null;
}
}
}
- return source;
- }
-
- /**
- * Returns the SourceRange for the name of the given element, or
- * {-1, -1} if no source range is known for the name of the element.
- */
- public SourceRange getNameRange(IJavaElement element) {
- if (element.getElementType() == IJavaElement.METHOD
- && ((IMember) element).isBinary()) {
- element = getUnqualifiedMethodHandle((IMethod) element);
- }
- SourceRange[] ranges = (SourceRange[]) fSourceRanges.get(element);
- if (ranges == null) {
- return fgUnknownRange;
- } else {
- return ranges[1];
+ } catch (CoreException e) {
+ return null;
+ } finally {
+ if (zip != null) {
+ try {
+ zip.close();
+ } catch(IOException e) {}
}
}
-
- /**
- * Returns the <code>SourceRange</code> for the given element, or
- * {-1, -1} if no source range is known for the element.
- */
- public SourceRange getSourceRange(IJavaElement element) {
- if (element.getElementType() == IJavaElement.METHOD
- && ((IMember) element).isBinary()) {
- element = getUnqualifiedMethodHandle((IMethod) element);
- }
- SourceRange[] ranges = (SourceRange[]) fSourceRanges.get(element);
- if (ranges == null) {
- return fgUnknownRange;
- } else {
- return ranges[0];
- }
- }
-
- /**
- * Returns the type with the given <code>typeName</code>. Returns inner classes
- * as well.
- */
- protected IType getType(String typeName) {
- if (fType.getElementName().equals(typeName))
- return fType;
- else
- return fType.getType(typeName);
+ return source;
+}
+/**
+ * Returns the SourceRange for the name of the given element, or
+ * {-1, -1} if no source range is known for the name of the element.
+ */
+public SourceRange getNameRange(IJavaElement element) {
+ if (element.getElementType() == IJavaElement.METHOD && ((IMember)element).isBinary()) {
+ element= getUnqualifiedMethodHandle((IMethod)element);
}
-
- /**
- * Creates a handle that has parameter types that are not
- * fully qualified so that the correct source is found.
- */
- protected IJavaElement getUnqualifiedMethodHandle(IMethod method) {
-
- String[] qualifiedParameterTypes = method.getParameterTypes();
- String[] unqualifiedParameterTypes = new String[qualifiedParameterTypes.length];
- for (int i = 0; i < qualifiedParameterTypes.length; i++) {
- StringBuffer unqualifiedName = new StringBuffer();
- String qualifiedName = qualifiedParameterTypes[i];
- int count = 0;
- while (qualifiedName.charAt(count) == Signature.C_ARRAY) {
- unqualifiedName.append(Signature.C_ARRAY);
- ++count;
- }
- if (qualifiedName.charAt(count) == Signature.C_RESOLVED) {
- unqualifiedName.append(Signature.C_UNRESOLVED);
- unqualifiedName.append(Signature.getSimpleName(qualifiedName));
- } else {
- unqualifiedName.append(qualifiedName.substring(count, qualifiedName.length()));
- }
- unqualifiedParameterTypes[i] = unqualifiedName.toString();
- }
- return ((IType) method.getParent()).getMethod(
- method.getElementName(),
- unqualifiedParameterTypes);
+ SourceRange[] ranges= (SourceRange[])fSourceRanges.get(element);
+ if (ranges == null) {
+ return fgUnknownRange;
+ } else {
+ return ranges[1];
}
-
- /**
- * Returns the <code>ZipFile</code> that source is located in.
- */
- public ZipFile getZip() throws CoreException {
- return fJavaModel.fgJavaModelManager.getZipFile(fZipPath);
+}
+/**
+ * Returns the <code>SourceRange</code> for the given element, or
+ * {-1, -1} if no source range is known for the element.
+ */
+public SourceRange getSourceRange(IJavaElement element) {
+ if (element.getElementType() == IJavaElement.METHOD && ((IMember)element).isBinary()) {
+ element= getUnqualifiedMethodHandle((IMethod)element);
}
-
- /**
- * Maps the given source code to the given binary type and its children.
- */
- public void mapSource(IType type, char[] contents) {
- this.mapSource(type, contents, null);
+ SourceRange[] ranges= (SourceRange[])fSourceRanges.get(element);
+ if (ranges == null) {
+ return fgUnknownRange;
+ } else {
+ return ranges[0];
}
-
- /**
- * Maps the given source code to the given binary type and its children.
- * If a non-null java element is passed, finds the name range for the
- * given java element without storing it.
- */
- public ISourceRange mapSource(
- IType type,
- char[] contents,
- IJavaElement searchedElement) {
- fType = (BinaryType) type;
-
- this.importsTable.remove(fType);
- this.importsCounterTable.remove(fType);
- this.searchedElement = searchedElement;
- this.types = new IType[1];
- this.typeDeclarationStarts = new int[1];
- this.typeNameRanges = new SourceRange[1];
- this.typeDepth = -1;
+}
+/**
+ * Returns the type with the given <code>typeName</code>. Returns inner classes
+ * as well.
+ */
+protected IType getType(String typeName) {
+ if (fType.getElementName().equals(typeName))
+ return fType;
+ else
+ return fType.getType(typeName);
+}
+/**
+ * Creates a handle that has parameter types that are not
+ * fully qualified so that the correct source is found.
+ */
+protected IJavaElement getUnqualifiedMethodHandle(IMethod method) {
- Hashtable oldSourceRanges = (Hashtable) fSourceRanges.clone();
- try {
- IProblemFactory factory = new DefaultProblemFactory();
- SourceElementParser parser = new SourceElementParser(this, factory);
- parser.parseCompilationUnit(
- new BasicCompilationUnit(contents, type.getElementName() + ".java" ), //$NON-NLS-1$
- false);
- if (searchedElement != null) {
- ISourceRange range = this.getNameRange(searchedElement);
- return range;
- } else {
- return null;
- }
- } finally {
- if (searchedElement != null) {
- fSourceRanges = oldSourceRanges;
- }
- fType = null;
- this.searchedElement = null;
- this.types = null;
- this.typeDeclarationStarts = null;
- this.typeNameRanges = null;
- this.typeDepth = -1;
+ String[] qualifiedParameterTypes = method.getParameterTypes();
+ String[] unqualifiedParameterTypes = new String[qualifiedParameterTypes.length];
+ for (int i = 0; i < qualifiedParameterTypes.length; i++) {
+ StringBuffer unqualifiedName= new StringBuffer();
+ String qualifiedName= qualifiedParameterTypes[i];
+ int count = 0;
+ while (qualifiedName.charAt(count) == Signature.C_ARRAY) {
+ unqualifiedName.append(Signature.C_ARRAY);
+ ++count;
+ }
+ if (qualifiedName.charAt(count) == Signature.C_RESOLVED) {
+ unqualifiedName.append(Signature.C_UNRESOLVED);
+ unqualifiedName.append(Signature.getSimpleName(qualifiedName));
+ } else {
+ unqualifiedName.append(qualifiedName.substring(count, qualifiedName.length()));
}
+ unqualifiedParameterTypes[i]= unqualifiedName.toString();
}
-
- /**
- * Returns the contents of the specified zip entry
- */
- protected byte[] readEntry(ZipFile zip, ZipEntry entry) {
- InputStream stream = null;
- try {
- stream = zip.getInputStream(entry);
- int remaining = (int) entry.getSize();
- byte[] bytes = new byte[remaining];
- int offset = 0;
- while (remaining > 0) {
- int read = stream.read(bytes, offset, remaining);
- if (read == -1)
- break;
- remaining -= read;
- offset += read;
- }
- return bytes;
- } catch (IOException e) {
- return null;
- } catch (ArrayIndexOutOfBoundsException e) {
+ return ((IType) method.getParent()).getMethod(method.getElementName(), unqualifiedParameterTypes);
+}
+/**
+ * Returns the <code>ZipFile</code> that source is located in.
+ */
+public ZipFile getZip() throws CoreException {
+ return fJavaModel.fgJavaModelManager.getZipFile(fZipPath);
+}
+/**
+ * Maps the given source code to the given binary type and its children.
+ */
+public void mapSource(IType type, char[] contents) {
+ this.mapSource(type, contents, null);
+}
+/**
+ * Maps the given source code to the given binary type and its children.
+ * If a non-null java element is passed, finds the name range for the
+ * given java element without storing it.
+ */
+public ISourceRange mapSource(IType type, char[] contents, IJavaElement searchedElement) {
+ fType= (BinaryType)type;
+
+ this.searchedElement = searchedElement;
+ this.types = new IType[1];
+ this.typeDeclarationStarts = new int[1];
+ this.typeNameRanges = new SourceRange[1];
+ this.typeDepth = -1;
+
+ Hashtable oldSourceRanges = (Hashtable)fSourceRanges.clone();
+ try {
+ IProblemFactory factory= new DefaultProblemFactory();
+ SourceElementParser parser = new SourceElementParser(this, factory);
+ parser.parseCompilationUnit(new BasicCompilationUnit(contents, type.getElementName() + ".java"/*nonNLS*/), false);
+ if (searchedElement != null) {
+ ISourceRange range = this.getNameRange(searchedElement);
+ return range;
+ } else {
return null;
- } finally {
- if (stream != null) {
- try {
- stream.close();
- } catch (IOException ioe) {
- }
- }
}
+ } finally {
+ if (searchedElement != null) {
+ fSourceRanges = oldSourceRanges;
+ }
+ fType= null;
+ this.searchedElement = null;
+ this.types = null;
+ this.typeDeclarationStarts = null;
+ this.typeNameRanges = null;
+ this.typeDepth = -1;
}
-
- /**
- * Sets the mapping for this element to its source ranges for its source range
- * and name range.
- *
- * @see fSourceRanges
- */
- protected void setSourceRange(
- IJavaElement element,
- SourceRange sourceRange,
- SourceRange nameRange) {
- fSourceRanges.put(element, new SourceRange[] { sourceRange, nameRange });
- }
-
- /**
- * Return a char[][] array containing the imports of the attached source for the fType binary
- */
- public char[][] getImports(BinaryType type) {
- char[][] imports = (char[][]) this.importsTable.get(type);
- if (imports != null) {
- int importsCounter = ((Integer) this.importsCounterTable.get(type)).intValue();
- if (imports.length != importsCounter) {
- System.arraycopy(
- imports,
- 0,
- (imports = new char[importsCounter][]),
- 0,
- importsCounter);
+}
+/**
+ * Returns the contents of the specified zip entry
+ */
+protected byte[] readEntry(ZipFile zip, ZipEntry entry) {
+ InputStream stream = null;
+ try {
+ stream = zip.getInputStream(entry);
+ int remaining = (int) entry.getSize();
+ byte[] bytes = new byte[remaining];
+ int offset = 0;
+ while (remaining > 0) {
+ int read = stream.read(bytes, offset, remaining);
+ if (read == -1)
+ break;
+ remaining -= read;
+ offset += read;
+ }
+ return bytes;
+ } catch (IOException e) {
+ return null;
+ } catch (ArrayIndexOutOfBoundsException e) {
+ return null;
+ } finally {
+ if (stream != null) {
+ try {
+ stream.close();
+ } catch (IOException ioe) {
}
}
- this.importsTable.put(type, imports);
- return imports;
}
-} \ No newline at end of file
+}
+/**
+ * Sets the mapping for this element to its source ranges for its source range
+ * and name range.
+ *
+ * @see fSourceRanges
+ */
+protected void setSourceRange(IJavaElement element, SourceRange sourceRange, SourceRange nameRange) {
+ fSourceRanges.put(element, new SourceRange[] {sourceRange, nameRange});
+}
+}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java
index d8cad208ed..e522c94da0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java
@@ -145,7 +145,7 @@ public String readableName() {
for (int i = 0; i < length; i++) {
buffer.append(Signature.toString(parameterTypes[i]));
if (i < length - 1) {
- buffer.append(", "); //$NON-NLS-1$
+ buffer.append(", "/*nonNLS*/);
}
}
}
@@ -192,11 +192,11 @@ protected boolean signatureEquals(IDOMMethod method) throws JavaModelException {
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
if (info == null) {
buffer.append(getElementName());
- buffer.append(" (not open)"); //$NON-NLS-1$
+ buffer.append(" (not open)"/*nonNLS*/);
} else {
try {
if (Flags.isStatic(this.getFlags())) {
- buffer.append("static "); //$NON-NLS-1$
+ buffer.append("static "/*nonNLS*/);
}
if (!this.isConstructor()) {
buffer.append(Signature.toString(this.getReturnType()));
@@ -210,13 +210,13 @@ protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
for (int i = 0; i < length; i++) {
buffer.append(Signature.toString(parameterTypes[i]));
if (i < length - 1) {
- buffer.append(", "); //$NON-NLS-1$
+ buffer.append(", "/*nonNLS*/);
}
}
}
buffer.append(')');
} catch (JavaModelException e) {
- buffer.append("<JavaModelException in toString of " + getElementName()); //$NON-NLS-1$
+ buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRange.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRange.java
index 22ad270995..e0aa4054a3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRange.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRange.java
@@ -33,11 +33,11 @@ public int getOffset() {
}
public String toString() {
StringBuffer buffer = new StringBuffer();
- buffer.append("[offset="); //$NON-NLS-1$
+ buffer.append("[offset="/*nonNLS*/);
buffer.append(this.offset);
- buffer.append(", length="); //$NON-NLS-1$
+ buffer.append(", length="/*nonNLS*/);
buffer.append(this.length);
- buffer.append("]"); //$NON-NLS-1$
+ buffer.append("]"/*nonNLS*/);
return buffer.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRefElement.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRefElement.java
index c1ee0d573b..c0f0f428ab 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRefElement.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceRefElement.java
@@ -23,7 +23,7 @@ protected SourceRefElement(int type, IJavaElement parent, String name) {
*/
public void copy(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {
if (container == null) {
- throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));
}
IJavaElement[] elements= new IJavaElement[] {this};
IJavaElement[] containers= new IJavaElement[] {container};
@@ -104,7 +104,7 @@ public IResource getUnderlyingResource() throws JavaModelException {
*/
public void move(IJavaElement container, IJavaElement sibling, String rename, boolean force, IProgressMonitor monitor) throws JavaModelException {
if (container == null) {
- throw new IllegalArgumentException(Util.bind("operation.nullContainer")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("operation.nullContainer"/*nonNLS*/));
}
IJavaElement[] elements= new IJavaElement[] {this};
IJavaElement[] containers= new IJavaElement[] {container};
@@ -163,7 +163,7 @@ public void offsetSourceRange(int amount) {
*/
public void rename(String name, boolean force, IProgressMonitor monitor) throws JavaModelException {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));
}
IJavaElement[] elements= new IJavaElement[] {this};
IJavaElement[] dests= new IJavaElement[] {this.getParent()};
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java
index e94abc998c..3fffc3fa6f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceType.java
@@ -263,7 +263,7 @@ public ITypeHierarchy newTypeHierarchy(IProgressMonitor monitor) throws JavaMode
*/
public ITypeHierarchy newTypeHierarchy(IJavaProject project, IProgressMonitor monitor) throws JavaModelException {
if (project == null) {
- throw new IllegalArgumentException(Util.bind("hierarchy.nullProject")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("hierarchy.nullProject"/*nonNLS*/));
}
CreateTypeHierarchyOperation op= new CreateTypeHierarchyOperation(
@@ -306,7 +306,7 @@ public ITypeHierarchy newTypeHierarchy(IJavaProject project, IProgressMonitor mo
}
TypeResolveRequestor requestor = new TypeResolveRequestor();
SelectionEngine engine =
- new SelectionEngine(environment, requestor, JavaModelManager.getOptions());
+ new SelectionEngine(environment, requestor, JavaModelManager.convertConfigurableOptions(JavaCore.getOptions()));
engine.selectType(info, typeName.toCharArray());
return requestor.answers;
@@ -317,17 +317,17 @@ public ITypeHierarchy newTypeHierarchy(IJavaProject project, IProgressMonitor mo
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
if (info == null) {
buffer.append(this.getElementName());
- buffer.append(" (not open)"); //$NON-NLS-1$
+ buffer.append(" (not open)"/*nonNLS*/);
} else {
try {
if (this.isInterface()) {
- buffer.append("interface "); //$NON-NLS-1$
+ buffer.append("interface "/*nonNLS*/);
} else {
- buffer.append("class "); //$NON-NLS-1$
+ buffer.append("class "/*nonNLS*/);
}
buffer.append(this.getElementName());
} catch (JavaModelException e) {
- buffer.append("<JavaModelException in toString of " + getElementName()); //$NON-NLS-1$
+ buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeVector.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeVector.java
index bc8facf788..11c365754f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeVector.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/TypeVector.java
@@ -89,12 +89,12 @@ public void removeAll() {
size = 0;
}
public String toString() {
- StringBuffer buffer = new StringBuffer("["); //$NON-NLS-1$
+ StringBuffer buffer = new StringBuffer("["/*nonNLS*/);
for (int i = 0; i < size; i++) {
- buffer.append("\n"); //$NON-NLS-1$
+ buffer.append("\n"/*nonNLS*/);
buffer.append(elements[i]);
}
- buffer.append("\n]"); //$NON-NLS-1$
+ buffer.append("\n]"/*nonNLS*/);
return buffer.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Util.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Util.java
index 179bd21717..4c39fff104 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Util.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Util.java
@@ -42,16 +42,16 @@ public class Util {
/* Bundle containing messages */
protected static ResourceBundle bundle;
- private final static String bundleName = "org.eclipse.jdt.internal.core.Messages"; //$NON-NLS-1$
+ private final static String bundleName = "org.eclipse.jdt.internal.core.Messages"/*nonNLS*/;
- public final static char[] SUFFIX_class = ".class".toCharArray(); //$NON-NLS-1$
- public final static char[] SUFFIX_CLASS = ".CLASS".toCharArray(); //$NON-NLS-1$
- public final static char[] SUFFIX_java = ".java".toCharArray(); //$NON-NLS-1$
- public final static char[] SUFFIX_JAVA = ".JAVA".toCharArray(); //$NON-NLS-1$
+ public final static char[] SUFFIX_class = ".class"/*nonNLS*/.toCharArray();
+ public final static char[] SUFFIX_CLASS = ".CLASS"/*nonNLS*/.toCharArray();
+ public final static char[] SUFFIX_java = ".java"/*nonNLS*/.toCharArray();
+ public final static char[] SUFFIX_JAVA = ".JAVA"/*nonNLS*/.toCharArray();
static {
- String ver = System.getProperty("java.version"); //$NON-NLS-1$
- JDK1_1 = ((ver != null) && ver.startsWith("1.1")); //$NON-NLS-1$
+ String ver = System.getProperty("java.version"/*nonNLS*/);
+ JDK1_1 = ((ver != null) && ver.startsWith("1.1"/*nonNLS*/));
relocalize();
}
/**
@@ -155,8 +155,8 @@ public static int compare(char[] v1, char[] v2) {
* @see concat(String, String)
*/
public static String concat(String s1, char c, String s2) {
- if (s1 == null) s1 = "null"; //$NON-NLS-1$
- if (s2 == null) s2 = "null"; //$NON-NLS-1$
+ if (s1 == null) s1 = "null"/*nonNLS*/;
+ if (s2 == null) s2 = "null"/*nonNLS*/;
int l1 = s1.length();
int l2 = s2.length();
char[] buf = new char[l1 + 1 + l2];
@@ -176,8 +176,8 @@ public static int compare(char[] v1, char[] v2) {
* String constructor copies its argument, but there's no way around this.
*/
public static String concat(String s1, String s2) {
- if (s1 == null) s1 = "null"; //$NON-NLS-1$
- if (s2 == null) s2 = "null"; //$NON-NLS-1$
+ if (s1 == null) s1 = "null"/*nonNLS*/;
+ if (s2 == null) s2 = "null"/*nonNLS*/;
int l1 = s1.length();
int l2 = s2.length();
char[] buf = new char[l1 + l2];
@@ -190,9 +190,9 @@ public static int compare(char[] v1, char[] v2) {
* @see concat(String, String)
*/
public static String concat(String s1, String s2, String s3) {
- if (s1 == null) s1 = "null"; //$NON-NLS-1$
- if (s2 == null) s2 = "null"; //$NON-NLS-1$
- if (s3 == null) s3 = "null"; //$NON-NLS-1$
+ if (s1 == null) s1 = "null"/*nonNLS*/;
+ if (s2 == null) s2 = "null"/*nonNLS*/;
+ if (s3 == null) s3 = "null"/*nonNLS*/;
int l1 = s1.length();
int l2 = s2.length();
int l3 = s3.length();
@@ -772,14 +772,14 @@ public static String bind(String id) {
*/
public static String bind(String id, String[] bindings) {
if (id == null)
- return "No message available"; //$NON-NLS-1$
+ return "No message available"/*nonNLS*/;
String message = null;
try {
message = bundle.getString(id);
} catch (MissingResourceException e) {
// If we got an exception looking for the message, fail gracefully by just returning
// the id we were looking for. In most cases this is semi-informative so is not too bad.
- return "Missing message: " + id + " in: " + bundleName; //$NON-NLS-2$ //$NON-NLS-1$
+ return "Missing message: "/*nonNLS*/ + id + " in: "/*nonNLS*/ + bundleName;
}
if (bindings == null)
return message;
@@ -798,7 +798,7 @@ public static String bind(String id, String[] bindings) {
} catch (NumberFormatException nfe) {
output.append(message.substring(end + 1, start + 1));
} catch (ArrayIndexOutOfBoundsException e) {
- output.append("{missing " + Integer.toString(index) + "}"); //$NON-NLS-2$ //$NON-NLS-1$
+ output.append("{missing "/*nonNLS*/ + Integer.toString(index) + "}"/*nonNLS*/);
}
} else {
output.append(message.substring(end, length));
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/WorkingCopy.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/WorkingCopy.java
index a3e0388669..d2dde904a8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/WorkingCopy.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/WorkingCopy.java
@@ -306,7 +306,7 @@ public void restore() throws JavaModelException {
*/
protected void toString(int tab, StringBuffer buffer) {
buffer.append(this.tabString(tab));
- buffer.append("(working copy)\n"); //$NON-NLS-1$
+ buffer.append("(working copy)\n"/*nonNLS*/);
super.toString(tab, buffer);
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/DeltaKey.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/DeltaKey.java
index e2d57f388b..4810cf9d22 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/DeltaKey.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/DeltaKey.java
@@ -340,15 +340,15 @@ private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundE
public String toString () {
StringBuffer buffer = new StringBuffer();
- buffer.append("DeltaKey("); //$NON-NLS-1$
+ buffer.append("DeltaKey("/*nonNLS*/);
for (int i = 0; i < this.fLocalNames.length; i++) {
buffer.append(this.fLocalNames[i]);
if (i < this.fLocalNames.length - 1) {
- buffer.append("/"); //$NON-NLS-1$
+ buffer.append("/"/*nonNLS*/);
}
}
- buffer.append(")"); //$NON-NLS-1$
+ buffer.append(")"/*nonNLS*/);
return buffer.toString();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMemberHandle.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMemberHandle.java
index 657031b40b..3440f6455c 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMemberHandle.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMemberHandle.java
@@ -24,7 +24,7 @@ public abstract class AbstractMemberHandle extends NonStateSpecificHandleImpl im
String computeSignature(String name, IType[] parameterTypes) {
if (parameterTypes.length == 0) {
- return name + "()"; //$NON-NLS-1$
+ return name + "()"/*nonNLS*/;
}
StringBuffer sb = new StringBuffer(name);
@@ -33,7 +33,7 @@ public abstract class AbstractMemberHandle extends NonStateSpecificHandleImpl im
try {
((TypeImpl)parameterTypes[i]).appendSignature(sb, true);
} catch (ClassCastException e) {
- throw new StateSpecificException("Incompatible parameter types"); //$NON-NLS-1$
+ throw new StateSpecificException("Incompatible parameter types"/*nonNLS*/);
}
}
sb.append(')');
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMethodCollaboratorIndictment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMethodCollaboratorIndictment.java
index 59418a235e..b6c4016445 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMethodCollaboratorIndictment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMethodCollaboratorIndictment.java
@@ -41,6 +41,6 @@ protected AbstractMethodCollaboratorIndictment(IType type) {
*/
public String toString() {
// don't use + with char[]
- return new StringBuffer("AbstractMethodCollaboratorIndictment(").append(fName).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$
+ return new StringBuffer("AbstractMethodCollaboratorIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractNode.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractNode.java
index 4d61463b45..bb54ba75d5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractNode.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractNode.java
@@ -119,7 +119,7 @@ try {
/* add the dependent */
fDependents[min] = nodeThatDependsOnMe;
} catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("ArrayIndexOutOfBoundsException in AbstractNode.copyAddDependent()"); //$NON-NLS-1$
+ System.out.println("ArrayIndexOutOfBoundsException in AbstractNode.copyAddDependent()"/*nonNLS*/);
}
}
/**
@@ -148,28 +148,28 @@ try {
* For debugging only.
*/
public void dump(Dumper dumper) {
- dumper.dump("element", getElement()); //$NON-NLS-1$
+ dumper.dump("element"/*nonNLS*/, getElement());
if (getKind() == JCU_NODE)
- dumper.dump("types", getTypes()); //$NON-NLS-1$
+ dumper.dump("types"/*nonNLS*/, getTypes());
Object[] dependencies = new Object[fDependencies.length];
for (int i = 0; i < fDependencies.length; ++i) {
dependencies[i] = fDependencies[i].getElement();
}
- dumper.dump("dependencies", dependencies); //$NON-NLS-1$
+ dumper.dump("dependencies"/*nonNLS*/, dependencies);
Object[] dependents = new Object[fNumDependents];
for (int i = 0; i < fDependents.length; ++i) {
dependents[i] = fDependents[i].getElement();
}
- dumper.dump("dependents", dependents); //$NON-NLS-1$
+ dumper.dump("dependents"/*nonNLS*/, dependents);
}
/**
* Make sure equality tests are never carried out on nodes
*/
public boolean equals(Object o) {
- Assert.isTrue(false, "Internal Error - Equality not defined for dependency graph nodes"); //$NON-NLS-1$
+ Assert.isTrue(false, "Internal Error - Equality not defined for dependency graph nodes"/*nonNLS*/);
return false;
}
/**
@@ -338,7 +338,7 @@ public void dump(Dumper dumper) {
for (int i = 0; i < recursionLevel; ++i)
sb.append(' ');
sb.append(this);
- sb.append(": "); //$NON-NLS-1$
+ sb.append(": "/*nonNLS*/);
sb.append(refCount);
System.out.println(sb.toString());
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ArrayTypeHandleImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ArrayTypeHandleImpl.java
index 12c57b273a..ac15d5b35f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ArrayTypeHandleImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ArrayTypeHandleImpl.java
@@ -96,7 +96,7 @@ TypeImpl getElementType() {
public String getName() {
String name = fElementType.getName();
for (int i = 0; i < fNestingDepth; i++)
- name += "[]"; //$NON-NLS-1$
+ name += "[]"/*nonNLS*/;
return name;
}
/**
@@ -111,7 +111,7 @@ int getNestingDepth() {
public String getSimpleName() {
String simpleName = fElementType.getSimpleName();
for (int i = 0; i < fNestingDepth; i++)
- simpleName += "[]"; //$NON-NLS-1$
+ simpleName += "[]"/*nonNLS*/;
return simpleName;
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/BatchImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/BatchImageBuilder.java
index 4b6e2c2b90..453d8b1799 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/BatchImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/BatchImageBuilder.java
@@ -39,6 +39,7 @@ public BatchImageBuilder(StateImpl state) {
*/
protected BatchImageBuilder(StateImpl state, ConfigurableOption[] options) {
fDC = (JavaDevelopmentContextImpl) state.getDevelopmentContext();
+ state.setCompilerOptions(options);
fCompilerOptions = options;
fNewState = state;
fWorkQueue = new WorkQueue();
@@ -53,15 +54,15 @@ public void build() {
fNotifier.begin();
try {
fNewState.readClassPath();
- fNotifier.subTask(Util.bind("build.scrubbingOutput")); //$NON-NLS-1$
+ fNotifier.subTask(Util.bind("build.scrubbingOutput"/*nonNLS*/));
fNewState.getBinaryOutput().scrubOutput();
fNotifier.updateProgressDelta(0.05f);
- fNotifier.subTask(Util.bind("build.analyzingPackages")); //$NON-NLS-1$
+ fNotifier.subTask(Util.bind("build.analyzingPackages"/*nonNLS*/));
fNewState.buildInitialPackageMap();
fNotifier.updateProgressDelta(0.05f);
/* Force build all in build context */
- fNotifier.subTask(Util.bind("build.analyzingSources")); //$NON-NLS-1$
+ fNotifier.subTask(Util.bind("build.analyzingSources"/*nonNLS*/));
IPackage[] pkgs = fNewState.getPackageMap().getAllPackagesAsArray();
for (int i = 0; i < pkgs.length; ++i) {
fNotifier.checkCancel();
@@ -104,13 +105,13 @@ public IDelta getImageDelta(IImageContext imageContext) {
public void lazyBuild(PackageElement unit) {
// String msg = "Attempt to lazy build " + unit.getPackage().getName() + "." + unit.getFileName();
// System.err.println(msg + ". " + "Lazy building has been disabled.");
- Assert.isTrue(false, "Internal Error - Lazy building has been disabled"); //$NON-NLS-1$
+ Assert.isTrue(false, "Internal Error - Lazy building has been disabled"/*nonNLS*/);
}
/**
* Returns a string describe the builder
* @see IImageBuilder
*/
public String toString() {
- return "batch image builder for:\n\tnew state: " + getNewState(); //$NON-NLS-1$
+ return "batch image builder for:\n\tnew state: "/*nonNLS*/ + getNewState();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/BuildNotifier.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/BuildNotifier.java
index 1e84777f42..fb4f4c9251 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/BuildNotifier.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/BuildNotifier.java
@@ -46,10 +46,10 @@ public BuildNotifier(JavaDevelopmentContextImpl dc, boolean isBatch) {
}
public void begin() {
if (fBuildMonitor != null) {
- fBuildMonitor.beginBuild(fIsBatch ? Util.bind("build.beginBatch") : Util.bind("build.beginIncremental")); //$NON-NLS-2$ //$NON-NLS-1$
+ fBuildMonitor.beginBuild(fIsBatch ? Util.bind("build.beginBatch"/*nonNLS*/) : Util.bind("build.beginIncremental"/*nonNLS*/));
}
if (fProgress != null) {
- fProgress.beginTask("", fTotalWork); //$NON-NLS-1$
+ fProgress.beginTask(""/*nonNLS*/, fTotalWork);
}
this.previousSubtask = null;
}
@@ -90,9 +90,9 @@ public void compiling(CompilerCompilationUnit unit) {
int start = message.indexOf('/', 1);
int end = message.lastIndexOf('/');
if (end <= start){
- message = Util.bind("build.compiling", message.substring(start+1)); //$NON-NLS-1$
+ message = Util.bind("build.compiling"/*nonNLS*/, message.substring(start+1));
} else {
- message = Util.bind("build.compilingContent", message.substring(start+1, end)); //$NON-NLS-1$
+ message = Util.bind("build.compilingContent"/*nonNLS*/, message.substring(start+1, end));
}
subTask(message);
updateProgressDelta(fProgressPerCompilationUnit/2);
@@ -100,12 +100,12 @@ public void compiling(CompilerCompilationUnit unit) {
}
public void done() {
updateProgress(1.0f);
- subTask(Util.bind("build.done")); //$NON-NLS-1$
+ subTask(Util.bind("build.done"/*nonNLS*/));
if (fProgress != null) {
fProgress.done();
}
if (fBuildMonitor != null) {
- fBuildMonitor.endBuild(fIsBatch ? Util.bind("build.endBatch") : Util.bind("build.endIncremental")); //$NON-NLS-2$ //$NON-NLS-1$
+ fBuildMonitor.endBuild(fIsBatch ? Util.bind("build.endBatch"/*nonNLS*/) : Util.bind("build.endIncremental"/*nonNLS*/));
}
this.previousSubtask = null;
}
@@ -154,16 +154,16 @@ protected String problemsMessage() {
int numNew = fNewErrorCount + fNewWarningCount;
int numFixed = fFixedErrorCount + fFixedWarningCount;
if (numNew == 0 && numFixed == 0) {
- return ""; //$NON-NLS-1$
+ return ""/*nonNLS*/;
}
if (numFixed == 0) {
- return '(' + numNew == 1 ? Util.bind("build.oneProblemFound", String.valueOf(numNew)) : Util.bind("build.problemsFound", String.valueOf(numNew)) +')'; //$NON-NLS-2$ //$NON-NLS-1$
+ return '(' + numNew == 1 ? Util.bind("build.oneProblemFound"/*nonNLS*/, String.valueOf(numNew)) : Util.bind("build.problemsFound"/*nonNLS*/, String.valueOf(numNew)) +')';
} else
if (numNew == 0) {
- return '(' + numFixed == 1 ? Util.bind("build.oneProblemFixed", String.valueOf(numFixed)) : Util.bind("build.problemsFixed", String.valueOf(numFixed)) + ')'; //$NON-NLS-2$ //$NON-NLS-1$
+ return '(' + numFixed == 1 ? Util.bind("build.oneProblemFixed"/*nonNLS*/, String.valueOf(numFixed)) : Util.bind("build.problemsFixed"/*nonNLS*/, String.valueOf(numFixed)) + ')';
} else {
- return '(' + (numFixed == 1 ? Util.bind("build.oneProblemFixed", String.valueOf(numFixed)) : Util.bind("build.problemsFixed", String.valueOf(numFixed))) //$NON-NLS-2$ //$NON-NLS-1$
- + (numNew == 1 ? Util.bind("build.oneProblemFound", String.valueOf(numNew)) : Util.bind("build.problemsFound", String.valueOf(numNew))) + ')'; //$NON-NLS-2$ //$NON-NLS-1$
+ return '(' + (numFixed == 1 ? Util.bind("build.oneProblemFixed"/*nonNLS*/, String.valueOf(numFixed)) : Util.bind("build.problemsFixed"/*nonNLS*/, String.valueOf(numFixed)))
+ + (numNew == 1 ? Util.bind("build.oneProblemFound"/*nonNLS*/, String.valueOf(numNew)) : Util.bind("build.problemsFound"/*nonNLS*/, String.valueOf(numNew))) + ')';
}
}
/**
@@ -183,7 +183,7 @@ public void setProgressPerCompilationUnit(float progress) {
}
public void subTask(String message) {
String pm = problemsMessage();
- String msg = pm.length() == 0 ? message : pm + " " + message; //$NON-NLS-1$
+ String msg = pm.length() == 0 ? message : pm + " "/*nonNLS*/ + message;
if (msg.equals(this.previousSubtask)) return; // avoid refreshing with same one
if (DEBUG) System.out.println(msg);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ClassOrInterfaceHandleImplSWH.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ClassOrInterfaceHandleImplSWH.java
index d4dadea883..6f5d52fc72 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ClassOrInterfaceHandleImplSWH.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ClassOrInterfaceHandleImplSWH.java
@@ -206,7 +206,7 @@ public int getDeclaredModifiers() throws NotPresentException {
public String getDeclaredName() throws NotPresentException {
if (isAnonymous()) {
- return ""; //$NON-NLS-1$
+ return ""/*nonNLS*/;
}
String name = fHandle.getSimpleName();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/CompilerCompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/CompilerCompilationUnit.java
index a56bd4af4c..37a55091c4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/CompilerCompilationUnit.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/CompilerCompilationUnit.java
@@ -64,6 +64,6 @@ public SourceEntry getSourceEntry() {
}
public String toString() {
// don't use append(char[]) due to JDK1.2 problems
- return new StringBuffer("CompilationUnit(").append(getFileName()).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$
+ return new StringBuffer("CompilationUnit("/*nonNLS*/).append(getFileName()).append(")"/*nonNLS*/).toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConstructorImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConstructorImpl.java
index fe2ac0be92..260240acea 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConstructorImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConstructorImpl.java
@@ -9,7 +9,7 @@ import org.eclipse.jdt.internal.core.builder.*;
public class ConstructorImpl extends AbstractMemberHandle implements IConstructor {
ConstructorImpl (ClassOrInterfaceHandleImpl owner, IType[] paramTypes) {
fOwner = owner;
- fSignature = computeSignature("", paramTypes); //$NON-NLS-1$
+ fSignature = computeSignature(""/*nonNLS*/, paramTypes);
}
public ConstructorImpl(ClassOrInterfaceHandleImpl owner, String signature) {
fOwner = owner;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConvertedCompilationResult.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConvertedCompilationResult.java
index e2afe9c68c..d023e60cd2 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConvertedCompilationResult.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConvertedCompilationResult.java
@@ -38,6 +38,6 @@ ConvertedCompilationResult(
return fTypes;
}
public String toString() {
- return (fProblems.length == 0 ? "" : "*") + "ConvertedCompilationResult(" + fPackageElement + ")"; //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-4$
+ return (fProblems.length == 0 ? ""/*nonNLS*/ : "*"/*nonNLS*/) + "ConvertedCompilationResult("/*nonNLS*/ + fPackageElement + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DeltaImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DeltaImpl.java
index 7d0040a654..5407ba1f24 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DeltaImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DeltaImpl.java
@@ -28,17 +28,17 @@ class DeltaImpl implements IDelta {
protected IImageContext fContext;
/* names for checklist items */
- public static final String fgImage = "Image"; //$NON-NLS-1$
+ public static final String fgImage = "Image"/*nonNLS*/;
- public static final String fgPackageCategory = "Packages"; //$NON-NLS-1$
- public static final String fgTypeCategory = "Types"; //$NON-NLS-1$
- public static final String fgBinaryCategory = "Binaries"; //$NON-NLS-1$
- public static final String fgMethodCategory = "Methods"; //$NON-NLS-1$
+ public static final String fgPackageCategory = "Packages"/*nonNLS*/;
+ public static final String fgTypeCategory = "Types"/*nonNLS*/;
+ public static final String fgBinaryCategory = "Binaries"/*nonNLS*/;
+ public static final String fgMethodCategory = "Methods"/*nonNLS*/;
- public static final String fgPackage = "Package"; //$NON-NLS-1$
- public static final String fgType = "Type"; //$NON-NLS-1$
- public static final String fgBinary = "Binary"; //$NON-NLS-1$
- public static final String fgMethod = "Method"; //$NON-NLS-1$
+ public static final String fgPackage = "Package"/*nonNLS*/;
+ public static final String fgType = "Type"/*nonNLS*/;
+ public static final String fgBinary = "Binary"/*nonNLS*/;
+ public static final String fgMethod = "Method"/*nonNLS*/;
/* convenience structure for delta calculation process */
class DeltaInfo {
@@ -99,7 +99,7 @@ class DeltaImpl implements IDelta {
fNewState = (StateImpl)newState;
fOldState = (StateImpl)oldState;
} catch (ClassCastException cce) {
- Assert.isTrue(false, "Internal Error - Invalid states"); //$NON-NLS-1$
+ Assert.isTrue(false, "Internal Error - Invalid states"/*nonNLS*/);
}
fStatus = CHANGED;
fName = fgImage;
@@ -200,7 +200,7 @@ protected int compareBuilderType(BuilderType type) {
*/
public int compareTo(IDelta anotherDelta) {
/* is this used? */
- Assert.isTrue(false, "TBD"); //$NON-NLS-1$
+ Assert.isTrue(false, "TBD"/*nonNLS*/);
return 0;
}
/**
@@ -606,7 +606,7 @@ protected int compareTypes(IType handle) {
}
protected static void dump(IDelta delta, int depth) {
for (int i = 0; i < depth; ++i)
- System.out.print(" "); //$NON-NLS-1$
+ System.out.print(" "/*nonNLS*/);
System.out.println(delta);
IDelta[] children = delta.getAffectedSubdeltas();
for (int i = 0; i < children.length; ++i) {
@@ -893,23 +893,23 @@ public Enumeration getAffectedPackages() {
* @return java.lang.String
*/
public String toString() {
- StringBuffer sb = new StringBuffer("DeltaImpl("); //$NON-NLS-1$
+ StringBuffer sb = new StringBuffer("DeltaImpl("/*nonNLS*/);
switch (fStatus) {
- case ADDED: sb.append("+"); //$NON-NLS-1$
+ case ADDED: sb.append("+"/*nonNLS*/);
break;
- case REMOVED: sb.append("-"); //$NON-NLS-1$
+ case REMOVED: sb.append("-"/*nonNLS*/);
break;
- case CHANGED: sb.append("*"); //$NON-NLS-1$
+ case CHANGED: sb.append("*"/*nonNLS*/);
break;
- case SAME: sb.append("="); //$NON-NLS-1$
+ case SAME: sb.append("="/*nonNLS*/);
break;
- case UNKNOWN: sb.append("?"); //$NON-NLS-1$
+ case UNKNOWN: sb.append("?"/*nonNLS*/);
break;
- default: sb.append("(ERROR)"); //$NON-NLS-1$
+ default: sb.append("(ERROR)"/*nonNLS*/);
}
if (fKey.isRoot()) {
sb.append(fOldState);
- sb.append("-->"); //$NON-NLS-1$
+ sb.append("-->"/*nonNLS*/);
sb.append(fNewState);
}
else {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DependencyGraph.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DependencyGraph.java
index 2ffce7be21..feeaac13a6 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DependencyGraph.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DependencyGraph.java
@@ -106,7 +106,7 @@ public void add(PackageElement resultUnit, IType[] types, Vector vDependencies)
}
catch (CloneNotSupportedException e) {
// Should not happen since we implement Cloneable
- Assert.isTrue(false, "Unexpected clone exception in DependencyGraph.clone()"); //$NON-NLS-1$
+ Assert.isTrue(false, "Unexpected clone exception in DependencyGraph.clone()"/*nonNLS*/);
return null;
}
}
@@ -186,7 +186,7 @@ public void add(PackageElement resultUnit, IType[] types, Vector vDependencies)
value = fZips.remove(((ZipNode)toRemove).getZipFile());
break;
default:
- Assert.isTrue(false, "Attempt to delete unknown node type from dependency graph"); //$NON-NLS-1$
+ Assert.isTrue(false, "Attempt to delete unknown node type from dependency graph"/*nonNLS*/);
}
return (INode)value;
}
@@ -194,7 +194,7 @@ public void add(PackageElement resultUnit, IType[] types, Vector vDependencies)
* For debugging only. Dump the graph in readable form.
*/
public void dump(Dumper dumper) {
- dumper.dumpMessage("Namespaces", ""); //$NON-NLS-2$ //$NON-NLS-1$
+ dumper.dumpMessage("Namespaces"/*nonNLS*/, ""/*nonNLS*/);
dumper.indent();
for (Enumeration e = fNamespaces.elements(); e.hasMoreElements();) {
AbstractNode node = (AbstractNode) e.nextElement();
@@ -202,7 +202,7 @@ public void dump(Dumper dumper) {
}
dumper.outdent();
- dumper.dumpMessage("JCUs", ""); //$NON-NLS-2$ //$NON-NLS-1$
+ dumper.dumpMessage("JCUs"/*nonNLS*/, ""/*nonNLS*/);
dumper.indent();
for (Enumeration e = fCompilationUnits.elements(); e.hasMoreElements();) {
AbstractNode node = (AbstractNode) e.nextElement();
@@ -210,7 +210,7 @@ public void dump(Dumper dumper) {
}
dumper.outdent();
- dumper.dumpMessage("ZIPs", ""); //$NON-NLS-2$ //$NON-NLS-1$
+ dumper.dumpMessage("ZIPs"/*nonNLS*/, ""/*nonNLS*/);
dumper.indent();
for (Enumeration e = fZips.elements(); e.hasMoreElements();) {
AbstractNode node = (AbstractNode) e.nextElement();
@@ -312,7 +312,7 @@ public Enumeration getJCUNodes() {
return getNodeFor((IPath)o, create);
}
else {
- Assert.isTrue(false, "Unknown kind of node"); //$NON-NLS-1$
+ Assert.isTrue(false, "Unknown kind of node"/*nonNLS*/);
return null;
}
}
@@ -477,7 +477,7 @@ public Vector getUnusedNamespaceNodes() {
* For debugging only -- asserts graph integrity
*/
public void integrityCheck(Dictionary table) {
- String msg = "Internal Error: the dependency graph is corrupt, do a full build to workaround error"; //$NON-NLS-1$
+ String msg = "Internal Error: the dependency graph is corrupt, do a full build to workaround error"/*nonNLS*/;
for (Enumeration e = table.elements(); e.hasMoreElements();) {
AbstractNode node = (AbstractNode) e.nextElement();
@@ -564,6 +564,6 @@ public void removePackage(IPackage pkg) {
return fNamespaces.size() + fTypes.size() + fCompilationUnits.size();
}
public String toString() {
- return "a DependencyGraph"; //$NON-NLS-1$
+ return "a DependencyGraph"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldCollaboratorIndictment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldCollaboratorIndictment.java
index a838444518..9f30f029a4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldCollaboratorIndictment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldCollaboratorIndictment.java
@@ -24,6 +24,6 @@ protected FieldCollaboratorIndictment(char[] name) {
*/
public String toString() {
// don't use + with char[]
- return new StringBuffer("FieldIndictment(").append(fName).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$
+ return new StringBuffer("FieldIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldImpl.java
index f5bbc14bfa..c2762ae8c0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldImpl.java
@@ -44,6 +44,6 @@ public IHandle inState(IState s) throws org.eclipse.jdt.internal.core.builder.St
* toString method comment.
*/
public String toString() {
- return getDeclaringClass().getName() + "." + getName(); //$NON-NLS-1$
+ return getDeclaringClass().getName() + "."/*nonNLS*/ + getName();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageBuilderInternalException.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageBuilderInternalException.java
index 0f16b2f909..3c67b9ee96 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageBuilderInternalException.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageBuilderInternalException.java
@@ -40,7 +40,7 @@ public Throwable getThrowable() {
public void printStackTrace() {
if (fThrowable != null) {
System.err.println(this);
- System.err.println("Stack trace of embedded throwable:"); //$NON-NLS-1$
+ System.err.println("Stack trace of embedded throwable:"/*nonNLS*/);
fThrowable.printStackTrace();
} else {
super.printStackTrace();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageContextImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageContextImpl.java
index 5a4fd511a0..210df5cc37 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageContextImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageContextImpl.java
@@ -88,9 +88,9 @@ public class ImageContextImpl implements IImageContext {
* purposes only.
*/
public String toString() {
- StringBuffer buf = new StringBuffer("ImageContext with packages: \n"); //$NON-NLS-1$
+ StringBuffer buf = new StringBuffer("ImageContext with packages: \n"/*nonNLS*/);
for (int i = 0; i < fPackages.length; i++)
- buf.append(" " + fPackages[i].getName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
+ buf.append(" "/*nonNLS*/ + fPackages[i].getName() + "\n"/*nonNLS*/);
return buf.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageImpl.java
index 41a3091b13..1bf30c241f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageImpl.java
@@ -199,7 +199,7 @@ public org.eclipse.jdt.internal.core.builder.IType shortType() {
* Returns a string representation of the image handle.
*/
public String toString() {
- return "image"; //$NON-NLS-1$
+ return "image"/*nonNLS*/;
}
/**
* Returns the Type representing the primitive type void
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageImplSWH.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageImplSWH.java
index 6c8569537e..1d35cebf32 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageImplSWH.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ImageImplSWH.java
@@ -114,7 +114,7 @@ public IType[] getAllClasses(IImageContext context) {
Vector vResult = new Vector();
// try {
String extension = path.getFileExtension().toLowerCase();
- if (extension.equals("java") || extension.equals("class")) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (extension.equals("java"/*nonNLS*/) || extension.equals("class"/*nonNLS*/)) {
IPath pkgPath = path.removeLastSegments(1);
IPackage pkg = fState.getPathMap().packageHandleFromPath(pkgPath);
TypeStructureEntry[] tsEntries = fState.getAllTypesForPackage(pkg);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/IncrementalImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/IncrementalImageBuilder.java
index 398878fa64..224ee43ae6 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/IncrementalImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/IncrementalImageBuilder.java
@@ -155,7 +155,7 @@ protected void addChangedFileNamesFromChangedPackage(IResourceDelta pkgDelta, Ha
IPath path = elementDelta.getFullPath();
String extension = path.getFileExtension();
if (extension != null) {
- if (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class")) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/)) {
SourceEntry entry = new SourceEntry(path, null, null);
PackageElement element = new PackageElement(pkg, entry);
pkgTable.put(entry.getFileName(), element);
@@ -198,16 +198,17 @@ protected void addSourceElement(SourceEntry newEntry) {
public void applySourceDelta(Hashtable deltas) {
fNotifier = new BuildNotifier(fDC, false);
fNotifier.begin();
- fNotifier.subTask(Util.bind("build.preparingBuild")); //$NON-NLS-1$
+ fNotifier.subTask(Util.bind("build.preparingBuild"/*nonNLS*/));
fSourceDeltas = deltas;
fNewState = fOldState.copy(fNewProject, fImageContext);
// options might have changed since last builder run, thus refresh them
- fCompilerOptions = JavaModelManager.getOptions();
+ fCompilerOptions = JavaModelManager.convertConfigurableOptions(JavaCore.getOptions());
+ fNewState.setCompilerOptions(fCompilerOptions);
try {
/* find out what has changed at the package level */
- fNotifier.subTask(Util.bind("build.analyzingPackages")); //$NON-NLS-1$
+ fNotifier.subTask(Util.bind("build.analyzingPackages"/*nonNLS*/));
computeAllPackages();
checkCancel();
@@ -235,7 +236,7 @@ public void applySourceDelta(Hashtable deltas) {
}
/* find out what has changed at the package element level */
- fNotifier.subTask(Util.bind("build.analyzingSources")); //$NON-NLS-1$
+ fNotifier.subTask(Util.bind("build.analyzingSources"/*nonNLS*/));
computeAllClasses();
checkCancel();
@@ -559,7 +560,7 @@ protected void computeAllPackages(IResourceDelta delta, IPackageFragmentRoot[] o
for (int i = 0; i < oldRoots.length; i++) {
rootResource = null;
try {
- rootResource = oldRoots[i].getUnderlyingResource();
+ oldRoots[i].getUnderlyingResource();
} catch (JavaModelException e) {
}
if (rootResource != null && rootResource.getFullPath().isPrefixOf(path)) {
@@ -581,8 +582,8 @@ protected void computeAllPackages(IResourceDelta delta, IPackageFragmentRoot[] o
for (int i = 0; i < children.length; ++i) {
String extension = children[i].getFullPath().getFileExtension();
if (extension == null
- || extension.equalsIgnoreCase("zip") //$NON-NLS-1$
- || extension.equalsIgnoreCase("jar")) { //$NON-NLS-1$
+ || extension.equalsIgnoreCase("zip"/*nonNLS*/)
+ || extension.equalsIgnoreCase("jar"/*nonNLS*/)) {
// TBD: Currently rely on empty extension indicating folder
computeAllPackages(children[i], oldRoots, newRoots);
}
@@ -627,7 +628,7 @@ protected void computeNamespaceChanges() {
// Process added packages
for (Enumeration addedPkgs = fAddedPackageHandles.elements(); addedPkgs.hasMoreElements();) {
IPackage pkg = (IPackage) addedPkgs.nextElement();
- fNotifier.subTask(Util.bind("build.analyzing", PackageImpl.readableName(pkg))); //$NON-NLS-1$
+ fNotifier.subTask(Util.bind("build.analyzing"/*nonNLS*/, PackageImpl.readableName(pkg)));
// Mark all dependents of missing namespace as needing compile.
markDependentsAsNeedingCompile(pkg);
@@ -642,7 +643,7 @@ protected void computeNamespaceChanges() {
// Process removed packages
for (Enumeration removedPkgs = fRemovedPackageHandles.elements(); removedPkgs.hasMoreElements();) {
IPackage pkg = (IPackage) removedPkgs.nextElement();
- fNotifier.subTask(Util.bind("build.analyzing", PackageImpl.readableName(pkg))); //$NON-NLS-1$
+ fNotifier.subTask(Util.bind("build.analyzing"/*nonNLS*/, PackageImpl.readableName(pkg)));
// Mark all dependents of namespace as needing compile.
markDependentsAsNeedingCompile(pkg);
@@ -657,7 +658,7 @@ protected void computeNamespaceChanges() {
// Process changed packages
for (Enumeration changedPkgs = fChangedPackageHandles.elements(); changedPkgs.hasMoreElements();) {
IPackage pkg = (IPackage) changedPkgs.nextElement();
- fNotifier.subTask(Util.bind("build.analyzing", PackageImpl.readableName(pkg))); //$NON-NLS-1$
+ fNotifier.subTask(Util.bind("build.analyzing"/*nonNLS*/, PackageImpl.readableName(pkg)));
computeNamespaceChanges(pkg);
fNotifier.updateProgressDelta(progressDelta);
fNotifier.checkCancel();
@@ -670,7 +671,7 @@ protected void computeNamespaceChanges(Hashtable oldTSEntries, String parentType
String typeName = type.getElementName();
if (parentTypeName != null) {
int len = parentTypeName.length() + typeName.length() + 1;
- typeName = new StringBuffer(len).append(parentTypeName).append("$").append(typeName).toString(); //$NON-NLS-1$
+ typeName = new StringBuffer(len).append(parentTypeName).append("$"/*nonNLS*/).append(typeName).toString();
}
/* Remove it so that only non-matching ones remain in the table. */
TypeStructureEntry tsEntry = (TypeStructureEntry) oldTSEntries.remove(typeName);
@@ -913,7 +914,7 @@ static void dump(IResourceDelta delta) {
StringBuffer sb = new StringBuffer();
IPath path = delta.getFullPath();
for (int i = path.segmentCount(); --i > 0;) {
- sb.append(" "); //$NON-NLS-1$
+ sb.append(" "/*nonNLS*/);
}
switch (delta.getKind()) {
case IResourceDelta.ADDED:
@@ -1047,7 +1048,7 @@ protected Dictionary getSourceChanges(IPackage pkgHandle) {
/* skip non-java resources */
String extension = path.getFileExtension();
- if (extension != null && (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (extension != null && (extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/))) {
set.put(path, path);
}
}
@@ -1071,7 +1072,7 @@ protected boolean hasPackageMapChanges() {
IResourceDelta changed = (IResourceDelta) e.nextElement();
String extension = changed.getFullPath().getFileExtension();
if (extension != null) {
- if (extension.equalsIgnoreCase("zip") || extension.equalsIgnoreCase("jar")) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (extension.equalsIgnoreCase("zip"/*nonNLS*/) || extension.equalsIgnoreCase("jar"/*nonNLS*/)) {
return true;
}
}
@@ -1126,7 +1127,7 @@ protected boolean hasSourceEntryChanges(IPackage pkgHandle) {
/* skip java resources */
String extension = path.getFileExtension();
if (extension != null) {
- if ((extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ if ((extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/))) {
/* if there is an added or removed jcu or binary, the source entries have changed */
int status = fileDeltas[j].getKind();
if (status == IResourceDelta.ADDED || status == IResourceDelta.REMOVED) {
@@ -1422,7 +1423,7 @@ protected void sort(PackageElement[] compileArray) {
* @see IImageBuilder
*/
public String toString() {
- return "incremental image builder for:\n" + "\tnew state: " + getNewState() + "\n" + "\told state: " + getOldState(); //$NON-NLS-1$ //$NON-NLS-4$ //$NON-NLS-2$ //$NON-NLS-3$
+ return "incremental image builder for:\n"/*nonNLS*/ + "\tnew state: "/*nonNLS*/ + getNewState() + "\n"/*nonNLS*/ + "\told state: "/*nonNLS*/ + getOldState();
}
/**
* If this type is a subtype is the originator of an abstract method
@@ -1633,7 +1634,7 @@ protected boolean tryZeroArgConstructorInSuperclass(PackageElement unit, Indictm
for (int i = 0; i < types.length; ++i) {
IType superclass = getBuilderType(types[i]).getSuperclass();
if (superclass != null) {
- String key = '<' + superclass.getDeclaredName() + ">/0"; //$NON-NLS-1$
+ String key = '<' + superclass.getDeclaredName() + ">/0"/*nonNLS*/;
if (indictments.tryMethodEvidence(key.toCharArray())) {
return true;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/IndictmentSet.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/IndictmentSet.java
index c37effa7b2..b9040e53ca 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/IndictmentSet.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/IndictmentSet.java
@@ -56,7 +56,7 @@ public class IndictmentSet {
fMethodOwners = new Hashtable(11);
fMethodOwners.put(owner, owner);
fMethodOwnersArray = null;
- if (i.getName().startsWith("<")) { //$NON-NLS-1$
+ if (i.getName().startsWith("<"/*nonNLS*/)) {
fHasConstructorIndictments = true;
}
break;
@@ -71,7 +71,7 @@ public class IndictmentSet {
fAbstractMethodTable.put(i.getKey(), i);
break;
default:
- Assert.isTrue(false, "Internal Error - Unexpected kind of indictment"); //$NON-NLS-1$
+ Assert.isTrue(false, "Internal Error - Unexpected kind of indictment"/*nonNLS*/);
break;
}
}
@@ -161,13 +161,13 @@ public void convictAll() {
*/
public String toString() {
return
- "IndictmentSet(" //$NON-NLS-1$
- + "\n hierarchyChange: " + fHierarchyChange //$NON-NLS-1$
- + "\n types:\n" + fTypesTable //$NON-NLS-1$
- + "\n interfaces:\n" + fAbstractMethodTable //$NON-NLS-1$
- + "\n methods:\n" + fMethodsTable //$NON-NLS-1$
- + "\n fields:\n" + fFieldsTable //$NON-NLS-1$
- + "\n)"; //$NON-NLS-1$
+ "IndictmentSet("/*nonNLS*/
+ + "\n hierarchyChange: "/*nonNLS*/ + fHierarchyChange
+ + "\n types:\n"/*nonNLS*/ + fTypesTable
+ + "\n interfaces:\n"/*nonNLS*/ + fAbstractMethodTable
+ + "\n methods:\n"/*nonNLS*/ + fMethodsTable
+ + "\n fields:\n"/*nonNLS*/ + fFieldsTable
+ + "\n)"/*nonNLS*/;
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JCUNode.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JCUNode.java
index 3438cb221a..192d62644e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JCUNode.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JCUNode.java
@@ -86,6 +86,6 @@ public class JCUNode extends AbstractNode {
* purposes only.
*/
public String toString() {
- return "JCUNode(" + fUnit.getFileName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "JCUNode("/*nonNLS*/ + fUnit.getFileName() + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaBuilder.java
index f18efd9ed9..43dd321781 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaBuilder.java
@@ -60,7 +60,7 @@ public JavaBuilder() {
if (e.getThrowable() instanceof CoreException) {
throw (CoreException) e.getThrowable();
} else {
- throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("build.builderName"), e)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("build.builderName"/*nonNLS*/), e));
}
} catch (OperationCanceledException e) {
// Do nothing for now, and avoid propagating the exception.
@@ -74,7 +74,7 @@ public JavaBuilder() {
// forcing a full build next time.
setLastBuiltState(null);
}
- if (monitor != null) monitor.subTask(Util.bind("build.completed")); //$NON-NLS-1$
+ if (monitor != null) monitor.subTask(Util.bind("build.completed"/*nonNLS*/));
}
return getRequiredProjects(getLastBuiltState(monitor));
}
@@ -93,28 +93,28 @@ public JavaBuilder() {
Hashtable deltas = new Hashtable(11);
IProject project = getProject();
- if (monitor != null) monitor.subTask(Util.bind("build.readingDelta", project.getName())); //$NON-NLS-1$
+ if (monitor != null) monitor.subTask(Util.bind("build.readingDelta"/*nonNLS*/, project.getName()));
IResourceDelta delta = getDelta(project);
if (delta == null){
//System.out.println("Missing delta for: "+ project.getName());
- if (monitor != null) monitor.subTask(""); //$NON-NLS-1$
+ if (monitor != null) monitor.subTask(""/*nonNLS*/);
return null;
} else {
deltas.put(project, delta);
}
IProject[] prereqs = getRequiredProjects(oldState);
for (int i = 0; i < prereqs.length; ++i) {
- if (monitor != null) monitor.subTask(Util.bind("build.readingDelta", prereqs[i].getName())); //$NON-NLS-1$
+ if (monitor != null) monitor.subTask(Util.bind("build.readingDelta"/*nonNLS*/, prereqs[i].getName()));
delta = getDelta(prereqs[i]);
if (delta == null){
//System.out.println("Missing delta for: "+ prereqs[i].getName());
- if (monitor != null) monitor.subTask(""); //$NON-NLS-1$
+ if (monitor != null) monitor.subTask(""/*nonNLS*/);
return null;
} else {
deltas.put(prereqs[i], delta);
}
}
- if (monitor != null) monitor.subTask(""); //$NON-NLS-1$
+ if (monitor != null) monitor.subTask(""/*nonNLS*/);
return deltas;
}
/**
@@ -127,7 +127,7 @@ protected boolean classpathChanged(IState lastBuiltState) throws CoreException {
return !Util.equalArraysOrNull(oldRoots, newRoots);
} catch (JavaModelException e) {
throw new CoreException(
- new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("element.projectDoesNotExist", getProject().getFullPath().toString()), e)); //$NON-NLS-1$
+ new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("element.projectDoesNotExist"/*nonNLS*/, getProject().getFullPath().toString()), e));
}
}
/**
@@ -143,7 +143,7 @@ protected boolean classpathChanged(IState lastBuiltState) throws CoreException {
/* create and invoke the batch builder */
// Pass the compiler options, needed for 1FVXS80: ITPJCORE:ALL - .class files are missing their LocalVariableTable
- ConfigurableOption[] options = JavaModelManager.getOptions();
+ ConfigurableOption[] options = JavaModelManager.convertConfigurableOptions(JavaCore.getOptions());
setLastBuiltState(null); // free possible existing state
IImageBuilder builder = dc.createState(project, null, problemReporter, options);
setLastBuiltState(builder.getNewState());
@@ -237,8 +237,8 @@ protected boolean isEmpty(IResourceDelta change) {
int flags = change.getFlags();
boolean contentChanged = isChanged && (flags & IResourceDelta.CONTENT) != 0;
String extension = change.getFullPath().getFileExtension();
- boolean isJavaOrClassFile = extension != null && (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class")); //$NON-NLS-1$ //$NON-NLS-2$
- boolean isArchive = extension != null && (extension.equalsIgnoreCase("zip") || extension.equalsIgnoreCase("jar")); //$NON-NLS-1$ //$NON-NLS-2$
+ boolean isJavaOrClassFile = extension != null && (extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/));
+ boolean isArchive = extension != null && (extension.equalsIgnoreCase("zip"/*nonNLS*/) || extension.equalsIgnoreCase("jar"/*nonNLS*/));
// care about added, removed and modified (content actually modified) .java and .class files
if (isJavaOrClassFile && (isAdded || isRemoved || contentChanged))
@@ -288,7 +288,7 @@ protected boolean outputLocationChanged(IState lastBuiltState) throws CoreExcept
IPath newOutputLocation = getJavaProject().getOutputLocation();
return !oldOutputLocation.equals(newOutputLocation);
} catch (JavaModelException e) {
- throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("element.projectDoesNotExist", getProject().getFullPath().toString()), e)); //$NON-NLS-1$
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, Util.bind("element.projectDoesNotExist"/*nonNLS*/, getProject().getFullPath().toString()), e));
}
}
protected void setLastBuiltState(IState state) {
@@ -300,9 +300,9 @@ protected void setLastBuiltState(IState state) {
public String toString() {
IState lastBuiltState = getLastBuiltState(null);
if (lastBuiltState == null) {
- return "JavaBuilder(no built state)"; //$NON-NLS-1$
+ return "JavaBuilder(no built state)"/*nonNLS*/;
} else {
- return "JavaBuilder(" + lastBuiltState + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "JavaBuilder("/*nonNLS*/ + lastBuiltState + ")"/*nonNLS*/;
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaDevelopmentContextImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaDevelopmentContextImpl.java
index 118f597b18..3b894eac78 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaDevelopmentContextImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaDevelopmentContextImpl.java
@@ -18,10 +18,8 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.internal.compiler.Compiler;
import org.eclipse.jdt.internal.compiler.ConfigurableOption;
-import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.JavaModelManager;
import org.eclipse.jdt.internal.core.builder.IBinaryBroker;
import org.eclipse.jdt.internal.core.builder.IBuildListener;
import org.eclipse.jdt.internal.core.builder.IBuildMonitor;
@@ -72,12 +70,12 @@ public class JavaDevelopmentContextImpl implements IDevelopmentContext {
/**
* The default package.
*/
- private final IPackage fDefaultPackage = fImage.getPackageHandle("java.lang", false); //$NON-NLS-1$
+ private final IPackage fDefaultPackage = fImage.getPackageHandle("java.lang"/*nonNLS*/, false);
/**
* The root class handle
*/
- private final IType fRootClass = fDefaultPackage.getClassHandle("Object"); //$NON-NLS-1$
+ private final IType fRootClass = fDefaultPackage.getClassHandle("Object"/*nonNLS*/);
/**
* Primitive types
@@ -197,7 +195,7 @@ protected Vector getBuildListeners() {
}
public IState getCurrentState() throws NotPresentException {
if (fCurrentState == null) {
- throw new NotPresentException("Internal Error - No current state"); //$NON-NLS-1$
+ throw new NotPresentException("Internal Error - No current state"/*nonNLS*/);
}
return fCurrentState;
}
@@ -205,7 +203,15 @@ public IState getCurrentState() throws NotPresentException {
* Reads the default compiler options.
*/
protected static ConfigurableOption[] getDefaultCompilerOptions() {
- return JavaModelManager.getOptions();
+ ConfigurableOption[] options = Compiler.getDefaultOptions(Locale.getDefault());
+
+ /**
+ * Ugly because this requires knowledge of the compiler's
+ * internal problem representation.
+ */
+ setCompilerOption(options, 11, 1);
+ setCompilerOption(options, 12, 1);
+ return options;
}
/**
* Returns the default package handle (java.lang).
@@ -297,7 +303,7 @@ protected IType[] parameterTypesFromSignature(final String signature) {
char c = localSig.charAt(position);
if (c == 'L' || c == 'Q') {
/* its a class type */
- int endIndex = localSig.indexOf(";") + 1; //$NON-NLS-1$
+ int endIndex = localSig.indexOf(";"/*nonNLS*/) + 1;
parmType = classTypeFromName(localSig.substring(position, endIndex));
localSig = localSig.substring(endIndex);
} else {
@@ -399,7 +405,17 @@ public void setBinaryBroker(IBinaryBroker broker) {
*/
public void setBuildProgressListener(IProgressListener listener) {
}
-
+/**
+ * Sets a compiler option. This seems awkward.
+ */
+protected static void setCompilerOption(ConfigurableOption[] options, int optionID, int valueIndex) {
+ for (int i = 0; i < options.length; i++) {
+ if (options[i].getID() == optionID) {
+ options[i].setValueIndex(valueIndex);
+ return;
+ }
+ }
+}
/**
* setCurrentState method comment.
*/
@@ -413,6 +429,6 @@ public void setCurrentState(IState state) {
fProgressMonitor = monitor;
}
public String toString() {
- return "a JavaDevelopmentContextImpl(" + fCurrentState + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "a JavaDevelopmentContextImpl("/*nonNLS*/ + fCurrentState + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MarkerProblemReporter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MarkerProblemReporter.java
index 11927c5611..b98c6abf38 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MarkerProblemReporter.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MarkerProblemReporter.java
@@ -1,5 +1,5 @@
package org.eclipse.jdt.internal.core.builder.impl;
-
+
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
@@ -7,12 +7,12 @@ package org.eclipse.jdt.internal.core.builder.impl;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-
+
import org.eclipse.jdt.internal.core.builder.*;
import org.eclipse.jdt.core.*;
-
+
import java.util.*;
-
+
/**
* An <code>IProblemReporter</code> that reports problems using the <code>IMarker</code> API.
@@ -120,22 +120,21 @@ public boolean hasProblems(Object sourceID) {
protected void markerFromProblemDetail(IResource resource, IProblemDetail problem) throws CoreException {
IMarker marker = resource.createMarker(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER);
- int start = problem.getStartPos();
+
+ marker.setAttribute(IMarker.MESSAGE, problem.getMessage());
+
int sev = problem.getSeverity();
- marker.setAttributes(
- new String[]{ IMarker.MESSAGE, IMarker.SEVERITY, "ID", IMarker.CHAR_START, IMarker.CHAR_END, IMarker.LINE_NUMBER}, //$NON-NLS-1$
- new Object[]{
- problem.getMessage(),
- new Integer((sev & IProblemDetail.S_ERROR) != 0 ? IMarker.SEVERITY_ERROR : IMarker.SEVERITY_WARNING),
- new Integer(problem.getID()),
- new Integer(start),
- new Integer(problem.getEndPos() + 1),
- new Integer(problem.getLineNumber())
- });
-
+ marker.setAttribute(IMarker.SEVERITY , ((sev & IProblemDetail.S_ERROR) != 0 ? IMarker.SEVERITY_ERROR : IMarker.SEVERITY_WARNING));
if ((sev & ProblemDetailImpl.S_SYNTAX_ERROR) != 0) {
- marker.setAttribute(IJavaModelMarker.FLAGS, ProblemDetailImpl.S_SYNTAX_ERROR == 0 ? null : new Integer(ProblemDetailImpl.S_SYNTAX_ERROR));
+ setFlags(marker, ProblemDetailImpl.S_SYNTAX_ERROR);
}
+ marker.setAttribute("ID"/*nonNLS*/, new Integer(problem.getID()));
+
+ int start = problem.getStartPos();
+ marker.setAttribute(IMarker.CHAR_START, new Integer(start));
+ marker.setAttribute(IMarker.CHAR_END, new Integer(problem.getEndPos() + 1));
+ marker.setAttribute(IMarker.LINE_NUMBER, new Integer(problem.getLineNumber()));
+
// compute a user-friendly location
IJavaElement element = JavaCore.create(resource);
if (element instanceof ICompilationUnit){ // try to find a finer grain element
@@ -155,7 +154,7 @@ protected void markerFromProblemDetail(IResource resource, IProblemDetail proble
public void putProblem(Object sourceID, IProblemDetail problem) {
/* Delegate first to the backing problem table. */
fProblemTable.putProblem(sourceID, problem);
-
+
/* Now update the markers. */
IResource resource = getResource(sourceID);
if (resource != null) {
@@ -212,7 +211,7 @@ public void removeNonSyntaxErrors(Object sourceID) {
public void removeProblems(Object sourceID) {
/* Delegate first to the backing problem table. */
fProblemTable.removeProblems(sourceID);
-
+
/* Now update the markers. */
IResource resource = getResource(sourceID);
if (resource != null) {
@@ -237,13 +236,21 @@ public void removeSyntaxErrors(Object sourceID) {
removeMarkers(sourceID, true);
}
/**
+ * Sets the extra flags for the given marker.
+ */
+protected void setFlags(IMarker marker, int flags) throws CoreException {
+ // Don't take space if no extra flags.
+ marker.setAttribute(IJavaModelMarker.FLAGS, flags == 0 ? null : new Integer(flags));
+}
+
+/**
* Creates a new MarkerProblemReporter that reports problems as markers
* against the given project.
*/
public MarkerProblemReporter(IProject project, IDevelopmentContext dc) {
initialize(project, dc);
}
-
+
/**
* @see org.eclipse.jdt.internal.core.builder.IProblemReporter
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MethodCollaboratorIndictment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MethodCollaboratorIndictment.java
index bb99d279e2..4d8740ed2e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MethodCollaboratorIndictment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MethodCollaboratorIndictment.java
@@ -57,7 +57,7 @@ protected MethodCollaboratorIndictment(IType owner, char[] name, int parmCount)
* only (NON-NLS).
*/
public String toString() {
- StringBuffer buf = new StringBuffer("MethodIndictment("); //$NON-NLS-1$
+ StringBuffer buf = new StringBuffer("MethodIndictment("/*nonNLS*/);
buf.append(fName);
buf.append('/');
buf.append(fParmCount);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MethodImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MethodImpl.java
index 7864051a0b..9f37f904a1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MethodImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MethodImpl.java
@@ -61,14 +61,14 @@ public class MethodImpl extends AbstractMemberHandle implements IMethod {
* unqualified source signature format.
*/
protected String getSourceParameters() {
- String sourceSig = "("; //$NON-NLS-1$
+ String sourceSig = "("/*nonNLS*/;
/* append parameter types to signature */
IType[] parms = getParameterTypes();
for (int i = 0; i < parms.length; i++) {
sourceSig += parms[i].getSimpleName().replace('L', 'Q');
}
- sourceSig += ")"; //$NON-NLS-1$
+ sourceSig += ")"/*nonNLS*/;
return sourceSig;
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ModifiedBuilderType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ModifiedBuilderType.java
index 74aea1cb36..283589f160 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ModifiedBuilderType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ModifiedBuilderType.java
@@ -249,7 +249,7 @@ public void setNewTypeStructureEntry(TypeStructureEntry newEntry) {
* For debugging only
*/
public String toString() {
- StringBuffer buf = new StringBuffer("ModifiedBuilderType("); //$NON-NLS-1$
+ StringBuffer buf = new StringBuffer("ModifiedBuilderType("/*nonNLS*/);
return buf.append(fOldTSEntry.getType().getName()).append(')').toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NamespaceNode.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NamespaceNode.java
index 2c53ebf0c1..852058220b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NamespaceNode.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NamespaceNode.java
@@ -62,6 +62,6 @@ public class NamespaceNode extends AbstractNode {
* purposes only.
*/
public String toString() {
- return "NamespaceNode(" + fPackage.getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "NamespaceNode("/*nonNLS*/ + fPackage.getName() + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NewBuilderType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NewBuilderType.java
index aff7c6241f..1b40365c57 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NewBuilderType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NewBuilderType.java
@@ -48,6 +48,6 @@ public void setNewTypeStructureEntry(TypeStructureEntry newEntry) {
* For debugging only
*/
public String toString() {
- return "NewBuilderType(" + fNewTSEntry.getType().getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "NewBuilderType("/*nonNLS*/ + fNewTSEntry.getType().getName() + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NonStateSpecificHandleImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NonStateSpecificHandleImpl.java
index 71dde7667d..2b5be96a65 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NonStateSpecificHandleImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NonStateSpecificHandleImpl.java
@@ -9,7 +9,7 @@ import org.eclipse.jdt.internal.core.builder.*;
public abstract class NonStateSpecificHandleImpl implements IHandle {
public boolean equals(Object obj) {
- Assert.isTrue(false, "TBD"); //$NON-NLS-1$
+ Assert.isTrue(false, "TBD"/*nonNLS*/);
return false;
}
public IDevelopmentContext getDevelopmentContext() {
@@ -107,7 +107,7 @@ static IType[] nonStateSpecific(IType[] stateSpecific) {
return result;
}
public String toString() {
- Assert.isTrue(false, "TBD"); //$NON-NLS-1$
+ Assert.isTrue(false, "TBD"/*nonNLS*/);
return null;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/OldBuilderType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/OldBuilderType.java
index f65be18f2e..7d947d4935 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/OldBuilderType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/OldBuilderType.java
@@ -56,6 +56,6 @@ public void setNewTypeStructureEntry(TypeStructureEntry newEntry) {
* For debugging only
*/
public String toString() {
- return "OldBuilderType(" + fOldTSEntry.getType().getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "OldBuilderType("/*nonNLS*/ + fOldTSEntry.getType().getName() + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/OrderedSet.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/OrderedSet.java
index 5cbcc5fbce..a37998d4ef 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/OrderedSet.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/OrderedSet.java
@@ -214,7 +214,7 @@ public String toString () {
for (int i=0; i<elementCount; i++) {
if (i != 0) buffer.append (',');
if (buffer.length() > 1000) {
- buffer.append("..."); //$NON-NLS-1$
+ buffer.append("..."/*nonNLS*/);
break;
}
buffer.append (orderedList[i]);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImpl.java
index 1a6c0c971c..99c8630ce8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImpl.java
@@ -19,7 +19,7 @@ public class PackageImpl extends NonStateSpecificHandleImpl implements IPackage
String fName;
boolean fIsUnnamed;
- public static final String DEFAULT_PACKAGE_PREFIX = "Default-"; //$NON-NLS-1$
+ public static final String DEFAULT_PACKAGE_PREFIX = "Default-"/*nonNLS*/;
/**
* Creates a new package
* @param name of package
@@ -203,9 +203,9 @@ public boolean isUnnamed() {
public static String readableName(IPackage pkg) {
String name = pkg.getName();
if (pkg.isUnnamed()) {
- return Util.bind("build.defaultPackageName", name.substring(DEFAULT_PACKAGE_PREFIX.length())); //$NON-NLS-1$
+ return Util.bind("build.defaultPackageName"/*nonNLS*/, name.substring(DEFAULT_PACKAGE_PREFIX.length()));
} else {
- return Util.bind("build.packageName", name); //$NON-NLS-1$
+ return Util.bind("build.packageName"/*nonNLS*/, name);
}
}
/**
@@ -213,9 +213,9 @@ public static String readableName(IPackage pkg) {
* only (NON-NLS).
*/
public String toString() {
- String result = "package "; //$NON-NLS-1$
+ String result = "package "/*nonNLS*/;
if (isUnnamed())
- result += "{unnamed, id=" + getName() + "}"; //$NON-NLS-2$ //$NON-NLS-1$
+ result += "{unnamed, id="/*nonNLS*/ + getName() + "}"/*nonNLS*/;
else
result += getName();
return result;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImplSWH.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImplSWH.java
index 4f34fc8b68..8bf3a153fa 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImplSWH.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImplSWH.java
@@ -146,7 +146,7 @@ public IPackage[] getReferencedPackages() throws NotPresentException {
public IPackage[] getReferencingPackages(IImageContext context)
throws NotPresentException {
if (!isPresent())
- throw new NotPresentException(Util.bind("element.notPresent")); //$NON-NLS-1$
+ throw new NotPresentException(Util.bind("element.notPresent"/*nonNLS*/));
IPackage[] pkgs = fState.getReferencingPackages(fHandle, context);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageMap.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageMap.java
index ed4d744c87..8f88cf2b6e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageMap.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageMap.java
@@ -112,15 +112,15 @@ public class PackageMap extends StateTables {
IPackage[] pkgs = getAllPackagesAsArray();
Arrays.sort(pkgs, StateImpl.getPackageComparator());
StringBuffer sb = new StringBuffer();
- sb.append(super.toString() + ":\n"); //$NON-NLS-1$
+ sb.append(super.toString() + ":\n"/*nonNLS*/);
for (int i = 0; i < pkgs.length; ++i) {
- sb.append(" " + pkgs[i].getName() + ": "); //$NON-NLS-2$ //$NON-NLS-1$
+ sb.append(" "/*nonNLS*/ + pkgs[i].getName() + ": "/*nonNLS*/);
IPath[] fragments = getFragments(pkgs[i]);
for (int j = 0; j < fragments.length; ++j) {
- if (j != 0) sb.append(", "); //$NON-NLS-1$
+ if (j != 0) sb.append(", "/*nonNLS*/);
sb.append(fragments[j]);
}
- sb.append("\n"); //$NON-NLS-1$
+ sb.append("\n"/*nonNLS*/);
}
return sb.toString();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageMapEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageMapEntry.java
index 869afaa6df..6f80669b5e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageMapEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageMapEntry.java
@@ -73,9 +73,9 @@ void addFragment(IPath fragment) {
* This method is for debugging purposes only.
*/
public String toString() {
- StringBuffer buf = new StringBuffer("PackageMapEntry("); //$NON-NLS-1$
+ StringBuffer buf = new StringBuffer("PackageMapEntry("/*nonNLS*/);
buf.append(fPkg);
- buf.append(")"); //$NON-NLS-1$
+ buf.append(")"/*nonNLS*/);
return buf.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PathMap.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PathMap.java
index 98908acfe6..4a85e78bc8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PathMap.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PathMap.java
@@ -61,10 +61,10 @@ boolean hasPath(IPath path) {
IPackage packageHandleFromPath(IPath path) {
IPackage[] pkgs = (IPackage[])fTable.get(path);
if (pkgs == null) {
- throw new Error(Util.bind("build.noPackagePath", path.toString())); //$NON-NLS-1$
+ throw new Error(Util.bind("build.noPackagePath"/*nonNLS*/, path.toString()));
}
if (pkgs.length != 1) {
- throw new Error(Util.bind("build.ambiguousPackage", path.toString())); //$NON-NLS-1$
+ throw new Error(Util.bind("build.ambiguousPackage"/*nonNLS*/, path.toString()));
}
return pkgs[0];
}
@@ -120,23 +120,23 @@ IPackage[] packageHandlesFromPath(IPath path) {
}
Collections.sort(list, StateImpl.getPathComparator());
StringBuffer sb = new StringBuffer();
- sb.append(super.toString() + ":\n"); //$NON-NLS-1$
+ sb.append(super.toString() + ":\n"/*nonNLS*/);
for (int i = 0; i < list.size(); ++i) {
IPath path = (IPath) list.get(i);
- sb.append(" " + path + ": "); //$NON-NLS-2$ //$NON-NLS-1$
+ sb.append(" "/*nonNLS*/ + path + ": "/*nonNLS*/);
IPackage[] pkgs = packageHandlesFromPath(path);
if (pkgs.length == 1) {
sb.append(pkgs[0].getName());
}
else {
Arrays.sort(pkgs, StateImpl.getPackageComparator());
- sb.append("(" + pkgs.length + " packages)"); //$NON-NLS-2$ //$NON-NLS-1$
+ sb.append("("/*nonNLS*/ + pkgs.length + " packages)"/*nonNLS*/);
for (int j = 0; j < pkgs.length; ++j) {
- sb.append("\n "); //$NON-NLS-1$
+ sb.append("\n "/*nonNLS*/);
sb.append(pkgs[j].getName());
}
}
- sb.append("\n"); //$NON-NLS-1$
+ sb.append("\n"/*nonNLS*/);
}
return sb.toString();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PrimitiveTypeHandleImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PrimitiveTypeHandleImpl.java
index db45948865..ecf1893011 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PrimitiveTypeHandleImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PrimitiveTypeHandleImpl.java
@@ -149,23 +149,23 @@ public String getName() {
public String getSimpleName() {
switch (fTypeCode) {
case TC_BOOLEAN :
- return "boolean"; //$NON-NLS-1$
+ return "boolean"/*nonNLS*/;
case TC_BYTE :
- return "byte"; //$NON-NLS-1$
+ return "byte"/*nonNLS*/;
case TC_CHAR :
- return "char"; //$NON-NLS-1$
+ return "char"/*nonNLS*/;
case TC_DOUBLE :
- return "double"; //$NON-NLS-1$
+ return "double"/*nonNLS*/;
case TC_FLOAT :
- return "float"; //$NON-NLS-1$
+ return "float"/*nonNLS*/;
case TC_INT :
- return "int"; //$NON-NLS-1$
+ return "int"/*nonNLS*/;
case TC_LONG :
- return "long"; //$NON-NLS-1$
+ return "long"/*nonNLS*/;
case TC_SHORT :
- return "short"; //$NON-NLS-1$
+ return "short"/*nonNLS*/;
case TC_VOID :
- return "void"; //$NON-NLS-1$
+ return "void"/*nonNLS*/;
default :
}
return null;
@@ -219,25 +219,25 @@ public boolean isPrimitive() {
protected static String typeSignature(int typeCode) {
switch (typeCode) {
case TC_VOID :
- return "V"; //$NON-NLS-1$
+ return "V"/*nonNLS*/;
case TC_BOOLEAN :
- return "Z"; //$NON-NLS-1$
+ return "Z"/*nonNLS*/;
case TC_BYTE :
- return "B"; //$NON-NLS-1$
+ return "B"/*nonNLS*/;
case TC_CHAR :
- return "C"; //$NON-NLS-1$
+ return "C"/*nonNLS*/;
case TC_SHORT :
- return "S"; //$NON-NLS-1$
+ return "S"/*nonNLS*/;
case TC_INT :
- return "I"; //$NON-NLS-1$
+ return "I"/*nonNLS*/;
case TC_LONG :
- return "J"; //$NON-NLS-1$
+ return "J"/*nonNLS*/;
case TC_FLOAT :
- return "F"; //$NON-NLS-1$
+ return "F"/*nonNLS*/;
case TC_DOUBLE :
- return "D"; //$NON-NLS-1$
+ return "D"/*nonNLS*/;
default :
- return "unknown"; //$NON-NLS-1$
+ return "unknown"/*nonNLS*/;
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemDetailImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemDetailImpl.java
index a0d71a0ee9..812c53225b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemDetailImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemDetailImpl.java
@@ -197,6 +197,6 @@ public void setSourceStart(int sourceStart) {
* purposes only. Non-NLS.
*/
public String toString() {
- return "ProblemDetail(" + getMessage() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "ProblemDetail("/*nonNLS*/ + getMessage() + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemFactory.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemFactory.java
index 14672d113d..87c7237959 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemFactory.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemFactory.java
@@ -25,7 +25,7 @@ public class ProblemFactory implements IProblemFactory {
*/
private ProblemFactory(Locale locale) {
fLocale = locale;
- fCompilerResources = ResourceBundle.getBundle("org.eclipse.jdt.internal.compiler.problem.Messages", locale); //$NON-NLS-1$
+ fCompilerResources = ResourceBundle.getBundle("org.eclipse.jdt.internal.compiler.problem.Messages"/*nonNLS*/, locale);
initializeMessageTemplates();
}
/**
@@ -53,7 +53,7 @@ public String getLocalizedMessage(int id, String[] problemArguments) {
StringBuffer output = new StringBuffer(80);
String message = fMessageTemplates[ (id & ProblemIrritants.IgnoreCategoriesMask)];
if (message == null) {
- return "Unable to retrieve the error message for problem id: "+ id + ". Check compiler resources."; //$NON-NLS-1$ //$NON-NLS-2$
+ return "Unable to retrieve the error message for problem id: "/*nonNLS*/+ id + ". Check compiler resources."/*nonNLS*/;
}
int length = message.length();
int start = -1, end = length;
@@ -66,7 +66,7 @@ public String getLocalizedMessage(int id, String[] problemArguments) {
} catch (NumberFormatException nfe) {
output.append(message.substring(end + 1, start + 1));
} catch (ArrayIndexOutOfBoundsException e) {
- return "Corrupted compiler resources for problem id: " + (id & ProblemIrritants.IgnoreCategoriesMask) + ". Check compiler resources."; //$NON-NLS-1$ //$NON-NLS-2$
+ return "Corrupted compiler resources for problem id: "/*nonNLS*/ + (id & ProblemIrritants.IgnoreCategoriesMask) + ". Check compiler resources."/*nonNLS*/;
}
} else {
output.append(message.substring(end, length));
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemTable.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemTable.java
index 9d92795185..3b7e49c40b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemTable.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProblemTable.java
@@ -170,12 +170,12 @@ public void removeSyntaxErrors(Object entry) {
* @return a string representation of the receiver
*/
public String toString() {
- StringBuffer buf = new StringBuffer("ProblemTable(\n\t"); //$NON-NLS-1$
- buf.append("type problems: "); //$NON-NLS-1$
+ StringBuffer buf = new StringBuffer("ProblemTable(\n\t"/*nonNLS*/);
+ buf.append("type problems: "/*nonNLS*/);
buf.append(fTable);
- buf.append("\n\timage problems: "); //$NON-NLS-1$
+ buf.append("\n\timage problems: "/*nonNLS*/);
buf.append(fImageProblems);
- buf.append(")"); //$NON-NLS-1$
+ buf.append(")"/*nonNLS*/);
return buf.toString();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectBinaryOutput.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectBinaryOutput.java
index 6973b1669b..745d9c03e4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectBinaryOutput.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectBinaryOutput.java
@@ -103,7 +103,7 @@ private void deleteClassesInContainer(IContainer container) {
IResource resource = (IResource) members[i];
switch (resource.getType()) {
case IResource.FILE :
- if (resource.getName().toLowerCase().endsWith(".class")) { //$NON-NLS-1$
+ if (resource.getName().toLowerCase().endsWith(".class"/*nonNLS*/)) {
resource.delete(true, null);
}
break;
@@ -141,7 +141,8 @@ public byte[] getBinary(TypeStructureEntry tsEntry, IType type) {
} catch (IOException e) {
return new byte[0];
} catch (CoreException e) {
- return new byte[0]; }
+ return new byte[0];
+ }
}
/**
* Returns the container for a path.
@@ -175,7 +176,7 @@ IPath getOutputPath() {
* Returns the path in the output folder for the given type.
*/
private IPath getPathForBinary(IType type) {
- return getOutputPath().append(type.getName().replace('.', '/') + ".class"); //$NON-NLS-1$
+ return getOutputPath().append(type.getName().replace('.', '/') + ".class"/*nonNLS*/);
}
/**
* Returns the container at the given path, creating it and any parent folders if necessary.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectResourceCopier.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectResourceCopier.java
index 90194e8756..628a23699b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectResourceCopier.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectResourceCopier.java
@@ -65,7 +65,7 @@ public void copyAllResourcesOnClasspath(){
if (this.outputLocation.equals(this.sourceFolders[i].getFullPath())) continue; // do nothing if output is same as source folder
if (!hasNotified){
hasNotified = true;
- if (notifier != null) notifier.subTask(Util.bind("build.copyingResources")); //$NON-NLS-1$
+ if (notifier != null) notifier.subTask(Util.bind("build.copyingResources"/*nonNLS*/));
}
this.sourceFolders[i].accept(this);
}
@@ -87,7 +87,7 @@ private boolean copyToOutput(IResource resource) {
switch (resource.getType()){
case IResource.FILE :
if (sourceFolderPath == null) return false; // resource is not inside the classpath
- if (!"java".equals(resource.getFileExtension())){ // ignore source files //$NON-NLS-1$
+ if (!"java"/*nonNLS*/.equals(resource.getFileExtension())){ // ignore source files
IFile currentFile = (IFile) resource;
IPath pathSuffix = resourcePath.removeFirstSegments(sourceFolderPath.segmentCount());
@@ -140,7 +140,7 @@ private boolean deleteResourceCopyFromOutput(IResource resource) {
switch (resource.getType()){
case IResource.FILE :
- if (!"java".equals(resource.getFileExtension())){ // ignore source files //$NON-NLS-1$
+ if (!"java"/*nonNLS*/.equals(resource.getFileExtension())){ // ignore source files
IFile currentFile = (IFile) resource;
pathSuffix = resourcePath.removeFirstSegments(sourceFolderPath.segmentCount());
@@ -195,7 +195,7 @@ private IPath getSourceFolderPath(IResource resource) {
if (this.outputLocation.equals(this.sourceFolders[i].getFullPath())) continue; // do nothing if output is same as source folder
if (!hasNotified){
hasNotified = true;
- if (notifier != null) notifier.subTask(Util.bind("build.updatingResources")); //$NON-NLS-1$
+ if (notifier != null) notifier.subTask(Util.bind("build.updatingResources"/*nonNLS*/));
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ReportCardImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ReportCardImpl.java
index 5590beff71..10bef72e28 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ReportCardImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ReportCardImpl.java
@@ -104,7 +104,7 @@ private void getProblemsForPath(IPath path, Vector vResults) {
if (path.isPrefixOf(sEntryPath)) {
String extension = sEntryPath.getFileExtension();
// test most frequent cases first
- if (extension != null && (extension.toLowerCase().equals("java") || extension.toLowerCase().equals("class"))) { //$NON-NLS-1$ //$NON-NLS-2$
+ if (extension != null && (extension.toLowerCase().equals("java"/*nonNLS*/) || extension.toLowerCase().equals("class"/*nonNLS*/))) {
getProblemsForSourceEntry(sEntry, vResults);
} else {
if (fState.isZipElement(sEntryPath)) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceElementTable.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceElementTable.java
index efd6f1ddfb..48067b1fe7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceElementTable.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceElementTable.java
@@ -123,6 +123,6 @@ SourceEntry removeSourceEntry(IPackage pkg, String fileName) {
* @return a string representation of the receiver
*/
public String toString() {
- return "SourceElementTable(" + fPackageTable + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "SourceElementTable("/*nonNLS*/ + fPackageTable + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceEntry.java
index a63718d9ba..d42409f719 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceEntry.java
@@ -94,7 +94,7 @@ public String getPathWithZipEntryName() {
return s.replace('/', File.separatorChar);
}
public String getZipEntryName() {
- return fZipEntryPath == null ? fZipEntryFileName : fZipEntryPath + "/" + fZipEntryFileName; //$NON-NLS-1$
+ return fZipEntryPath == null ? fZipEntryFileName : fZipEntryPath + "/"/*nonNLS*/ + fZipEntryFileName;
}
public int hashCode() {
int code = fPath.hashCode();
@@ -112,10 +112,10 @@ public String getPathWithZipEntryName() {
*/
public boolean isBinary() {
if (fZipEntryFileName != null) {
- return fZipEntryFileName.endsWith(".class"); //$NON-NLS-1$
+ return fZipEntryFileName.endsWith(".class"/*nonNLS*/);
}
String extension = fPath.getFileExtension();
- return extension != null && extension.equalsIgnoreCase("class"); //$NON-NLS-1$
+ return extension != null && extension.equalsIgnoreCase("class"/*nonNLS*/);
}
/**
* Returns true if the source entry comes from a compilation unit, otherwise
@@ -123,16 +123,16 @@ public String getPathWithZipEntryName() {
*/
public boolean isSource() {
if (fZipEntryFileName != null) {
- return fZipEntryFileName.endsWith(".java"); //$NON-NLS-1$
+ return fZipEntryFileName.endsWith(".java"/*nonNLS*/);
}
String extension = fPath.getFileExtension();
- return extension != null && extension.equalsIgnoreCase("java"); //$NON-NLS-1$
+ return extension != null && extension.equalsIgnoreCase("java"/*nonNLS*/);
}
/**
* Returns a String that represents the value of this object.
* @return a string representation of the receiver
*/
public String toString() {
- return fZipEntryFileName == null ? fPath.toString() : fPath.toString() + ", entry: " + this.getZipEntryName(); //$NON-NLS-1$
+ return fZipEntryFileName == null ? fPath.toString() : fPath.toString() + ", entry: "/*nonNLS*/ + this.getZipEntryName();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceFragmentImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceFragmentImpl.java
index d1dc34f996..76a1bf438d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceFragmentImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/SourceFragmentImpl.java
@@ -62,7 +62,7 @@ public String getZipEntryName() {
*/
public String toString() {
return
- "SourceFragmentImpl(" + fPath //$NON-NLS-1$
- + (fZipEntryName == null ? "" : " : " + fZipEntryName) + ")"; //$NON-NLS-2$ //$NON-NLS-1$ //$NON-NLS-3$
+ "SourceFragmentImpl("/*nonNLS*/ + fPath
+ + (fZipEntryName == null ? ""/*nonNLS*/ : " : "/*nonNLS*/ + fZipEntryName) + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateImpl.java
index b22c4dcabe..0dce2cd329 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateImpl.java
@@ -1,5 +1,5 @@
package org.eclipse.jdt.internal.core.builder.impl;
-
+
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
@@ -16,7 +16,7 @@ import java.util.Random;
import java.util.Vector;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
-
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -63,52 +63,52 @@ import org.eclipse.jdt.internal.core.builder.NotPresentException;
import org.eclipse.jdt.internal.core.builder.StateSpecificException;
import org.eclipse.jdt.internal.core.lookup.ReferenceInfo;
import org.eclipse.jdt.internal.core.util.LookupTable;
-
+
/**
* The concrete representation of a built state.
*
* @see IState
*/
public class StateImpl implements IState {
-
+
/**
* The development context corresponding to this state
*/
private JavaDevelopmentContextImpl fDevelopmentContext;
-
+
/**
* The build context. Only packages in the build context
* are actually built
*/
private IImageContext fBuildContext;
-
+
/**
* The project built by this state.
*/
private IProject fProject;
-
+
/**
* The name of the project built by this state.
*/
private String fProjectName;
-
+
/**
* The paths of the package fragment roots in the class path.
*/
private IPackageFragmentRoot[] fPackageFragmentRootsInClassPath;
-
+
/**
* The binary output.
*/
private BinaryOutput fBinaryOutput;
-
+
/**
* The package map. A hashtable of package handles to PackageMapEntry objects.
* The package map entries store the collection of package fragments that
* make up the given builder package.
*/
private PackageMap fPackageMap;
-
+
/**
* The path map. A table that maps from paths to package handles. This
* is essentially a reverse index of the package map. Note that this
@@ -116,58 +116,63 @@ public class StateImpl implements IState {
* not need to be serialized or incrementally updated.
*/
private PathMap fPathMap;
-
+
/**
* The source element table. This table holds a source fragment for
* all workspace elements.
*/
private SourceElementTable fSourceElementTable;
-
+
/**
* The principal structure table. A table of type handles to TypeStructureEntry objects.
* This is where build results are stored. This table only contains types that
* have been compiled.
*/
private Hashtable fPrincipalStructureTable;
-
+
/**
* Table of IPackage to TypeStructureEntry[] for all types in package (lazy).
*/
private Hashtable fPrincipalStructureByPackageTable;
-
+
/**
* The problem reporter. All problems for this state are stored in this problem
* reporter.
*/
private IProblemReporter fProblemReporter;
-
+
/**
* The graph of source element dependencies, used for
* incremental compilation
*/
private DependencyGraph fGraph= null;
-
+
/**
* The table of subtypes. Maps from IType to TypeStructureEntry[]. Absence in table implies no subtypes.
*/
private Hashtable fSubtypesTable;
private IImageContext fSubtypesTableImageContext;
-
+
/**
* The image corresponding to this state
*/
private IImage fImage;
-
+
+ /**
+ * The compiler options that were used to build this state.
+ */
+ private ConfigurableOption[] fCompilerOptions;
+
/**
* Unique state number
*/
private int fStateNumber;
-
+
/**
* Fingerprint bytes
*/
private byte[] fFingerprint;
-
+
/* primitive type handles */
final IType fVoidType;
final IType fIntType;
@@ -178,28 +183,28 @@ public class StateImpl implements IState {
final IType fLongType;
final IType fShortType;
final IType fBooleanType;
-
+
/**
* Counter for unique state numbers (not the fingerprint).
*/
private static int fgStateCounter= 0;
-
+
/**
* Namespace flag indicating CU has parse error.
* Must not conflict with modifiers or other flags in IConstants.
*/
private static final int F_HAS_PARSE_ERROR= 0x10000000;
-
+
/**
* Name for namespace node representing unknown dependencies.
*/
- private static final String UNKNOWN_DEPENDENCIES= "$UNKNOWN_DEPENDENCIES$"; //$NON-NLS-1$
-
+ private static final String UNKNOWN_DEPENDENCIES= "$UNKNOWN_DEPENDENCIES$"/*nonNLS*/;
+
/**
* Random number generator, used for generating fingerprints.
*/
private static final Random fgRandom= new Random();
-
+
/**
* State constructor comment. The build context, fingerprint, and internal tables
* are not instantiated and must be filled in before use.
@@ -226,7 +231,7 @@ public class StateImpl implements IState {
protected StateImpl(JavaDevelopmentContextImpl dc, IProject project, IImageContext buildContext) {
this(dc, project);
fBuildContext= buildContext;
-
+
/* state tables */
fPackageMap= new PackageMap();
fSourceElementTable= new SourceElementTable();
@@ -250,7 +255,7 @@ public class StateImpl implements IState {
*/
protected void buildInitialPackageMap() {
fPackageMap= new PackageMap();
-
+
/* do for each package fragment root in (classpath INTERSECT workspace) */
try {
IPackageFragmentRoot[] roots= getPackageFragmentRootsInClassPath();
@@ -274,7 +279,7 @@ public class StateImpl implements IState {
} catch (JavaModelException e) {
throw internalException(e);
}
-
+
/* build the reverse index -- the path map */
fPathMap= new PathMap(fPackageMap);
}
@@ -352,12 +357,12 @@ public class StateImpl implements IState {
IPackage[] oldPackages= oldContext.getPackages();
int pkgCount= oldPackages.length;
IPackage[] newPackages= new IPackage[pkgCount];
-
+
/* canonicalize packages through package map */
for (int i= 0; i < pkgCount; i++) {
newPackages[i]= canonicalize(oldPackages[i]);
}
-
+
return new ImageContextImpl(fDevelopmentContext, newPackages);
}
/**
@@ -401,7 +406,7 @@ public class StateImpl implements IState {
String fileName= new String(result.getFileName());
SourceEntry sEntry= SourceEntry.fromPathWithZipEntryName(fileName);
PackageElement resultUnit= packageElementFromSourceEntry(sEntry);
-
+
/**
* Make sure the CU exists. May be null if unit is unavailable
* (e.g. package is not included in package map due to class path omission).
@@ -410,7 +415,7 @@ public class StateImpl implements IState {
IPackage resultPkg= resultUnit.getPackage();
IProblem[] compilerProblems= result.getProblems();
Vector vProblems= new Vector(compilerProblems == null ? 0 : compilerProblems.length);
-
+
/* convert type names to type handles for the produced types */
ClassFile[] classFiles= result.getClassFiles();
Vector vTSEntries= new Vector(classFiles.length);
@@ -420,7 +425,7 @@ public class StateImpl implements IState {
String className= Util.toString(classFile.getCompoundName());
if (classFile == null) {
// Could not discover principal structure
- String msg= Util.bind("build.errorParsingBinary", className); //$NON-NLS-1$
+ String msg= Util.bind("build.errorParsingBinary"/*nonNLS*/, className);
ProblemDetailImpl problem= new ProblemDetailImpl(msg, sEntry);
vProblems.addElement(problem);
// skip it
@@ -439,7 +444,7 @@ public class StateImpl implements IState {
if (!typePkg.isUnnamed()) {
path= path.append(typePkg.getName().replace('.', IPath.SEPARATOR));
}
- String msg= Util.bind("build.packageMismatch", path.toString()); //$NON-NLS-1$
+ String msg= Util.bind("build.packageMismatch"/*nonNLS*/, path.toString());
ProblemDetailImpl problem= new ProblemDetailImpl(msg, 0, IProblemDetail.S_ERROR, sEntry, 0, 0, 1);
vProblems.addElement(problem);
// Only report the conflict once (there may be several types, but there's only one package declaration).
@@ -449,7 +454,7 @@ public class StateImpl implements IState {
continue;
}
TypeStructureEntry tsEntry= new TypeStructureEntry(sEntry, typeHandle);
-
+
/* squirrel the binary away */
byte[] binary= classFile.getBytes();
// as a side effect, the following sets the crc32 for the type structure entry
@@ -458,10 +463,10 @@ public class StateImpl implements IState {
}
TypeStructureEntry[] tsEntries= new TypeStructureEntry[vTSEntries.size()];
vTSEntries.copyInto(tsEntries);
-
+
/* convert dependencies */
Vector dependencies= resolveDependencies(resultUnit, result);
-
+
/* convert problems */
if (compilerProblems != null) {
for (int i= 0; i < compilerProblems.length; i++) {
@@ -488,6 +493,7 @@ public class StateImpl implements IState {
newState.fProblemReporter= this.fProblemReporter.copy();
newState.fGraph= this.fGraph.copy();
newState.fBuildContext= context;
+ newState.fCompilerOptions= this.fCompilerOptions;
return newState;
}
/**
@@ -515,7 +521,7 @@ public class StateImpl implements IState {
IType type= tsEntry.getType();
SourceEntry sEntry= tsEntry.getSourceEntry();
IBinaryType binaryType= null;
-
+
/* if its a class file, get descriptor from binary index */
if (sEntry.isBinary()) {
try {
@@ -538,7 +544,7 @@ public class StateImpl implements IState {
}
if (lazyBuildCU && binaryType == null) {
/* couldn't parse the class file */
- ProblemDetailImpl problem= new ProblemDetailImpl(Util.bind("build.errorParsingBinary", type.getName()), sEntry); //$NON-NLS-1$
+ ProblemDetailImpl problem= new ProblemDetailImpl(Util.bind("build.errorParsingBinary"/*nonNLS*/, type.getName()), sEntry);
fProblemReporter.putProblem(sEntry, problem);
}
return binaryType;
@@ -574,9 +580,9 @@ public class StateImpl implements IState {
if (!fPackageMap.containsPackage(pkg)) {
return null;
}
-
+
// TBD: Doesn't support lazy builds.
-
+
int max= 30;
TypeStructureEntry[] list= new TypeStructureEntry[max];
int count= 0;
@@ -605,12 +611,12 @@ public class StateImpl implements IState {
}
IType nssHandle= (IType) type.nonStateSpecific();
TypeStructureEntry tsEntry= buildTypeStructureEntry(nssHandle);
-
+
/* Attempt to retrieve binary from binary output */
byte[] binary= getBinaryOutput().getBinary(tsEntry, nssHandle);
if (binary != null)
return binary;
-
+
/*
* We have a built entry, but couldn't get the bytes from the binary output.
* Need to recompile.
@@ -618,7 +624,7 @@ public class StateImpl implements IState {
if (!lazyBuildCU) {
return null;
}
-
+
/* make sure the entry is a compilation unit */
PackageElement unit= packageElementFromSourceEntry(tsEntry.getSourceEntry());
new BatchImageBuilder(this).lazyBuild(unit);
@@ -648,11 +654,11 @@ public class StateImpl implements IState {
* is thrown.
*/
protected IBinaryType getBinaryType(TypeStructureEntry tsEntry) throws NotPresentException {
-
+
/* rebuild descriptor from indexes or binary */
IBinaryType binaryType= forceBinaryType(tsEntry, false); // Use false for 1FVQGL1: ITPJCORE:WINNT - SEVERE - Error saving java file
if (binaryType == null) {
- throw new NotPresentException(Util.bind("build.errorBuildingType", tsEntry.getSourceEntry().getFileName())); //$NON-NLS-1$
+ throw new NotPresentException(Util.bind("build.errorBuildingType"/*nonNLS*/, tsEntry.getSourceEntry().getFileName()));
}
return binaryType;
}
@@ -662,7 +668,7 @@ public class StateImpl implements IState {
* the binary is not available (doesn't invoke a lazy build)
*/
protected IBinaryType getBinaryTypeOrNull(TypeStructureEntry tsEntry) {
-
+
/* rebuild descriptor from binary */
return forceBinaryType(tsEntry, false);
}
@@ -717,12 +723,17 @@ public class StateImpl implements IState {
if (!fSourceElementTable.containsPackage(pkg)) {
getSourceEntries(pkg);
}
- SourceEntry entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java"); //$NON-NLS-1$
+ SourceEntry entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java"/*nonNLS*/);
if (entry == null)
return null;
return new PackageElement(pkg, entry);
}
-
+ /**
+ * Returns the compiler options used to build this state.
+ */
+ public ConfigurableOption[] getCompilerOptions() {
+ return fCompilerOptions;
+ }
/**
* Returns an enumeration of TypeStructureEntry objects for all top-level types
* in the given package. Returns null if the package does not exist.
@@ -803,7 +814,7 @@ public class StateImpl implements IState {
return fDevelopmentContext.getBinaryFromFileSystem(file);
} catch (IOException e) {
String message= e.getMessage();
- message= (message == null ? "." : " due to " + message + "."); //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$
+ message= (message == null ? "."/*nonNLS*/ : " due to "/*nonNLS*/ + message + "."/*nonNLS*/);
return new byte[0];
}
}
@@ -920,7 +931,7 @@ public class StateImpl implements IState {
}
}
if (frag == null) {
- throw internalException(Util.bind("build.missingFile", sEntry.toString())); //$NON-NLS-1$
+ throw internalException(Util.bind("build.missingFile"/*nonNLS*/, sEntry.toString()));
}
String fileName= sEntry.getPath().lastSegment();
if (sEntry.isSource()) {
@@ -1081,10 +1092,10 @@ static Comparator getPathComparator() {
* The resulting packages are in no particular order.
*/
protected IPackage[] getReferencedPackages(IPackage pkgHandle) {
-
+
/* set of referenced builder packages */
Hashtable pkgTable= getTableOfReferencedPackages(pkgHandle);
-
+
/* convert to array and return */
IPackage[] results= new IPackage[pkgTable.size()];
int i= 0;
@@ -1124,11 +1135,11 @@ static Comparator getPathComparator() {
* This is an extremely slow implementation (n^3?). Avoid using it if possible.
*/
protected IPackage[] getReferencingPackages(IPackage pkgHandle, IImageContext context) {
-
+
/* the results */
Vector vResults= new Vector();
IImage image= fDevelopmentContext.getImage();
-
+
/* do for each package in the image context */
IPackage[] pkgs= context.getPackages();
for (int i= 0; i < pkgs.length; i++) {
@@ -1208,9 +1219,9 @@ static Comparator getPathComparator() {
ICompilationUnit unit= units[i];
String fileName= unit.getElementName();
// get the corresponding .class file name
- String classFileName = ""; //$NON-NLS-1$
+ String classFileName = ""/*nonNLS*/;
if (Util.isJavaFileName(fileName)) { // paranoia check
- classFileName = fileName.substring(0, fileName.length()-5).concat(".class"); //$NON-NLS-1$
+ classFileName = fileName.substring(0, fileName.length()-5).concat(".class"/*nonNLS*/);
}
// see if a source entry exists for this file name
// or for the corresponding .class file
@@ -1234,7 +1245,7 @@ static Comparator getPathComparator() {
String fileName= classFile.getElementName();
// get the corresponding .java file name
// note: this handles nested types, but not secondary types (e.g. class B defined in A.java)
- String javaFileName = ""; //$NON-NLS-1$
+ String javaFileName = ""/*nonNLS*/;
if (Util.isClassFileName(fileName)) { // paranoia check
// strip off any nested types
javaFileName = fileName.substring(0, fileName.length()-6);
@@ -1242,7 +1253,7 @@ static Comparator getPathComparator() {
if (dol != -1) {
javaFileName = javaFileName.substring(0, dol);
}
- javaFileName = javaFileName.concat(".java"); //$NON-NLS-1$
+ javaFileName = javaFileName.concat(".java"/*nonNLS*/);
}
// see if a source entry exists for this file name
// or for the corresponding .java file
@@ -1281,15 +1292,15 @@ static Comparator getPathComparator() {
if (entries != null) {
return entries;
}
-
+
/* Need to build the table for the package */
-
+
/* go through package fragments and compute all source entries */
IPath[] frags= fPackageMap.getFragments(pkg);
if (frags == null) {
return null; // package not present
}
-
+
/* build a table of source entries, keyed by filename */
LookupTable entryTable= new LookupTable(20);
for (int i= 0; i < frags.length; i++) {
@@ -1304,7 +1315,7 @@ static Comparator getPathComparator() {
protected SourceEntry getSourceEntry(String qualifiedNameWithSuffix) {
int dot= qualifiedNameWithSuffix.lastIndexOf('.');
dot= qualifiedNameWithSuffix.lastIndexOf('.', dot - 1);
- String pkgName= (dot == -1 ? ".default" : qualifiedNameWithSuffix.substring(0, dot)); //$NON-NLS-1$
+ String pkgName= (dot == -1 ? ".default"/*nonNLS*/ : qualifiedNameWithSuffix.substring(0, dot));
String fileName= (dot == -1 ? qualifiedNameWithSuffix : qualifiedNameWithSuffix.substring(dot + 1));
IPackage pkg= fDevelopmentContext.getImage().getPackageHandle(pkgName, false);
getSourceEntries(pkg); // force
@@ -1333,16 +1344,16 @@ static Comparator getPathComparator() {
getSourceEntries(pkg);
}
String simpleName= type.getSimpleName();
- SourceEntry entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java"); //$NON-NLS-1$
+ SourceEntry entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java"/*nonNLS*/);
if (entry == null) {
- entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".class"); //$NON-NLS-1$
+ entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".class"/*nonNLS*/);
if (entry == null) {
int firstDollar= simpleName.indexOf('$');
if (firstDollar != -1) {
simpleName= simpleName.substring(0, firstDollar);
- entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java"); //$NON-NLS-1$
+ entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java"/*nonNLS*/);
if (entry == null) {
- entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".class"); //$NON-NLS-1$
+ entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".class"/*nonNLS*/);
}
}
}
@@ -1415,14 +1426,14 @@ static Comparator getPathComparator() {
protected Hashtable getTableOfReferencedPackages(IPackage pkgHandle) {
/* set of referenced builder packages */
Hashtable pkgTable= new Hashtable();
-
+
/* do for each type in this package */
TypeStructureEntry[] types= getAllTypesForPackage(pkgHandle);
if (types != null) {
for (int i= 0; i < types.length; i++) {
PackageElement element= packageElementFromSourceEntry(types[i].getSourceEntry());
IPackage[] deps= getInternalDependencyGraph().getNamespaceDependencies(element);
-
+
/* make sure namespaces are actually packages */
for (int j= 0; j < deps.length; j++) {
if (fPackageMap.getEntry(deps[j]) != null) {
@@ -1431,7 +1442,7 @@ static Comparator getPathComparator() {
}
}
}
-
+
/* remove this package */
pkgTable.remove(pkgHandle);
return pkgTable;
@@ -1441,7 +1452,7 @@ static Comparator getPathComparator() {
*/
protected TypeStructureEntry getTypeStructureEntry(String qualifiedNameWithoutSuffix) {
int dot= qualifiedNameWithoutSuffix.lastIndexOf('.');
- String pkgName= (dot == -1 ? ".default" : qualifiedNameWithoutSuffix.substring(0, dot)); //$NON-NLS-1$
+ String pkgName= (dot == -1 ? ".default"/*nonNLS*/ : qualifiedNameWithoutSuffix.substring(0, dot));
String typeName= (dot == -1 ? qualifiedNameWithoutSuffix : qualifiedNameWithoutSuffix.substring(dot + 1));
IPackage pkg= fDevelopmentContext.getImage().getPackageHandle(pkgName, false);
IType type= pkg.getClassHandle(typeName);
@@ -1458,16 +1469,16 @@ static Comparator getPathComparator() {
if (tsEntry != null) {
return tsEntry;
}
-
+
// TBD: Doesn't handle lazy builds.
-
+
/* get the source element */
IPackage pkg= handle.getPackage();
SourceEntry sEntry= getSourceEntry(handle);
if (sEntry == null) {
return null;
}
-
+
/* if its a class file, parse it */
if (sEntry.isBinary()) {
//byte[] bytes = getElementContentBytes(sEntry);
@@ -1482,13 +1493,13 @@ static Comparator getPathComparator() {
// Don't try again.
return null;
}
-
+
// make sure the entry is a compilation unit
PackageElement unit= packageElementFromSourceEntry(sEntry);
-
+
// compile it
new BatchImageBuilder(this).lazyBuild(unit);
-
+
// try to get the entry again; may still be null
tsEntry= (TypeStructureEntry) fPrincipalStructureTable.get(handle);
}
@@ -1521,7 +1532,7 @@ static Comparator getPathComparator() {
*/
protected static boolean isZipElement(IPath path) {
String extension= path.getFileExtension();
- return extension != null && (extension.equalsIgnoreCase("zip") || extension.equalsIgnoreCase("jar")); //$NON-NLS-1$ //$NON-NLS-2$
+ return extension != null && (extension.equalsIgnoreCase("zip"/*nonNLS*/) || extension.equalsIgnoreCase("jar"/*nonNLS*/));
}
/**
* Given a project-relative path, returns an absolute path.
@@ -1556,7 +1567,7 @@ static Comparator getPathComparator() {
protected IPackage packageFromSourceEntry(SourceEntry entry) {
IPath path= entry.getPath();
IPackage pkgHandle;
-
+
/* if it's a zip file */
String zipEntryFileName = entry.fZipEntryFileName;
if (zipEntryFileName != null) {
@@ -1581,23 +1592,23 @@ static Comparator getPathComparator() {
*/
protected void putCompilationResult(ConvertedCompilationResult result) {
PackageElement unit= result.getPackageElement();
-
+
/* get source entry for result */
SourceEntry sEntry= getSourceEntry(unit);
-
+
/* record problems */
fProblemReporter.removeNonSyntaxErrors(sEntry);
IProblemDetail[] problems= result.getProblems();
for (int i= 0; i < problems.length; ++i) {
fProblemReporter.putProblem(sEntry, problems[i]);
}
-
+
/* This records the types actually contributed, */
/* to record in the dependency graph. */
TypeStructureEntry[] tsEntries= result.getTypes();
IType[] types= new IType[tsEntries.length];
int count= 0;
-
+
/* record type structure */
for (int i= 0; i < tsEntries.length; i++) {
TypeStructureEntry tsEntry= tsEntries[i];
@@ -1607,19 +1618,19 @@ static Comparator getPathComparator() {
if (tsExisting != null) {
if (!tsExisting.getSourceEntry().getFileName().equals(sEntry.getFileName())) {
// Same type provided by different files
- String msg= Util.bind("build.duplicateType", typeHandle.getName(), tsExisting.getSourceEntry().getFileName()); //$NON-NLS-1$
+ String msg= Util.bind("build.duplicateType"/*nonNLS*/, typeHandle.getName(), tsExisting.getSourceEntry().getFileName());
ProblemDetailImpl problem= new ProblemDetailImpl(msg, sEntry);
fProblemReporter.putProblem(sEntry, problem);
// skip it
continue;
}
}
-
+
// Finally, put it in table.
fPrincipalStructureTable.put(typeHandle, tsEntry);
types[count++]= typeHandle;
}
-
+
/* Update the dependency graph. */
if (count < types.length) {
System.arraycopy(types, 0, types= new IType[count], 0, count);
@@ -1712,7 +1723,7 @@ static Comparator getPathComparator() {
if (!vSourceDeps.contains(fDevelopmentContext.getDefaultPackage())) {
vSourceDeps.addElement(fDevelopmentContext.getDefaultPackage());
}
-
+
/* do for each file dependency */
if (fileDependencies != null) {
for (int i= 0; i < fileDependencies.length; i++) {
@@ -1745,6 +1756,13 @@ static Comparator getPathComparator() {
fBuildContext= context;
}
/**
+ * Sets the compiler options that were in effect when
+ * this state was built.
+ */
+ protected void setCompilerOptions(ConfigurableOption[] options) {
+ fCompilerOptions= options;
+ }
+ /**
* Sets the fingerprint for this state.
*/
protected void setFingerprint(byte[] fp) {
@@ -1798,7 +1816,7 @@ static Comparator getPathComparator() {
* Returns a string representation of the receiver.
*/
public String toString() {
- return "StateImpl(" + fStateNumber + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "StateImpl("/*nonNLS*/ + fStateNumber + ")"/*nonNLS*/;
}
/**
* Returns the type handle for the given type name,
@@ -1850,7 +1868,7 @@ static Comparator getPathComparator() {
++i;
c= sig.charAt(i);
}
-
+
/* if its a class */
IType elementType;
if (c == 'L') {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnap.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnap.java
index 01bf6366de..52fcb91c38 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnap.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnap.java
@@ -75,7 +75,7 @@ public StateImpl read(JavaDevelopmentContextImpl dc, IProject project, DataInput
int magic = in.readInt();
int version = in.readShort();
if (magic != MAGIC) { // magic = "STAT"e
- throw new IOException(Util.bind("build.wrongFileFormat")); //$NON-NLS-1$
+ throw new IOException(Util.bind("build.wrongFileFormat"/*nonNLS*/));
}
/* dispatch to appropriate reader */
@@ -85,7 +85,7 @@ public StateImpl read(JavaDevelopmentContextImpl dc, IProject project, DataInput
case VERSION6:
return new StateSnapV6().read(dc, project, in);
default:
- throw new IOException(Util.bind("build.unhandledVersionFormat")); //$NON-NLS-1$
+ throw new IOException(Util.bind("build.unhandledVersionFormat"/*nonNLS*/));
}
}
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapConstantPool.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapConstantPool.java
index 898311cce7..7584b6f8fb 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapConstantPool.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapConstantPool.java
@@ -114,14 +114,14 @@ public void add(IHandle handle) {
// NOP
break;
default:
- Assert.isTrue(false, "Unknown kind of handle"); //$NON-NLS-1$
+ Assert.isTrue(false, "Unknown kind of handle"/*nonNLS*/);
}
}
/**
* Add a SourceEntry to the pool.
*/
public void add(SourceEntry entry) {
- Assert.isNotNull(entry, "Null SourceEntry being added to StateSnapConstantPool"); //$NON-NLS-1$
+ Assert.isNotNull(entry, "Null SourceEntry being added to StateSnapConstantPool"/*nonNLS*/);
if (!fSet.includes(entry)) {
add(entry.getPath());
String zipEntryPath = entry.fZipEntryPath;
@@ -171,12 +171,12 @@ public IHandle getHandle(int index) throws IOException {
try {
IHandle result = (IHandle)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
}
/**
@@ -192,12 +192,12 @@ public IPackage getPackage(int index) throws IOException {
try {
IPackage result = (IPackage)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
}
/**
@@ -207,12 +207,12 @@ public IPath getPath(int index) throws IOException {
try {
IPath result = (IPath)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
}
/**
@@ -222,12 +222,12 @@ public SourceEntry getSourceEntry(int index) throws IOException {
try {
SourceEntry result = (SourceEntry)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
}
/**
@@ -237,12 +237,12 @@ public String getString(int index) throws IOException {
try {
String result = (String)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
}
/**
@@ -263,7 +263,7 @@ public Object getStringOrNumber(int index) throws IOException {
return result;
}
else {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
}
/**
@@ -273,12 +273,12 @@ public IType getType(int index) throws IOException {
try {
IType result = (IType)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
}
/**
@@ -306,10 +306,10 @@ public String histogram() {
++nN;
}
else {
- Assert.isTrue(false, "Unexpected pool item"); //$NON-NLS-1$
+ Assert.isTrue(false, "Unexpected pool item"/*nonNLS*/);
}
}
- return "nStr=" + nStr + ", nID=" + nID + ", nSE=" + nSE + ", nH=" + nH + ",nN=" + nN; //$NON-NLS-1$ //$NON-NLS-5$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-4$
+ return "nStr="/*nonNLS*/ + nStr + ", nID="/*nonNLS*/ + nID + ", nSE="/*nonNLS*/ + nSE + ", nH="/*nonNLS*/ + nH + ",nN="/*nonNLS*/ + nN;
}
/**
@@ -323,7 +323,7 @@ public int index(Object obj) {
return fSet.index(obj);
}
catch (IllegalArgumentException e) {
- throw new IllegalArgumentException("Internal error in state serialization. Expected object missing from constant pool: " + obj); //$NON-NLS-1$
+ throw new IllegalArgumentException("Internal error in state serialization. Expected object missing from constant pool: "/*nonNLS*/ + obj);
}
}
/**
@@ -397,7 +397,7 @@ private void read(IDevelopmentContext dc, DataInputStream in, StateSnapV5 snap)
fSet.put(i, readNumber(in, tag));
break;
default:
- throw new IOException("Unexpected kind of pool item"); //$NON-NLS-1$
+ throw new IOException("Unexpected kind of pool item"/*nonNLS*/);
}
}
}
@@ -415,7 +415,7 @@ private IHandle readHandle(IDevelopmentContext dc, DataInputStream in, int tag)
case 5: {
// primitive type
// Should not occur since primitive types are well known and not written
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
case 6: {
// array type
@@ -433,7 +433,7 @@ private IHandle readHandle(IDevelopmentContext dc, DataInputStream in, int tag)
// method
IType declaringClass = getType(in.readInt());
if (declaringClass.isPrimitive() || declaringClass.isArray()) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
String name = getString(in.readInt());
int numParams = in.readByte() & 0xFF;
@@ -447,7 +447,7 @@ private IHandle readHandle(IDevelopmentContext dc, DataInputStream in, int tag)
// constructor
IType declaringClass = getType(in.readInt());
if (declaringClass.isPrimitive() || declaringClass.isArray()) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
int numParams = in.readByte() & 0xFF;
IType[] params = new IType[numParams];
@@ -460,7 +460,7 @@ private IHandle readHandle(IDevelopmentContext dc, DataInputStream in, int tag)
// field
IType declaringClass = getType(in.readInt());
if (declaringClass.isPrimitive() || declaringClass.isArray()) {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
String name = getString(in.readInt());
return declaringClass.getFieldHandle(name);
@@ -469,7 +469,7 @@ private IHandle readHandle(IDevelopmentContext dc, DataInputStream in, int tag)
// image
return dc.getImage();
default:
- throw new IOException("Unexpected kind of pool item"); //$NON-NLS-1$
+ throw new IOException("Unexpected kind of pool item"/*nonNLS*/);
}
}
/**
@@ -490,7 +490,7 @@ private Number readNumber(DataInputStream in, int tag) throws IOException {
// Double
return new Double(Double.longBitsToDouble(in.readLong()));
default:
- throw new IOException("Unexpected type of number"); //$NON-NLS-1$
+ throw new IOException("Unexpected type of number"/*nonNLS*/);
}
}
/**
@@ -539,7 +539,7 @@ public void write(DataOutputStream out) throws IOException {
writeNumber((Number)obj, out); // tags 12 through 15
}
else {
- Assert.isTrue(false, "Unexpected kind of pool item"); //$NON-NLS-1$
+ Assert.isTrue(false, "Unexpected kind of pool item"/*nonNLS*/);
}
}
}
@@ -559,7 +559,7 @@ private void writeHandle(IHandle h, DataOutputStream out) throws IOException {
if (t.isPrimitive()) {
// tag=5
// Primitive types should not show up since they are well known and are not written.
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
else if (t.isArray()) {
ArrayTypeHandleImpl at = (ArrayTypeHandleImpl)t;
@@ -611,7 +611,7 @@ private void writeHandle(IHandle h, DataOutputStream out) throws IOException {
out.writeByte(11);
break;
default:
- Assert.isTrue(false, "Unknown kind of handle"); //$NON-NLS-1$
+ Assert.isTrue(false, "Unknown kind of handle"/*nonNLS*/);
}
}
/**
@@ -635,7 +635,7 @@ private void writeNumber(Number num, DataOutputStream out) throws IOException {
out.writeLong(Double.doubleToLongBits(num.doubleValue()));
}
else {
- Assert.isTrue(false, "Unexpected type of number"); //$NON-NLS-1$
+ Assert.isTrue(false, "Unexpected type of number"/*nonNLS*/);
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapV5.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapV5.java
index 75baf0db3f..e7f9d4f4fd 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapV5.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapV5.java
@@ -75,7 +75,7 @@ protected void addDependencyGraphToPool(StateImpl state, StateSnapConstantPool p
pool.add(((ZipNode)node).getZipFile());
break;
default:
- Assert.isTrue(false, "Unexpected kind of node"); //$NON-NLS-1$
+ Assert.isTrue(false, "Unexpected kind of node"/*nonNLS*/);
}
// Don't need to process node dependents here, since they're nodes as well
// and will have their info added to the pool above.
@@ -153,7 +153,7 @@ protected void addTypeStructureEntryToPool(TypeStructureEntry tsEntry, StateSnap
pool.add(tsEntry.getType());
}
protected void badFormat() throws IOException {
- throw new IOException("Error in format"); //$NON-NLS-1$
+ throw new IOException("Error in format"/*nonNLS*/);
}
/**
* Check that the next section has the given name.
@@ -202,7 +202,7 @@ public StateImpl read(JavaDevelopmentContextImpl dc, IProject project, DataInput
* Read the build context.
*/
protected IImageContext readBuildContext(IDevelopmentContext dc, StateSnapConstantPool pool, DataInputStream in) throws IOException {
- checkSection(in, "BuildContext"); //$NON-NLS-1$
+ checkSection(in, "BuildContext"/*nonNLS*/);
int numPkgs = in.readInt();
if (numPkgs == -1) {
return null;
@@ -218,7 +218,7 @@ protected IImageContext readBuildContext(IDevelopmentContext dc, StateSnapConsta
* The state is needed to create CompilationUnit objects from SourceEntry objects.
*/
protected DependencyGraph readDependencyGraph(StateSnapConstantPool pool, DataInputStream in, StateImpl state) throws IOException {
- checkSection(in, "DependencyGraph"); //$NON-NLS-1$
+ checkSection(in, "DependencyGraph"/*nonNLS*/);
DependencyGraph graph = new DependencyGraph();
// Avoid creating package elements for each node and dependency.
@@ -268,7 +268,7 @@ protected DependencyGraph readDependencyGraph(StateSnapConstantPool pool, DataIn
* Read the package map.
*/
protected PackageMap readPackageMap(StateSnapConstantPool pool, DataInputStream in) throws IOException {
- checkSection(in, "PackageMap"); //$NON-NLS-1$
+ checkSection(in, "PackageMap"/*nonNLS*/);
PackageMap map = new PackageMap();
int size = in.readInt();
for (int i = 0; i < size; ++i) {
@@ -286,7 +286,7 @@ protected PackageMap readPackageMap(StateSnapConstantPool pool, DataInputStream
* Read the principal structure table.
*/
protected Hashtable readPrincipalStructureTable(StateSnapConstantPool pool, DataInputStream in, StateImpl state) throws IOException {
- checkSection(in, "PrincipalStructureTable"); //$NON-NLS-1$
+ checkSection(in, "PrincipalStructureTable"/*nonNLS*/);
int numEntries = in.readInt();
Hashtable table = new Hashtable(numEntries * 2 + 1);
for (int i = 0; i < numEntries; ++i) {
@@ -314,7 +314,7 @@ protected ProblemDetailImpl readProblem(StateSnapConstantPool pool, DataInputStr
* Read the problem reporter.
*/
protected IProblemReporter readProblemReporter(IProject project, StateSnapConstantPool pool, DataInputStream in) throws IOException {
- checkSection(in, "Problems"); //$NON-NLS-1$
+ checkSection(in, "Problems"/*nonNLS*/);
IProblemReporter reporter = null;
boolean isProblemTable = in.readBoolean();
if (isProblemTable) {
@@ -330,14 +330,14 @@ protected IProblemReporter readProblemReporter(IProject project, StateSnapConsta
try {
clazz = Class.forName(className);
} catch (ClassNotFoundException e) {
- throw new IOException("Class " + className + " was not found."); //$NON-NLS-2$ //$NON-NLS-1$
+ throw new IOException("Class "/*nonNLS*/ + className + " was not found."/*nonNLS*/);
}
try {
reporter = (IProblemReporter) clazz.newInstance();
} catch (InstantiationException e) {
- throw new IOException("Could not instanciate " + clazz.getName()); //$NON-NLS-1$
+ throw new IOException("Could not instanciate "/*nonNLS*/ + clazz.getName());
} catch (IllegalAccessException e) {
- throw new IOException("Could not instanciate " + clazz.getName()); //$NON-NLS-1$
+ throw new IOException("Could not instanciate "/*nonNLS*/ + clazz.getName());
}
reporter.initialize(project, JavaModelManager.getJavaModelManager().getDevelopmentContext(project));
}
@@ -347,7 +347,7 @@ protected IProblemReporter readProblemReporter(IProject project, StateSnapConsta
* Read the source element table.
*/
protected SourceElementTable readSourceElementTable(StateSnapConstantPool pool, DataInputStream in) throws IOException {
- checkSection(in, "SourceElementTable"); //$NON-NLS-1$
+ checkSection(in, "SourceElementTable"/*nonNLS*/);
SourceElementTable table = new SourceElementTable();
int numPackages = in.readInt();
for (int i = 0; i < numPackages; ++i) {
@@ -476,7 +476,7 @@ protected void skipAttributes(DataInputStream in) throws IOException {
* Write the build context.
*/
protected void writeBuildContext(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {
- out.writeUTF("BuildContext"); //$NON-NLS-1$
+ out.writeUTF("BuildContext"/*nonNLS*/);
IImageContext ctx = state.getBuildContext();
if (ctx == null) {
out.writeInt(-1);
@@ -493,7 +493,7 @@ protected void writeBuildContext(StateImpl state, StateSnapConstantPool pool, Da
* Write the dependency graph.
*/
protected void writeDependencyGraph(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {
- out.writeUTF("DependencyGraph"); //$NON-NLS-1$
+ out.writeUTF("DependencyGraph"/*nonNLS*/);
DependencyGraph graph = state.getInternalDependencyGraph();
graph.integrityCheck();
/**
@@ -508,7 +508,7 @@ protected void writeDependencyGraph(StateImpl state, StateSnapConstantPool pool,
out.writeBoolean(true);
SourceEntry sEntry = state.getSourceEntry(jcu.getPackageElement());
if (sEntry == null) {
- System.out.println("Warning: StatSnap: Attempt to serialize dependency graph node for missing JCU: " + jcu.getPackageElement() + ". Skipping..."); //$NON-NLS-1$ //$NON-NLS-2$
+ System.out.println("Warning: StatSnap: Attempt to serialize dependency graph node for missing JCU: "/*nonNLS*/ + jcu.getPackageElement() + ". Skipping..."/*nonNLS*/);
} else {
Assert.isNotNull(sEntry);
out.writeInt(pool.index(sEntry));
@@ -572,7 +572,7 @@ protected void writeEmptyAttributes(DataOutputStream out) throws IOException {
* Write the package map.
*/
protected void writePackageMap(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {
- out.writeUTF("PackageMap"); //$NON-NLS-1$
+ out.writeUTF("PackageMap"/*nonNLS*/);
PackageMap map = state.getPackageMap();
out.writeInt(map.size());
int count = 0;
@@ -592,7 +592,7 @@ protected void writePackageMap(StateImpl state, StateSnapConstantPool pool, Data
* Write the principal structure table.
*/
protected void writePrincipalStructureTable(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {
- out.writeUTF("PrincipalStructureTable"); //$NON-NLS-1$
+ out.writeUTF("PrincipalStructureTable"/*nonNLS*/);
Hashtable table = state.getPrincipalStructureTable();
int num = table.size();
out.writeInt(num);
@@ -621,7 +621,7 @@ protected void writeProblem(ProblemDetailImpl pb, StateSnapConstantPool pool, Da
* Write the problem reporter.
*/
protected void writeProblemReporter(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {
- out.writeUTF("Problems"); //$NON-NLS-1$
+ out.writeUTF("Problems"/*nonNLS*/);
IProblemReporter reporter = state.getProblemReporter();
if (reporter instanceof ProblemTable) {
out.writeBoolean(true);
@@ -645,7 +645,7 @@ protected void writeProblemReporter(StateImpl state, StateSnapConstantPool pool,
* Write the source element table.
*/
protected void writeSourceElementTable(StateImpl state, StateSnapConstantPool pool, DataOutputStream out) throws IOException {
- out.writeUTF("SourceElementTable"); //$NON-NLS-1$
+ out.writeUTF("SourceElementTable"/*nonNLS*/);
SourceElementTable table = state.getSourceElementTable();
int num = table.numPackages();
out.writeInt(num);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeCollaboratorIndictment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeCollaboratorIndictment.java
index b799ee9ff5..622b1e5361 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeCollaboratorIndictment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeCollaboratorIndictment.java
@@ -28,6 +28,6 @@ protected TypeCollaboratorIndictment(char[] name) {
*/
public String toString() {
// don't use + with char[]
- return new StringBuffer("TypeIndictment(").append(fName).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$
+ return new StringBuffer("TypeIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeHierarchyIndictment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeHierarchyIndictment.java
index 97d8a65c21..cf0bf75dfa 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeHierarchyIndictment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeHierarchyIndictment.java
@@ -28,6 +28,6 @@ protected TypeHierarchyIndictment(char[] name) {
*/
public String toString() {
// don't use + with char[]
- return new StringBuffer("TypeHierarchyIndictment(").append(fName).append(")").toString(); //$NON-NLS-1$ //$NON-NLS-2$
+ return new StringBuffer("TypeHierarchyIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeImpl.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeImpl.java
index d398e6e1eb..a7b9c0dc34 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeImpl.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeImpl.java
@@ -16,7 +16,7 @@ public abstract class TypeImpl extends NonStateSpecificHandleImpl implements ITy
typeA = (IType)a;
typeB = (IType)b;
} catch (ClassCastException e) {
- Assert.isTrue(false, "Should only be comparing ITypes"); //$NON-NLS-1$
+ Assert.isTrue(false, "Should only be comparing ITypes"/*nonNLS*/);
}
return typeA.getName().compareTo(typeB.getName());
}
@@ -149,7 +149,7 @@ public int getDeclaredModifiers() throws NotPresentException {
* a String of length 0.
*/
public String getDeclaredName() throws NotPresentException {
- return ""; //$NON-NLS-1$
+ return ""/*nonNLS*/;
}
/**
* If the class or interface represented by this Type object is
@@ -476,6 +476,6 @@ public boolean isTopLevel() throws org.eclipse.jdt.internal.core.builder.NotPres
* only (NON-NLS).
*/
public String toString() {
- return "type " + getName(); //$NON-NLS-1$
+ return "type "/*nonNLS*/ + getName();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeImplSWH.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeImplSWH.java
index 8f50227169..373d85435e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeImplSWH.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeImplSWH.java
@@ -126,7 +126,7 @@ public int getDeclaredModifiers() throws NotPresentException {
* a String of length 0.
*/
public String getDeclaredName() throws NotPresentException {
- return ""; //$NON-NLS-1$
+ return ""/*nonNLS*/;
}
/**
* If the class or interface represented by this Type object is
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeNode.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeNode.java
index e99317d460..bd9a84b627 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeNode.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeNode.java
@@ -63,6 +63,6 @@ public IType[] getTypes() {
* purposes only.
*/
public String toString() {
- return "TypeNode(" + fType.getFileName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "TypeNode("/*nonNLS*/ + fType.getFileName() + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeStructureEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeStructureEntry.java
index bdb9564bf8..3e11a4f827 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeStructureEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeStructureEntry.java
@@ -92,11 +92,11 @@ int getCRC32() {
* @return a string representation of the receiver
*/
public String toString() {
- StringBuffer buf = new StringBuffer("TypeStructureEntry("); //$NON-NLS-1$
+ StringBuffer buf = new StringBuffer("TypeStructureEntry("/*nonNLS*/);
if (fType != null) {
buf.append(fType.getName());
}
- buf.append(")"); //$NON-NLS-1$
+ buf.append(")"/*nonNLS*/);
return buf.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/UnmodifiedBuilderType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/UnmodifiedBuilderType.java
index 83dd0eff3a..21812de253 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/UnmodifiedBuilderType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/UnmodifiedBuilderType.java
@@ -52,6 +52,6 @@ public boolean isAffected() {
* For debugging only
*/
public String toString() {
- return "UnmodifiedBuilderType(" + fNewTSEntry.getType().getName() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "UnmodifiedBuilderType("/*nonNLS*/ + fNewTSEntry.getType().getName() + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/WorkQueue.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/WorkQueue.java
index 7186c891c8..8f263a08a0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/WorkQueue.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/WorkQueue.java
@@ -61,7 +61,7 @@ public void add(PackageElement element) {
} else {
if (entry.status != NEEDS_COMPILE) {
if (entry.status == COMPILED) {
- System.out.println("Warning: image builder wants to recompile already compiled element: " + element); //$NON-NLS-1$
+ System.out.println("Warning: image builder wants to recompile already compiled element: "/*nonNLS*/ + element);
}
entry.status = NEEDS_COMPILE;
needsCompileList.addElement(element);
@@ -79,7 +79,7 @@ public void compiled(PackageElement element) {
entries.put(element, entry);
} else {
if (entry.status != NEEDS_COMPILE) {
- System.out.println("Warning: Java builder compiled the same element twice: " + element); //$NON-NLS-1$
+ System.out.println("Warning: Java builder compiled the same element twice: "/*nonNLS*/ + element);
}
needsCompileList.removeElement(element);
}
@@ -117,6 +117,6 @@ public boolean needsCompile(PackageElement element) {
return entry != null && entry.status == NEEDS_COMPILE;
}
public String toString() {
- return "WorkQueue: " + needsCompileList; //$NON-NLS-1$
+ return "WorkQueue: "/*nonNLS*/ + needsCompileList;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ZipNode.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ZipNode.java
index 635086d5bc..2f51cb3f79 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ZipNode.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ZipNode.java
@@ -57,6 +57,6 @@ public IPath getZipFile() {
* purposes only.
*/
public String toString() {
- return "ZipNode(" + fZipFile + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ return "ZipNode("/*nonNLS*/ + fZipFile + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java
index e3cc003fdb..2e7995f41a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java
@@ -7,17 +7,16 @@ package org.eclipse.jdt.internal.core.eval;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
-import org.eclipse.jdt.core.*;
-import org.eclipse.jdt.core.eval.*;
import org.eclipse.jdt.internal.codeassist.ISelectionRequestor;
import org.eclipse.jdt.internal.codeassist.ICompletionRequestor;
import org.eclipse.jdt.internal.compiler.*;
import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
+import org.eclipse.jdt.core.*;
+import org.eclipse.jdt.core.eval.*;
import org.eclipse.jdt.internal.compiler.util.CharOperation;
import org.eclipse.jdt.internal.core.*;
import org.eclipse.jdt.internal.core.builder.impl.JavaBuilder;
import org.eclipse.jdt.internal.core.builder.impl.ProblemFactory;
-import org.eclipse.jdt.internal.core.ClassFile;
import org.eclipse.jdt.internal.eval.*;
import java.util.Locale;
@@ -53,7 +52,7 @@ public IGlobalVariable[] allVariables() {
*/
protected void checkBuilderState() throws JavaModelException {
if (!getProject().hasBuildState()) {
- throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.EVALUATION_ERROR, Util.bind("eval.needBuiltState"))); //$NON-NLS-1$
+ throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.EVALUATION_ERROR, Util.bind("eval.needBuiltState"/*nonNLS*/)));
}
}
/**
@@ -65,7 +64,7 @@ public void codeComplete(String codeSnippet, int position, ICodeCompletionReques
position,
this.project.getSearchableNameEnvironment(),
new CompletionRequestorWrapper(requestor),
- JavaModelManager.getOptions()
+ JavaModelManager.convertConfigurableOptions(JavaCore.getOptions())
);
}
/**
@@ -79,7 +78,7 @@ public IJavaElement[] codeSelect(String codeSnippet, int offset, int length) thr
offset + length - 1,
this.project.getSearchableNameEnvironment(),
requestor,
- JavaModelManager.getOptions()
+ JavaModelManager.convertConfigurableOptions(JavaCore.getOptions())
);
return requestor.getElements();
}
@@ -91,7 +90,7 @@ public void deleteVariable(IGlobalVariable variable) {
GlobalVariableWrapper wrapper = (GlobalVariableWrapper)variable;
this.context.deleteVariable(wrapper.variable);
} else {
- throw new Error("Unknown implementation of IGlobalVariable"); //$NON-NLS-1$
+ throw new Error("Unknown implementation of IGlobalVariable"/*nonNLS*/);
}
}
/**
@@ -138,15 +137,6 @@ public void evaluateCodeSnippet(
}
this.context.setImports(importsNames);
}
- } else {
- // try to retrieve imports from the source
- SourceMapper sourceMapper = ((ClassFile) declaringType.getClassFile()).getSourceMapper();
- if (sourceMapper != null) {
- char[][] imports = sourceMapper.getImports((BinaryType) declaringType);
- if (imports != null) {
- this.context.setImports(imports);
- }
- }
}
}
try {
@@ -203,7 +193,7 @@ protected INameEnvironment getBuildNameEnvironment() throws JavaModelException {
* Returns the compiler's configurable options.
*/
protected ConfigurableOption[] getCompilerOptions() throws JavaModelException {
- return JavaModelManager.getOptions();
+ return JavaModelManager.convertConfigurableOptions(JavaCore.getOptions());
}
/**
* @see org.eclipse.jdt.core.eval.IEvaluationContext#getImports
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
index c8a6c6265b..41e2274f3f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyBinaryType.java
@@ -162,37 +162,30 @@ public void recordSuperType(char[] superTypeName, char[] superQualification, cha
public String toString() {
StringBuffer buffer = new StringBuffer();
if (this.modifiers == IConstants.AccPublic) {
- buffer.append("public "); //$NON-NLS-1$
+ buffer.append("public "/*nonNLS*/);
}
if (this.isClass()) {
- buffer.append("class "); //$NON-NLS-1$
+ buffer.append("class "/*nonNLS*/);
} else {
- buffer.append("interface "); //$NON-NLS-1$
+ buffer.append("interface "/*nonNLS*/);
}
if (this.name != null) {
buffer.append(this.name);
}
if (this.superclass != null) {
- buffer.append("\n extends "); //$NON-NLS-1$
+ buffer.append("\n extends "/*nonNLS*/);
buffer.append(this.superclass);
}
int length;
if (this.superInterfaces != null && (length = this.superInterfaces.length) != 0) {
- buffer.append("\n implements "); //$NON-NLS-1$
+ buffer.append("\n implements "/*nonNLS*/);
for (int i = 0; i < length; i++) {
buffer.append(this.superInterfaces[i]);
if (i != length - 1) {
- buffer.append(", "); //$NON-NLS-1$
+ buffer.append(", "/*nonNLS*/);
}
}
}
return buffer.toString();
}
-
-/**
- * @see org.eclipse.jdt.internal.compiler.env.IBinaryType.
- */
-public char[] sourceFileName() {
- return null;
-}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
index b611d2fe5c..1b204e594d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/IndexBasedHierarchyBuilder.java
@@ -75,7 +75,7 @@ public class IndexBasedHierarchyBuilder extends HierarchyBuilder {
return name;
}
public String toString(){
- StringBuffer buffer = new StringBuffer("Queue:\n"); //$NON-NLS-1$
+ StringBuffer buffer = new StringBuffer("Queue:\n"/*nonNLS*/);
for (int i = this.start; i <= this.end; i++){
buffer.append(names[i]).append('\n');
}
@@ -319,7 +319,7 @@ private void createInfoFromClassFile(Openable handle, String osPath, Vector info
*/
private void createInfoFromClassFileInJar(Openable classFile, Vector infos) throws JavaModelException {
IJavaElement pkg = classFile.getParent();
- String classFilePath = pkg.getElementName().replace('.', '/') + "/" + classFile.getElementName(); //$NON-NLS-1$
+ String classFilePath = pkg.getElementName().replace('.', '/') + "/"/*nonNLS*/ + classFile.getElementName();
IGenericType info = null;
java.util.zip.ZipFile zipFile = null;
try {
@@ -443,7 +443,7 @@ public static void searchAllPossibleSubTypes(
IIndexSearchRequestor searchRequestor = new IndexSearchAdapter(){
public void acceptSuperTypeReference(String resourcePath, char[] qualification, char[] typeName, char[] enclosingTypeName, char classOrInterface, char[] superQualification, char[] superTypeName, char superClassOrInterface, int modifiers) {
pathRequestor.acceptPath(resourcePath);
- if (resourcePath.endsWith("class")){ //$NON-NLS-1$
+ if (resourcePath.endsWith("class"/*nonNLS*/)){
HierarchyBinaryType binaryType = (HierarchyBinaryType)binariesFromIndexMatches.get(resourcePath);
if (binaryType == null){
binaryType = new HierarchyBinaryType(modifiers, qualification, typeName, enclosingTypeName, classOrInterface);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
index afb64f0fd0..de684ca051 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java
@@ -1022,7 +1022,7 @@ public void refresh(IProgressMonitor monitor) throws JavaModelException {
}
fProgressMonitor = monitor;
if (monitor != null) {
- monitor.beginTask(Util.bind("hierarchy.creating"), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
+ monitor.beginTask(Util.bind("hierarchy.creating"/*nonNLS*/), IProgressMonitor.UNKNOWN);
}
compute();
if (fType != null) {
@@ -1097,7 +1097,7 @@ private boolean subtypesIncludeSupertypeOf(IType type) {
return false;
}
if (superclassName == null) {
- superclassName = "Object"; //$NON-NLS-1$
+ superclassName = "Object"/*nonNLS*/;
}
int dot = -1;
String simpleSuper = (dot = superclassName.lastIndexOf('.')) > -1 ?
@@ -1133,24 +1133,24 @@ private boolean subtypesIncludeSupertypeOf(IType type) {
*/
public String toString() {
StringBuffer buffer = new StringBuffer();
- buffer.append("Focus: "); //$NON-NLS-1$
- buffer.append(fType == null ? "<NONE>" : fType.getFullyQualifiedName()); //$NON-NLS-1$
- buffer.append("\n"); //$NON-NLS-1$
+ buffer.append("Focus: "/*nonNLS*/);
+ buffer.append(fType == null ? "<NONE>"/*nonNLS*/ : fType.getFullyQualifiedName());
+ buffer.append("\n"/*nonNLS*/);
if (exists()) {
if (fType != null) {
- buffer.append("Super types:\n"); //$NON-NLS-1$
+ buffer.append("Super types:\n"/*nonNLS*/);
toString(buffer, fType, 1, true);
- buffer.append("Sub types:\n"); //$NON-NLS-1$
+ buffer.append("Sub types:\n"/*nonNLS*/);
toString(buffer, fType, 1, false);
} else {
- buffer.append("Sub types of root classes:\n"); //$NON-NLS-1$
+ buffer.append("Sub types of root classes:\n"/*nonNLS*/);
IType[] roots= getRootClasses();
for (int i= 0; i < roots.length; i++) {
toString(buffer, roots[i], 1, false);
}
}
} else {
- buffer.append("(Hierarchy became stale)"); //$NON-NLS-1$
+ buffer.append("(Hierarchy became stale)"/*nonNLS*/);
}
return buffer.toString();
}
@@ -1161,7 +1161,7 @@ public String toString() {
*/
private void toString(StringBuffer buffer, IType type, int indent, boolean ascendant) {
for (int i= 0; i < indent; i++) {
- buffer.append(" "); //$NON-NLS-1$
+ buffer.append(" "/*nonNLS*/);
}
buffer.append(type.getFullyQualifiedName());
buffer.append('\n');
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/CompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/CompilationUnit.java
index 4b6b41e6bd..b7454d9e55 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/CompilationUnit.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/CompilationUnit.java
@@ -22,11 +22,11 @@ public CompilationUnit(char[] contents, char[] filename) {
fFileName = filename;
String file = new String(filename);
- int start = file.lastIndexOf("/") + 1; //$NON-NLS-1$
- if (start == 0 || start < file.lastIndexOf("\\")) //$NON-NLS-1$
- start = file.lastIndexOf("\\") + 1; //$NON-NLS-1$
+ int start = file.lastIndexOf("/"/*nonNLS*/) + 1;
+ if (start == 0 || start < file.lastIndexOf("\\"/*nonNLS*/))
+ start = file.lastIndexOf("\\"/*nonNLS*/) + 1;
- int end = file.lastIndexOf("."); //$NON-NLS-1$
+ int end = file.lastIndexOf("."/*nonNLS*/);
if (end == -1)
end = file.length();
@@ -42,6 +42,6 @@ public char[] getMainTypeName() {
return fMainTypeName;
}
public String toString() {
- return "CompilationUnit[" + new String(fFileName) + "]"; //$NON-NLS-2$ //$NON-NLS-1$
+ return "CompilationUnit["/*nonNLS*/ + new String(fFileName) + "]"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.java
index e7da005cdf..421510efea 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.java
@@ -33,7 +33,7 @@ class DOMCompilationUnit extends DOMNode implements IDOMCompilationUnit {
* Creates a new empty COMPILATION_UNIT document fragment.
*/
DOMCompilationUnit() {
- fHeader=""; //$NON-NLS-1$
+ fHeader=""/*nonNLS*/;
}
/**
* Creates a new COMPILATION_UNIT on the given range of the document.
@@ -47,7 +47,7 @@ DOMCompilationUnit() {
*/
DOMCompilationUnit(char[] document, int[] sourceRange) {
super(document, sourceRange, null, new int[]{-1, -1});
- fHeader = ""; //$NON-NLS-1$
+ fHeader = ""/*nonNLS*/;
}
/**
* @see DOMNode#appendContents(CharArrayBuffer)
@@ -75,7 +75,7 @@ public IJavaElement getJavaElement(IJavaElement parent) throws IllegalArgumentEx
if (parent.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
return ((IPackageFragment)parent).getCompilationUnit(getName());
} else {
- throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));
}
}
/**
@@ -102,7 +102,7 @@ public String getName() {
topLevelType= firstType;
}
if (topLevelType != null) {
- return topLevelType.getName() + ".java"; //$NON-NLS-1$
+ return topLevelType.getName() + ".java"/*nonNLS*/;
} else {
return null;
}
@@ -174,6 +174,6 @@ protected void shareContents(DOMNode node) {
* @see IDOMNode#toString()
*/
public String toString() {
- return "COMPILATION_UNIT: " + getName(); //$NON-NLS-1$
+ return "COMPILATION_UNIT: "/*nonNLS*/ + getName();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java
index d6e1b1a010..e9d22f5c3a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java
@@ -229,7 +229,7 @@ protected void becomeDetailed() throws DOMException {
DOMBuilder builder = new DOMBuilder();
IDOMField[] details= builder.createFields(source.toCharArray());
if (details.length == 0) {
- throw new DOMException(Util.bind("dom.cannotDetail")); //$NON-NLS-1$
+ throw new DOMException(Util.bind("dom.cannotDetail"/*nonNLS*/));
} else {
node= this;
for (int i= 0; i < details.length; i++) {
@@ -316,7 +316,7 @@ public IJavaElement getJavaElement(IJavaElement parent) throws IllegalArgumentEx
if (parent.getElementType() == IJavaElement.TYPE) {
return ((IType)parent).getField(getName());
} else {
- throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));
}
}
/**
@@ -561,7 +561,7 @@ protected void setIsVariableDeclarator(boolean isVariableDeclarator) {
*/
public void setName(String name) throws IllegalArgumentException {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));
} else {
super.setName(name);
setTypeAltered(true);
@@ -572,7 +572,7 @@ public void setName(String name) throws IllegalArgumentException {
*/
public void setType(String typeName) throws IllegalArgumentException {
if (typeName == null) {
- throw new IllegalArgumentException(Util.bind("element.nullType")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.nullType"/*nonNLS*/));
}
becomeDetailed();
expand();
@@ -603,6 +603,6 @@ protected void shareContents(DOMNode node) {
* @see IDOMNode#toString()
*/
public String toString() {
- return "FIELD: " + getName(); //$NON-NLS-1$
+ return "FIELD: "/*nonNLS*/ + getName();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMImport.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMImport.java
index a966e74095..5a9baf69fb 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMImport.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMImport.java
@@ -27,7 +27,7 @@ class DOMImport extends DOMNode implements IDOMImport {
* Creates a new empty IMPORT node.
*/
DOMImport() {
- fName = "java.lang.*"; //$NON-NLS-1$
+ fName = "java.lang.*"/*nonNLS*/;
setMask(MASK_DETAILED_SOURCE_INDEXES, true);
}
/**
@@ -78,7 +78,7 @@ DOMImport(char[] document, int[] sourceRange, String name, boolean onDemand) {
protected void appendFragmentedContents(CharArrayBuffer buffer) {
if (fNameRange[0] < 0) {
buffer
- .append("import ") //$NON-NLS-1$
+ .append("import "/*nonNLS*/)
.append(fName)
.append(';')
.append(JavaModelManager.LINE_SEPARATOR);
@@ -112,7 +112,7 @@ public IJavaElement getJavaElement(IJavaElement parent) throws IllegalArgumentEx
if (parent.getElementType() == IJavaElement.COMPILATION_UNIT) {
return ((ICompilationUnit)parent).getImport(getName());
} else {
- throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));
}
}
/**
@@ -138,16 +138,16 @@ protected DOMNode newDOMNode() {
*/
public void setName(String name) {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));
}
becomeDetailed();
super.setName(name);
- fOnDemand = name.endsWith(".*"); //$NON-NLS-1$
+ fOnDemand = name.endsWith(".*"/*nonNLS*/);
}
/**
* @see IDOMNode#toString()
*/
public String toString() {
- return "IMPORT: " + getName(); //$NON-NLS-1$
+ return "IMPORT: "/*nonNLS*/ + getName();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMInitializer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMInitializer.java
index 86a735a075..0a1e6a2a44 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMInitializer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMInitializer.java
@@ -102,7 +102,7 @@ protected void appendMemberBodyContents(CharArrayBuffer buffer) {
.append(getBody())
.append(fDocument, fBodyRange[1] + 1, fSourceRange[1] - fBodyRange[1]);
} else {
- buffer.append("{}").append(JavaModelManager.LINE_SEPARATOR); //$NON-NLS-1$
+ buffer.append("{}"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);
}
}
/**
@@ -156,7 +156,7 @@ public IJavaElement getJavaElement(IJavaElement parent) throws IllegalArgumentEx
}
return ((IType) parent).getInitializer(count);
} else {
- throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));
}
}
/**
@@ -219,6 +219,6 @@ protected void shareContents(DOMNode node) {
* @see IDOMNode#toString()
*/
public String toString() {
- return "INITIALIZER"; //$NON-NLS-1$
+ return "INITIALIZER"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMMember.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMMember.java
index 09596aecc7..76e25ee0b8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMMember.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMMember.java
@@ -281,7 +281,7 @@ public void setComment(String comment) {
/* see 1FVIJAH */
if (comment != null) {
String commentString = new String(comment);
- if (commentString.indexOf("@deprecated") >= 0) { //$NON-NLS-1$
+ if (commentString.indexOf("@deprecated"/*nonNLS*/) >= 0) {
fFlags= fFlags | IConstants.AccDeprecated;
return;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMMethod.java
index 59c20e4f61..921ef4cf5a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMMethod.java
@@ -226,7 +226,7 @@ DOMMethod(char[] document, int[] sourceRange, String name, int[] nameRange, int
*/
public void addException(String name) throws IllegalArgumentException {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("dom.nullExceptionType")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("dom.nullExceptionType"/*nonNLS*/));
}
if (fExceptions == null) {
fExceptions= new String[1];
@@ -241,10 +241,10 @@ public void addException(String name) throws IllegalArgumentException {
*/
public void addParameter(String type, String name) throws IllegalArgumentException {
if (type == null) {
- throw new IllegalArgumentException(Util.bind("dom.nullTypeParameter")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("dom.nullTypeParameter"/*nonNLS*/));
}
if (name == null) {
- throw new IllegalArgumentException(Util.bind("dom.nullNameParameter")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("dom.nullNameParameter"/*nonNLS*/));
}
if (fParameterNames == null) {
fParameterNames= new String[1];
@@ -306,7 +306,7 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
if (fExceptionRange[0] >= 0) {
buffer.append(fDocument, start, fExceptionRange[0] - start);
} else {
- buffer.append(" throws "); //$NON-NLS-1$
+ buffer.append(" throws "/*nonNLS*/);
}
// add exception list
if (fExceptionList != null) {
@@ -414,7 +414,7 @@ public IJavaElement getJavaElement(IJavaElement parent) throws IllegalArgumentEx
}
return ((IType)parent).getMethod(name, sigs);
} else {
- throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));
}
}
/**
@@ -573,7 +573,7 @@ public void setBody(String body) {
fBody= body;
setHasBody(body != null);
if (!hasBody()) {
- fBody= ";"+JavaModelManager.LINE_SEPARATOR; //$NON-NLS-1$
+ fBody= ";"/*nonNLS*/+JavaModelManager.LINE_SEPARATOR;
}
}
/**
@@ -615,7 +615,7 @@ public void setExceptions(String[] names) {
*/
public void setName(String name) {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));
} else {
super.setName(name);
}
@@ -631,17 +631,17 @@ public void setParameters(String[] types, String[] names) throws IllegalArgument
fParameterNames= null;
fParameterList= new char[] {'(',')'};
} else {
- throw new IllegalArgumentException(Util.bind("dom.mismatchArgNamesAndTypes")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("dom.mismatchArgNamesAndTypes"/*nonNLS*/));
}
} else if (names.length != types.length) {
- throw new IllegalArgumentException(Util.bind("dom.mismatchArgNamesAndTypes")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("dom.mismatchArgNamesAndTypes"/*nonNLS*/));
} else if (names.length == 0) {
setParameters(null, null);
} else {
fParameterNames= names;
fParameterTypes= types;
CharArrayBuffer parametersBuffer = new CharArrayBuffer();
- parametersBuffer.append("("); //$NON-NLS-1$
+ parametersBuffer.append("("/*nonNLS*/);
char[] comma = new char[] {',', ' '};
for (int i = 0; i < names.length; i++) {
if (i > 0) {
@@ -662,7 +662,7 @@ public void setParameters(String[] types, String[] names) throws IllegalArgument
*/
public void setReturnType(String name) throws IllegalArgumentException {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("dom.nullReturnType")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("dom.nullReturnType"/*nonNLS*/));
}
becomeDetailed();
fragment();
@@ -705,9 +705,9 @@ protected void shareContents(DOMNode node) {
*/
public String toString() {
if (isConstructor()) {
- return "CONSTRUCTOR"; //$NON-NLS-1$
+ return "CONSTRUCTOR"/*nonNLS*/;
} else {
- return "METHOD: " + getName(); //$NON-NLS-1$
+ return "METHOD: "/*nonNLS*/ + getName();
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMNode.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMNode.java
index aa6ca79618..660f13c795 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMNode.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMNode.java
@@ -331,23 +331,23 @@ protected abstract void appendFragmentedContents(CharArrayBuffer buffer);
void basicAddChild(IDOMNode child) throws IllegalArgumentException, DOMException {
// verify child may be added
if (!canHaveChildren()) {
- throw new DOMException(Util.bind("dom.unableAddChild")); //$NON-NLS-1$
+ throw new DOMException(Util.bind("dom.unableAddChild"/*nonNLS*/));
}
if (child == null) {
- throw new IllegalArgumentException(Util.bind("dom.addNullChild")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("dom.addNullChild"/*nonNLS*/));
}
if (!isAllowableChild(child)) {
- throw new DOMException(Util.bind("dom.addIncompatibleChild")); //$NON-NLS-1$
+ throw new DOMException(Util.bind("dom.addIncompatibleChild"/*nonNLS*/));
}
if (child.getParent() != null) {
- throw new DOMException(Util.bind("dom.addChildWithParent")); //$NON-NLS-1$
+ throw new DOMException(Util.bind("dom.addChildWithParent"/*nonNLS*/));
}
/* NOTE: To test if the child is an ancestor of this node, we
* need only test if the root of this node is the child (the child
* is already a root since we have just guarenteed it has no parent).
*/
if (child == getRoot()) {
- throw new DOMException(Util.bind("dom.addAncestorAsChild")); //$NON-NLS-1$
+ throw new DOMException(Util.bind("dom.addAncestorAsChild"/*nonNLS*/));
}
DOMNode node= (DOMNode)child;
@@ -379,7 +379,7 @@ protected void becomeDetailed() throws DOMException {
if (!isDetailed()) {
DOMNode detailed= getDetailedNode();
if (detailed == null) {
- throw new DOMException(Util.bind("dom.cannotDetail")); //$NON-NLS-1$
+ throw new DOMException(Util.bind("dom.cannotDetail"/*nonNLS*/));
}
if (detailed != this) {
shareContents(detailed);
@@ -652,23 +652,23 @@ public int getStartPosition() {
public void insertSibling(IDOMNode sibling) throws IllegalArgumentException, DOMException {
// verify sibling may be added
if (sibling == null) {
- throw new IllegalArgumentException(Util.bind("dom.addNullSibling")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("dom.addNullSibling"/*nonNLS*/));
}
if (fParent == null) {
- throw new DOMException(Util.bind("dom.addSiblingBeforeRoot")); //$NON-NLS-1$
+ throw new DOMException(Util.bind("dom.addSiblingBeforeRoot"/*nonNLS*/));
}
if (!fParent.isAllowableChild(sibling)) {
- throw new DOMException(Util.bind("dom.addIncompatibleSibling")); //$NON-NLS-1$
+ throw new DOMException(Util.bind("dom.addIncompatibleSibling"/*nonNLS*/));
}
if (sibling.getParent() != null) {
- throw new DOMException(Util.bind("dom.addSiblingWithParent")); //$NON-NLS-1$
+ throw new DOMException(Util.bind("dom.addSiblingWithParent"/*nonNLS*/));
}
/* NOTE: To test if the sibling is an ancestor of this node, we
* need only test if the root of this node is the child (the sibling
* is already a root since we have just guaranteed it has no parent).
*/
if (sibling == getRoot()) {
- throw new DOMException(Util.bind("dom.addAncestorAsSibling")); //$NON-NLS-1$
+ throw new DOMException(Util.bind("dom.addAncestorAsSibling"/*nonNLS*/));
}
DOMNode node= (DOMNode)sibling;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMPackage.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMPackage.java
index 87c7be8865..dec2d57e07 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMPackage.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMPackage.java
@@ -70,7 +70,7 @@ DOMPackage(char[] document, int[] sourceRange, String name, int[] nameRange) {
protected void appendFragmentedContents(CharArrayBuffer buffer) {
if (fNameRange[0] < 0) {
buffer
- .append("package ") //$NON-NLS-1$
+ .append("package "/*nonNLS*/)
.append(fName)
.append(';')
.append(JavaModelManager.LINE_SEPARATOR);
@@ -104,7 +104,7 @@ public IJavaElement getJavaElement(IJavaElement parent) throws IllegalArgumentEx
if (parent.getElementType() == IJavaElement.COMPILATION_UNIT) {
return ((ICompilationUnit)parent).getPackageDeclaration(getName());
} else {
- throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));
}
}
/**
@@ -130,6 +130,6 @@ public void setName(String name) {
* @see IDOMNode#toString()
*/
public String toString() {
- return "PACKAGE: " + getName(); //$NON-NLS-1$
+ return "PACKAGE: "/*nonNLS*/ + getName();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMType.java
index 320560e948..f1132242f7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMType.java
@@ -226,7 +226,7 @@ DOMType(char[] document, int[] sourceRange, String name, int[] nameRange, int fl
*/
public void addSuperInterface(String name) throws IllegalArgumentException {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("dom.addNullInterface")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("dom.addNullInterface"/*nonNLS*/));
}
if (fSuperInterfaces == null) {
fSuperInterfaces= new String[1];
@@ -264,7 +264,7 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
if (getMask(MASK_TYPE_HAS_SUPERCLASS)) {
hasSuperclass = true;
if (fExtendsRange[0] < 0) {
- buffer.append(" extends "); //$NON-NLS-1$
+ buffer.append(" extends "/*nonNLS*/);
} else {
buffer.append(fDocument, fExtendsRange[0], fExtendsRange[1] + 1 - fExtendsRange[0]);
}
@@ -277,7 +277,7 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
if (getMask(MASK_TYPE_HAS_INTERFACES)) {
hasInterfaces = true;
if (fImplementsRange[0] < 0) {
- buffer.append(" implements "); //$NON-NLS-1$
+ buffer.append(" implements "/*nonNLS*/);
} else {
buffer.append(fDocument, fImplementsRange[0], fImplementsRange[1] + 1 - fImplementsRange[0]);
}
@@ -307,7 +307,7 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
} else {
if (getMask(MASK_TYPE_HAS_INTERFACES)) {
if (fExtendsRange[0] < 0) {
- buffer.append(" extends "); //$NON-NLS-1$
+ buffer.append(" extends "/*nonNLS*/);
} else {
buffer.append(fDocument, fExtendsRange[0], fExtendsRange[1] + 1 - fExtendsRange[0]);
}
@@ -377,7 +377,7 @@ public IJavaElement getJavaElement(IJavaElement parent) throws IllegalArgumentEx
} else if (parent.getElementType() == IJavaElement.COMPILATION_UNIT) {
return ((ICompilationUnit)parent).getType(getName());
} else {
- throw new IllegalArgumentException(Util.bind("element.illegalParent")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));
}
}
/**
@@ -527,9 +527,9 @@ public void setClass(boolean b) {
fragment();
setMask(MASK_TYPE_IS_CLASS, b);
if (b) {
- fTypeKeyword= "class"; //$NON-NLS-1$
+ fTypeKeyword= "class"/*nonNLS*/;
} else {
- fTypeKeyword= "interface"; //$NON-NLS-1$
+ fTypeKeyword= "interface"/*nonNLS*/;
setSuperclass(null);
}
}
@@ -556,7 +556,7 @@ void setCloseBodyRangeStart(int start) {
*/
public void setName(String name) throws IllegalArgumentException {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("element.nullName")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));
}
super.setName(name);
Enumeration children= getChildren();
@@ -588,7 +588,7 @@ public void setSuperclass(String superclassName) {
public void setSuperInterfaces(String[] names) {
becomeDetailed();
if (names == null) {
- throw new IllegalArgumentException(Util.bind("dom.nullInterfaces")); //$NON-NLS-1$
+ throw new IllegalArgumentException(Util.bind("dom.nullInterfaces"/*nonNLS*/));
}
fragment();
fSuperInterfaces= names;
@@ -601,7 +601,7 @@ public void setSuperInterfaces(String[] names) {
CharArrayBuffer buffer = new CharArrayBuffer();
for (int i = 0; i < names.length; i++) {
if (i > 0) {
- buffer.append(", "); //$NON-NLS-1$
+ buffer.append(", "/*nonNLS*/);
}
buffer.append(names[i]);
}
@@ -636,6 +636,6 @@ protected void shareContents(DOMNode node) {
* @see IDOMNode#toString()
*/
public String toString() {
- return "TYPE: " + getName(); //$NON-NLS-1$
+ return "TYPE: "/*nonNLS*/ + getName();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.java
index 214c053afe..49830eb364 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.java
@@ -27,7 +27,7 @@ public void acceptImport(int declarationStart, int declarationEnd, char[] name,
String importName = new String(name);
/** name is set to contain the '*' */
if (onDemand) {
- importName+=".*"; //$NON-NLS-1$
+ importName+=".*"/*nonNLS*/;
}
fNode= new DOMImport(fDocument, sourceRange, importName, onDemand);
addChild(fNode);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/lookup/ReferenceInfo.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/lookup/ReferenceInfo.java
index 8e5fd4b26f..6a73282029 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/lookup/ReferenceInfo.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/lookup/ReferenceInfo.java
@@ -53,12 +53,12 @@ public char[][] getNames() {
* For debugging only
*/
public String toString() {
- StringBuffer buf = new StringBuffer("ReferenceInfo("); //$NON-NLS-1$
+ StringBuffer buf = new StringBuffer("ReferenceInfo("/*nonNLS*/);
for (int i = 0; i < fNames.length; i++) {
buf.append(fNames[i]);
- buf.append(" "); //$NON-NLS-1$
+ buf.append(" "/*nonNLS*/);
}
- buf.append(")"); //$NON-NLS-1$
+ buf.append(")"/*nonNLS*/);
return buf.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Messages.properties b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/messages.properties
index a3c90e4f40..a49d4524f5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/Messages.properties
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/messages.properties
@@ -75,7 +75,7 @@ build.analyzingSources = Analyzing sources
build.analyzing = Analyzing {0}
build.preparingBuild = Preparing for build
build.compiling = Compiling {0}
-build.readingDelta = Reading resource change information for: {0}
+build.readingDelta = Reading resource change information for : {0}
build.completed = Java build completed
build.builderName = Java Builder
build.compilingContent = Compiling content of {0}
@@ -149,7 +149,6 @@ classpath.needAbsolutePath = Path for IClasspathEntry must be absolute.
file.notFound = File not found.
file.badFormat = Bad format.
variable.badFormat = Bad format for variables.
-option.badFormat = Bad format for options.
path.nullPath = Path cannot be null.
path.mustBeAbsolute = Path must be absolute.
cache.invalidLoadFactor = Incorrect load factor
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/AnonymousFileSource.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/AnonymousFileSource.java
index eaf8532740..e846e1ac14 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/AnonymousFileSource.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/AnonymousFileSource.java
@@ -19,7 +19,7 @@ public AnonymousFileSource(File directory) {
if (!directory.exists()) {
directory.mkdirs();
} else if (!directory.isDirectory()) {
- throw new IllegalArgumentException("Directory arguments should be a directory."); //$NON-NLS-1$
+ throw new IllegalArgumentException("Directory arguments should be a directory."/*nonNLS*/);
}
fDirectory = directory;
}
@@ -30,7 +30,7 @@ public AnonymousFileSource(File directory) {
synchronized public RandomAccessFile allocateAnonymousFile() throws IOException {
File file = getAnonymousFile();
- return new RandomAccessFile(file, "rw"); //$NON-NLS-1$
+ return new RandomAccessFile(file, "rw"/*nonNLS*/);
}
/**
* Returns a URL on a newly allocated file with the given initial content.
@@ -38,17 +38,17 @@ synchronized public RandomAccessFile allocateAnonymousFile() throws IOException
*/
synchronized public URL allocateAnonymousURL(byte[] bytes) throws IOException {
try {
- byte hasharray[] = java.security.MessageDigest.getInstance("SHA").digest(bytes); //$NON-NLS-1$
+ byte hasharray[] = java.security.MessageDigest.getInstance("SHA"/*nonNLS*/).digest(bytes);
StringBuffer sb = new StringBuffer();
for (int i = 0; i < hasharray.length; i++) {
sb.append(Character.forDigit((int)((hasharray[i] >> 4) & 0x0F), 16));
sb.append(Character.forDigit((int)(hasharray[i] & 0x0F), 16));
}
- sb.append(".jnk"); //$NON-NLS-1$
+ sb.append(".jnk"/*nonNLS*/);
String fileName = sb.toString();
File file = fileForName(fileName);
if (!file.exists()) {
- RandomAccessFile raf = new RandomAccessFile(file, "rw"); //$NON-NLS-1$
+ RandomAccessFile raf = new RandomAccessFile(file, "rw"/*nonNLS*/);
raf.write(bytes);
raf.close();
}
@@ -64,7 +64,7 @@ synchronized public URL allocateAnonymousURL(byte[] bytes) throws IOException {
static public URL convertFileToURL(File file) {
try {
String path = file.getCanonicalPath().replace(java.io.File.separatorChar, '/');
- return new URL("file", "", "/" + path); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ return new URL("file"/*nonNLS*/, ""/*nonNLS*/, "/"/*nonNLS*/ + path);
}
catch (IOException ioe) {
throw new Error();
@@ -121,7 +121,7 @@ synchronized public String getAnonymousFileName(long l) {
sb.append(Character.forDigit((int)(l % 36), 36));
l /= 36;
}
- sb.append(".jnk"); //$NON-NLS-1$
+ sb.append(".jnk"/*nonNLS*/);
return sb.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCache.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCache.java
index ad02b6f058..7213985e80 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCache.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCache.java
@@ -171,9 +171,9 @@ public class DiskCache {
EntryCache fEntryCache;
- static final String CONTENTS_FILE_NAME = "contents"; //$NON-NLS-1$
- static final String TEMP_CONTENTS_FILE_NAME = "tempcont"; //$NON-NLS-1$
- static final String CONTENTS_VERSION = "DiskCache.V1.0"; //$NON-NLS-1$
+ static final String CONTENTS_FILE_NAME = "contents"/*nonNLS*/;
+ static final String TEMP_CONTENTS_FILE_NAME = "tempcont"/*nonNLS*/;
+ static final String CONTENTS_VERSION = "DiskCache.V1.0"/*nonNLS*/;
/**
* Set to true when cache is modified, cleared when saved.
@@ -217,7 +217,7 @@ public DiskCache(File directory, int spaceLimit) {
*/
public OutputStream add(final String key, int size, byte[] extraInfo) throws IOException {
if (size > fSpaceLimit*1024) {
- throw new IOException("Entry size greater than cache size"); //$NON-NLS-1$
+ throw new IOException("Entry size greater than cache size"/*nonNLS*/);
}
final File file;
OutputStream output;
@@ -518,7 +518,7 @@ public int getNumberOfFilesToBeDeleted() {
int spaceUsed = in.readInt(); /* Ignored -- updated as entries are read */
int numEntries = in.readInt();
if (!sig.equals(CONTENTS_VERSION)) {
- throw new IOException(Util.bind("file.badFormat")); //$NON-NLS-1$
+ throw new IOException(Util.bind("file.badFormat"/*nonNLS*/));
}
/* Read to a temp. array of entries. The entries are in most- to
@@ -736,7 +736,7 @@ public synchronized void removeAll(Vector keys) {
}
}
};
- fPeriodicSaveThread.setName("DiskCache periodic save"); //$NON-NLS-1$
+ fPeriodicSaveThread.setName("DiskCache periodic save"/*nonNLS*/);
fPeriodicSaveThread.start();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Dumper.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Dumper.java
index bc32cd26f9..2f61613f59 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Dumper.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/Dumper.java
@@ -62,30 +62,30 @@ public void dump(int[] val, int maxPerLine) {
if (!oneLine) {
++fTabLevel;
}
- fWriter.print("["); //$NON-NLS-1$
+ fWriter.print("["/*nonNLS*/);
for (int i = 0; i < len; ++i) {
if (!oneLine) {
if ((i % maxPerLine) == 0) {
fWriter.println();
tabIfNeeded();
fWriter.print(i);
- fWriter.print(": "); //$NON-NLS-1$
+ fWriter.print(": "/*nonNLS*/);
}
}
fWriter.print(val[i]);
if (i + 1 < len) {
- fWriter.print(", "); //$NON-NLS-1$
+ fWriter.print(", "/*nonNLS*/);
}
}
if (oneLine) {
- fWriter.print("]"); //$NON-NLS-1$
+ fWriter.print("]"/*nonNLS*/);
fWriter.println();
}
else {
fWriter.println();
--fTabLevel;
tabIfNeeded();
- fWriter.print("]"); //$NON-NLS-1$
+ fWriter.print("]"/*nonNLS*/);
fWriter.println();
}
}
@@ -94,7 +94,7 @@ public void dump(int[] val, int maxPerLine) {
*/
public void dump(Object[] val) {
int len = val.length;
- fWriter.print("["); //$NON-NLS-1$
+ fWriter.print("["/*nonNLS*/);
if (len > 0) {
fWriter.println();
++fTabLevel;
@@ -104,7 +104,7 @@ public void dump(Object[] val) {
--fTabLevel;
tabIfNeeded();
}
- fWriter.println("]"); //$NON-NLS-1$
+ fWriter.println("]"/*nonNLS*/);
}
/**
* Dumps the given array.
@@ -116,20 +116,20 @@ public void dump(String[] val, int maxPerLine) {
if (!oneLine) {
++fTabLevel;
}
- fWriter.print("["); //$NON-NLS-1$
+ fWriter.print("["/*nonNLS*/);
boolean newLine = !oneLine;
for (int i = 0; i < len; ++i) {
if (newLine) {
fWriter.println();
tabIfNeeded();
}
- fWriter.print("\"" + val[i] + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+ fWriter.print("\""/*nonNLS*/ + val[i] + "\""/*nonNLS*/);
if (i + 1 < len) {
- fWriter.print(", "); //$NON-NLS-1$
+ fWriter.print(", "/*nonNLS*/);
}
newLine = (i != 0 && (i % maxPerLine) == 0);
}
- fWriter.print("]"); //$NON-NLS-1$
+ fWriter.print("]"/*nonNLS*/);
if (oneLine || newLine) {
fWriter.println();
}
@@ -144,18 +144,18 @@ public void dump(Object val) {
tabIfNeeded();
if (val instanceof IDumpable) {
IDumpable dumpable = (IDumpable) val;
- fWriter.println(classNameFor(val) + " {"); //$NON-NLS-1$
+ fWriter.println(classNameFor(val) + " {"/*nonNLS*/);
int originalLevel = fTabLevel;
++fTabLevel;
try {
dumpable.dump(this);
}
catch (Throwable t) {
- fWriter.println("*ERR*"); //$NON-NLS-1$
+ fWriter.println("*ERR*"/*nonNLS*/);
}
fTabLevel = originalLevel;
tabIfNeeded();
- fWriter.println("}"); //$NON-NLS-1$
+ fWriter.println("}"/*nonNLS*/);
}
else {
fWriter.println(val);
@@ -211,7 +211,7 @@ public void dump(String name, Object val) {
*/
public void dump(String name, String val) {
prefix(name);
- fWriter.println(val == null ? "null" : "\"" + val + "\""); //$NON-NLS-1$ //$NON-NLS-3$ //$NON-NLS-2$
+ fWriter.println(val == null ? "null"/*nonNLS*/ : "\""/*nonNLS*/ + val + "\""/*nonNLS*/);
}
/**
* Dumps the given value, with the given name as a prefix.
@@ -264,7 +264,7 @@ public void outdent() {
void prefix(String name) {
tabIfNeeded();
fWriter.print(name);
- fWriter.print(": "); //$NON-NLS-1$
+ fWriter.print(": "/*nonNLS*/);
}
/**
* Print an object directly, without a newline.
@@ -289,7 +289,7 @@ public void println(Object obj) {
*/
void tabIfNeeded() {
for (int i = 0; i < fTabLevel; ++i) {
- fWriter.print(" "); //$NON-NLS-1$
+ fWriter.print(" "/*nonNLS*/);
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/LRUCache.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/LRUCache.java
index b6b72e4419..fbac18a93b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/LRUCache.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/LRUCache.java
@@ -80,7 +80,7 @@ public class LRUCache implements Cloneable {
*/
public String toString() {
- return "LRUCacheEntry [" + _fKey + "-->" + _fValue + "]"; //$NON-NLS-3$ //$NON-NLS-1$ //$NON-NLS-2$
+ return "LRUCacheEntry ["/*nonNLS*/ + _fKey + "-->"/*nonNLS*/ + _fValue + "]"/*nonNLS*/;
}
}
@@ -444,7 +444,7 @@ public class LRUCache implements Cloneable {
*/
public String toString() {
return
- "LRUCache " + (fCurrentSpace * 100.0 / fSpaceLimit) + "% full\n" + //$NON-NLS-1$ //$NON-NLS-2$
+ "LRUCache "/*nonNLS*/ + (fCurrentSpace * 100.0 / fSpaceLimit) + "% full\n"/*nonNLS*/ +
this.toStringContents();
}
/**
@@ -471,9 +471,9 @@ protected String toStringContents() {
String toString = sorter.sortedStrings[i];
Object value = this.get(sorter.sortedObjects[i]);
result.append(toString);
- result.append(" -> "); //$NON-NLS-1$
+ result.append(" -> "/*nonNLS*/);
result.append(value);
- result.append("\n"); //$NON-NLS-1$
+ result.append("\n"/*nonNLS*/);
}
return result.toString();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/LookupTable.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/LookupTable.java
index 777bc912f7..74888e9e6b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/LookupTable.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/LookupTable.java
@@ -62,7 +62,7 @@ public class LookupTable extends Dictionary implements Cloneable {
entry = null;
return next;
}
- throw new NoSuchElementException("LookupTable Enumerator"); //$NON-NLS-1$
+ throw new NoSuchElementException("LookupTable Enumerator"/*nonNLS*/);
}
}
/**
@@ -94,10 +94,10 @@ public class LookupTable extends Dictionary implements Cloneable {
*/
public LookupTable(int initialCapacity, float loadFactor) {
if (initialCapacity < 0)
- throw new IllegalArgumentException("Illegal Capacity: "+ //$NON-NLS-1$
+ throw new IllegalArgumentException("Illegal Capacity: "/*nonNLS*/+
initialCapacity);
if (loadFactor <= 0)
- throw new IllegalArgumentException("Illegal Load: "+loadFactor); //$NON-NLS-1$
+ throw new IllegalArgumentException("Illegal Load: "/*nonNLS*/+loadFactor);
if (initialCapacity==0)
initialCapacity = 1;
@@ -428,27 +428,27 @@ public class LookupTable extends Dictionary implements Cloneable {
for (int i = 0; i < keys.length; ++i) {
if (keys[i] == null) {
if (values[i] != null) {
- System.err.println("LookupTable sanity check in " + where + ": key is null, but value isn't at index " + i); //$NON-NLS-2$ //$NON-NLS-1$
+ System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": key is null, but value isn't at index "/*nonNLS*/ + i);
throw new Error();
}
}
else {
if (values[i] == null) {
- System.err.println("LookupTable sanity check in " + where + ": value is null, but key isn't at index " + i); //$NON-NLS-2$ //$NON-NLS-1$
+ System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": value is null, but key isn't at index "/*nonNLS*/ + i);
throw new Error();
}
else {
++n;
Object value = get(keys[i]);
if (value == null || value != values[i]) {
- System.err.println("LookupTable sanity check in " + where + ": key doesn't hash to proper value: " + keys[i]); //$NON-NLS-2$ //$NON-NLS-1$
+ System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": key doesn't hash to proper value: "/*nonNLS*/ + keys[i]);
throw new Error();
}
}
}
}
if (n != count) {
- System.err.println("LookupTable sanity check in " + where + ": count is " + count + " but there are " + n + " entries"); //$NON-NLS-4$ //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
+ System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": count is "/*nonNLS*/ + count + " but there are "/*nonNLS*/ + n + " entries"/*nonNLS*/);
throw new Error();
}
}
@@ -473,7 +473,7 @@ public class LookupTable extends Dictionary implements Cloneable {
*/
public synchronized String toString() {
StringBuffer buf = new StringBuffer();
- buf.append("{"); //$NON-NLS-1$
+ buf.append("{"/*nonNLS*/);
boolean first = true;
for (int i = 0, max = keys.length; i < max; i++) {
if (keys[i] != null) {
@@ -481,18 +481,18 @@ public class LookupTable extends Dictionary implements Cloneable {
first = false;
}
else {
- buf.append(", "); //$NON-NLS-1$
+ buf.append(", "/*nonNLS*/);
}
if (buf.length() > 1000) {
- buf.append("..."); //$NON-NLS-1$
+ buf.append("..."/*nonNLS*/);
break;
}
else {
- buf.append(keys[i]).append("=").append(values[i]); //$NON-NLS-1$
+ buf.append(keys[i]).append("="/*nonNLS*/).append(values[i]);
}
}
}
- buf.append("}"); //$NON-NLS-1$
+ buf.append("}"/*nonNLS*/);
return buf.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringHashtableOfInt.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringHashtableOfInt.java
index 356e552868..6846b44865 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringHashtableOfInt.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringHashtableOfInt.java
@@ -117,9 +117,9 @@ public String toString() {
String key = this.keyTable[i];
if (key != null) {
buffer.append(key);
- buffer.append(" -> "); //$NON-NLS-1$
+ buffer.append(" -> "/*nonNLS*/);
buffer.append(this.valueTable[i]);
- buffer.append("\n"); //$NON-NLS-1$
+ buffer.append("\n"/*nonNLS*/);
}
}
return buffer.toString();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringMatcher.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringMatcher.java
index 33492d8b22..3d161d9018 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringMatcher.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringMatcher.java
@@ -229,9 +229,9 @@ public class StringMatcher {
* @param p, a String object that is a simple regular expression with ‘*’ and/or ‘?’
*/
private void parseWildCards() {
- if(fPattern.startsWith("*")) //$NON-NLS-1$
+ if(fPattern.startsWith("*"/*nonNLS*/))
fHasLeadingStar = true;
- if(fPattern.endsWith("*")) { //$NON-NLS-1$
+ if(fPattern.endsWith("*"/*nonNLS*/)) {
/* make sure it's not an escaped wildcard */
if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
fHasTrailingStar = true;

Back to the top