Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jdt.core/model/org/eclipse')
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java24
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IBufferChangedListener.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClassFile.java35
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IElementChangedListener.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IField.java15
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IImportContainer.java13
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IImportDeclaration.java11
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java26
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java47
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java69
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMember.java17
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java21
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageDeclaration.java11
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragment.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragmentRoot.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IParent.java17
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/IRegion.java23
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceRange.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceReference.java31
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeHierarchyChangedListener.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java227
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java210
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaModelException.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java48
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IGlobalVariable.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/DOMException.java11
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/DOMFactory.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMCompilationUnit.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMFactory.java43
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMField.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMImport.java13
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMInitializer.java13
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMMember.java17
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMMethod.java15
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMPackage.java13
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMType.java18
-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/CopyElementsOperation.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CopyResourceElementsOperation.java10
-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.java22
-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/FailedReconciliationException.java5
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/HandleFactory.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IJavaReconciler.java17
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IPathRequestor.java5
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ImportContainer.java7
-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/IncrementalDeterministicRequestor.java268
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalReconciler.java353
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalReconcilerRequestor.java388
-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.java19
-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.java13
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/JavaModelManager.java80
-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.java225
-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.java2
-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.java10
-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.java86
-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.java8
-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.java45
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SetOutputLocationOperation.java56
-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.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMethod.java20
-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.java10
-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.java112
-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/BuildEvent.java8
-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/IBuildMonitor.java10
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IConstructor.java26
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IDeltaKey.java19
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IDependencyGraph.java9
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IField.java27
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IHandle.java94
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IImageBuilder.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IImageContext.java34
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IMember.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IMethod.java23
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IPackage.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IProblemDetail.java11
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearch.java52
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearchFactory.java187
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearchListener.java11
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IType.java104
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/InvalidKeyException.java20
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NotPresentException.java23
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/SearchProgressEvent.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/SearchResultEvent.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/StateSpecificException.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/AbstractMemberHandle.java5
-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.java23
-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.java23
-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/ConsoleProgressMonitor.java78
-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.java61
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/DependencyGraph.java17
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/FieldCollaboratorIndictment.java7
-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.java11
-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.java34
-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.java26
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/JavaDevelopmentContextImpl.java48
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/MarkerProblemReporter.java2
-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.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NamespaceNode.java7
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/NewBuilderType.java10
-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.java49
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImpl.java20
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PackageImplSWH.java13
-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.java5
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PathMap.java23
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/PrimitiveTypeHandleImpl.java40
-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.java8
-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.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ProjectResourceCopier.java31
-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.java3
-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.java132
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnap.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapConstantPool.java76
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/StateSnapV5.java60
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeCollaboratorIndictment.java11
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/TypeHierarchyIndictment.java11
-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.java7
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/eval/EvaluationContextWrapper.java6
-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.java18
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/TypeHierarchy.java21
-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.java11
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMField.java30
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMImport.java22
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMInitializer.java18
-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.java43
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMNode.java35
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMPackage.java16
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMType.java41
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/ILineStartFinder.java9
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/SimpleDOMBuilder.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/lookup/ReferenceInfo.java13
-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/CharArrayBuffer.java21
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CharArrayOps.java21
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCache.java14
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCacheEntry.java10
-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/HackFinder.java5
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/IComparator.java8
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ILRUCacheable.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/IProgressListener.java22
-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/ReferenceInfoAdapter.java9
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringHashtableOfInt.java12
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/StringMatcher.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ToStringSorter.java23
228 files changed, 2828 insertions, 2807 deletions
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java
index b2a1737ec2..fbcabf6c29 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Flags.java
@@ -169,20 +169,20 @@ private Flags() {}
public static String toString(int flags) {
StringBuffer sb = new StringBuffer();
- if (isPublic(flags)) sb.append("public "/*nonNLS*/);
- if (isProtected(flags)) sb.append("protected "/*nonNLS*/);
- if (isPrivate(flags)) sb.append("private "/*nonNLS*/);
- if (isStatic(flags)) sb.append("static "/*nonNLS*/);
- if (isAbstract(flags)) sb.append("abstract "/*nonNLS*/);
- if (isFinal(flags)) sb.append("final "/*nonNLS*/);
- if (isNative(flags)) sb.append("native "/*nonNLS*/);
- if (isSynchronized(flags)) sb.append("synchronized "/*nonNLS*/);
- if (isTransient(flags)) sb.append("transient "/*nonNLS*/);
- if (isVolatile(flags)) sb.append("volatile "/*nonNLS*/);
- if (isStrictfp(flags)) sb.append("strictfp "/*nonNLS*/);
+ if (isPublic(flags)) sb.append("public ");
+ if (isProtected(flags)) sb.append("protected ");
+ if (isPrivate(flags)) sb.append("private ");
+ if (isStatic(flags)) sb.append("static ");
+ if (isAbstract(flags)) sb.append("abstract ");
+ if (isFinal(flags)) sb.append("final ");
+ if (isNative(flags)) sb.append("native ");
+ if (isSynchronized(flags)) sb.append("synchronized ");
+ if (isTransient(flags)) sb.append("transient ");
+ if (isVolatile(flags)) sb.append("volatile ");
+ if (isStrictfp(flags)) sb.append("strictfp ");
int len = sb.length();
- if (len == 0) return ""/*nonNLS*/;
+ if (len == 0) return "";
sb.setLength(len-1);
return sb.toString();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IBufferChangedListener.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IBufferChangedListener.java
index 650996a7b6..b716d1b2a9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IBufferChangedListener.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IBufferChangedListener.java
@@ -1,19 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * A listener which gets notified when the contents of a specific buffer
- * have changed, or when the buffer is closed.
- * When a buffer is closed, the listener is notified <em>after</em> the buffer has been closed.
- * A listener is not notified when a buffer is saved.
- * <p>
- * This interface may be implemented by clients.
- * </p>
- */
public interface IBufferChangedListener {
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClassFile.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClassFile.java
index bfb14d3018..12451debc4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClassFile.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IClassFile.java
@@ -1,30 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents an entire binary type (single <code>.class</code> file).
- * A class file has a single child of type <code>IType</code>.
- * Class file elements need to be opened before they can be navigated.
- * If a class file cannot be parsed, its structure remains unknown. Use
- * <code>IJavaElement.isStructureKnown</code> to determine whether this is the
- * case.
- * <p>
- * Note: <code>IClassFile</code> extends <code>ISourceReference</code>.
- * Source can be obtained for a class file iff source has been attached to this
- * class file. The source associated with a class file is the source code of
- * the compilation unit it was (nominally) generated from.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- * @see IPackageFragmentRoot#attachSource
- */
-
public interface IClassFile extends IJavaElement, IParent, IOpenable, ISourceReference, ICodeAssist {
/**
* Returns the smallest element within this class file that
@@ -35,10 +10,10 @@ public interface IClassFile extends IJavaElement, IParent, IOpenable, ISourceRef
*
* @param position a source position inside the class file
* @return the innermost Java element enclosing a given source position or <code>null</code>
- * if none (excluding the class file).
+ * if none (excluding the class file).
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
+ * exception occurs while accessing its corresponding resource
*/
IJavaElement getElementAt(int position) throws JavaModelException;
/**
@@ -47,7 +22,7 @@ IJavaElement getElementAt(int position) throws JavaModelException;
* @return the type contained in this class file
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
+ * exception occurs while accessing its corresponding resource
*/
IType getType() throws JavaModelException;
/**
@@ -57,7 +32,7 @@ IType getType() throws JavaModelException;
* @return <code>true</code> if the class file represents a class.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
+ * exception occurs while accessing its corresponding resource
*/
boolean isClass() throws JavaModelException;
/**
@@ -67,7 +42,7 @@ boolean isClass() throws JavaModelException;
* @return <code>true</code> if the class file represents an interface.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
+ * exception occurs while accessing its corresponding resource
*/
boolean isInterface() throws JavaModelException;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java
index 1daed6981e..921f25c173 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICodeAssist.java
@@ -1,17 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Common protocol for Java elements that support source code assist and code
- * resolve.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface ICodeAssist {
/**
* Performs code completion at the given offset position in this compilation unit,
@@ -22,13 +10,13 @@ public interface ICodeAssist {
*
* @exception JavaModelException if code assist could not be performed. Reasons include:<ul>
* <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
- * <li> The position specified is < -1 or is greater than this compilation unit's
- * source length (INDEX_OUT_OF_BOUNDS)
+ * <li> The position specified is < -1 or is greater than this compilation unit's
+ * source length (INDEX_OUT_OF_BOUNDS)
* </ul>
*
* @exception IllegalArgumentException if <code>requestor</code> is <code>null</code>
*/
- void codeComplete(int offset, ICodeCompletionRequestor requestor) throws JavaModelException;
+ void codeComplete(int offset, ICodeCompletionRequestor requestor) throws JavaModelException;
/**
* Performs code selection on the given selected text in this compilation unit,
* reporting results to the given selection requestor. The <code>offset</code>
@@ -37,8 +25,8 @@ public interface ICodeAssist {
*
* @exception JavaModelException if code resolve could not be performed. Reasons include:
* <li>This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
- * <li> The range specified is not within this element's
- * source range (INDEX_OUT_OF_BOUNDS)
+ * <li> The range specified is not within this element's
+ * source range (INDEX_OUT_OF_BOUNDS)
* </ul>
*
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java
index b0af01ebb8..9ee55c405a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ICompilationUnit.java
@@ -72,7 +72,7 @@ IImportDeclaration createImport(String name, IJavaElement sibling, IProgressMoni
* <li> The name is not a valid package name (INVALID_NAME)
* </ul>
*/
- IPackageDeclaration createPackageDeclaration(String name, IProgressMonitor monitor) throws JavaModelException;
+ IPackageDeclaration createPackageDeclaration(String name, IProgressMonitor monitor) throws JavaModelException;
/**
* Creates and returns a type in this compilation unit with the
* given contents. If this compilation unit does not exist, one
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IElementChangedListener.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IElementChangedListener.java
index 89e9e8f65f..3f2b6dc461 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IElementChangedListener.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IElementChangedListener.java
@@ -1,17 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * An element changed listener receives notification of changes to Java elements
- * maintained by the Java model.
- * <p>
- * This interface may be implemented by clients.
- * </p>
- */
public interface IElementChangedListener {
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IField.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IField.java
index 75e869b2dd..184cdbd061 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IField.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IField.java
@@ -1,16 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents a field declared in a type.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IField extends IMember {
/**
* Returns the constant value associated with this field
@@ -21,7 +10,7 @@ public interface IField extends IMember {
* a <code>Short</code>.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
+ * exception occurs while accessing its corresponding resource
*/
public Object getConstant() throws JavaModelException;
/**
@@ -33,7 +22,7 @@ String getElementName();
*
* @see Signature
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
+ * exception occurs while accessing its corresponding resource
*/
String getTypeSignature() throws JavaModelException;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IImportContainer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IImportContainer.java
index dc479c3a7e..735c7deefd 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IImportContainer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IImportContainer.java
@@ -1,18 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents an import container is a child of a Java compilation unit that contains
- * all (and only) the import declarations. If a compilation unit has no import
- * declarations, no import container will be present.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IImportContainer extends IJavaElement, IParent, ISourceReference {
/**
* Returns the first import declaration in this import container with the given name.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IImportDeclaration.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IImportDeclaration.java
index e4c6a5bf15..6eac7ea894 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IImportDeclaration.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IImportDeclaration.java
@@ -1,16 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents an import declaration in Java compilation unit.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IImportDeclaration extends IJavaElement, ISourceReference, ISourceManipulation {
/**
* Returns the name that has been imported.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java
index 30af205c32..e5a4757fed 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelMarker.java
@@ -1,17 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Markers used by the Java model.
- * <p>
- * This interface declares constants only; it is not intended to be implemented
- * or extended.
- * </p>
- */
public interface IJavaModelMarker {
/**
@@ -19,7 +7,7 @@ public interface IJavaModelMarker {
* This can be used to recognize those markers in the workspace that flag problems
* detected by the Java tooling during compilation.
*/
- public static final String JAVA_MODEL_PROBLEM_MARKER = JavaCore.PLUGIN_ID + ".problem"/*nonNLS*/;
+ public static final String JAVA_MODEL_PROBLEM_MARKER = JavaCore.PLUGIN_ID + ".problem";
/**
@@ -28,19 +16,19 @@ public interface IJavaModelMarker {
* problems detected by the Java tooling (such as a cycle in the build path, a problem
* detected by the outliner, or a problem detected during a code completion)
*/
- public static final String TRANSIENT_PROBLEM = JavaCore.PLUGIN_ID + ".transient_problem"/*nonNLS*/;
-
+ public static final String TRANSIENT_PROBLEM = JavaCore.PLUGIN_ID + ".transient_problem";
+
/**
* Id marker attribute (value <code>"id"</code>).
* Reserved for future use.
*/
- public static final String ID = "id"/*nonNLS*/;
+ public static final String ID = "id";
/**
* Flags marker attribute (value <code>"flags"</code>).
* Reserved for future use.
*/
- public static final String FLAGS = "flags"/*nonNLS*/;
+ public static final String FLAGS = "flags";
/**
* Cycle detected marker attribute (value <code>"cycleDetected"</code>).
@@ -48,11 +36,11 @@ public interface IJavaModelMarker {
* The value of this attribute is the name of the project that caused a
* cycle in the projects classpaths.
*/
- public static final String CYCLE_DETECTED = "cycleDetected"/*nonNLS*/;
+ public static final String CYCLE_DETECTED = "cycleDetected";
/**
* Build path problem marker type (value <code>"org.eclipse.jdt.core.buildpath_problem"</code>).
* This can be used to recognize those markers in the workspace that flag problems
* detected by the Java tooling during classpath setting.
*/
- public static final String BUILDPATH_PROBLEM_MARKER = JavaCore.PLUGIN_ID + ".buildpath_problem"/*nonNLS*/;
+ public static final String BUILDPATH_PROBLEM_MARKER = JavaCore.PLUGIN_ID + ".buildpath_problem";
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java
index 6297996c38..11ea0fb91d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaModelStatusConstants.java
@@ -1,20 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-
-/**
- * Status codes used with Java model status objects.
- * <p>
- * This interface declares constants only; it is not intended to be implemented
- * or extended.
- * </p>
- *
- * @see IJavaModelStatus
- * @see org.eclipse.core.runtime.IStatus#getCode
- */
+
public interface IJavaModelStatusConstants {
/**
@@ -29,7 +14,7 @@ public interface IJavaModelStatusConstants {
* Use <code>getException</code> to retrieve a <code>CoreException</code>.
*/
public static final int CORE_EXCEPTION = 966;
-
+
/**
* Status constant indicating one or more of the elements
* supplied are not of a valid type for the operation to
@@ -58,14 +43,14 @@ public interface IJavaModelStatusConstants {
* supplied to the operation.
*/
public static final int NULL_PATH = 970;
-
+
/**
* Status constant indicating that a path outside of the
* project was supplied to the operation. The path can be retrieved using
* <code>getPath</code> on the status object.
*/
public static final int PATH_OUTSIDE_PROJECT = 971;
-
+
/**
* Status constant indicating that a relative path
* was supplied to the operation when an absolute path is
@@ -73,7 +58,7 @@ public interface IJavaModelStatusConstants {
* status object.
*/
public static final int RELATIVE_PATH = 972;
-
+
/**
* Status constant indicating that a path specifying a device
* was supplied to the operation when a path with no device is
@@ -81,45 +66,45 @@ public interface IJavaModelStatusConstants {
* status object.
*/
public static final int DEVICE_PATH = 973;
-
+
/**
* Status constant indicating that a string
* was supplied to the operation that was <code>null</code>.
*/
public static final int NULL_STRING = 974;
-
+
/**
* Status constant indicating that the operation encountered
* a read-only element.
* The element(s) can be retrieved using <code>getElements</code> on the status object.
*/
public static final int READ_ONLY = 976;
-
+
/**
* Status constant indicating that a naming collision would occur
* if the operation proceeded.
*/
public static final int NAME_COLLISION = 977;
-
+
/**
* Status constant indicating that a destination provided for a copy/move/rename operation
* is invalid.
* The destination element can be retrieved using <code>getElements</code> on the status object.
*/
public static final int INVALID_DESTINATION = 978;
-
+
/**
* Status constant indicating that a path provided to an operation
* is invalid. The path can be retrieved using <code>getPath</code> on the
* status object.
*/
public static final int INVALID_PATH = 979;
-
+
/**
* Status constant indicating the given source position is out of bounds.
*/
public static final int INDEX_OUT_OF_BOUNDS = 980;
-
+
/**
* Status constant indicating there is an update conflict
* for a working copy. The compilation unit on which the
@@ -194,14 +179,14 @@ public interface IJavaModelStatusConstants {
*/
public static final int INVALID_RESOURCE = 995;
- /**
+ /**
* Status indicating that a Java element could not be created because
* the underlying resource is not of an appropriate type.
* @see JavaCore
*/
public static final int INVALID_RESOURCE_TYPE = 996;
- /**
+ /**
* Status indicating that a Java element could not be created because
* the project owning underlying resource does not have the Java nature.
* @see JavaCore
@@ -223,8 +208,4 @@ public interface IJavaModelStatusConstants {
* has been made locally available.
*/
public static final int NO_LOCAL_CONTENTS = 999;
- /**
- * Status constant indicating that a classpath entry was invalid
- */
- public static final int INVALID_CLASSPATH = 964;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java
index c2434d349b..521a3b7fef 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IJavaProject.java
@@ -94,6 +94,16 @@ IPackageFragmentRoot findPackageFragmentRoot(IPath path) throws JavaModelExcepti
*/
IPackageFragmentRoot[] getAllPackageFragmentRoots() throws JavaModelException;
/**
+ * Returns the classpath for the project, as a list of classpath
+ * entries.
+ *
+ * @exception JavaModelException if this element does not exist or if an
+ * exception occurs while accessing its corresponding resource
+ *
+ * @deprecated - since classpath variable support was added either use #getRawClasspath or #getResolvedClasspath
+ */
+IClasspathEntry[] getClasspath() throws JavaModelException;
+/**
* Returns an array of non-Java resources directly contained in this project.
* It does not transitively answer non-Java resources contained in folders;
* these would have to be explicitly iterated over.
@@ -228,6 +238,43 @@ public boolean hasClasspathCycle(IClasspathEntry[] entries);
*/
IEvaluationContext newEvaluationContext();
/**
+ * Creates and returns a new classpath entry of kind <code>K_BINARY</code> for the JAR
+ * or folder identified by the given absolute path. This specifies that
+ * all package fragments within the root will have children of type
+ * <code>IClassFile</code>.
+ * The path can be:
+ * - internal to the workbench: "/Project/binary"
+ * - external to the workbench: "c:/jdk/classes.zip"
+ *
+ * @deprecated - use JavaCore#newLibraryEntry
+ */
+public IClasspathEntry newLibraryEntry(IPath path);
+/**
+ * Creates and returns a new classpath entry of kind <code>K_SOURCE</code>
+ * for the project identified by the given absolute path. This
+ * identifies all the source code of the given project to be
+ * used in the Java model, and the output location of the project
+ * to be used when building.
+ * The path can be:
+ * - internal to the workbench: "/Project/binary"
+ * - external to the workbench: "c:/jdk/classes.zip"
+ *
+ * @deprecated - use JavaCore#newProjectEntry
+ */
+public IClasspathEntry newProjectEntry(IPath path);
+/**
+ * Creates and returns a new classpath entry of kind <code>K_SOURCE</code>
+ * for folder identified by the given absolute path. This specifies that
+ * all package fragments within the root will have children of type
+ * <code>ICompilationUnit</code>.
+ * The path can be:
+ * - internal to the workbench: "/Project/binary"
+ * - external to the workbench: "c:/jdk/classes.zip"
+ *
+ * @deprecated - use JavaCore#newSourceEntry
+ */
+public IClasspathEntry newSourceEntry(IPath path);
+/**
* Creates and returns a type hierarchy for all types in the given
* region, considering subtypes within that region.
*
@@ -248,6 +295,28 @@ ITypeHierarchy newTypeHierarchy(IRegion region, IProgressMonitor monitor) throws
*/
ITypeHierarchy newTypeHierarchy(IType type, IRegion region, IProgressMonitor monitor) throws JavaModelException;
/**
+ * Sets the classpath of this project.
+ * <p>
+ * Setting the classpath to <code>null</code> specifies a default classpath
+ * (the project root). Setting the classpath to an empty array specifies an
+ * empty classpath.
+ * <p>
+ * If a cycle is detected while setting this classpath, an error marker will be added
+ * to the project closing the cycle.
+ * To avoid this problem, use <code>hasClasspathCycle(IClasspathEntry[] entries)</code>
+ * before setting the classpath.
+ *
+ * @exception JavaModelException if the classpath could not be set. Reasons include:
+ * <ul>
+ * <li> This Java element does not exist (ELEMENT_DOES_NOT_EXIST)</li>
+ * <li> Two or more entries specify source roots with the same or overlapping paths (NAME_COLLISION)
+ * <li> A entry of kind <code>CPE_PROJECT</code> refers to this project (INVALID_PATH)
+ * <li> The classpath is being modified during resource change event notification (CORE_EXCEPTION)
+ * </ul>
+ * @deprecated - was renamed to #setRawClasspath
+ */
+void setClasspath(IClasspathEntry[] entries, IProgressMonitor monitor) throws JavaModelException;
+/**
* Sets the output location of this project to the location
* described by the given absolute path.
* <p>
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMember.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMember.java
index 634d1315d6..8aee2fe2f5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMember.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMember.java
@@ -1,18 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Common protocol for Java elements that can be members of types.
- * This set consists of <code>IType</code>, <code>IMethod</code>,
- * <code>IField</code>, and <code>IInitializer</code>.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IMember extends IJavaElement, ISourceReference, ISourceManipulation {
/**
* Returns the class file in which this member is declared, or <code>null</code>
@@ -37,7 +24,7 @@ IType getDeclaringType();
* <code>Flags</code>.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
+ * exception occurs while accessing its corresponding resource.
*
* @see Flags
*/
@@ -49,7 +36,7 @@ int getFlags() throws JavaModelException;
* associated source code (for example, a binary type).
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
+ * exception occurs while accessing its corresponding resource.
*/
ISourceRange getNameRange() throws JavaModelException;
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java
index f3b6029f54..8cc01a6165 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IMethod.java
@@ -1,16 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents a method (or constructor) declared in a type.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IMethod extends IMember {
/**
* Returns the simple name of this method.
@@ -31,7 +20,7 @@ String getElementName();
* would return the array <code>{"QIOException;"}</code>.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
+ * exception occurs while accessing its corresponding resource.
*
* @see Signature
*/
@@ -51,7 +40,7 @@ int getNumberOfParameters();
* would return the array <code>{"text","length"}</code>.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
+ * exception occurs while accessing its corresponding resource.
*/
String[] getParameterNames() throws JavaModelException;
/**
@@ -73,7 +62,7 @@ String[] getParameterTypes();
* would return <code>"QString;"</code>.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
+ * exception occurs while accessing its corresponding resource.
*
* @see Signature
*/
@@ -86,7 +75,7 @@ String getReturnType() throws JavaModelException;
* would return <code>"(QString;I)V"</code>.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
+ * exception occurs while accessing its corresponding resource.
*
* @see Signature
*/
@@ -95,7 +84,7 @@ String getSignature() throws JavaModelException;
* Returns whether this method is a constructor.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource.
+ * exception occurs while accessing its corresponding resource.
*/
boolean isConstructor() throws JavaModelException;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageDeclaration.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageDeclaration.java
index fc1418ebe0..b3723df89d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageDeclaration.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageDeclaration.java
@@ -1,16 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents a package declaration in Java compilation unit.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IPackageDeclaration extends IJavaElement, ISourceReference {
/**
* Returns the name of the package the statement refers to.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragment.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragment.java
index fde463d5a8..4f5c0f3074 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragment.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragment.java
@@ -31,7 +31,7 @@ public interface IPackageFragment extends IParent, IJavaElement, IOpenable, ISou
* string, <code>""</code>).
* </p>
*/
- public static final String DEFAULT_PACKAGE_NAME = ""/*nonNLS*/;
+ public static final String DEFAULT_PACKAGE_NAME = "";
/**
* Returns whether this fragment contains at least one Java resource.
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragmentRoot.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragmentRoot.java
index ed893af0a2..4304ae83c4 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragmentRoot.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IPackageFragmentRoot.java
@@ -40,7 +40,7 @@ public interface IPackageFragmentRoot extends IParent, IJavaElement, IOpenable {
/**
* Empty root path
*/
- String DEFAULT_PACKAGEROOT_PATH = ""/*nonNLS*/;
+ String DEFAULT_PACKAGEROOT_PATH = "";
/**
* Attaches the source archive identified by the given absolute path to this
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IParent.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IParent.java
index c01d74b191..ef06f37ea7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IParent.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IParent.java
@@ -1,16 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-
-/**
- * Common protocol for Java elements that contain other Java elements.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
+
public interface IParent {
/**
* Returns the immediate children of this element.
@@ -18,7 +7,7 @@ public interface IParent {
* the children are in no particular order.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
+ * exception occurs while accessing its corresponding resource
*/
IJavaElement[] getChildren() throws JavaModelException;
/**
@@ -27,7 +16,7 @@ IJavaElement[] getChildren() throws JavaModelException;
* testing whether <code>getChildren</code> is an empty array.
*
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
+ * exception occurs while accessing its corresponding resource
*/
boolean hasChildren() throws JavaModelException;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IRegion.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IRegion.java
index 06dc491c75..aedb33f9b8 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IRegion.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/IRegion.java
@@ -1,28 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * A Java model region describes a hierarchical set of elements.
- * Regions are often used to describe a set of elements to be considered
- * when performing operations; for example, the set of elements to be
- * considered during a search. A region may include elements from different
- * projects.
- * <p>
- * When an element is included in a region, all of its children
- * are considered to be included. Children of an included element
- * <b>cannot</b> be selectively excluded.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * Instances can be created via the <code>JavaCore.newRegion</code>.
- * </p>
- *
- * @see JavaCore#newRegion
- */
public interface IRegion {
/**
* Adds the given element and all of its descendents to this region.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceRange.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceRange.java
index 2c9dd0314b..9fced6406b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceRange.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceRange.java
@@ -1,17 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * A source range defines an element's source coordinates relative to
- * its source buffer.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface ISourceRange {
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceReference.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceReference.java
index 9b5dd16ac9..0228695227 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceReference.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ISourceReference.java
@@ -1,32 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Common protocol for Java elements that have associated source code.
- * This set consists of <code>IClassFile</code>, <code>ICompilationUnit</code>,
- * <code>IPackageDeclaration</code>, <code>IImportDeclaration</code>,
- * <code>IImportContainer</code>, <code>IType</code>, <code>IField</code>,
- * <code>IMethod</code>, and <code>IInitializer</code>.
- * </ul>
- * <p>
- * Note: For <code>IClassFile</code>, <code>IType</code> and other members
- * derived from a binary type, the implementation returns source iff the
- * element has attached source code.
- * </p>
- * <p>
- * Source reference elements may be working copies if they were created from
- * a compilation unit that is a working copy.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- * @see IPackageFragmentRoot#attachSource
- */
public interface ISourceReference {
/**
* Returns the source code associated with this element.
@@ -41,7 +14,7 @@ public interface ISourceReference {
* @return the source code, or <code>null</code> if this element has no
* associated source code
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
+ * exception occurs while accessing its corresponding resource
*/
String getSource() throws JavaModelException;
/**
@@ -54,7 +27,7 @@ String getSource() throws JavaModelException;
* @return the source range, or <code>null</code> if if this element has no
* associated source code
* @exception JavaModelException if this element does not exist or if an
- * exception occurs while accessing its corresponding resource
+ * exception occurs while accessing its corresponding resource
*/
ISourceRange getSourceRange() throws JavaModelException;
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeHierarchyChangedListener.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeHierarchyChangedListener.java
index 2356e0423f..cf59398365 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeHierarchyChangedListener.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/ITypeHierarchyChangedListener.java
@@ -1,17 +1,5 @@
package org.eclipse.jdt.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * A listener which gets notified when a particular type hierarchy object
- * changes.
- * <p>
- * This interface may be implemented by clients.
- * </p>
- */
public interface ITypeHierarchyChangedListener {
/**
* Notifies that the given type hierarchy has changed in some way and should
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java
index 9e7fdcd235..15c7a0f712 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaConventions.java
@@ -5,6 +5,9 @@ package org.eclipse.jdt.core;
* All Rights Reserved.
*/
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.internal.compiler.parser.InvalidInputException;
import org.eclipse.jdt.internal.compiler.parser.Scanner;
@@ -14,11 +17,7 @@ import org.eclipse.jdt.internal.compiler.util.CharOperation;
import java.util.StringTokenizer;
-import org.eclipse.jdt.internal.core.JavaModelStatus;
-import org.eclipse.core.runtime.*;
-import java.io.File;
-import org.eclipse.jdt.internal.core.*;
-import org.eclipse.core.resources.*;
+import org.eclipse.jdt.internal.core.Util;
/**
* Provides methods for checking Java-specific conventions such as name syntax.
@@ -29,7 +28,7 @@ import org.eclipse.core.resources.*;
*/
public final class JavaConventions {
private final static char fgDot= '.';
- private final static String fgJAVA= "JAVA"/*nonNLS*/;
+ private final static String fgJAVA= "JAVA";
/**
* Not instantiable.
*/
@@ -48,8 +47,8 @@ public static boolean isOverlappingRoots(IPath rootPath1, IPath rootPath2) {
}
String extension1 = rootPath1.getFileExtension();
String extension2 = rootPath2.getFileExtension();
- String jarExtension = "JAR"/*nonNLS*/;
- String zipExtension = "ZIP"/*nonNLS*/;
+ String jarExtension = "JAR";
+ String zipExtension = "ZIP";
if (extension1 != null && (extension1.equalsIgnoreCase(jarExtension) || extension1.equalsIgnoreCase(zipExtension))) {
return false;
}
@@ -111,14 +110,14 @@ private static char[] scannedIdentifier(String id) {
*/
public static IStatus validateCompilationUnitName(String name) {
if (name == null) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.unit.nullName"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "Compilation unit name must not be null", null);
}
String extension;
String identifier;
int index;
index = name.indexOf('.');
if (index == -1) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.unit.notJavaName"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "Compilation unit name must include the \".java\" suffix", null);
}
identifier = name.substring(0, index);
extension = name.substring(index + 1);
@@ -127,9 +126,9 @@ public static IStatus validateCompilationUnitName(String name) {
return status;
}
if (!Util.isJavaFileName(name)) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.unit.notJavaName"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "Compilation unit name must include the \".java\" suffix", null);
}
- return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK"/*nonNLS*/, null);
+ return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK", null);
}
/**
* Validate the given field name.
@@ -159,9 +158,9 @@ public static IStatus validateFieldName(String name) {
*/
public static IStatus validateIdentifier(String id) {
if (scannedIdentifier(id) != null) {
- return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK"/*nonNLS*/, null);
+ return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK", null);
} else {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.illegalIdentifier"/*nonNLS*/, id), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, id + " is not a valid Java identifier", null);
}
}
/**
@@ -178,13 +177,13 @@ public static IStatus validateIdentifier(String id) {
*/
public static IStatus validateImportDeclaration(String name) {
if (name == null || name.length() == 0) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.import.nullImport"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "An import declaration must not be null", null);;
}
if (name.charAt(name.length() - 1) == '*') {
if (name.charAt(name.length() - 2) == '.') {
return validatePackageName(name.substring(0, name.length() - 2));
} else {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.import.unqualifiedImport"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "An import declaration must not end with an unqualified *", null);;
}
}
return validatePackageName(name);
@@ -204,11 +203,11 @@ public static IStatus validateImportDeclaration(String name) {
*/
public static IStatus validateJavaTypeName(String name) {
if (name == null) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.nullName"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "A Java type name must not be null", null);
}
String trimmed = name.trim();
if (!name.equals(trimmed)) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.nameWithBlanks"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "A Java type name must not start or end with a blank.", null);;
}
int index = name.lastIndexOf('.');
char[] scannedID;
@@ -228,14 +227,14 @@ public static IStatus validateJavaTypeName(String name) {
if (scannedID != null) {
if (CharOperation.contains('$', scannedID)) {
- return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.dollarName"/*nonNLS*/), null);
+ return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, "By convention, Java type names usually don't contain the $ character.", null);
}
if ((scannedID.length > 0 && Character.isLowerCase(scannedID[0]))) {
- return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.lowercaseName"/*nonNLS*/), null);
+ return new Status(IStatus.WARNING, JavaCore.PLUGIN_ID, -1, "By convention, Java type names usually start with an uppercase letter.", null);
}
- return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK"/*nonNLS*/, null);
+ return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK", null);
} else {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.type.invalidName"/*nonNLS*/, name), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "The type name " + name + " is not a valid identifier.", null);
}
}
/**
@@ -266,22 +265,22 @@ public static IStatus validateMethodName(String name) {
*/
public static IStatus validatePackageName(String name) {
if (name == null) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.nullName"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "A package name must not be null", null);
}
int length;
if ((length = name.length()) == 0) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.emptyName"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "A package name must not be empty", null);
}
if (name.charAt(0) == fgDot || name.charAt(length-1) == fgDot) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.dotName"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "A package name cannot start or end with a dot", null);
}
if (Character.isWhitespace(name.charAt(0)) || Character.isWhitespace(name.charAt(name.length() - 1))) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.nameWithBlanks"/*nonNLS*/), null);;
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "A package name must not start or end with a blank", null);;
}
int dot = 0;
while (dot != -1 && dot < length-1) {
if ((dot = name.indexOf(fgDot, dot+1)) != -1 && dot < length-1 && name.charAt(dot+1) == fgDot) {
- return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, Util.bind("convention.package.consecutiveDotsName"/*nonNLS*/), null);
+ return new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "A package name must not contain two consecutive dots", null);
}
}
StringTokenizer st = new StringTokenizer(name, new String(new char[] {fgDot}));
@@ -293,178 +292,6 @@ public static IStatus validatePackageName(String name) {
return status;
}
}
- return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK"/*nonNLS*/, null);
-}
-
-/**
- * Validate the given classpath and output location.
- * - Source folders cannot be nested inside the binary output, and reciprocally. They can coincidate.
- * - Source folders cannot be nested in each other.
- * - Output location must be nested inside project.
-
- * @param classpath a given classpath
- * @param outputLocation a given output location
- * @return a status object with code <code>IStatus.OK</code> if
- * the given classpath and output location are compatible, otherwise a status
- * object indicating what is wrong with the classpath or output location
- */
-public static IJavaModelStatus validateClasspath(IJavaProject javaProject, IClasspathEntry[] classpath, IPath outputLocation) {
-
- IProject project = javaProject.getProject();
- IPath projectPath= project.getFullPath();
-
- /* validate output location */
- if (outputLocation == null) {
- return new JavaModelStatus(IJavaModelStatusConstants.NULL_PATH);
- }
- if (outputLocation.isAbsolute()) {
- if (!projectPath.isPrefixOf(outputLocation)) {
- return new JavaModelStatus(IJavaModelStatusConstants.PATH_OUTSIDE_PROJECT, javaProject, outputLocation.toString());
- }
- } else {
- return new JavaModelStatus(IJavaModelStatusConstants.RELATIVE_PATH, 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_CLASSPATH, Util.bind("classpath.cannotNestSourceFolderInSource"/*nonNLS*/,entryPath.toString(), otherEntry.getPath().toString()));
- }
- }
- }
- }
- // prevent nesting output location inside entry
- if (entryPath.isPrefixOf(outputLocation)) {
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.cannotNestSourceFolderInOutput"/*nonNLS*/,entryPath.toString(), outputLocation.toString()));
- }
-
- // prevent nesting entry inside output location - when distinct from project or a source folder
- if (!allowNestingInOutput && outputLocation.isPrefixOf(entryPath)) {
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.cannotNestOuputInSourceFolder"/*nonNLS*/, outputLocation.toString(), entryPath.toString()));
- }
- }
- return JavaModelStatus.VERIFIED_OK;
-}
-
- /**
- * 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).
- */
- public static IJavaModelStatus validateClasspathEntry(IJavaProject javaProject, IClasspathEntry entry, boolean checkSourceAttachment){
-
- IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
- IPath path = entry.getPath();
-
- switch(entry.getEntryKind()){
-
- // variable entry check
- case IClasspathEntry.CPE_VARIABLE :
- if (path != null && path.segmentCount() >= 1){
- entry = JavaCore.getResolvedClasspathEntry(entry);
- if (entry == null){
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundVariablePath"/*nonNLS*/, path.toString()));
- }
- return validateClasspathEntry(javaProject, entry, checkSourceAttachment);
- } else {
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.illegalVariablePath"/*nonNLS*/, path.toString()));
- }
-
- // 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 new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, 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 new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, 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 new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundSourceAttachment"/*nonNLS*/, sourceAttachment.toString()));
- }
- } else {
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundLibrary"/*nonNLS*/, path.toString()));
- }
- } else {
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, 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 new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundProject"/*nonNLS*/, path.segment(0).toString()));
- }
- } catch (CoreException e){
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundProject"/*nonNLS*/, path.segment(0).toString()));
- }
- } else {
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, 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= javaProject.getProject().getFullPath();
- if (!projectPath.isPrefixOf(path) || JavaModel.getTarget(workspaceRoot, path, true) == null){
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.unboundSourceFolder"/*nonNLS*/, path.toString()));
- }
- } else {
- return new JavaModelStatus(IJavaModelStatusConstants.INVALID_CLASSPATH, Util.bind("classpath.illegalSourceFolderPath"/*nonNLS*/, path.toString()));
- }
- break;
- }
- return JavaModelStatus.VERIFIED_OK;
+ return new Status(IStatus.OK, JavaCore.PLUGIN_ID, -1, "OK", null);
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
index 7ad19d2235..0db3ddb172 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaCore.java
@@ -9,7 +9,6 @@ import org.eclipse.core.runtime.*;
import org.eclipse.core.resources.*;
import java.io.*;
-import java.net.URL;
import java.util.*;
import org.eclipse.jdt.internal.compiler.*;
@@ -45,19 +44,19 @@ public final class JavaCore extends Plugin implements IExecutableExtension {
* The plug-in identifier of the Java core support
* (value <code>"org.eclipse.jdt.core"</code>).
*/
- public static final String PLUGIN_ID = "org.eclipse.jdt.core"/*nonNLS*/; // getPlugin().getDescriptor().getUniqueIdentifier();
+ public static final String PLUGIN_ID = "org.eclipse.jdt.core"; // getPlugin().getDescriptor().getUniqueIdentifier();
/**
* The identifier for the Java builder
* (value <code>"org.eclipse.jdt.core.javabuilder"</code>).
*/
- public static final String BUILDER_ID = PLUGIN_ID + ".javabuilder"/*nonNLS*/;
+ public static final String BUILDER_ID = PLUGIN_ID + ".javabuilder";
/**
* The identifier for the Java model
* (value <code>"org.eclipse.jdt.core.javamodel"</code>).
*/
- public static final String MODEL_ID = PLUGIN_ID + ".javamodel"/*nonNLS*/;
+ public static final String MODEL_ID = PLUGIN_ID + ".javamodel";
/**
* The identifier for the Java nature
@@ -67,82 +66,76 @@ public final class JavaCore extends Plugin implements IExecutableExtension {
*
* @see org.eclipse.core.resources.IProject#hasNature
*/
- public static final String NATURE_ID = PLUGIN_ID + ".javanature"/*nonNLS*/;
+ public static final String NATURE_ID = PLUGIN_ID + ".javanature";
/**
* Name of the handle id attribute in a Java marker
*/
- private static final String ATT_HANDLE_ID= "org.eclipse.jdt.internal.core.JavaModelManager.handleId"/*nonNLS*/;
+ private static final String ATT_HANDLE_ID= "org.eclipse.jdt.internal.core.JavaModelManager.handleId";
/**
* Names of recognized configurable options
*/
- public static final String COMPILER_LOCAL_VARIABLE_ATTR = PLUGIN_ID + ".compiler.debug.localVariable"/*nonNLS*/;
+ public static final String COMPILER_LOCAL_VARIABLE_ATTR = PLUGIN_ID + ".compiler.debug.localVariable";
// possible values are GENERATE or DO_NOT_GENERATE (default is DO_NOT_GENERATE)
- public static final String COMPILER_LINE_NUMBER_ATTR = PLUGIN_ID + ".compiler.debug.lineNumber"/*nonNLS*/;
+ public static final String COMPILER_LINE_NUMBER_ATTR = PLUGIN_ID + ".compiler.debug.lineNumber";
// possible values are GENERATE or DO_NOT_GENERATE (default is GENERATE)
- public static final String COMPILER_SOURCE_FILE_ATTR = PLUGIN_ID + ".compiler.debug.sourceFile"/*nonNLS*/;
+ public static final String COMPILER_SOURCE_FILE_ATTR = PLUGIN_ID + ".compiler.debug.sourceFile";
// possible values are GENERATE or DO_NOT_GENERATE (default is GENERATE)
- public static final String COMPILER_CODEGEN_UNUSED_LOCAL = PLUGIN_ID + ".compiler.codegen.unusedLocal"/*nonNLS*/;
+ public static final String COMPILER_CODEGEN_UNUSED_LOCAL = PLUGIN_ID + ".compiler.codegen.unusedLocal";
// possible values are PRESERVE or OPTIMIZE_OUT (default is OPTIMIZE_OUT)
- public static final String COMPILER_CODEGEN_TARGET_PLATFORM = PLUGIN_ID + ".compiler.codegen.targetPlatform"/*nonNLS*/;
+ public static final String COMPILER_CODEGEN_TARGET_PLATFORM = PLUGIN_ID + ".compiler.codegen.targetPlatform";
// possible values are VERSION_1_1 or VERSION_1_2 (default is VERSION_1_1)
- public static final String COMPILER_PB_UNREACHABLE_CODE = PLUGIN_ID + ".compiler.problem.unreachableCode"/*nonNLS*/;
+ public static final String COMPILER_PB_UNREACHABLE_CODE = PLUGIN_ID + ".compiler.problem.unreachableCode";
// possible values are ERROR or WARNING (default is ERROR)
- public static final String COMPILER_PB_INVALID_IMPORT = PLUGIN_ID + ".compiler.problem.invalidImport"/*nonNLS*/;
+ public static final String COMPILER_PB_INVALID_IMPORT = PLUGIN_ID + ".compiler.problem.invalidImport";
// possible values are ERROR or WARNING (default is ERROR)
- public static final String COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD = PLUGIN_ID + ".compiler.problem.overridingPackageDefaultMethod"/*nonNLS*/;
+ public static final String COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD = PLUGIN_ID + ".compiler.problem.overridingPackageDefaultMethod";
// possible values are WARNING or IGNORE (default is WARNING)
- public static final String COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME = PLUGIN_ID + ".compiler.problem.methodWithConstructorName"/*nonNLS*/;
+ public static final String COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME = PLUGIN_ID + ".compiler.problem.methodWithConstructorName";
// possible values are WARNING or IGNORE (default is WARNING)
- public static final String COMPILER_PB_DEPRECATION = PLUGIN_ID + ".compiler.problem.deprecation"/*nonNLS*/;
+ public static final String COMPILER_PB_DEPRECATION = PLUGIN_ID + ".compiler.problem.deprecation";
// possible values are WARNING or IGNORE (default is WARNING)
- public static final String COMPILER_PB_HIDDEN_CATCH_BLOCK = PLUGIN_ID + ".compiler.problem.hiddenCatchBlock"/*nonNLS*/;
+ public static final String COMPILER_PB_HIDDEN_CATCH_BLOCK = PLUGIN_ID + ".compiler.problem.hiddenCatchBlock";
// possible values are WARNING or IGNORE (default is WARNING)
- public static final String COMPILER_PB_UNUSED_LOCAL = PLUGIN_ID + ".compiler.problem.unusedLocal"/*nonNLS*/;
+ public static final String COMPILER_PB_UNUSED_LOCAL = PLUGIN_ID + ".compiler.problem.unusedLocal";
// possible values are WARNING or IGNORE (default is WARNING)
- public static final String COMPILER_PB_UNUSED_PARAMETER = PLUGIN_ID + ".compiler.problem.unusedParameter"/*nonNLS*/;
+ public static final String COMPILER_PB_UNUSED_PARAMETER = PLUGIN_ID + ".compiler.problem.unusedParameter";
// possible values are WARNING or IGNORE (default is WARNING)
- public static final String COMPILER_PB_SYNTHETIC_ACCESS_EMULATION = PLUGIN_ID + ".compiler.problem.syntheticAccessEmulation"/*nonNLS*/;
- // possible values are WARNING or IGNORE (default is IGNORE)
-
- public static final String CORE_JAVA_BUILD_ORDER = PLUGIN_ID + ".computeJavaBuildOrder"/*nonNLS*/;
+ public static final String COMPILER_PB_SYNTHETIC_ACCESS_EMULATION = PLUGIN_ID + ".compiler.problem.syntheticAccessEmulation";
+ // possible values are WARNING or IGNORE (default is IGNORE)
+
+ public static final String CORE_JAVA_BUILD_ORDER = PLUGIN_ID + ".computeJavaBuildOrder";
// possible values are COMPUTE or IGNORE (default is COMPUTE)
/**
* Possible values for configurable options
*/
- public static final String GENERATE = "generate"/*nonNLS*/;
- public static final String DO_NOT_GENERATE = "do not generate"/*nonNLS*/;
- public static final String PRESERVE = "preserve"/*nonNLS*/;
- public static final String OPTIMIZE_OUT = "optimize out"/*nonNLS*/;
- public static final String VERSION_1_1 = "1.1"/*nonNLS*/;
- public static final String VERSION_1_2 = "1.2"/*nonNLS*/;
- public static final String ERROR = "error"/*nonNLS*/;
- public static final String WARNING = "warning"/*nonNLS*/;
- public static final String IGNORE = "ignore"/*nonNLS*/;
- public static final String COMPUTE = "compute"/*nonNLS*/;
+ public static final String GENERATE = "generate";
+ public static final String DO_NOT_GENERATE = "do not generate";
+ public static final String PRESERVE = "preserve";
+ public static final String OPTIMIZE_OUT = "optimize out";
+ public static final String VERSION_1_1 = "1.1";
+ public static final String VERSION_1_2 = "1.2";
+ public static final String ERROR = "error";
+ public static final String WARNING = "warning";
+ public static final String IGNORE = "ignore";
+ public static final String COMPUTE = "compute";
private static Hashtable ConfigurableOptions;
private static Hashtable Variables = new Hashtable(5);
- // possible values are WARNING or IGNORE (default is IGNORE)
-
- public static final String COMPILER_PB_NON_EXTERNALIZED_STRING_LITERAL = PLUGIN_ID + ".compiler.problem.nonExternalizedStringLiteral"/*nonNLS*/;
-
- private static Hashtable DefaultOptions;
- private final static String PropertiesBundleName = "org.eclipse.jdt.core.JavaCore"/*nonNLS*/;
/**
* Creates the Java core plug-in.
*/
@@ -223,11 +216,11 @@ public static IJavaElement create(IFile file) {
String extension= file.getProjectRelativePath().getFileExtension();
if (extension != null) {
extension= extension.toLowerCase();
- if (extension.equals("java"/*nonNLS*/)) {
+ if (extension.equals("java")) {
return createCompilationUnitFrom(file);
- } else if (extension.equals("class"/*nonNLS*/)) {
+ } else if (extension.equals("class")) {
return createClassFileFrom(file);
- } else if (extension.equals("jar"/*nonNLS*/) || extension.equals("zip"/*nonNLS*/)) {
+ } else if (extension.equals("jar") || extension.equals("zip")) {
return createJarPackageFragmentRootFrom(file);
}
}
@@ -419,7 +412,7 @@ private static IJavaElement determineIfOnClasspath(IResource resource, IJavaProj
}
pkgName.append(segment);
if (j < pkgPath.segmentCount() - 1) {
- pkgName.append("."/*nonNLS*/);
+ pkgName.append(".");
}
}
return root.getPackageFragment(pkgName.toString());
@@ -468,33 +461,105 @@ public static String[] getClasspathVariableNames() {
/**
* Answers a set of configurable options with their default values.
* These options allow to configure the behavior of the underlying components.
+ *
+ * Recognized options are listed below, optionName = possibleValue1 / possibleValue2
+ * where [] are enclosing the default value of the corresponding option.
+ *
+ * Note: more options might be added in further releases.
+ *
+ * RECOGNIZED OPTIONS:
+ *
+ * COMPILER_LOCAL_VARIABLE_ATTR = [GENERATE] | DO_NOT_GENERATE
+ * When generated, this attribute will enable local variable names to be displayed
+ * in debugger, only in place where variables are definitely assigned
+ * (.class file is then bigger)
+ *
+ * COMPILER_LINE_NUMBER_ATTR = [GENERATE] | DO_NOT_GENERATE
+ * When generated, this attribute will enable source code highlighting in debugger
+ * (.class file is then bigger).
+ *
+ * COMPILER_SOURCE_FILE_ATTR = [GENERATE] | DO_NOT_GENERATE
+ * When generated, this attribute will enable the debugger to present the
+ * corresponding source code.
+ *
+ * COMPILER_CODEGEN_UNUSED_LOCAL = [PRESERVE] | OPTIMIZE_OUT
+ * Unless requested to preserve unused local variables (i.e. never read), the
+ * compiler will optimize them out, potentially altering debugging
+ *
+ * COMPILER_CODEGEN_TARGET_PLATFORM = [VERSION_1_1] | VERSION_1_2
+ * Generate .class files either backward compatible with JVM 1.1 or only executable
+ * on JVM 1.2 and later
+ *
+ * COMPILER_PB_UNREACHABLE_CODE = [ERROR] | WARNING
+ * Unreachable code can either be reported as an error or a warning
+ *
+ * COMPILER_PB_INVALID_IMPORT = [ERROR] | WARNING
+ * An import statement that cannot be resolved might either be reported
+ * either as an error or as a warning
+ *
+ * COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD = [WARNING] | IGNORE
+ * A package default method is not visible in a different package, and thus
+ * cannot be overriden. When enabling this option, the compiler will signal
+ * such scenarii.
+ *
+ * COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME = [WARNING] | IGNORE
+ * Naming a method with a constructor name is generally considered poor
+ * style programming. When enabling this option, the compiler will signal such
+ * scenarii
+ *
+ * COMPILER_PB_DEPRECATION = [WARNING] | IGNORE
+ * When enabled, the compiler will signal use of deprecated API.
+ *
+ * COMPILER_PB_HIDDEN_CATCH_BLOCK = [WARNING] | IGNORE
+ * Locally to a try statement, some catch blocks may hide others
+ * (e.g. try { throw new java.io.CharConversionException();
+ * } catch (java.io.CharConversionException e) {
+ * } catch (java.io.IOException e) {}).
+ * When enabling this option, the compiler will issue a warning for hidden catch
+ * blocks corresponding to checked exceptions
+ *
+ * COMPILER_PB_UNUSED_LOCAL = WARNING | [IGNORE]
+ * When enabled, the compiler will issue a warning for unused local variables
+ * (i.e. variables never read from)
+ *
+ * COMPILER_PB_UNUSED_PARAMETER = WARNING | [IGNORE]
+ * When enabled, the compiler will issue a warning for unused method parameters
+ * (i.e. parameters never read from)
+ *
+ * COMPILER_PB_SYNTHETIC_ACCESS_EMULATION = WARNING | [IGNORE]
+ * When enabled, the compiler will issue a warning whenever it emulates access
+ * to a non-accessible member of an enclosing type
+ *
+ * CORE_JAVA_BUILD_ORDER = [COMPUTE] | IGNORE
+ * When enabled, the build order is automatically reflecting the classpath on each
+ * classpath change action. It can still be modified manually afterwards.
*/
+
public static Hashtable getDefaultOptions(){
- if (DefaultOptions == null) {
- DefaultOptions = new Hashtable(10);
-
- try{
- ResourceBundle bundle =
- ResourceBundle.getBundle(PropertiesBundleName,Locale.getDefault());
-
- Enumeration enum = bundle.getKeys();
- while(enum.hasMoreElements()){
- String id = (String)enum.nextElement();
- System.out.println(id);
- DefaultOptions.put(id,bundle.getString(id));
- }
- } catch(Exception ex){}
- }
- return (Hashtable)DefaultOptions.clone();
-
-
-}
+ Hashtable defaultOptions = new Hashtable(10);
-private static IPath getInstallLocation() {
- return new Path(getPlugin().getDescriptor().getInstallURL().getFile());
-}
+ // Compiler settings
+ defaultOptions.put(COMPILER_LOCAL_VARIABLE_ATTR, GENERATE);
+ defaultOptions.put(COMPILER_LINE_NUMBER_ATTR, GENERATE);
+ defaultOptions.put(COMPILER_SOURCE_FILE_ATTR, GENERATE);
+ defaultOptions.put(COMPILER_CODEGEN_UNUSED_LOCAL, PRESERVE);
+ defaultOptions.put(COMPILER_CODEGEN_TARGET_PLATFORM, VERSION_1_1);
+ defaultOptions.put(COMPILER_PB_UNREACHABLE_CODE, ERROR);
+ defaultOptions.put(COMPILER_PB_INVALID_IMPORT, ERROR);
+ defaultOptions.put(COMPILER_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD, WARNING);
+ defaultOptions.put(COMPILER_PB_METHOD_WITH_CONSTRUCTOR_NAME, WARNING);
+ defaultOptions.put(COMPILER_PB_DEPRECATION, WARNING);
+ defaultOptions.put(COMPILER_PB_HIDDEN_CATCH_BLOCK, WARNING);
+ defaultOptions.put(COMPILER_PB_UNUSED_LOCAL, IGNORE);
+ defaultOptions.put(COMPILER_PB_UNUSED_PARAMETER, IGNORE);
+ defaultOptions.put(COMPILER_PB_SYNTHETIC_ACCESS_EMULATION, IGNORE);
+
+ // JavaCore settings
+ defaultOptions.put(CORE_JAVA_BUILD_ORDER, IGNORE);
+ return defaultOptions;
+}
/**
* Returns the single instance of the Java core plug-in runtime class.
* Equivalent to <code>(JavaCore) getPlugin()</code>.
@@ -575,7 +640,7 @@ public static IClasspathEntry getResolvedClasspathEntry(IClasspathEntry entry) {
return JavaCore.newProjectEntry(resolvedPath); // internal project
case IResource.FILE :
String extension = resolvedResource.getFileExtension();
- if ("jar"/*nonNLS*/.equalsIgnoreCase(extension) || "zip"/*nonNLS*/.equalsIgnoreCase(extension)){ // internal binary archive
+ if ("jar".equalsIgnoreCase(extension) || "zip".equalsIgnoreCase(extension)){ // internal binary archive
return JavaCore.newLibraryEntry(
resolvedPath,
getResolvedVariablePath(entry.getSourceAttachmentPath()),
@@ -595,7 +660,7 @@ public static IClasspathEntry getResolvedClasspathEntry(IClasspathEntry entry) {
File externalFile = (File) target;
if (externalFile.isFile()){
String fileName = externalFile.getName().toLowerCase();
- if (fileName.endsWith(".jar"/*nonNLS*/) || fileName.endsWith(".zip"/*nonNLS*/)){ // external binary archive
+ if (fileName.endsWith(".jar") || fileName.endsWith(".zip")){ // external binary archive
return JavaCore.newLibraryEntry(
resolvedPath,
getResolvedVariablePath(entry.getSourceAttachmentPath()),
@@ -686,7 +751,7 @@ public static boolean isReferencedBy(IJavaElement element, IMarkerDelta markerDe
*/
public static IClasspathEntry newLibraryEntry(IPath path, IPath sourceAttachmentPath, IPath sourceAttachmentRootPath) {
- Assert.isTrue(path.isAbsolute(), Util.bind("classpath.needAbsolutePath"/*nonNLS*/));
+ Assert.isTrue(path.isAbsolute(), "path for IClasspathEntry must be absolute");
return new ClasspathEntry(
IPackageFragmentRoot.K_BINARY,
IClasspathEntry.CPE_LIBRARY,
@@ -708,7 +773,7 @@ public static IClasspathEntry newLibraryEntry(IPath path, IPath sourceAttachment
* The prerequisite project is referred to using an absolute path relative to the workspace root.
*/
public static IClasspathEntry newProjectEntry(IPath path){
- Assert.isTrue(path.isAbsolute(), Util.bind("classpath.needAbsolutePath"/*nonNLS*/));
+ Assert.isTrue(path.isAbsolute(), "path for IClasspathEntry must be absolute");
return new ClasspathEntry(IPackageFragmentRoot.K_SOURCE, IClasspathEntry.CPE_PROJECT, path, null, null);
}
/**
@@ -728,7 +793,7 @@ public static IRegion newRegion() {
* context of the containing project (a source entry "Proj1/src" cannot be used on the classpath of Proj2).
*/
public static IClasspathEntry newSourceEntry(IPath path){
- Assert.isTrue(path.isAbsolute(), Util.bind("classpath.needAbsolutePath"/*nonNLS*/));
+ Assert.isTrue(path.isAbsolute(), "path for IClasspathEntry must be absolute");
return new ClasspathEntry(IPackageFragmentRoot.K_SOURCE, IClasspathEntry.CPE_SOURCE, path, null, null);
}
/**
@@ -761,7 +826,7 @@ public static IClasspathEntry newSourceEntry(IPath path){
* or <code>null</code> if <code>archivePath</code> is also <code>null</code>
*/
public static IClasspathEntry newVariableEntry(IPath variablePath, IPath variableSourceAttachmentPath, IPath sourceAttachmentRootPath){
- Assert.isTrue(variablePath != null && variablePath.segmentCount() >= 1, Util.bind("classpath.illegalVariablePath"/*nonNLS*/));
+ Assert.isTrue(variablePath != null && variablePath.segmentCount() >= 1, "invalid variable path");
return new ClasspathEntry(
IPackageFragmentRoot.K_SOURCE,
IClasspathEntry.CPE_VARIABLE,
@@ -855,7 +920,7 @@ public static void setClasspathVariable(String variableName, IPath path) throws
*/
public static void setClasspathVariable(String variableName, IPath path, IProgressMonitor monitor) throws JavaModelException {
- Assert.isTrue(path != null, Util.bind("classpath.nullVariablePath"/*nonNLS*/));
+ Assert.isTrue(path != null, "variable path cannot be null");
updateVariableValue(variableName, path, monitor);
}
/* (non-Javadoc)
@@ -1004,5 +1069,4 @@ private static void updateVariableValue(String variableName, IPath path, IProgre
}
}
}
-
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaModelException.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaModelException.java
index e7017e5071..29df1e6c8a 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaModelException.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/JavaModelException.java
@@ -98,13 +98,13 @@ public boolean isDoesNotExist() {
*/
public String toString() {
StringBuffer buffer= new StringBuffer();
- buffer.append("Java Model Exception: "/*nonNLS*/);
+ buffer.append("Java Model Exception: ");
if (getException() != null) {
if (getException() instanceof CoreException) {
CoreException c= (CoreException)getException();
- buffer.append("Core Exception [code "/*nonNLS*/);
+ buffer.append("Core Exception [code ");
buffer.append(c.getStatus().getCode());
- buffer.append("] "/*nonNLS*/);
+ buffer.append("] ");
buffer.append(c.getStatus().getMessage());
} else {
buffer.append(getException().toString());
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java
index 7a870dd705..a9f96eaf36 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java
@@ -173,54 +173,54 @@ public final class Signature {
* String constant for the signature of the primitive type boolean.
* Value is <code>"Z"</code>.
*/
- public static final String SIG_BOOLEAN = "Z"/*nonNLS*/;
+ public static final String SIG_BOOLEAN = "Z";
/**
* String constant for the signature of the primitive type byte.
* Value is <code>"B"</code>.
*/
- public static final String SIG_BYTE = "B"/*nonNLS*/;
+ public static final String SIG_BYTE = "B";
/**
* String constant for the signature of the primitive type char.
* Value is <code>"C"</code>.
*/
- public static final String SIG_CHAR = "C"/*nonNLS*/;
+ public static final String SIG_CHAR = "C";
/**
* String constant for the signature of the primitive type double.
* Value is <code>"D"</code>.
*/
- public static final String SIG_DOUBLE = "D"/*nonNLS*/;
+ public static final String SIG_DOUBLE = "D";
/**
* String constant for the signature of the primitive type float.
* Value is <code>"F"</code>.
*/
- public static final String SIG_FLOAT = "F"/*nonNLS*/;
+ public static final String SIG_FLOAT = "F";
/**
* String constant for the signature of the primitive type int.
* Value is <code>"I"</code>.
*/
- public static final String SIG_INT = "I"/*nonNLS*/;
+ public static final String SIG_INT = "I";
/**
* String constant for the signature of the primitive type long.
* Value is <code>"J"</code>.
*/
- public static final String SIG_LONG = "J"/*nonNLS*/;
+ public static final String SIG_LONG = "J";
/**
* String constant for the signature of the primitive type short.
* Value is <code>"S"</code>.
*/
- public static final String SIG_SHORT = "S"/*nonNLS*/;
+ public static final String SIG_SHORT = "S";
/** String constant for the signature of result type void.
* Value is <code>"V"</code>.
*/
- public static final String SIG_VOID = "V"/*nonNLS*/;
+ public static final String SIG_VOID = "V";
/**
* Not instantiable.
@@ -236,7 +236,7 @@ private static String arrayIfy(String typeName, int arrayCount) {
StringBuffer sb = new StringBuffer(typeName.length() + arrayCount * 2);
sb.append(typeName);
for (int i = 0; i < arrayCount; ++i) {
- sb.append("[]"/*nonNLS*/);
+ sb.append("[]");
}
return sb.toString();
}
@@ -302,7 +302,7 @@ public static String createTypeSignature(char[] typeName, boolean isResolved) {
return SIG_VOID;
case 6 :
if (typeName[0] == 'S' && typeName[1] == 't' && typeName[2] == 'r' && typeName[3] == 'i' && typeName[4] == 'n' && typeName[5] == 'g')
- if (!isResolved) return "QString;"/*nonNLS*/;
+ if (!isResolved) return "QString;";
break;
case 7 :
if (typeName[0] == 'b' && typeName[1] == 'o' && typeName[2] == 'o' && typeName[3] == 'l' && typeName[4] == 'e' && typeName[5] == 'a' && typeName[6] == 'n')
@@ -617,7 +617,7 @@ public static String[] getParameterTypes(String methodSignature) throws IllegalA
public static String getQualifier(String name) {
int lastDot = name.lastIndexOf(C_DOT);
if (lastDot == -1) {
- return ""/*nonNLS*/;
+ return "";
}
return name.substring(0, lastDot);
}
@@ -715,7 +715,7 @@ public static String[] getSimpleNames(String name) {
*/
public static String toQualifiedName(String[] segments) {
if (segments.length == 0) {
- return ""/*nonNLS*/;
+ return "";
}
if (segments.length == 1) {
return segments[0];
@@ -755,28 +755,28 @@ public static String toQualifiedName(String[] segments) {
public static String toString(String signature) throws IllegalArgumentException {
try {
if (signature.charAt(0) == C_PARAM_START) {
- return toString(signature, ""/*nonNLS*/, null, true, true);
+ return toString(signature, "", null, true, true);
}
int arrayCount = getArrayCount(signature);
switch (signature.charAt(arrayCount)) {
case C_BOOLEAN :
- return arrayIfy("boolean"/*nonNLS*/, arrayCount);
+ return arrayIfy("boolean", arrayCount);
case C_BYTE :
- return arrayIfy("byte"/*nonNLS*/, arrayCount);
+ return arrayIfy("byte", arrayCount);
case C_CHAR :
- return arrayIfy("char"/*nonNLS*/, arrayCount);
+ return arrayIfy("char", arrayCount);
case C_DOUBLE :
- return arrayIfy("double"/*nonNLS*/, arrayCount);
+ return arrayIfy("double", arrayCount);
case C_FLOAT :
- return arrayIfy("float"/*nonNLS*/, arrayCount);
+ return arrayIfy("float", arrayCount);
case C_INT :
- return arrayIfy("int"/*nonNLS*/, arrayCount);
+ return arrayIfy("int", arrayCount);
case C_LONG :
- return arrayIfy("long"/*nonNLS*/, arrayCount);
+ return arrayIfy("long", arrayCount);
case C_SHORT :
- return arrayIfy("short"/*nonNLS*/, arrayCount);
+ return arrayIfy("short", arrayCount);
case C_VOID :
- return arrayIfy("void"/*nonNLS*/, arrayCount);
+ return arrayIfy("void", arrayCount);
case C_RESOLVED :
case C_UNRESOLVED :
int semi = signature.indexOf(C_SEMICOLON, arrayCount + 1);
@@ -838,7 +838,7 @@ public static String toString(String methodSignature, String methodName, String[
sb.append(C_PARAM_START);
for (int i = 0; i < paramTypes.length; ++i) {
if (i != 0)
- sb.append(", "/*nonNLS*/);
+ sb.append(", ");
String readableParamType = toString(paramTypes[i]);
if (!fullyQualifyTypeNames) {
int lastDot = readableParamType.lastIndexOf(C_DOT);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IGlobalVariable.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IGlobalVariable.java
index 76d45d7a1d..fa2ea0cfc5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IGlobalVariable.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/eval/IGlobalVariable.java
@@ -1,19 +1,5 @@
package org.eclipse.jdt.core.eval;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * A global variable declared in an evaluation context.
- * <p>
- * This interface is not intended to be implemented by clients.
- * <code>IEvaluationContext.newVariable</code> can be used to obtain an instance.
- * </p>
- *
- * @see IEvaluationContext#newVariable
- */
public interface IGlobalVariable {
/**
* Returns the initializer of this global variable.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/DOMException.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/DOMException.java
index 7d183703bf..9a382d1ac3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/DOMException.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/DOMException.java
@@ -1,16 +1,5 @@
package org.eclipse.jdt.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Unchecked exception thrown when an illegal manipulation of the JDOM is
- * performed, or when an attempt is made to access/set an attribute of a
- * JDOM node that source indexes cannot be determined for (in case the source
- * was syntactically incorrect).
- */
public class DOMException extends RuntimeException {
/**
* Creates a new exception with no detail message.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/DOMFactory.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/DOMFactory.java
index bb561115f9..a556c4856c 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/DOMFactory.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/DOMFactory.java
@@ -47,7 +47,7 @@ public IDOMCompilationUnit createCompilationUnit(String sourceCode, String name)
* Method declared on IDOMFactory.
*/
public IDOMField createField() {
- return createField("Object aField;"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR);
+ return createField("Object aField;"+ JavaModelManager.LINE_SEPARATOR);
}
/* (non-Javadoc)
* Method declared on IDOMFactory.
@@ -77,7 +77,7 @@ public IDOMImport createImport(String sourceCode) {
* Method declared on IDOMFactory.
*/
public IDOMInitializer createInitializer() {
- return createInitializer("static {}"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR);
+ return createInitializer("static {}"+ JavaModelManager.LINE_SEPARATOR);
}
/* (non-Javadoc)
* Method declared on IDOMFactory.
@@ -92,7 +92,7 @@ public IDOMInitializer createInitializer(String sourceCode) {
* Method declared on IDOMFactory.
*/
public IDOMMethod createMethod() {
- return createMethod("public void newMethod() {"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR+"}"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR);
+ return createMethod("public void newMethod() {"+ JavaModelManager.LINE_SEPARATOR+"}"+ JavaModelManager.LINE_SEPARATOR);
}
/* (non-Javadoc)
* Method declared on IDOMFactory.
@@ -122,7 +122,7 @@ public IDOMPackage createPackage(String sourceCode) {
* Method declared on IDOMFactory.
*/
public IDOMType createType() {
- return createType("public class AClass {"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR +"}"/*nonNLS*/+ JavaModelManager.LINE_SEPARATOR);
+ return createType("public class AClass {"+ JavaModelManager.LINE_SEPARATOR +"}"+ JavaModelManager.LINE_SEPARATOR);
}
/* (non-Javadoc)
* Method declared on IDOMFactory.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMCompilationUnit.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMCompilationUnit.java
index 83a6eac788..e9702c11df 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMCompilationUnit.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMCompilationUnit.java
@@ -1,19 +1,5 @@
package org.eclipse.jdt.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents a Java compilation unit (<code>.java</code> source file).
- * The corresponding syntactic unit is CompilationUnit (JLS2 7.3).
- * Allowable child types for a compilation unit are <code>IDOMPackage</code>, <code>IDOMImport</code>,
- * and <code>IDOMType</code>.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IDOMCompilationUnit extends IDOMNode {
/**
* Returns the header comment for this compilation unit. The header comment
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMFactory.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMFactory.java
index 9a5669a259..878df04d95 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMFactory.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMFactory.java
@@ -1,48 +1,5 @@
package org.eclipse.jdt.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * A factory used to create document fragment (DF) nodes. An
- * <code>IDOMCompilationUnit</code> represents the root of a complete JDOM (that
- * is, a ".java" file). Other node types represent fragments of a compilation
- * unit.
- * <p>
- * The factory can be used to create empty DFs or it can create DFs from source
- * strings. All DFs created empty are assigned default values as required, such
- * that a call to <code>IDOMNode.getContents</code> will generate a valid source
- * string. See individual <code>create</code> methods for details on the default
- * values supplied. The factory does its best to recognize Java structures in
- * the source provided. If the factory is completely unable to recognize source
- * constructs, the factory method returns <code>null</code>.
- * </p>
- * <p>
- * Even if a DF is created successfully from source code, it does not guarantee
- * that the source code will compile error free. Similary, the contents of a DF
- * are not guaranteed to compile error free. However, syntactically correct
- * source code is guaranteed to be recognized and successfully generate a DF.
- * Similarly, if all of the fragments of a JDOM are syntactically correct, the
- * contents of the entire document will be correct too.
- * </p>
- * <p>
- * The factory does not perform or provide any code formatting. Document
- * fragments created on source strings must be pre-formatted. The JDOM attempts
- * to maintain the formatting of documents as best as possible. For this reason,
- * document fragments created for nodes that are to be strung together should
- * end with a new-line character. Failing to do so will result in a document
- * that has elements strung together on the same line. This is especially
- * important if a source string ends with a // comment. In this case, it would
- * be syntactically incorrect to omit the new line character.
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- * @see IDOMNode
- */
public interface IDOMFactory {
/**
* Creates and return an empty JDOM. The initial content is an empty string.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMField.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMField.java
index 9799b736b1..c623cfcb99 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMField.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMField.java
@@ -1,19 +1,5 @@
package org.eclipse.jdt.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents a field declaration. The corresponding
- * syntactic units are FieldDeclaration (JLS2 8.3) and ConstantDeclaration
- * (JLS2 9.3) restricted to a single VariableDeclarator clause.
- * A field has no children. The parent of a field is a type.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IDOMField extends IDOMMember {
/**
* Returns the initializer expression for this field.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMImport.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMImport.java
index c7596dd4a3..fc56e6a327 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMImport.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMImport.java
@@ -1,18 +1,5 @@
package org.eclipse.jdt.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents an import declaration.
- * The corresponding syntactic unit is ImportDeclaration (JLS2 7.5).
- * An import has no children and its parent is a compilation unit.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IDOMImport extends IDOMNode {
/**
* The <code>IDOMImport</code> refinement of this <code>IDOMNode</code>
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMInitializer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMInitializer.java
index beb3c5183b..a8f82f403c 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMInitializer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMInitializer.java
@@ -1,18 +1,5 @@
package org.eclipse.jdt.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents an initializer. The corresponding syntactic
- * units are InstanceInitializer (JLS2 8.6) and StaticDeclaration (JLS2 8.7).
- * An initializer has no children and its parent is a type.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IDOMInitializer extends IDOMMember {
/**
* Returns the body of this initializer. The syntax for a body corresponds to
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMMember.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMMember.java
index 916b1a27e6..6cb9542ce2 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMMember.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMMember.java
@@ -1,22 +1,5 @@
package org.eclipse.jdt.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * An <code>IDOMMember</code> defines functionality common to nodes which
- * can be members of types.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- *
- * @see IDOMType
- * @see IDOMMethod
- * @see IDOMField
- * @see IDOMInitializer
- */
public interface IDOMMember extends IDOMNode {
/**
* Returns the comment associated with this member (including comment delimiters).
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMMethod.java
index c9b1b14105..a0b53d39c5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMMethod.java
@@ -1,20 +1,5 @@
package org.eclipse.jdt.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents a method declaration.
- * The corresponding syntactic units are MethodDeclaration (JLS2 8.4),
- * ConstructorDeclaration (JLS2 8.8), and AbstractMethodDeclaration (JLS2 9.4).
- * A method has no children and its parent is a type.
- * Local classes are considered to be part of the body of a method, not a child.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IDOMMethod extends IDOMMember {
/**
* Adds the given exception to the end of the list of exceptions this method
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMPackage.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMPackage.java
index 861cb912ec..5231e29735 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMPackage.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMPackage.java
@@ -1,18 +1,5 @@
package org.eclipse.jdt.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents a package declaration.
- * The corresponding syntactic unit is PackageDeclaration (JLS2 7.4).
- * A Package has no children, and its parent is a compilation unit.
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IDOMPackage extends IDOMNode {
/**
* The <code>IDOMPackage</code> refinement of this <code>IDOMNode</code>
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMType.java
index 17a5f1a3d9..d5c1c2be6b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/core/jdom/IDOMType.java
@@ -1,23 +1,5 @@
package org.eclipse.jdt.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.internal.core.*;
-/**
- * Represents a source type in a compilation unit, either as a top-level type or a member type.
- * The corresponding syntactic units are ClassDeclaration (JLS2 8.1) and InterfaceDeclaration (JLS2 9.1).
- * <p>
- * Allowable child types for a type are <code>IDOMType</code>, <code>IDOMField</code>,
- * <code>IDOMMethod</code>, and <code>IDOMInitializer</code>.
- * Children are listed in the order in which they appear in the source. The parent of a type
- * is a type (in the case of a member type) or a compilation unit (in the case of a top-level type).
- * </p>
- * <p>
- * This interface is not intended to be implemented by clients.
- * </p>
- */
public interface IDOMType extends IDOMMember {
/**
* Adds the given interface name to the names of interfaces that this type implements or extends
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 707494cf7b..f90627e9cd 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, ""/*nonNLS*/);
+ return isLegal(expression, "");
}
/** 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, ""/*nonNLS*/);
+ isNotNull(object, "");
}
/** 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"/*nonNLS*/,message));
+ throw new AssertionFailedException("null argument;" + 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, ""/*nonNLS*/);
+ return isTrue(expression, "");
}
/** 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"/*nonNLS*/, message));
+ throw new AssertionFailedException("assertion failed; "+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 7f9ec6723d..87113dc906 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("/"/*nonNLS*/) + 1;
- if (start == 0 || start < fileName.lastIndexOf("\\"/*nonNLS*/))
- start = fileName.lastIndexOf("\\"/*nonNLS*/) + 1;
+ int start = fileName.lastIndexOf("/") + 1;
+ if (start == 0 || start < fileName.lastIndexOf("\\"))
+ start = fileName.lastIndexOf("\\") + 1;
- int end = fileName.lastIndexOf("."/*nonNLS*/);
+ int end = fileName.lastIndexOf(".");
if (end == -1)
end = fileName.length();
@@ -75,6 +75,6 @@ public char[] getMainTypeName() {
return mainTypeName;
}
public String toString(){
- return "CompilationUnit: "/*nonNLS*/+new String(fileName);
+ return "CompilationUnit: "+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 0616e24f54..a593da8ef6 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"/*nonNLS*/ + i;
+ fParameterNames[i] = "arg" + i;
}
}
return fParameterNames;
@@ -151,18 +151,18 @@ public boolean isConstructor() throws JavaModelException {
public String readableName() {
StringBuffer buffer = new StringBuffer(super.readableName());
- buffer.append("("/*nonNLS*/);
+ buffer.append("(");
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(", "/*nonNLS*/);
+ buffer.append(", ");
}
}
}
- buffer.append(")"/*nonNLS*/);
+ buffer.append(")");
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 49dbcaf257..4c72cc70f4 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"/*nonNLS*/).getType();
+ return getPackageFragment().getClassFile(new String(enclosingTypeName) + ".class").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() + "$"/*nonNLS*/ + name + ".class"/*nonNLS*/);
+ IClassFile classFile= getPackageFragment().getClassFile(getTypeQualifiedName() + "$" + name + ".class");
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"/*nonNLS*/));
+ throw new IllegalArgumentException("project argument cannot be null");
}
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 150909f0e4..4cf8c557fd 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"/*nonNLS*/;
- case '\r': return nextChar == '\n' ? "\r\n"/*nonNLS*/ : "\r"/*nonNLS*/;
+ case '\n': return "\n";
+ case '\r': return nextChar == '\n' ? "\r\n" : "\r";
}
}
}
@@ -208,7 +208,7 @@ public char[] getCharacters() {
*/
public String getContents() {
if (fContents == null)
- return ""/*nonNLS*/;
+ return "";
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 ""/*nonNLS*/;
+ return "";
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"/*nonNLS*/);
+ buffer.append("Buffer:\n");
for (int i = 0; i < length; i++) {
char car = contents[i];
switch (car) {
case '\n':
- buffer.append("\\n\n"/*nonNLS*/);
+ buffer.append("\\n\n");
break;
case '\r':
if (i < length-1 && contents[i+1] == '\n') {
- buffer.append("\\r\\n\n"/*nonNLS*/);
+ buffer.append("\\r\\n\n");
i++;
} else {
- buffer.append("\\r\n"/*nonNLS*/);
+ buffer.append("\\r\n");
}
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 a956b0d46b..2f68e53315 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"/*nonNLS*/));
+ throw new IllegalArgumentException("class file name must end with .class");
}
}
/**
@@ -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"/*nonNLS*/);
+ BasicCompilationUnit cu = new BasicCompilationUnit(getSource().toCharArray(), getElementName() + ".java");
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"/*nonNLS*/;
+ name = name + ".java";
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(""/*nonNLS*/)) {
+ if (entryName.equals("")) {
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"/*nonNLS*/;
+ name = name + ".java";
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 2db5ba76dd..3421a37cb8 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"/*nonNLS*/);
+ IClassFile classFile= ((IPackageFragment)fClassFile.getParent()).getClassFile(new String(ClassFile.unqualifiedName(binaryType.getName())) + ".class");
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 8ec95adbbd..3734bbc855 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"/*nonNLS*/);
+ buffer.append("CPE_LIBRARY");
break;
case IClasspathEntry.CPE_PROJECT:
- buffer.append("CPE_PROJECT"/*nonNLS*/);
+ buffer.append("CPE_PROJECT");
break;
case IClasspathEntry.CPE_SOURCE:
- buffer.append("CPE_SOURCE"/*nonNLS*/);
+ buffer.append("CPE_SOURCE");
break;
case IClasspathEntry.CPE_VARIABLE:
- buffer.append("CPE_VARIABLE"/*nonNLS*/);
+ buffer.append("CPE_VARIABLE");
break;
}
- buffer.append("]["/*nonNLS*/);
+ buffer.append("][");
switch (getContentKind()) {
case IPackageFragmentRoot.K_BINARY:
- buffer.append("K_BINARY"/*nonNLS*/);
+ buffer.append("K_BINARY");
break;
case IPackageFragmentRoot.K_SOURCE:
- buffer.append("K_SOURCE"/*nonNLS*/);
+ buffer.append("K_SOURCE");
break;
case ClasspathEntry.K_OUTPUT:
- buffer.append("K_OUTPUT"/*nonNLS*/);
+ buffer.append("K_OUTPUT");
break;
}
buffer.append(']');
if (getSourceAttachmentPath() != null){
- buffer.append("[sourcePath:"/*nonNLS*/);
+ buffer.append("[sourcePath:");
buffer.append(getSourceAttachmentPath());
buffer.append(']');
}
if (getSourceAttachmentRootPath() != null){
- buffer.append("[rootPath:"/*nonNLS*/);
+ buffer.append("[rootPath:");
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 28d5127d25..7a138f6d97 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"/*nonNLS*/), 2);
+ beginTask("Committing working copy...", 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 8372504636..4b972a5b35 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"/*nonNLS*/));
+ throw new IllegalArgumentException("compilation unit name must end with .java");
}
}
/**
@@ -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"/*nonNLS*/));
+ throw new IllegalArgumentException("container cannot be null");
}
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 = ""/*nonNLS*/;
+ String source = "";
if (pkg.getElementName().length() > 0) {
//not the default package...add the package declaration
- source = "package "/*nonNLS*/ + pkg.getElementName() + ";"/*nonNLS*/ + JavaModelManager.LINE_SEPARATOR;
+ source = "package " + pkg.getElementName() + ";" + 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"/*nonNLS*/));
+ String typeNodeName = nodeName.substring(0, nodeName.indexOf(".java"));
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 ""/*nonNLS*/;
+ if (buffer == null) return "";
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"/*nonNLS*/));
+ throw new IllegalArgumentException("container cannot be null");
}
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"/*nonNLS*/));
+ throw new IllegalArgumentException("name cannot be null");
}
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 acecc72b22..80e4bf4c40 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 = "<"/*nonNLS*/ + new String(typeName) + ">/"/*nonNLS*/ + argCount;
+ String name = "<" + new String(typeName) + ">/" + 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) + ".*"/*nonNLS*/;
+ importName= new String(name) + ".*";
} 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) + "/"/*nonNLS*/ + argCount;
+ String name = new String(methodName) + "/" + 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) + "."/*nonNLS*/ + nameString).toCharArray();
+ qualifiedName= (new String(fPackageName) + "." + nameString).toCharArray();
}
}
else if (parentHandle.getElementType() == IJavaElement.TYPE) {
handle = ((IType) parentHandle).getType(nameString);
enclosingTypeName= ((SourceTypeElementInfo)parentInfo).getName();
- qualifiedName= (new String(((SourceTypeElementInfo)parentInfo).getQualifiedName()) + "."/*nonNLS*/ + nameString).toCharArray();
+ qualifiedName= (new String(((SourceTypeElementInfo)parentInfo).getQualifiedName()) + "." + nameString).toCharArray();
}
else {
Assert.isTrue(false); // Should not happen
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 4858baf980..25a27952d0 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"/*nonNLS*/);
+ return "Copying elements...";
}
/**
* 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"/*nonNLS*/}, fForce);
+ return new RenameResourceElementsOperation(new IJavaElement[] {dest}, new IJavaElement[] {dest.getParent()}, new String[]{getNewNameFor(element) + ".java"}, 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 3fe95cd814..b868a99001 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"/*nonNLS*/);
+ return "Copying resources...";
}
/**
* Sets the deltas to register the changes resulting from this operation
@@ -223,9 +223,7 @@ private void processCompilationUnitResource(ICompilationUnit source, IPackageFra
// update new resource content
try {
- if (newContent != null){
- destFile.setContents(new ByteArrayInputStream(newContent.getBytes()), fForce, true, getSubProgressMonitor(1));
- }
+ destFile.setContents(new ByteArrayInputStream(newContent.getBytes()), fForce, true, getSubProgressMonitor(1));
} catch (CoreException e) {
throw new JavaModelException(e);
}
@@ -342,7 +340,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"/*nonNLS*/)) {
+ if (resources[i].getName().endsWith(".java")) {
// we only consider potential compilation units
ICompilationUnit cu = newFrag.getCompilationUnit(resources[i].getName());
IDOMCompilationUnit domCU = fFactory.createCompilationUnit(cu.getSource(), cu.getElementName());
@@ -428,7 +426,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 "/*nonNLS*/ + pkgName + ";"/*nonNLS*/ + JavaModelManager.LINE_SEPARATOR);
+ IDOMPackage pkg = fFactory.createPackage("package " + pkgName + ";" + 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 2a8ce5ffbe..22db53e9c6 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"/*nonNLS*/), 2);
+ beginTask("Creating a compilation unit...", 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 79ab766ce7..7515b81962 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"/*nonNLS*/);
+ return "Creating a field...";
}
/**
* 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 f40b1fb73a..bb9f7ca7fd 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"/*nonNLS*/);
+ return "Creating imports...";
}
/**
* 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 436ee5ad48..b060f1755b 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"/*nonNLS*/);
+ return "Creating an initializer...";
}
/**
* 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 d99a852b86..f9b152ada6 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"/*nonNLS*/);
+ return "Creating a method...";
}
/**
* @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 14fd9662ab..5e71dc70e9 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"/*nonNLS*/);
+ return "Creating a package declaration...";
}
/**
* 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 8e9c69ec77..f0bf63662c 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"/*nonNLS*/), names.length);
+ beginTask("Creating package fragment(s)...", names.length);
IContainer parentFolder = (IContainer) root.getUnderlyingResource();
- String sideEffectPackageName = ""/*nonNLS*/;
+ String sideEffectPackageName = "";
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 58e4d3c878..abd5d79917 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 {"/*nonNLS*/ + JavaModelManager.LINE_SEPARATOR);
+ buff.append(JavaModelManager.LINE_SEPARATOR + " public class A {" + JavaModelManager.LINE_SEPARATOR);
buff.append(fSource);
buff.append(JavaModelManager.LINE_SEPARATOR).append('}');
- IDOMCompilationUnit domCU = (new DOMFactory()).createCompilationUnit(buff.toString(), "A.java"/*nonNLS*/);
- IDOMNode node = (IDOMNode) domCU.getChild("A"/*nonNLS*/).getChildren().nextElement();
+ IDOMCompilationUnit domCU = (new DOMFactory()).createCompilationUnit(buff.toString(), "A.java");
+ IDOMNode node = (IDOMNode) domCU.getChild("A").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 9a1a08d0bc..9d20048ed7 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"/*nonNLS*/);
+ return "Creating a type...";
}
/**
* 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 1f1a2e7b71..cce6e15e50 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"/*nonNLS*/);
+ return "Deleting elements...";
}
/**
* 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"/*nonNLS*/, e.getElementName(), cuDOM.getName()));
+ Assert.isTrue(node != null, "Failed to locate " + e.getElementName() + " in " + 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 01cf6dbaf0..099fee64bd 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
@@ -61,25 +61,15 @@ private void deletePackageFragment(IPackageFragment frag)
}
deleteResources(actualNonJavaResources, fForce);
- // delete remaining files in this package (.class file in the case where Proj=src=bin)
- IResource[] remaingFiles;
+ // remove the folder if it is empty
+ IResource[] members;
try {
- remaingFiles = ((IFolder) res).members();
+ members = ((IFolder) res).members();
} catch (CoreException ce) {
throw new JavaModelException(ce);
}
- boolean isEmpty = true;
- for (int i = 0, length = remaingFiles.length; i < length; i++) {
- IResource file = remaingFiles[i];
- if (file instanceof IFile) {
- this.deleteResource(file, true);
- } else {
- isEmpty = false;
- }
- }
- if (isEmpty) {
- // delete recursively empty folders
- deleteEmptyPackageFragment(frag, false);
+ if (members.length == 0) {
+ deleteEmptyPackageFragment(frag, fForce);
}
}
}
@@ -87,7 +77,7 @@ private void deletePackageFragment(IPackageFragment frag)
* @see MultiOperation
*/
protected String getMainTaskName() {
- return Util.bind("operation.deleteResourceProgress"/*nonNLS*/);
+ return "Deleting resources...";
}
/**
* @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 5b36f6f281..71af00d2ab 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"/*nonNLS*/.equals(extension) || "zip"/*nonNLS*/.equals(extension)) {
+ if ("jar".equals(extension) || "zip".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/FailedReconciliationException.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/FailedReconciliationException.java
index 61eaed2947..6f799b4eb5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/FailedReconciliationException.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/FailedReconciliationException.java
@@ -1,9 +1,4 @@
package org.eclipse.jdt.internal.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
public class FailedReconciliationException extends RuntimeException {
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/HandleFactory.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/HandleFactory.java
index 5c81de4270..c2e111ad6e 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/HandleFactory.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/HandleFactory.java
@@ -96,7 +96,7 @@ public class HandleFactory {
this.packageHandles.put(packageName, pkgFragment);
}
String simpleName= resourcePath.substring(lastSlash + 1);
- if (Util.isJavaFileName(simpleName)) {
+ if (simpleName.endsWith(".java")) {
ICompilationUnit unit= pkgFragment.getCompilationUnit(simpleName);
return (Openable) unit;
} else {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IJavaReconciler.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IJavaReconciler.java
index 5d5778e236..d407ea71c2 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IJavaReconciler.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IJavaReconciler.java
@@ -1,22 +1,5 @@
package org.eclipse.jdt.internal.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * An <code>IJavaReconciler</code> is used to incrementally update
- * the structure of a working copy compilation unit as edits take
- * place in its buffer. As each contiguous edit is performed on the
- * buffer, calls are made to the reconciler which will update the
- * internal structure of the working copy (i.e. add/remove elements),
- * and report structural changes as <code>IJavaElementDelta</code>s.
- * <p>
- * Deltas are distributed via the <code>IElementChangedListener</code>
- * mechanism. Interested listeners must register with the
- * <code>IJavaModelManager</code>.
- */
public interface IJavaReconciler {
/**
* Reconciles a deletion of contiguous text.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IPathRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IPathRequestor.java
index 7f2a20e19f..90e7c7ae49 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IPathRequestor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IPathRequestor.java
@@ -1,9 +1,4 @@
package org.eclipse.jdt.internal.core;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
public interface IPathRequestor {
void acceptPath(String path);
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 99db352704..2aba257c97 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, ""/*nonNLS*/);
+ super(IMPORT_CONTAINER, parent, "");
}
/**
* @see JavaElement#getHandleMemento()
@@ -25,8 +25,7 @@ public String getHandleMemento(){
* @see JavaElement#getHandleMemento()
*/
protected char getHandleMementoDelimiter() {
- Assert.isTrue(false, Util.bind("assert.shouldNotImplement"/*nonNLS*/));
- return 0;
+ throw new Error("should not be called");
}
/**
* @see IImportContainer
@@ -65,7 +64,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"/*nonNLS*/);
+ if (i > 0) buffer.append("\n");
((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 bd6f12069c..250f049192 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(".*"/*nonNLS*/);
+ return fName.endsWith(".*");
}
/**
*/
@@ -51,10 +51,10 @@ public String readableName() {
* @private Debugging purposes
*/
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
- buffer.append("import "/*nonNLS*/);
+ buffer.append("import ");
buffer.append(getElementName());
if (info == null) {
- buffer.append(" (not open)"/*nonNLS*/);
+ buffer.append(" (not open)");
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalDeterministicRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalDeterministicRequestor.java
new file mode 100644
index 0000000000..7079c09151
--- /dev/null
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalDeterministicRequestor.java
@@ -0,0 +1,268 @@
+package org.eclipse.jdt.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+import org.eclipse.core.resources.*;
+
+import org.eclipse.jdt.internal.compiler.*;
+import org.eclipse.jdt.core.*;
+import org.eclipse.jdt.internal.core.util.ReferenceInfoAdapter;
+
+import java.util.*;
+
+/**
+ * Handles the results of a source element parse, and with
+ * the help of the <code>Reconciler</code>, throws element
+ * changed deltas.
+ */
+public class IncrementalDeterministicRequestor extends ReferenceInfoAdapter implements ISourceElementRequestor {
+
+
+ /**
+ * The expected elements
+ */
+ protected IJavaElement[] fElements;
+
+ /**
+ * The next element expected
+ */
+ protected IJavaElement fNextElement;
+
+ /**
+ * The index of the next expected element
+ */
+ protected int fNextIndex= 0;
+
+
+/**
+ * Creates a requestor
+ */
+public IncrementalDeterministicRequestor(IJavaElement[] expectations) {
+ fElements= expectations;
+ next();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptImport(int declarationStart, int declarationEnd, char[] name, boolean onDemand) {
+ if (fNextElement.getElementType() == IJavaElement.IMPORT_DECLARATION) {
+ if (isIdentical((IImportDeclaration) fNextElement, name, onDemand)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptInitializer(int modifiers, int declarationSourceStart, int declarationSourceEnd) {
+ if (fNextElement.getElementType() == IJavaElement.IMPORT_DECLARATION) {
+ next();
+ return;
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptLineSeparatorPositions(int[] positions) {}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptPackage(int declarationStart, int declarationEnd, char[] name) {
+ if (fNextElement.getElementType() == IJavaElement.PACKAGE_DECLARATION) {
+ if (isIdentical((IPackageDeclaration) fNextElement, name)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptProblem(IProblem problem) {}
+/**
+ * Advances to the next expected element
+ */
+protected void advance() {
+ if (fNextIndex < fElements.length) {
+ fNextElement= fElements[fNextIndex];
+ fNextIndex++;
+ } else {
+ fNextElement= null;
+ }
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterClass(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[] superclass, char[][] superinterfaces) {
+ if (fNextElement.getElementType() == IJavaElement.TYPE) {
+ if (isIdentical((IType) fNextElement, name)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterCompilationUnit() {
+ if (fNextElement.getElementType() == IJavaElement.COMPILATION_UNIT) {
+ next();
+ return;
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterConstructor(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[][] parameterTypes, char[][] parameterNames, char[][] exceptionTypes) {
+ if (fNextElement.getElementType() == IJavaElement.METHOD) {
+ if (isIdentical((IMethod)fNextElement, name, parameterTypes)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterField(int declarationStart, int modifiers, char[] type, char[] name, int nameSourceStart, int nameSourceEnd) {
+ if (fNextElement.getElementType() == IJavaElement.FIELD) {
+ if (isIdentical((IField)fNextElement, name)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterInterface(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[][] superinterfaces) {
+ if (fNextElement.getElementType() == IJavaElement.TYPE) {
+ if (isIdentical((IType) fNextElement, name)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterMethod(int declarationStart, int modifiers, char[] returnType, char[] name, int nameSourceStart, int nameSourceEnd, char[][] parameterTypes, char[][] parameterNames, char[][] exceptionTypes) {
+ if (fNextElement.getElementType() == IJavaElement.METHOD) {
+ if (isIdentical((IMethod)fNextElement, name, parameterTypes)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * Answers true if the two arguments are equal. If either are null answers false, if
+ * both are null answers true;
+ */
+protected static final boolean equals(String string, char[] chars) {
+ if (string == null ^ chars == null)
+ return false;
+ if (string == null)
+ return true;
+ int length = chars.length;
+ if (string.length() != length)
+ return false;
+ while(length-- != 0) {
+ if (string.charAt(length) != chars[length])
+ return false;
+ }
+ return true;
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitClass(int declarationEnd) {
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitCompilationUnit(int declarationEnd) {}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitConstructor(int declarationEnd) {}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitField(int declarationEnd) {}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitInterface(int declarationEnd) {
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitMethod(int declarationEnd) {}
+protected boolean isIdentical(IField field, char[] name) {
+ if (!equals(field.getElementName(), name))
+ return false;
+ return true;
+}
+protected boolean isIdentical(IImportDeclaration anImport, char[] name, boolean isOnDemand) {
+ String importString = new String(name);
+ if (isOnDemand)
+ importString += ".*";
+ if (!anImport.getElementName().equals(importString))
+ return false;
+ return true;
+}
+protected boolean isIdentical(IMethod method, char[] name, char[][] parameterTypes) {
+ if (!equals(method.getElementName(), name))
+ return false;
+ String[] parameters = method.getParameterTypes();
+ if (parameters == null || parameters.length == 0) {
+ if (parameterTypes == null || parameterTypes.length == 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ if (parameters.length != parameterTypes.length)
+ return false;
+ for(int i = 0, length = parameters.length; i < length; i++) {
+ if (parameters[i] == null ^ parameterTypes[i] == null)
+ return false;
+ if (parameters[i] == null)
+ continue;
+ if (!parameters[i].equals(Signature.createTypeSignature(parameterTypes[i], false)))
+ return false;
+ }
+ return true;
+}
+protected boolean isIdentical(IPackageDeclaration aPackage, char[] name) {
+ if (!equals(aPackage.getElementName(), name))
+ return false;
+ return true;
+}
+protected boolean isIdentical(IType type, char[] name) {
+ if (!equals(type.getElementName(), name))
+ return false;
+ return true;
+}
+/**
+ * Advances the next element expected.
+ */
+protected void next() {
+ advance();
+ if (fNextElement.getElementType() == IJavaElement.IMPORT_CONTAINER)
+ next();
+}
+}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalReconciler.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalReconciler.java
new file mode 100644
index 0000000000..23952e80e7
--- /dev/null
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalReconciler.java
@@ -0,0 +1,353 @@
+package org.eclipse.jdt.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+import org.eclipse.core.resources.*;
+
+import org.eclipse.jdt.internal.compiler.*;
+import org.eclipse.jdt.internal.compiler.env.ISourceType;
+import org.eclipse.jdt.core.*;
+
+import java.util.*;
+
+
+import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
+
+/**
+ * The <code>IncrementalReconciler</code> notifies the
+ * JavaModel of changes made the compilation unit that
+ * this reconciler watches.
+ *
+ * <p>The <code>IncrementalReconciler</code> attempts to
+ * improve the performance and functionality of the
+ * <code>Reconciler</code> by only reconciling elements
+ * which are effected by a text edit.
+ *
+ * <p>The implementation is not thread safe.
+ *
+ * <p>The API expects all text edits to have already occured
+ * in the buffer of the <code>ICompilationUnit</code>
+ * which this reconciler is using.
+ *
+ * @see Reconciler
+ */
+public class IncrementalReconciler implements IJavaReconciler {
+ /**
+ * The current compilation unit
+ */
+ protected ICompilationUnit fCompilationUnit = null;
+/**
+ * Create a reconciler on a compilation unit
+ *
+ * @exception IllegalArgumentException if the compilation unit is not
+ * a working copy.
+ */
+public IncrementalReconciler(ICompilationUnit cu) {
+ fCompilationUnit = cu;
+ if (!cu.isWorkingCopy()) {
+ throw new IllegalArgumentException("must create reconciler on a working copy");
+ }
+}
+/**
+ * Does a full reconcile.
+ */
+protected void doFullReconcile() {
+ try {
+ fCompilationUnit.reconcile();
+ } catch (JavaModelException e) {
+ }
+}
+/**
+ * Answers the <code>IJavaElement</code> closest too and after the given
+ * position in the given parent, or <code>null</code> if there is no element
+ * after the given position.
+ */
+protected IJavaElement getElementAfter(int position, IJavaElement parent) {
+ IJavaElement[] children = null;
+ try {
+ children = ((IParent) parent).getChildren();
+ } catch (JavaModelException npe) {
+ return null;
+ }
+ if (children == null)
+ return null;
+ int length = children.length;
+ if (length > 0) {
+ for(int i = 0; i < length ; i++) {
+ IJavaElement child = children[i];
+ if (getSourceOffset(child) + getSourceLength(child) - 1 > position)
+ return child;
+ }
+ }
+ return null;
+}
+/**
+ * Answers the <code>IJavaElement</code> following the
+ * given element, or <code>null</code> if there is no element
+ * following the given element.
+ */
+protected IJavaElement getElementAfter(IJavaElement element) {
+ IJavaElement[] children = null;
+ try {
+ children = ((IParent)element.getParent()).getChildren();
+ } catch (JavaModelException npe) {
+ return null;
+ }
+ if (children == null)
+ return null;
+ int length = children.length;
+ if (length > 0) {
+ for(int i = 0; i < length ; i++) {
+ IJavaElement child = children[i];
+ if (child.equals(element) && i < length - 1)
+ return children[i + 1];
+ }
+ }
+ return null;
+}
+/**
+ * Answers the <code>IJavaElement</code> closest too and before the given
+ * position in the given parent, or <code>null</code> if there is no element
+ * before the given position.
+ */
+protected IJavaElement getElementBefore(int position, IJavaElement parent) {
+ IJavaElement[] children = null;
+ try {
+ children = ((IParent) parent).getChildren();
+ } catch (JavaModelException npe) {
+ return null;
+ }
+ if (children == null)
+ return null;
+ int length = children.length;
+ if (length > 0) {
+ for(int i = length -1; i >= 0; i--) {
+ IJavaElement child = children[i];
+ if (getSourceOffset(child) + getSourceLength(child) - 1 < position)
+ return child;
+ }
+ }
+ return null;
+}
+/**
+ *
+ */
+protected IJavaElement[] getElementsBetween(IJavaElement first, IJavaElement last) {
+ if (first.equals(last)) {
+ return new IJavaElement[] {first};
+ }
+
+ IJavaElement[] children = null;
+ IParent parent= (IParent)first.getParent();
+ Vector elements= new Vector();
+
+ try {
+ children = ((IParent) parent).getChildren();
+ } catch (JavaModelException npe) {
+ return null;
+ }
+ if (children == null)
+ return null;
+
+ boolean inside= false;
+ for(int i = 0; i < children.length; i++) {
+ IJavaElement child = children[i];
+ if (inside) {
+ elements.addElement(child);
+ if (child.equals(last)) {
+ inside= false;
+ break;
+ }
+ } else {
+ if (child.equals(first)){
+ inside= true;
+ elements.addElement(child);
+ }
+ }
+ }
+
+ IJavaElement[] array = new IJavaElement[elements.size()];
+ elements.copyInto(array);
+ return array;
+}
+/**
+ * Answers the closest enclosing type of the element
+ */
+protected IType getEnclosingType(IJavaElement element) {
+ IJavaElement parent = element.getParent();
+ while(parent != null && !(parent.getElementType() == IJavaElement.TYPE))
+ parent = parent.getParent();
+ return (IType)parent;
+}
+/**
+ * Returns the source length of the element or
+ * 0 if the element is not present or not a source element.
+ */
+protected int getSourceLength(IJavaElement element) {
+ if (element instanceof SourceRefElement) {
+ try {
+ return ((SourceRefElement) element).getSourceRange().getLength();
+ } catch (JavaModelException npe) {}
+ }
+ return 0;
+}
+/**
+ * Returns the source offset of the element or
+ * -1 if the element is not present or not a source element.
+ */
+protected int getSourceOffset(IJavaElement element) {
+ if (element instanceof SourceRefElement) {
+ try {
+ return ((SourceRefElement) element).getSourceRange().getOffset();
+ } catch (JavaModelException npe) {}
+ }
+ return -1;
+}
+protected boolean isWhitespace(int position, int length) {
+ int end = position + length;
+ try {
+ IBuffer buffer = fCompilationUnit.getBuffer();
+ for (int i = position; i < end; i++) {
+ if (!Character.isWhitespace(buffer.getChar(i)))
+ return false;
+ }
+ return true;
+ } catch (JavaModelException npe) {
+ return false;
+ }
+}
+protected void reconcile(SourceType type, IncrementalDeterministicRequestor requestor, int start, int end) {
+ SourceElementParser parser = new SourceElementParser(requestor, new DefaultProblemFactory());
+ try {
+ if (type != null) {
+ try {
+ parser.parseTypeMemberDeclarations((ISourceType) type.getElementInfo(), (CompilationUnit) fCompilationUnit, start, end, false);
+ } catch (JavaModelException npe) {
+ doFullReconcile();
+ return;
+ }
+ } else {
+ parser.parseCompilationUnit((CompilationUnit) fCompilationUnit, start, end, false);
+ }
+ } catch (FailedReconciliationException fre) {
+ doFullReconcile();
+ return;
+ }
+ System.out.println("Did incremental");
+}
+/**
+ * @see IReconciler
+ */
+public void textDeleted(int position, int length) {
+ doFullReconcile();
+ if (true) {
+ return;
+ }
+ try {
+ if (isWhitespace(position, length)) {
+ System.out.println("Whitespace");
+ return;
+ }
+
+ int endPosition = position + length;
+ IJavaElement first = fCompilationUnit.getElementAt(position);
+ IJavaElement last = fCompilationUnit.getElementAt(endPosition);
+
+ if (first == last) {
+ if (first == null) {
+ first = fCompilationUnit;
+ last = fCompilationUnit;
+ }
+ } else {
+ doFullReconcile();
+ return;
+ }
+
+ if (first instanceof IParent) {
+ first = getElementBefore(position, first);
+ last = getElementAfter(endPosition, last);
+ }
+
+ if (first != last) {
+ doFullReconcile();
+ return;
+ }
+
+ int offset = getSourceOffset(first);
+ int end = offset + getSourceLength(first) - length;
+
+ if (end <= offset) {
+ doFullReconcile();
+ return;
+ }
+
+ SourceType type = (SourceType) getEnclosingType(first);
+
+ IncrementalDeterministicRequestor requestor =
+ new IncrementalDeterministicRequestor(new IJavaElement[] {first});
+ reconcile(type, requestor, offset, end);
+ } catch (JavaModelException e) {
+ return;
+ }
+}
+/**
+ * @see IReconciler
+ */
+public void textInserted(int position, int length) {
+ doFullReconcile();
+ if (true) {
+ return;
+ }
+ try {
+ if (isWhitespace(position, length)) {
+ System.out.println("Whitespace");
+ return;
+ }
+
+ IJavaElement element= fCompilationUnit.getElementAt(position);
+ IJavaElement first= null, last= null;
+
+ if (element == null)
+ element = fCompilationUnit;
+
+ if (element instanceof IParent) {
+ first= getElementBefore(position, element);
+ last= getElementAfter(position, element);
+ } else {
+ if (position == getSourceOffset(element)) {
+ first = getElementBefore(position, element.getParent());
+ last = element;
+ } else {
+ first = element;
+ last = getElementAfter(element);
+ }
+ }
+
+ if (first == null || last == null) {
+ doFullReconcile();
+ return;
+ }
+
+ int offset= getSourceOffset(first);
+ int end= offset + getSourceLength(last) + length - 1;
+
+ if (end <= offset) {
+ doFullReconcile();
+ return;
+ }
+
+ SourceType type = (SourceType)getEnclosingType(first);
+ // parse the new text, hoping for the same elements
+ IncrementalDeterministicRequestor requestor =
+ new IncrementalDeterministicRequestor(new IJavaElement[] {first, last});
+
+ reconcile(type, requestor, offset, end);
+
+ } catch (JavaModelException e) {
+ return;
+ }
+
+}
+}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalReconcilerRequestor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalReconcilerRequestor.java
new file mode 100644
index 0000000000..3738ef1999
--- /dev/null
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/IncrementalReconcilerRequestor.java
@@ -0,0 +1,388 @@
+package org.eclipse.jdt.internal.core;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+import org.eclipse.core.resources.*;
+
+import org.eclipse.jdt.internal.compiler.*;
+import org.eclipse.jdt.core.*;
+import org.eclipse.jdt.internal.core.util.ReferenceInfoAdapter;
+
+import java.util.*;
+
+/**
+ * Handles the results of a source element parse, and with
+ * the help of the <code>Reconciler</code>, throws element
+ * changed deltas.
+ */
+public class IncrementalReconcilerRequestor extends ReferenceInfoAdapter implements ISourceElementRequestor {
+ /**
+ * The compilation unit the reconciler is working on
+ */
+ protected ICompilationUnit fCompilationUnit;
+
+
+ /**
+ * The last expected element
+ */
+ protected IJavaElement fLastElement;
+
+
+ /**
+ * As the compilation unit is traversed, this stack
+ * maintains lists of children and positions in the list
+ */
+ protected Stack fStack;
+
+ /**
+ * The next element expected from the parser.
+ */
+ protected IJavaElement fNextElement;
+
+ /**
+ * A helper class which stores children and array position information
+ */
+ class TraversalInfo {
+ protected IJavaElement[] fArray;
+ protected int fLength;
+ protected int fPosition;
+ protected boolean fIsType;
+ protected String fParentName;
+ protected int fInitializerCount;
+
+ public TraversalInfo(IJavaElement[] array, String parentName, boolean isType) {
+ fArray = array;
+ fParentName = parentName;
+ fIsType = isType;
+ fLength = (fArray != null) ? fArray.length : 0;
+ fPosition = 0;
+ fInitializerCount = 0;
+ }
+ public IJavaElement next() {
+ if (fPosition < fLength)
+ return fArray[fPosition++];
+ return null;
+ }
+ public String getParentName() {
+ return fParentName;
+ }
+ public int getNextInitializer() {
+ return ++fInitializerCount;
+ }
+ public int getInitializerCount() {
+ return fInitializerCount;
+ }
+ public boolean isType() {
+ return fIsType;
+ }
+ }
+/**
+ * Creates a requestor
+ */
+public IncrementalReconcilerRequestor(ICompilationUnit cu, IJavaElement first, IJavaElement last) {
+ fCompilationUnit = cu;
+ fStack = new Stack();
+ initializeStack();
+ advanceTo(first);
+ fLastElement = last;
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptImport(int declarationStart, int declarationEnd, char[] name, boolean onDemand) {
+ if (fNextElement.getElementType() == IJavaElement.IMPORT_DECLARATION) {
+ if (isIdentical((IImportDeclaration) fNextElement, name, onDemand)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptInitializer(int modifiers, int declarationSourceStart, int declarationSourceEnd) {
+ if (fNextElement.getElementType() == IJavaElement.IMPORT_DECLARATION) {
+ next();
+ return;
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptLineSeparatorPositions(int[] positions) {}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptPackage(int declarationStart, int declarationEnd, char[] name) {
+ if (fNextElement.getElementType() == IJavaElement.PACKAGE_DECLARATION) {
+ if (isIdentical((IPackageDeclaration) fNextElement, name)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void acceptProblem(IProblem problem) {}
+/**
+ * Advances to the next expected element
+ */
+protected void advance() {
+ if (!fStack.empty()) {
+ TraversalInfo info = (TraversalInfo) fStack.peek();
+ fNextElement = info.next();
+ if (fNextElement == null) {
+ fStack.pop();
+ next();
+ return;
+ } else {
+ if (fNextElement instanceof IParent)
+ push(fNextElement);
+ }
+ } else {
+ fNextElement = null;
+ }
+}
+/**
+ * Advances to the given element.
+ */
+protected void advanceTo(IJavaElement element) {
+ while(fNextElement != element)
+ advance();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterClass(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[] superclass, char[][] superinterfaces) {
+ if (fNextElement.getElementType() == IJavaElement.TYPE) {
+ if (isIdentical((IType) fNextElement, name)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterCompilationUnit() {
+ if (fNextElement.getElementType() == IJavaElement.COMPILATION_UNIT) {
+ next();
+ return;
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterConstructor(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[][] parameterTypes, char[][] parameterNames, char[][] exceptionTypes) {
+ if (fNextElement.getElementType() == IJavaElement.METHOD) {
+ if (isIdentical((IMethod)fNextElement, name, parameterTypes)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterField(int declarationStart, int modifiers, char[] type, char[] name, int nameSourceStart, int nameSourceEnd) {
+ if (fNextElement.getElementType() == IJavaElement.FIELD) {
+ if (isIdentical((IField)fNextElement, name)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterInterface(int declarationStart, int modifiers, char[] name, int nameSourceStart, int nameSourceEnd, char[][] superinterfaces) {
+ if (fNextElement.getElementType() == IJavaElement.TYPE) {
+ if (isIdentical((IType) fNextElement, name)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void enterMethod(int declarationStart, int modifiers, char[] returnType, char[] name, int nameSourceStart, int nameSourceEnd, char[][] parameterTypes, char[][] parameterNames, char[][] exceptionTypes) {
+ if (fNextElement.getElementType() == IJavaElement.METHOD) {
+ if (isIdentical((IMethod)fNextElement, name, parameterTypes)) {
+ next();
+ return;
+ }
+ }
+ throw new FailedReconciliationException();
+}
+/**
+ * Answers true if the two arguments are equal. If either are null answers false, if
+ * both are null answers true;
+ */
+protected static final boolean equals(String string, char[] chars) {
+ if (string == null ^ chars == null)
+ return false;
+ if (string == null)
+ return true;
+ int length = chars.length;
+ if (string.length() != length)
+ return false;
+ while(length-- != 0) {
+ if (string.charAt(length) != chars[length])
+ return false;
+ }
+ return true;
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitClass(int declarationEnd) {
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitCompilationUnit(int declarationEnd) {}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitConstructor(int declarationEnd) {}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitField(int declarationEnd) {}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitInterface(int declarationEnd) {
+}
+/**
+ * @see ISourceElementRequestor
+ */
+public void exitMethod(int declarationEnd) {}
+/**
+ * Returns the first type encountered on the top of the stack
+ */
+protected IType getCurrentType() {
+ IType type = null;
+ for(int i = 0, length = fStack.size(); i < length; i++) {
+ TraversalInfo info = (TraversalInfo)fStack.elementAt(i);
+ if (info.isType()) {
+ if (type == null) {
+ type = fCompilationUnit.getType(info.getParentName());
+ } else {
+ type = type.getType(info.getParentName());
+ }
+ }
+ }
+ return type;
+}
+/**
+ * Answers the next initializer number for the current type
+ */
+protected int getNextInitializerNumber() {
+ // reverse traversal intentional
+ for (int i = fStack.size() - 1; i >= 0; i--) {
+ }
+ return -1;
+}
+/**
+ * Initializes the stack to contain <code>fCompilationUnit</code>
+ */
+protected void initializeStack() {
+ IJavaElement[] elements = { fCompilationUnit };
+ fStack.push(new TraversalInfo(elements, null, false));
+ next();
+}
+protected boolean isIdentical(IField field, char[] name) {
+ if (!equals(field.getElementName(), name))
+ return false;
+ return true;
+}
+protected boolean isIdentical(IImportDeclaration anImport, char[] name, boolean isOnDemand) {
+ String importString = new String(name);
+ if (isOnDemand)
+ importString += ".*";
+ if (!anImport.getElementName().equals(importString))
+ return false;
+ return true;
+}
+protected boolean isIdentical(IMethod method, char[] name, char[][] parameterTypes) {
+ if (!equals(method.getElementName(), name))
+ return false;
+ String[] parameters = method.getParameterTypes();
+ if (parameters == null || parameters.length == 0) {
+ if (parameterTypes == null || parameterTypes.length == 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ if (parameters.length != parameterTypes.length)
+ return false;
+ for(int i = 0, length = parameters.length; i < length; i++) {
+ if (parameters[i] == null ^ parameterTypes[i] == null)
+ return false;
+ if (parameters[i] == null)
+ continue;
+ if (!parameters[i].equals(Signature.createTypeSignature(parameterTypes[i], false)))
+ return false;
+ }
+ return true;
+}
+protected boolean isIdentical(IPackageDeclaration aPackage, char[] name) {
+ if (!equals(aPackage.getElementName(), name))
+ return false;
+ return true;
+}
+protected boolean isIdentical(IType type, char[] name) {
+ if (!equals(type.getElementName(), name))
+ return false;
+ return true;
+}
+/**
+ * Advances the next element expected.
+ */
+protected void next() {
+ advance();
+ if (fNextElement.getElementType() == IJavaElement.IMPORT_CONTAINER)
+ next();
+}
+/**
+ * Pushes the children of the container on the stack
+ */
+protected void push(IJavaElement element) {
+ IParent parent = (IParent)element;
+ boolean hasChildren = false;
+ try {
+ hasChildren = parent.hasChildren();
+ } catch (JavaModelException npe) {}
+ if (hasChildren) {
+ IJavaElement[] children = null;
+ try {
+ children = parent.getChildren();
+ } catch (JavaModelException npe) {}
+ if (children != null) {
+ TraversalInfo info = new TraversalInfo(children, element.getElementName(), element.getElementType() == IJavaElement.TYPE);
+ fStack.push(info);
+ }
+ }
+}
+/**
+ * Updates the source ranges of the elements which weren't effected by
+ * the parse, but follow the parsed elements.
+ */
+void updateSourceRanges() {
+}
+}
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 9bcbca58d5..6f7ceddc8b 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, ""/*nonNLS*/);
+ super(INITIALIZER, parent, "");
// 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>"/*nonNLS*/);
- buffer.append(" (not open)"/*nonNLS*/);
+ buffer.append("<initializer>");
+ buffer.append(" (not open)");
} else {
try {
if (Flags.isStatic(this.getFlags())) {
- buffer.append("static "/*nonNLS*/);
+ buffer.append("static ");
}
- buffer.append("initializer"/*nonNLS*/);
+ buffer.append("initializer");
} catch (JavaModelException e) {
- buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());
+ buffer.append("<JavaModelException in toString of " + 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 72d09145f5..eac61c7e4d 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["/*nonNLS*/+this.zipName+"::"/*nonNLS*/+this.entryName+"]"/*nonNLS*/;
+ return "JarEntryFile["+this.zipName+"::"+this.entryName+"]";
}
}
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 945ac02508..b9161203dd 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"/*nonNLS*/), 2);
+ monitor.beginTask("Attaching source...", 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"/*nonNLS*/.equalsIgnoreCase(file.getFileExtension()) || "zip"/*nonNLS*/.equalsIgnoreCase(file.getFileExtension())){
+ if ("jar".equalsIgnoreCase(file.getFileExtension()) || "zip".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"/*nonNLS*/) || Util.endsWithIgnoreCase(name, ".zip"/*nonNLS*/)){
+ String name = file.getName().toLowerCase();
+ if (name.endsWith(".jar") || name.endsWith(".zip")){
return entry;
}
}
@@ -404,15 +404,14 @@ public IClasspathEntry findSourceAttachmentRecommendation() {
Object target = JavaModel.getTarget(workspaceRoot, entry.getSourceAttachmentPath(), true);
if (target instanceof IFile){
IFile file = (IFile) target;
- String name = file.getName();
- if (Util.endsWithIgnoreCase(name, ".jar"/*nonNLS*/) || Util.endsWithIgnoreCase(name, ".zip"/*nonNLS*/)){
+ if ("jar".equalsIgnoreCase(file.getFileExtension()) || "zip".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"/*nonNLS*/) || Util.endsWithIgnoreCase(name, ".zip"/*nonNLS*/)){
+ String name = file.getName().toLowerCase();
+ if (name.endsWith(".jar") || name.endsWith(".zip")){
return entry;
}
}
@@ -503,7 +502,7 @@ public IClasspathEntry findSourceAttachmentRecommendation() {
if (recommendation != null){
propertyString = recommendation.getSourceAttachmentPath().toString()
+ ATTACHMENT_PROPERTY_DELIMITER
- + (recommendation.getSourceAttachmentRootPath() == null ? ""/*nonNLS*/ : recommendation.getSourceAttachmentRootPath().toString());
+ + (recommendation.getSourceAttachmentRootPath() == null ? "" : recommendation.getSourceAttachmentRootPath().toString());
getWorkspace().getRoot().setPersistentProperty(qName, propertyString);
}
}
@@ -520,7 +519,7 @@ public IClasspathEntry findSourceAttachmentRecommendation() {
ZipFile jarFile = null;
try {
jarFile = getJar();
- return new QualifiedName(JavaCore.PLUGIN_ID, "sourceattachment: "/*nonNLS*/ + jarFile.getName());
+ return new QualifiedName(JavaCore.PLUGIN_ID, "sourceattachment: " + 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 286bcd3f32..a42fa66147 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
@@ -69,7 +69,7 @@ public abstract class JavaElement extends PlatformObject implements IJavaElement
* Constructs a handle for a java element of the specified type, with
* the given parent element and name.
*
- * @param type - one of the constants defined in IJavaLanguageElement
+ * @param type - one of the constants defined in IJavaLanguageElementTypes
*
* @exception IllegalArgumentException if the type is not one of the valid
* Java element type constants
@@ -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"/*nonNLS*/));
+ throw new IllegalArgumentException("type is not one of the defined constants");
}
fLEType= type;
fParent= parent;
@@ -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(" "/*nonNLS*/);
+ buffer.append(" ");
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 "/*nonNLS*/);
+ buffer.append(" [in ");
Object parentInfo = fgJavaModelManager.getInfo(parent);
parent.toStringInfo(0, buffer, parentInfo);
parent.toStringAncestors(buffer);
- buffer.append("]"/*nonNLS*/);
+ buffer.append("]");
}
}
/**
@@ -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"/*nonNLS*/);
+ buffer.append("\n");
((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)"/*nonNLS*/);
+ buffer.append(" (not open)");
}
}
/**
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 35fd0e08dc..9a7e3f65ba 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("["/*nonNLS*/);
+ buffer.append("[");
switch (getKind()) {
case IJavaElementDelta.ADDED :
buffer.append('+');
@@ -492,68 +492,68 @@ public String toDebugString(int depth) {
buffer.append('?');
break;
}
- buffer.append("]: {"/*nonNLS*/);
+ buffer.append("]: {");
int changeFlags = getFlags();
boolean prev = false;
if ((changeFlags & IJavaElementDelta.F_CHILDREN) != 0) {
if (prev)
- buffer.append(" | "/*nonNLS*/);
- buffer.append("CHILDREN"/*nonNLS*/);
+ buffer.append(" | ");
+ buffer.append("CHILDREN");
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_CONTENT) != 0) {
if (prev)
- buffer.append(" | "/*nonNLS*/);
- buffer.append("CONTENT"/*nonNLS*/);
+ buffer.append(" | ");
+ buffer.append("CONTENT");
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_MOVED_FROM) != 0) {
if (prev)
- buffer.append(" | "/*nonNLS*/);
- buffer.append("MOVED_FROM("/*nonNLS*/ + ((JavaElement)getMovedFromElement()).toDebugString() + ")"/*nonNLS*/);
+ buffer.append(" | ");
+ buffer.append("MOVED_FROM(" + ((JavaElement)getMovedFromElement()).toDebugString() + ")");
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_MOVED_TO) != 0) {
if (prev)
- buffer.append(" | "/*nonNLS*/);
- buffer.append("MOVED_TO("/*nonNLS*/ + ((JavaElement)getMovedToElement()).toDebugString() + ")"/*nonNLS*/);
+ buffer.append(" | ");
+ buffer.append("MOVED_TO(" + ((JavaElement)getMovedToElement()).toDebugString() + ")");
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_ADDED_TO_CLASSPATH) != 0) {
if (prev)
- buffer.append(" | "/*nonNLS*/);
- buffer.append("ADDED TO CLASSPATH"/*nonNLS*/);
+ buffer.append(" | ");
+ buffer.append("ADDED TO CLASSPATH");
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) {
if (prev)
- buffer.append(" | "/*nonNLS*/);
- buffer.append("REMOVED FROM CLASSPATH"/*nonNLS*/);
+ buffer.append(" | ");
+ buffer.append("REMOVED FROM CLASSPATH");
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_CLASSPATH_REORDER) != 0) {
if (prev)
- buffer.append(" | "/*nonNLS*/);
- buffer.append("REORDERED IN CLASSPATH"/*nonNLS*/);
+ buffer.append(" | ");
+ buffer.append("REORDERED IN CLASSPATH");
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_MODIFIERS) != 0) {
if (prev)
- buffer.append(" | "/*nonNLS*/);
- buffer.append("MODIFIERS CHANGED"/*nonNLS*/);
+ buffer.append(" | ");
+ buffer.append("MODIFIERS CHANGED");
prev = true;
}
if ((changeFlags & IJavaElementDelta.F_SUPER_TYPES) != 0) {
if (prev)
- buffer.append(" | "/*nonNLS*/);
- buffer.append("SUPER TYPES CHANGED"/*nonNLS*/);
+ buffer.append(" | ");
+ buffer.append("SUPER TYPES CHANGED");
prev = true;
}
- buffer.append("}"/*nonNLS*/);
+ buffer.append("}");
IJavaElementDelta[] children = getAffectedChildren();
if (children != null) {
for (int i = 0; i < children.length; ++i) {
- buffer.append("\n"/*nonNLS*/);
+ buffer.append("\n");
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 3a9be1d0d8..432e46a182 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"/*nonNLS*/);
+ buffer.append("Built delta:\n");
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 a359be8acc..9583039351 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, ""/*nonNLS*/ /*workspace has empty name*/);
+ super(JAVA_MODEL, null, "" /*workspace has empty name*/);
this.workspace = workspace;
}
private void cleanupCycleMarkers() {
@@ -102,7 +102,7 @@ protected int computeDepth(String projectName, StringHashtableOfInt depthTable,
if (generateMarkerOnError) {
try {
IMarker marker = this.workspace.getRoot().getProject(dependentProjectName).createMarker(IJavaModelMarker.TRANSIENT_PROBLEM);
- marker.setAttribute(IMarker.MESSAGE, Util.bind("classpath.cycle"/*nonNLS*/));
+ marker.setAttribute(IMarker.MESSAGE, "A cycle was detected in the project's classpath");
marker.setAttribute(IMarker.PRIORITY, IMarker.PRIORITY_HIGH);
marker.setAttribute(IMarker.LOCATION, dependentProjectName);
marker.setAttribute(IJavaModelMarker.CYCLE_DETECTED, dependentProjectName);
@@ -374,8 +374,7 @@ public String getHandleMemento(){
* contribution to a memento.
*/
protected char getHandleMementoDelimiter(){
- Assert.isTrue(false, Util.bind("assert.shouldNotImplement"/*nonNLS*/));
- return 0;
+ throw new Error("should not be called");
}
/**
* @see IJavaElement
@@ -411,7 +410,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"/*nonNLS*/));
+ throw new IllegalArgumentException("Illegal argument - must be one of IProject, IFolder, or IFile");
}
}
/**
@@ -481,9 +480,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"/*nonNLS*/);
+ buffer.append("Java Model");
if (info == null) {
- buffer.append(" (not open)"/*nonNLS*/);
+ buffer.append(" (not open)");
}
}
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 7a88eb0ed6..d910935b05 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
@@ -93,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"/*nonNLS*/;
+ private static final String WKS_PROP_FILENAME= "workspace.properties";
/**
* Name of the handle id attribute in a Java marker
*/
- private static final String ATT_HANDLE_ID= "org.eclipse.jdt.internal.core.JavaModelManager.handleId"/*nonNLS*/;
+ private static final String ATT_HANDLE_ID= "org.eclipse.jdt.internal.core.JavaModelManager.handleId";
/**
* Table from IProject to PerProjectInfo.
@@ -129,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"/*nonNLS*/);
+ public static String LINE_SEPARATOR = System.getProperty("line.separator");
/**
* Constructs a new JavaModelManager
*/
@@ -359,18 +359,6 @@ public static ConfigurableOption[] convertConfigurableOptions(Hashtable optionMa
}
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());
}
@@ -483,7 +471,7 @@ public void doneSaving(ISaveContext context){
return null;
}
JavaModel model= (JavaModel) getJavaModel(workspace);
- if (memento.equals(""/*nonNLS*/)){ // workspace memento
+ if (memento.equals("")){ // workspace memento
return model;
}
int modelEnd= memento.indexOf(JavaElement.JEM_JAVAPROJECT);
@@ -584,7 +572,7 @@ public void doneSaving(ISaveContext context){
try {
modelInfo.fJavaModel.close();
} catch (JavaModelException e) {
- Assert.isTrue(false, Util.bind("element.onlyOneJavaModel"/*nonNLS*/));
+ Assert.isTrue(false, "Cannot instantiate more than one Java Model");
return null;
}
}
@@ -592,7 +580,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"/*nonNLS*/));
+ Assert.isTrue(false, "Cannot instantiate more than one Java Model");
return null;
}
@@ -618,7 +606,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"/*nonNLS*/, project.getName()));
+ if (monitor != null) monitor.subTask("Reading saved built state of "+project.getName());
state= readState(info);
info.setLastBuiltState(state);
} catch (CoreException e) {
@@ -663,12 +651,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"/*nonNLS*/).toFile();
+ return workingLocation.append("state.dat").toFile();
}
public String getVariablesAsXMLString() throws CoreException {
Document document = new DocumentImpl();
- Element rootElement = document.createElement("variables"/*nonNLS*/);
+ Element rootElement = document.createElement("variables");
document.appendChild(rootElement);
String[] variables = JavaCore.getClasspathVariableNames();
@@ -676,9 +664,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"/*nonNLS*/);
- varElement.setAttribute("name"/*nonNLS*/, var);
- varElement.setAttribute("path"/*nonNLS*/, varPath.toString());
+ Element varElement= document.createElement("variable");
+ varElement.setAttribute("name", var);
+ varElement.setAttribute("path", varPath.toString());
rootElement.appendChild(varElement);
}
@@ -720,7 +708,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"/*nonNLS*/), null));
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "file not found", null));
}
ensureLocal(file);
fileSystemPath= file.getLocation().toOSString();
@@ -731,7 +719,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"/*nonNLS*/), e));
+ throw new CoreException(new Status(Status.ERROR, JavaCore.PLUGIN_ID, -1, "IOException", e));
}
}
/**
@@ -751,7 +739,7 @@ public void doneSaving(ISaveContext context){
public void loadVariables() throws CoreException {
String xmlString = ResourcesPlugin.getWorkspace().getRoot().getPersistentProperty(
- new QualifiedName(JavaCore.PLUGIN_ID, "variables"/*nonNLS*/));
+ new QualifiedName(JavaCore.PLUGIN_ID, "variables"));
try {
if (xmlString != null) readVariables(xmlString);
} catch(IOException e){
@@ -846,13 +834,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"/*nonNLS*/));
+ throw new IOException("Wrong file format");
String kind= in.readUTF();
- if (!kind.equals("STATE"/*nonNLS*/))
- throw new IOException(Util.bind("build.wrongFileFormat"/*nonNLS*/));
+ if (!kind.equals("STATE"))
+ throw new IOException("Wrong file format");
int version= in.readInt();
if (version != 0x0001)
- throw new IOException(Util.bind("build.unhandledVersionFormat"/*nonNLS*/));
+ throw new IOException("Unhandled version of file format");
boolean hasState= in.readBoolean();
IState state= null;
if (hasState) {
@@ -876,15 +864,15 @@ public void prepareToSave(ISaveContext context) throws CoreException {
DocumentBuilder parser = DocumentBuilderFactory.newInstance().newDocumentBuilder();
cpElement = parser.parse(new InputSource(reader)).getDocumentElement();
} catch(SAXException e) {
- throw new IOException(Util.bind("variable.badFormat"/*nonNLS*/));
+ throw new IOException("bad format");
} catch(ParserConfigurationException e){
reader.close();
- throw new IOException(Util.bind("variable.badFormat"/*nonNLS*/));
+ throw new IOException("bad format");
} finally {
reader.close();
}
- if (!cpElement.getNodeName().equalsIgnoreCase("variables"/*nonNLS*/)) {
- throw new IOException(Util.bind("variable.badFormat"/*nonNLS*/));
+ if (!cpElement.getNodeName().equalsIgnoreCase("variables")) {
+ throw new IOException("bad format");
}
NodeList list= cpElement.getChildNodes();
Vector variables = new Vector();
@@ -894,11 +882,11 @@ 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"/*nonNLS*/)) {
- String varName = element.getAttribute("name"/*nonNLS*/);
- String varPath = element.getAttribute("path"/*nonNLS*/);
+ if (element.getNodeName().equalsIgnoreCase("variable")) {
+ String varName = element.getAttribute("name");
+ String varPath = element.getAttribute("path");
try {
- JavaCore.setClasspathVariable(varName, new Path(varPath), null);
+ JavaCore.setClasspathVariable(varName, new Path(varPath));
} catch(JavaModelException e){
} catch(RuntimeException e){
}
@@ -1057,7 +1045,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"/*nonNLS*/), null));
+ throw new CoreException(new MultiStatus(JavaCore.PLUGIN_ID, IStatus.ERROR, stats, "Error saving builder states", null));
}
}
/**
@@ -1065,7 +1053,7 @@ public void rollback(ISaveContext context){
*/
private void saveState(PerProjectInfo info) throws CoreException {
- if (VERBOSE) System.out.println(Util.bind("build.saveStateProgress"/*nonNLS*/, info.project.getName()));
+ if (VERBOSE) System.out.println("Saving Java Image Builder state for project " + info.project.getName());
long t= System.currentTimeMillis();
File file= getSerializationFile(info.project);
if (file == null) return;
@@ -1073,7 +1061,7 @@ public void rollback(ISaveContext context){
DataOutputStream out= new DataOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
try {
out.writeUTF(JavaCore.PLUGIN_ID);
- out.writeUTF("STATE"/*nonNLS*/);
+ out.writeUTF("STATE");
out.writeInt(0x0001);
IState state= info.getLastBuiltState();
if (state == null) {
@@ -1090,16 +1078,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"/*nonNLS*/, info.project.getName()), e));
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, "Error saving last build state for project "+ info.project.getFullPath(), 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"/*nonNLS*/, info.project.getName()), e));
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, "Error saving last build state for project "+ info.project.getFullPath(), e));
}
t= System.currentTimeMillis() - t;
- if (VERBOSE) System.out.println(Util.bind("build.saveStateComplete"/*nonNLS*/, String.valueOf(t)));
+ if (VERBOSE) System.out.println(" Saved in " + t + "ms");
}
/**
* Saves the built state for the project if it has been changed since last save.
@@ -1119,7 +1107,7 @@ public void rollback(ISaveContext context){
}
public void saveVariables() throws CoreException {
ResourcesPlugin.getWorkspace().getRoot().setPersistentProperty(
- new QualifiedName(JavaCore.PLUGIN_ID, "variables"/*nonNLS*/),
+ new QualifiedName(JavaCore.PLUGIN_ID, "variables"),
getVariablesAsXMLString());
}
/**
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 822686bbcd..b6ad6c2182 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"/*nonNLS*/));
+ throw new OperationCanceledException("Operation cancelled");
}
}
/**
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 c868e21682..1795a2ceb8 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"/*nonNLS*/, null);
+ super(ERROR, JavaCore.PLUGIN_ID, 0, "JavaModelStatus", null);
}
/**
* Constructs an Java model status with no corresponding elements.
*/
public JavaModelStatus(int code) {
- super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus"/*nonNLS*/, null);
+ super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", 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"/*nonNLS*/, null);
+ super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", 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"/*nonNLS*/, null);
+ super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", 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"/*nonNLS*/, throwable);
+ super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", 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"/*nonNLS*/, null);
+ super(ERROR, JavaCore.PLUGIN_ID, code, "JavaModelStatus", 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"/*nonNLS*/, coreException);
+ super(ERROR, JavaCore.PLUGIN_ID, CORE_EXCEPTION, "JavaModelStatus", 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"/*nonNLS*/);
+ return "Core exception.";
case BUILDER_INITIALIZATION_ERROR:
- return Util.bind("build.initializationError"/*nonNLS*/);
+ return "Builder initialization error.";
case BUILDER_SERIALIZATION_ERROR:
- return Util.bind("build.serializationError"/*nonNLS*/);
+ return "Builder serialization error.";
case DEVICE_PATH:
- return Util.bind("status.cannotUseDeviceOnPath"/*nonNLS*/, getPath().toString());
+ return "Operation requires a path with no device. Path specified was: " + getPath().toString();
case DOM_EXCEPTION:
- return Util.bind("status.JDOMError"/*nonNLS*/);
+ return "JDOM error.";
case ELEMENT_DOES_NOT_EXIST:
- return Util.bind("element.doesNotExist"/*nonNLS*/,fElements[0].getElementName());
+ return fElements[0].getElementName() + " does not exist.";
case EVALUATION_ERROR:
- return Util.bind("status.evaluationError"/*nonNLS*/, getString());
+ return "Evaluation error: " + getString();
case INDEX_OUT_OF_BOUNDS:
- return Util.bind("status.indexOutOfBounds"/*nonNLS*/);
+ return "Index out of bounds.";
case INVALID_CONTENTS:
- return Util.bind("status.invalidContents"/*nonNLS*/);
+ return "Invalid contents specified.";
case INVALID_DESTINATION:
- return Util.bind("status.invalidDestination"/*nonNLS*/, fElements[0].getElementName());
+ return "Invalid destination: " + fElements[0].getElementName();
case INVALID_ELEMENT_TYPES:
- StringBuffer buff= new StringBuffer(Util.bind("operation.notSupported"/*nonNLS*/));
+ StringBuffer buff= new StringBuffer("Operation not supported for specified element type(s): ");
for (int i= 0; i < fElements.length; i++) {
if (i > 0) {
- buff.append(", "/*nonNLS*/);
+ buff.append(", ");
}
buff.append(fElements[0].getElementName());
}
return buff.toString();
case INVALID_NAME:
- return Util.bind("status.invalidName"/*nonNLS*/, getString());
+ return "Invalid name specified: " + getString();
case INVALID_PACKAGE:
- return Util.bind("status.invalidPackage"/*nonNLS*/, getString());
+ return "Invalid package: " + getString();
case INVALID_PATH:
- return Util.bind("status.invalidPath"/*nonNLS*/, getPath() == null ? "null"/*nonNLS*/ : getPath().toString());
+ return "Invalid path: " + (getPath() == null ? "null" : getPath().toString());
case INVALID_PROJECT:
- return Util.bind("status.invalidProject"/*nonNLS*/, getString());
+ return "Invalid project: " + getString();
case INVALID_RESOURCE:
- return Util.bind("status.invalidResource"/*nonNLS*/, getString());
+ return "Invalid resource: " + getString();
case INVALID_RESOURCE_TYPE:
- return Util.bind("status.invalidResourceType"/*nonNLS*/, getString());
+ return "Invalid resource type for " + getString();
case INVALID_SIBLING:
- return Util.bind("status.invalidSibling"/*nonNLS*/, fElements[0].getElementName());
+ return "Invalid sibling: " + fElements[0].getElementName();
case IO_EXCEPTION:
- return Util.bind("status.IOException"/*nonNLS*/);
+ return "IO exception.";
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"/*nonNLS*/);
+ return "Default package cannot be renamed.";
}
}
- return Util.bind("status.nameCollision"/*nonNLS*/);
+ return "Name collision.";
case NO_ELEMENTS_TO_PROCESS:
- return Util.bind("operation.needElements"/*nonNLS*/);
+ return "Operation requires one or more elements.";
case NULL_NAME:
- return Util.bind("operation.needName"/*nonNLS*/);
+ return "Operation requires a name.";
case NULL_PATH:
- return Util.bind("operation.needPath"/*nonNLS*/);
+ return "Operation requires a path.";
case NULL_STRING:
- return Util.bind("operation.needString"/*nonNLS*/);
+ return "Operation requires a string.";
case PATH_OUTSIDE_PROJECT:
- return Util.bind("operation.pathOutsideProject"/*nonNLS*/, getString(), fElements[0].getElementName());
+ return "Illegal path specified: " + getPath().toString();
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"/*nonNLS*/);
+ name = "Default package";
}
- return Util.bind("status.readOnly"/*nonNLS*/, name);
+ return name + " is read-only.";
case RELATIVE_PATH:
- return Util.bind("operation.needAbsolutePath"/*nonNLS*/, getPath().toString());
+ return "Operation requires an absolute path. Relative path specified was: " + getPath().toString();
case TARGET_EXCEPTION:
- return Util.bind("status.targetException"/*nonNLS*/);
+ return "Target exception.";
case UPDATE_CONFLICT:
- return Util.bind("status.updateConflict"/*nonNLS*/);
+ return "Update conflict.";
case NO_LOCAL_CONTENTS :
- return Util.bind("status.noLocalContents"/*nonNLS*/, getPath().toString());
+ return "Cannot find local contents for resource: "+ getPath().toString();
}
return getString();
} else {
if (getCode() == CORE_EXCEPTION){
- return Util.bind("status.coreExceptionWithArg"/*nonNLS*/, getException().getMessage());
+ return "Core exception: " + 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 ["/*nonNLS*/);
+ buffer.append("Java Model Status [");
buffer.append(getMessage());
- buffer.append("]"/*nonNLS*/);
+ buffer.append("]");
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 9ca7292b1a..f38130837f 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"/*nonNLS*/);
+ return getProject().getFullPath().append("bin");
}
/**
* 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"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/)) {
+ } else if (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class")) {
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 + "."/*nonNLS*/ + typeName;
+ qualifiedName= packageName + "." + 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"/*nonNLS*/);
+ Element cpElement= doc.createElement("classpath");
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"/*nonNLS*/);
- oElement.setAttribute("kind"/*nonNLS*/, kindToString(ClasspathEntry.K_OUTPUT));
- oElement.setAttribute("path"/*nonNLS*/, outputLocation.toOSString());
+ Element oElement= doc.createElement("classpathentry");
+ oElement.setAttribute("kind", kindToString(ClasspathEntry.K_OUTPUT));
+ oElement.setAttribute("path", 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"/*nonNLS*/);
+ return new QualifiedName(JavaCore.PLUGIN_ID, "classpath");
}
/**
* 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"/*nonNLS*/);
- element.setAttribute("kind"/*nonNLS*/, kindToString(entry.getEntryKind()));
+ Element element= document.createElement("classpathentry");
+ element.setAttribute("kind", 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"/*nonNLS*/, path.toString());
+ element.setAttribute("path", path.toString());
if (entry.getSourceAttachmentPath() != null){
- element.setAttribute("sourcepath"/*nonNLS*/, entry.getSourceAttachmentPath().toString());
+ element.setAttribute("sourcepath", entry.getSourceAttachmentPath().toString());
}
if (entry.getSourceAttachmentRootPath() != null){
- element.setAttribute("rootpath"/*nonNLS*/, entry.getSourceAttachmentRootPath().toString());
+ element.setAttribute("rootpath", entry.getSourceAttachmentRootPath().toString());
}
return element;
}
@@ -589,8 +596,8 @@ public static IPath canonicalizedPath(IPath externalPath) {
* @see IJavaProject
*/
public IPackageFragmentRoot getPackageFragmentRoot(IResource resource) {
- String name= resource.getName();
- if (Util.endsWithIgnoreCase(name,".jar"/*nonNLS*/) || Util.endsWithIgnoreCase(name,".zip"/*nonNLS*/)) {
+ String name= resource.getName().toUpperCase();
+ if (name.endsWith(".JAR") || name.endsWith(".ZIP")) {
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"/*nonNLS*/) || ext.equalsIgnoreCase("jar"/*nonNLS*/))) {
+ if (ext != null && (ext.equalsIgnoreCase("zip") || ext.equalsIgnoreCase("jar"))) {
// 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"/*nonNLS*/))
+ if (kindStr.equalsIgnoreCase("prj"))
return IClasspathEntry.CPE_PROJECT;
- if (kindStr.equalsIgnoreCase("var"/*nonNLS*/))
+ if (kindStr.equalsIgnoreCase("var"))
return IClasspathEntry.CPE_VARIABLE;
- if (kindStr.equalsIgnoreCase("src"/*nonNLS*/))
+ if (kindStr.equalsIgnoreCase("src"))
return IClasspathEntry.CPE_SOURCE;
- if (kindStr.equalsIgnoreCase("lib"/*nonNLS*/))
+ if (kindStr.equalsIgnoreCase("lib"))
return IClasspathEntry.CPE_LIBRARY;
- if (kindStr.equalsIgnoreCase("output"/*nonNLS*/))
+ if (kindStr.equalsIgnoreCase("output"))
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"/*nonNLS*/; // backward compatibility
+ return "src"; // backward compatibility
case IClasspathEntry.CPE_SOURCE :
- return "src"/*nonNLS*/;
+ return "src";
case IClasspathEntry.CPE_LIBRARY :
- return "lib"/*nonNLS*/;
+ return "lib";
case IClasspathEntry.CPE_VARIABLE :
- return "var"/*nonNLS*/;
+ return "var";
case ClasspathEntry.K_OUTPUT :
- return "output"/*nonNLS*/;
+ return "output";
default :
- return "unknown"/*nonNLS*/;
+ return "unknown";
}
}
/**
@@ -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"/*nonNLS*/));
+ throw new IllegalArgumentException("region cannot be null");
}
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"/*nonNLS*/));
+ throw new IllegalArgumentException("type cannot be null");
}
if (region == null) {
- throw new IllegalArgumentException(Util.bind("hierarchy.nullRegion"/*nonNLS*/));
+ throw new IllegalArgumentException("region cannot be null");
}
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"/*nonNLS*/));
+ throw new IOException("bad format");
} catch(ParserConfigurationException e){
reader.close();
- throw new IOException(Util.bind("file.badFormat"/*nonNLS*/));
+ throw new IOException("bad format");
} finally {
reader.close();
}
- if (!cpElement.getNodeName().equalsIgnoreCase("classpath"/*nonNLS*/)) {
- throw new IOException(Util.bind("file.badFormat"/*nonNLS*/));
+ if (!cpElement.getNodeName().equalsIgnoreCase("classpath")) {
+ throw new IOException("bad format");
}
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"/*nonNLS*/)) {
- String cpeElementKind = cpeElement.getAttribute("kind"/*nonNLS*/);
- String pathStr = cpeElement.getAttribute("path"/*nonNLS*/);
+ if (cpeElement.getNodeName().equalsIgnoreCase("classpathentry")) {
+ String cpeElementKind = cpeElement.getAttribute("kind");
+ String pathStr = cpeElement.getAttribute("path");
// 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"/*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);
+ String sourceAttachmentPathStr = cpeElement.getAttribute("sourcepath");
+ IPath sourceAttachmentPath = sourceAttachmentPathStr.equals("") ? null : new Path(sourceAttachmentPathStr);
+ String sourceAttachmentRootPathStr = cpeElement.getAttribute("rootpath");
+ IPath sourceAttachmentRootPath = sourceAttachmentRootPathStr.equals("") ? 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"/*nonNLS*/));
+ throw new IllegalArgumentException("path cannot be null");
}
if (outputLocation.equals(getOutputLocation())) {
return;
@@ -1425,10 +1460,11 @@ protected void resetNonJavaResourcesForPackageFragmentRoots() throws JavaModelEx
*/
private void createClasspathProblemMarker(IClasspathEntry entry, String message){
try {
+ boolean isSourceAttachmentProblem = message.indexOf("source attachment") < 0;
IMarker marker = getProject().createMarker(IJavaModelMarker.BUILDPATH_PROBLEM_MARKER);
marker.setAttribute(IMarker.MESSAGE, message);
- marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_WARNING);
- marker.setAttribute(IMarker.LOCATION, Util.bind("classpath.buildPath"/*nonNLS*/));
+ marker.setAttribute(IMarker.SEVERITY, isSourceAttachmentProblem ? IMarker.SEVERITY_ERROR : IMarker.SEVERITY_WARNING);
+ marker.setAttribute(IMarker.LOCATION, "Build path");
} catch (CoreException e) {
}
}
@@ -1447,6 +1483,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 "Invalid project build path, references unbound variable path: "+path;
+ }
+ 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".equalsIgnoreCase(extension) || "zip".equalsIgnoreCase(extension)){ // internal binary archive
+ if (checkSourceAttachment
+ && sourceAttachment != null
+ && !sourceAttachment.isEmpty()
+ && JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){
+ return "Invalid source attachment: " + sourceAttachment;
+ }
+ }
+ break;
+ case IResource.FOLDER : // internal binary folder
+ if (checkSourceAttachment
+ && sourceAttachment != null
+ && !sourceAttachment.isEmpty()
+ && JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){
+ return "Invalid source attachment: " + sourceAttachment;
+ }
+ }
+ } else if (target instanceof File){
+ if (checkSourceAttachment
+ && sourceAttachment != null
+ && !sourceAttachment.isEmpty()
+ && JavaModel.getTarget(workspaceRoot, sourceAttachment, true) == null){
+ return "Invalid source attachment: " + sourceAttachment;
+ }
+ } else {
+ return "Invalid project build path, missing library: "+ path;
+ }
+ } else {
+ return "Invalid project build path, illegal library path: "+path;
+ }
+ 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 "Invalid project build path, missing Java project: "+path.segment(0);
+ }
+ } catch (CoreException e){
+ return "Invalid project build path, missing Java project: "+path.segment(0);
+ }
+ } else {
+ return "Invalid project build path, illegal project path: "+path;
+ }
+ 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 "Invalid project build path, illegal source folder path: "+path;
+ }
+ } else {
+ return "Invalid project build path, illegal source folder path: "+path;
+ }
+ 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 +1588,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 +1599,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], "unbound variable path: "+variablePath);
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 e9cbfbf3f1..087bc30b37 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"/*nonNLS*/);
+ return "Moving elements...";
}
/**
* @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 895def8ebd..85afa93866 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"/*nonNLS*/);
+ return "Moving resources...";
}
/**
* @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 8ebdbe1ca6..a8689e7a7d 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"/*nonNLS*/;
+ cuName += ".java";
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"/*nonNLS*/));
+ throw new IllegalArgumentException("Path must be absolute");
}
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"/*nonNLS*/));
+ throw new IllegalArgumentException("Path must be absolute");
}
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"/*nonNLS*/;
+ String unitName= partialMatch ? matchName.toLowerCase() : matchName + ".java";
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 e79947fcca..913e39c780 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"/*nonNLS*/)) {
+ if (!Signature.getReturnType(method.getSignature()).equals("V")) {
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 cc6944b475..2cdc8d2b19 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
@@ -95,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"/*nonNLS*/));
+ throw new IllegalArgumentException("requestor cannot be null");
}
if (position < -1 || position > getBuffer().getLength()) {
throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.INDEX_OUT_OF_BOUNDS));
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 2d49198720..132f65f660 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: "/*nonNLS*/ + forwardListLength);
+ System.out.println("Forward length: " + forwardListLength);
int backwardListLength = 0;
entry = fEntryQueueTail;
@@ -220,7 +220,7 @@ public void printStats() {
backwardListLength++;
entry = entry._fPrevious;
}
- System.out.println("Backward length: "/*nonNLS*/ + backwardListLength);
+ System.out.println("Backward length: " + 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: "/*nonNLS*/ + fClass + " has "/*nonNLS*/ + fCount + " entries."/*nonNLS*/;
+ return "Class: " + fClass + " has " + fCount + " entries.";
}
}
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"/*nonNLS*/));
+ throw new IllegalArgumentException("incorrect load factor");
}
/**
* 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 "/*nonNLS*/ + ((fCurrentSpace + fOverflow) * 100.0 / fSpaceLimit) + "% full\n"/*nonNLS*/ +
+ "OverflowingLRUCache " + ((fCurrentSpace + fOverflow) * 100.0 / fSpaceLimit) + "% full\n" +
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 c774187aab..f744f07a9d 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 "/*nonNLS*/);
+ buffer.append("package ");
buffer.append(getElementName());
if (info == null) {
- buffer.append(" (not open)"/*nonNLS*/);
+ buffer.append(" (not open)");
}
}
}
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 9ab3bb1c45..a9536101fb 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"/*nonNLS*/;
+ extType = "java";
} else {
- extType = "class"/*nonNLS*/;
+ extType = "class";
}
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"/*nonNLS*/));
+ throw new IllegalArgumentException("container cannot be null");
}
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+"."/*nonNLS*/;
+ String packageName = isDefaultPackage() ? name : name+".";
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"/*nonNLS*/));
+ throw new IllegalArgumentException("conatiner cannot be null");
}
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"/*nonNLS*/));
+ throw new IllegalArgumentException("name cannot be null");
}
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]"/*nonNLS*/);
+ buffer.append("[default]");
} else {
buffer.append(getElementName());
}
if (info == null) {
- buffer.append(" (not open)"/*nonNLS*/);
+ buffer.append(" (not open)");
} else {
if (tab > 0) {
- buffer.append(" (...)"/*nonNLS*/);
+ buffer.append(" (...)");
}
}
}
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 6dc504d686..45950b436c 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"/*nonNLS*/.equalsIgnoreCase(extension) && !"class"/*nonNLS*/.equalsIgnoreCase(extension)) {
+ if (!"java".equalsIgnoreCase(extension) && !"class".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 5de8071e79..57131b077e 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, ""/*nonNLS*/, vChildren);
+ computeFolderChildren((IContainer) fResource, "", 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 + "."/*nonNLS*/ + member.getName();
+ newPrefix = prefix + "." + member.getName();
}
// eliminate binary output only if nested inside direct subfolders
if (!member.getFullPath().equals(outputLocationPath)) {
@@ -219,7 +219,7 @@ protected String getPackageName(IFolder folder) throws JavaModelException {
StringBuffer name = new StringBuffer(IPackageFragment.DEFAULT_PACKAGE_NAME);
for (int i= mySegmentCount; i < pkgSegmentCount; i++) {
if (i > mySegmentCount) {
- name.append('.');
+ name.append(".");
}
name.append(pkgPath.segment(i));
}
@@ -296,12 +296,12 @@ public void refreshChildren() {
*/
protected void toStringInfo(int tab, StringBuffer buffer, Object info) {
if (getElementName().length() == 0) {
- buffer.append("[project root]"/*nonNLS*/);
+ buffer.append("[project root]");
} else {
buffer.append(getElementName());
}
if (info == null) {
- buffer.append(" (not open)"/*nonNLS*/);
+ buffer.append(" (not open)");
}
}
}
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 ff1c197991..6bc01a3fa6 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"/*nonNLS*/.equalsIgnoreCase(extension) && !"class"/*nonNLS*/.equalsIgnoreCase(extension)) {
+ if (!"java".equalsIgnoreCase(extension) && !"class".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 cbcafc5f4f..554dd53eca 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
@@ -1,6 +1,5 @@
package org.eclipse.jdt.internal.core;
-
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
@@ -11,7 +10,6 @@ import org.eclipse.jdt.internal.compiler.ast.*;
import org.eclipse.jdt.internal.compiler.problem.*;
import org.eclipse.jdt.internal.compiler.impl.*;
-
public class Problem implements IProblem, ProblemSeverities, ProblemIrritants {
private char[] fileName;
private int id;
@@ -38,6 +36,85 @@ public Problem(
this.endPosition = endPosition;
this.line = line;
}
+public String errorReportSource(ICompilationUnit compilationUnit) {
+ //extra from the source the innacurate token
+ //and "highlight" it using some underneath ^^^^^
+ //put some context around too.
+
+ //this code assumes that the font used in the console is fixed size
+
+ //sanity .....
+ if ((startPosition > endPosition)
+ || ((startPosition <= 0) && (endPosition <= 0)))
+ return "\n!! no source information available !!";
+
+ //regular behavior....(slow code)
+
+ final int AROUND = 60; //increase this value to see more ....
+ final char SPACE = '\u0020';
+ final char MARK = '^';
+ final char TAB = '\t';
+ char[] source = compilationUnit.getContents();
+ //the next code tries to underline the token.....
+ //it assumes (for a good display) that token source does not
+ //contain any \r \n. This is false on statements !
+ //(the code still works but the display is not optimal !)
+
+ //compute the how-much-char we are displaying around the inaccurate token
+ int begin = startPosition >= source.length ? source.length - 1 : startPosition;
+ int relativeStart = 0;
+ int end = endPosition >= source.length ? source.length - 1 : endPosition;
+ int relativeEnd = 0;
+ label : for (relativeStart = 0;; relativeStart++) {
+ if (begin == 0)
+ break label;
+ if ((source[begin - 1] == '\n') || (source[begin - 1] == '\r'))
+ break label;
+ begin--;
+ }
+ label : for (relativeEnd = 0;; relativeEnd++) {
+ if ((end + 1)>= source.length)
+ break label;
+ if ((source[end + 1] == '\r') || (source[end + 1] == '\n')) {
+ break label;
+ }
+ end++;
+ }
+ //extract the message form the source
+ char[] extract = new char[end - begin + 1];
+ System.arraycopy(source, begin, extract, 0, extract.length);
+ char c;
+ //remove all SPACE and TAB that begin the error message...
+ int trimLeftIndex = 0;
+ while (((c = extract[trimLeftIndex++]) == TAB) || (c == SPACE)) {};
+ System.arraycopy(
+ extract,
+ trimLeftIndex - 1,
+ extract = new char[extract.length - trimLeftIndex + 1],
+ 0,
+ extract.length);
+ relativeStart -= trimLeftIndex;
+ //buffer spaces and tabs in order to reach the error position
+ int pos = 0;
+ char[] underneath = new char[extract.length]; // can't be bigger
+ for (int i = 0; i <= relativeStart; i++) {
+ if (extract[i] == TAB) {
+ underneath[pos++] = TAB;
+ } else {
+ underneath[pos++] = SPACE;
+ }
+ }
+ //mark the error position
+ for (int i = startPosition;
+ i <= (endPosition >= source.length ? source.length - 1 : endPosition);
+ i++)
+ underneath[pos++] = MARK;
+ //resize underneathto remove 'null' chars
+ System.arraycopy(underneath, 0, underneath = new char[pos], 0, pos);
+
+ return " (at line " + String.valueOf(line) + ")" + //NON NLS
+ "\n\t" + new String(extract) + "\n\t" + new String(underneath);
+}
/**
* Answer back the original arguments recorded into the problem.
* @return java.lang.String[]
@@ -136,14 +213,13 @@ public void setSourceStart(int sourceStart) {
}
public String toString() {
-
- String s = "Pb("/*nonNLS*/ + (id & IgnoreCategoriesMask) + ") "/*nonNLS*/;
+ String s = "Pb(" + (id & IgnoreCategoriesMask) + ") ";
if (message != null) {
s += message;
} else {
if (arguments != null)
for (int i = 0; i < arguments.length; i++)
- s += " "/*nonNLS*/ + arguments[i];
+ s += " " + 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 15b66de75b..2fd90b660e 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(", "/*nonNLS*/);
+ buffer.append(", ");
}
}
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 50a35bf09e..1a76475692 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"/*nonNLS*/);
+ return "Renaming elements...";
}
/**
* @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 f26666bfec..75821a9419 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"/*nonNLS*/);
+ return "Renaming resources...";
}
/**
* @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 745ff1af97..0fe7f8ba38 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
@@ -94,7 +94,7 @@ public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
for(int i = 0; i < lengthM1; i++) {
buffer.append(compoundTypeName[i]);
if (i + 1 != lengthM1)
- buffer.append('.');
+ buffer.append(".");
}
String className = new String(compoundTypeName[lengthM1]);
return find(className, buffer.toString());
@@ -114,7 +114,7 @@ public NameEnvironmentAnswer findType(char[] name, char[][] packages) {
for(int i = 0; i < length; i++) {
buffer.append(packages[i]);
if (i + 1 != length)
- buffer.append('.');
+ buffer.append(".");
}
String className = new String(name);
return find(className, buffer.toString());
@@ -238,7 +238,7 @@ public boolean isPackage(char[][] parentPackageName, char[] subPackageName) {
if (parentPackageName[i] == null || isQualified(parentPackageName[i]))
return false;
buffer.append(parentPackageName[i]);
- buffer.append('.');
+ buffer.append(".");
}
if (isQualified(subPackageName)) {
return false;
@@ -272,7 +272,7 @@ public boolean isTopLevelPackage(char[] packageName) {
* Returns a printable string for the array.
*/
protected String toStringChar(char[] name) {
- return "["/*nonNLS*/ + new String(name) + "]"/*nonNLS*/;
+ return "[" + new String(name) + "]";
}
/**
* Returns a printable string for the array.
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 bc94fbc0b3..7aa2d63486 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]) + "."/*nonNLS*/;
+ pkg = new String(parameterPackageNames[i]) + ".";
}
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 8e622e34dd..d91296b0e5 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"/*nonNLS*/), 2);
+ beginTask("Setting classpath...", 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,46 @@ 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;
+ for (int i = 0 ; i < classpath.length; i++) {
+ if (classpath[i].getPath().equals(outputLocation)){
+ allowNestingInOutput = true;
+ break;
+ }
+ }
+
+ // 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 a21411e8ef..a9b4895673 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("."/*nonNLS*/)) {
+ if (name.endsWith(".")) {
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"/*nonNLS*/), 2);
+ beginTask("Setting output location...", 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,35 @@ 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;
+ for (int i = 0 ; i < classpath.length; i++) {
+ if (classpath[i].getPath().equals(fOutputLocation)){
+ allowNestingInOutput = true;
+ break;
+ }
+ }
+
+ // 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 00d5b06bd1..b9d102d647 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)"/*nonNLS*/);
+ buffer.append(" (not open)");
} else {
try {
buffer.append(Signature.toString(this.getTypeSignature()));
- buffer.append(" "/*nonNLS*/);
+ buffer.append(" ");
buffer.append(this.getElementName());
} catch (JavaModelException e) {
- buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());
+ buffer.append("<JavaModelException in toString of " + 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 b38372f52a..1d2e71692b 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
@@ -109,7 +109,7 @@ public class SourceMapper extends ReferenceInfoAdapter implements ISourceElement
public SourceMapper(IPath zipPath, String rootPath, JavaModel model) {
fZipPath= zipPath;
fRootPath= rootPath.replace('\\', '/');
- if (fRootPath.endsWith("/"/*nonNLS*/)) {
+ if (fRootPath.endsWith("/")) {
fRootPath = fRootPath.substring(0, fRootPath.lastIndexOf('/'));
}
fJavaModel= model;
@@ -305,9 +305,15 @@ public char[] findSource(IType type) {
* code cannot be found.
*/
public char[] findSource(IType type, IBinaryType info) {
- char[] sourceFileName = info.sourceFileName();
- if (sourceFileName == null) return null; // no source file attribute
- String name = new String(sourceFileName);
+ String name= null;
+ // see 1FVVWZT
+ if (info instanceof ClassFileReader) {
+ char[] sourceFileName = ((ClassFileReader)info).sourceFileName();
+ if (sourceFileName == null) return null; // no source file attribute
+ name = new String(sourceFileName);
+ } else {
+ return null;
+ }
IPackageFragment pkgFrag = type.getPackageFragment();
if (!pkgFrag.isDefaultPackage()) {
@@ -446,7 +452,7 @@ public ISourceRange mapSource(IType type, char[] contents, IJavaElement searched
try {
IProblemFactory factory= new DefaultProblemFactory();
SourceElementParser parser = new SourceElementParser(this, factory);
- parser.parseCompilationUnit(new BasicCompilationUnit(contents, type.getElementName() + ".java"/*nonNLS*/), false);
+ parser.parseCompilationUnit(new BasicCompilationUnit(contents, type.getElementName() + ".java"), false);
if (searchedElement != null) {
ISourceRange range = this.getNameRange(searchedElement);
return range;
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 e522c94da0..ed982a6874 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
@@ -138,18 +138,18 @@ public boolean isConstructor() throws JavaModelException {
public String readableName() {
StringBuffer buffer = new StringBuffer(super.readableName());
- buffer.append('(');
+ buffer.append("(");
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(", "/*nonNLS*/);
+ buffer.append(", ");
}
}
}
- buffer.append(')');
+ buffer.append(")");
return buffer.toString();
}
/**
@@ -192,31 +192,31 @@ 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)"/*nonNLS*/);
+ buffer.append(" (not open)");
} else {
try {
if (Flags.isStatic(this.getFlags())) {
- buffer.append("static "/*nonNLS*/);
+ buffer.append("static ");
}
if (!this.isConstructor()) {
buffer.append(Signature.toString(this.getReturnType()));
- buffer.append(' ');
+ buffer.append(" ");
}
buffer.append(this.getElementName());
- buffer.append('(');
+ buffer.append("(");
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(", "/*nonNLS*/);
+ buffer.append(", ");
}
}
}
- buffer.append(')');
+ buffer.append(")");
} catch (JavaModelException e) {
- buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());
+ buffer.append("<JavaModelException in toString of " + 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 e0aa4054a3..339d495102 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="/*nonNLS*/);
+ buffer.append("[offset=");
buffer.append(this.offset);
- buffer.append(", length="/*nonNLS*/);
+ buffer.append(", length=");
buffer.append(this.length);
- buffer.append("]"/*nonNLS*/);
+ buffer.append("]");
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 c0f0f428ab..843fcba627 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"/*nonNLS*/));
+ throw new IllegalArgumentException("conatiner cannot be null");
}
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"/*nonNLS*/));
+ throw new IllegalArgumentException("conatiner cannot be null");
}
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"/*nonNLS*/));
+ throw new IllegalArgumentException("name cannot be null");
}
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 3fffc3fa6f..b103373383 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"/*nonNLS*/));
+ throw new IllegalArgumentException("project argument cannot be null");
}
CreateTypeHierarchyOperation op= new CreateTypeHierarchyOperation(
@@ -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)"/*nonNLS*/);
+ buffer.append(" (not open)");
} else {
try {
if (this.isInterface()) {
- buffer.append("interface "/*nonNLS*/);
+ buffer.append("interface ");
} else {
- buffer.append("class "/*nonNLS*/);
+ buffer.append("class ");
}
buffer.append(this.getElementName());
} catch (JavaModelException e) {
- buffer.append("<JavaModelException in toString of "/*nonNLS*/ + getElementName());
+ buffer.append("<JavaModelException in toString of " + 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 11c365754f..9c6cef0136 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("["/*nonNLS*/);
+ StringBuffer buffer = new StringBuffer("[");
for (int i = 0; i < size; i++) {
- buffer.append("\n"/*nonNLS*/);
+ buffer.append("\n");
buffer.append(elements[i]);
}
- buffer.append("\n]"/*nonNLS*/);
+ buffer.append("\n]");
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 4c39fff104..f30d88810c 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
@@ -8,10 +8,6 @@ import org.eclipse.jdt.internal.compiler.util.CharOperation;
import java.io.*;
-import java.util.MissingResourceException;
-import java.util.Locale;
-import java.util.ResourceBundle;
-
/**
* Provides convenient utility methods to other types in this package.
*/
@@ -40,19 +36,13 @@ public class Util {
*/
private static boolean JDK1_1 = false;
- /* Bundle containing messages */
- protected static ResourceBundle bundle;
- private final static String bundleName = "org.eclipse.jdt.internal.core.Messages"/*nonNLS*/;
-
- 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();
-
+ private final static char[] SUFFIX_class = ".class".toCharArray();
+ private final static char[] SUFFIX_CLASS = ".CLASS".toCharArray();
+ private final static char[] SUFFIX_java = ".java".toCharArray();
+ private final static char[] SUFFIX_JAVA = ".JAVA".toCharArray();
static {
- String ver = System.getProperty("java.version"/*nonNLS*/);
- JDK1_1 = ((ver != null) && ver.startsWith("1.1"/*nonNLS*/));
- relocalize();
+ String ver = System.getProperty("java.version");
+ JDK1_1 = ((ver != null) && ver.startsWith("1.1"));
}
/**
* Checks the type signature in String sig,
@@ -155,8 +145,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"/*nonNLS*/;
- if (s2 == null) s2 = "null"/*nonNLS*/;
+ if (s1 == null) s1 = "null";
+ if (s2 == null) s2 = "null";
int l1 = s1.length();
int l2 = s2.length();
char[] buf = new char[l1 + 1 + l2];
@@ -176,8 +166,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"/*nonNLS*/;
- if (s2 == null) s2 = "null"/*nonNLS*/;
+ if (s1 == null) s1 = "null";
+ if (s2 == null) s2 = "null";
int l1 = s1.length();
int l2 = s2.length();
char[] buf = new char[l1 + l2];
@@ -190,9 +180,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"/*nonNLS*/;
- if (s2 == null) s2 = "null"/*nonNLS*/;
- if (s3 == null) s3 = "null"/*nonNLS*/;
+ if (s1 == null) s1 = "null";
+ if (s2 == null) s2 = "null";
+ if (s3 == null) s3 = "null";
int l1 = s1.length();
int l2 = s2.length();
int l3 = s3.length();
@@ -759,75 +749,6 @@ public static void sortReverseOrder(String[] strings) {
Assert.isTrue(isValidTypeSignature(sig, allowVoid));
}
-/**
- * Lookup the message with the given ID in this catalog
- */
-public static String bind(String id) {
- return bind(id, (String[])null);
-}
-
-/**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given string values.
- */
-public static String bind(String id, String[] bindings) {
- if (id == null)
- 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: "/*nonNLS*/ + id + " in: "/*nonNLS*/ + bundleName;
- }
- if (bindings == null)
- return message;
- int length = message.length();
- int start = -1;
- int end = length;
- StringBuffer output = new StringBuffer(80);
- while (true) {
- if ((end = message.indexOf('{', start)) > -1) {
- output.append(message.substring(start + 1, end));
- if ((start = message.indexOf('}', end)) > -1) {
- int index = -1;
- try {
- index = Integer.parseInt(message.substring(end + 1, start));
- output.append(bindings[index]);
- } catch (NumberFormatException nfe) {
- output.append(message.substring(end + 1, start + 1));
- } catch (ArrayIndexOutOfBoundsException e) {
- output.append("{missing "/*nonNLS*/ + Integer.toString(index) + "}"/*nonNLS*/);
- }
- } else {
- output.append(message.substring(end, length));
- break;
- }
- } else {
- output.append(message.substring(start + 1, length));
- break;
- }
- }
- return output.toString();
-}
-
-/**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given string.
- */
-public static String bind(String id, String binding) {
- return bind(id, new String[] {binding});
-}
-
-/**
- * Lookup the message with the given ID in this catalog and bind its
- * substitution locations with the given strings.
- */
-public static String bind(String id, String binding1, String binding2) {
- return bind(id, new String[] {binding1, binding2});
-}
-
/**
* Returns true iff str.toLowerCase().endsWith(end.toLowerCase())
* implementation is not creating extra strings.
@@ -884,11 +805,4 @@ public static String bind(String id, String binding1, String binding2) {
}
return true;
}
-
-/**
- * Creates a NLS catalog for the given locale.
- */
-public static void relocalize() {
- bundle = ResourceBundle.getBundle(bundleName, Locale.getDefault());
-}
}
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 d2dde904a8..f69650ee46 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"/*nonNLS*/);
+ buffer.append("(working copy)\n");
super.toString(tab, buffer);
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BuildEvent.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BuildEvent.java
index 54b687e2bb..87c981dbb1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BuildEvent.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/BuildEvent.java
@@ -1,13 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * A BuildEvent encapsulates information passed to an IBuildListener.
- */
public class BuildEvent {
protected ISourceFragment fSourceFragment;
protected int fNewErrorCount;
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 4810cf9d22..206cd477fc 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("/*nonNLS*/);
+ buffer.append("DeltaKey(");
for (int i = 0; i < this.fLocalNames.length; i++) {
buffer.append(this.fLocalNames[i]);
if (i < this.fLocalNames.length - 1) {
- buffer.append("/"/*nonNLS*/);
+ buffer.append("/");
}
}
- buffer.append(")"/*nonNLS*/);
+ buffer.append(")");
return buffer.toString();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IBuildMonitor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IBuildMonitor.java
index b79e3d6c0f..652126fba0 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IBuildMonitor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IBuildMonitor.java
@@ -1,15 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * A build monitor tracks what compilation units have been compiled during a
- * given build. This allows test suites to evaluate the efficiency of incremental
- * compilation.
- */
public interface IBuildMonitor {
/**
* Signals that a new build has begun
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IConstructor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IConstructor.java
index 04abc2d9e3..341de55fa5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IConstructor.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IConstructor.java
@@ -1,25 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * Constructor provides information about a single
- * constructor for a class.
- *
- * Changes from java.lang and java.lang.reflect:
- * <ul>
- * <li>toString() changed to be a handle-only method;
- * it ignores the modifiers and exceptions.</li>
- * </ul>
- *
- * @see IMember
- * @see IType
- * @see IType#getConstructorHandle
- * @see IType#getDeclaredConstructors
- */
public interface IConstructor extends IMember {
@@ -37,7 +17,7 @@ public interface IConstructor extends IMember {
/**
* Returns an array of Type objects that represent the types of
* the checked exceptions thrown by the underlying constructor
- * represented by this Constructor object.
+ * represented by this Constructor object.
* Unchecked exceptions are not included in the result, even if
* they are declared in the source.
* Returns an array of length 0 if the constructor throws no checked
@@ -50,7 +30,7 @@ public interface IConstructor extends IMember {
/**
* Returns an array of Type objects that represent the formal
* parameter types, in declaration order, of the constructor
- * represented by this Constructor object.
+ * represented by this Constructor object.
* Returns an array of length 0 if the underlying constructor
* takes no parameters.
* This is a handle-only method.
@@ -76,7 +56,7 @@ public interface IConstructor extends IMember {
* followed by a parenthesized, comma-separated list of the
* constructor's formal parameter types. For example:
* <pre>
- * java.util.Hashtable(int,float)
+ * java.util.Hashtable(int,float)
* </pre>
*
* @see IHandle#toString
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IDeltaKey.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IDeltaKey.java
index a8543cd1ce..81188232ef 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IDeltaKey.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IDeltaKey.java
@@ -1,9 +1,4 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
public interface IDeltaKey {
/**
@@ -34,16 +29,16 @@ public interface IDeltaKey {
* Returns the key describing the receiver's parent, or null if the receiver
* is the root key.
*/
- DeltaKey parent();
+ DeltaKey parent();
/**
* Returns a new key containing the first few local names in the
* receiver.
*
* @param count
- * number of local names to copy (length of prefix)
+ * number of local names to copy (length of prefix)
* @exception IllegalArgumentException
- * receiver contains fewer than count local names, or count is
- * negative."
+ * receiver contains fewer than count local names, or count is
+ * negative."
*/
DeltaKey prefix (int count);
/**
@@ -55,10 +50,10 @@ public interface IDeltaKey {
* names in the receiver.
*
* @param count
- * number of local names in the key to leave out (length of prefix to cut)
+ * number of local names in the key to leave out (length of prefix to cut)
* @exception IllegalArgumentException
- * receiver contains fewer than count local names, or count is
- * negative.
+ * receiver contains fewer than count local names, or count is
+ * negative.
*/
DeltaKey withoutPrefix (int count);
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IDependencyGraph.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IDependencyGraph.java
index 002e5b68a7..acf201bac1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IDependencyGraph.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IDependencyGraph.java
@@ -1,14 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The dependency graph describes the dependencies between elements in a given state.
- * It is navigated using non-state-specific class or interface handles.
- */
public interface IDependencyGraph {
/**
* Returns the namespaces on which the given type depends.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IField.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IField.java
index e4c8401d1a..763e943a36 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IField.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IField.java
@@ -1,28 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * A Field provides information about a
- * single field of a class or an interface. The field may
- * be a class (static) field or an instance field.
- *
- * Changes from java.lang and java.lang.reflect:
- * <ul>
- * <li>equals(Object) changed to ignore field type
- * (field type is not an identity criterion for field handles).</li>
- * <li>toString() changed to be a handle-only method;
- * it ignores the modifiers and field type.</li>
- * </ul>
- *
- * @see IMember
- * @see IType
- * @see IType#getFieldHandle
- * @see IType#getDeclaredFields
- */
public interface IField extends IMember {
@@ -61,8 +38,8 @@ public interface IField extends IMember {
* followed by a period, followed by the name of the field.
* For example:
* <pre>
- * java.lang.Thread.MIN_PRIORITY
- * java.io.FileDescriptor.fd
+ * java.lang.Thread.MIN_PRIORITY
+ * java.io.FileDescriptor.fd
* </pre>
*
* @see IHandle#toString
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IHandle.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IHandle.java
index a4233f511b..a341e518e1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IHandle.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IHandle.java
@@ -1,95 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The <code>IHandle</code> defines messages common to objects
- * in the image (for Java, these would be things such as packages, types,
- * methods, and fields).
- * Each one of these has an identifying handle, which represents the object.
- * There can only be at most one such object in the image.
- * <p>
- * Handles come in two flavours: state-specific, and non-state-specific.
- * A state-specific handle is tied to a specific state and refers to an
- * object in that state. The state of a state-specific handle cannot
- * be changed.
- * A non-state-specific handle is not tied to a specific state and refers
- * to an object in whichever state is the current state of the development context.
- * The current state may change, in which case all non-state-specific handles
- * now refer to the object in the new current state.
- * Normally a client is dealing with non state-specific handles, occasionally with
- * state-specific handles, and very rarely with a combination of the two.
- * <p>
- * It is possible for the object refered to by a handle to be
- * missing from the image (e.g. a class which was deleted).
- * The isPresent() method can be used to determine whether the object
- * is present in a state of the development context or not.
- * For state-specific handles, isPresent() returns true if and only if the
- * object is present in the state the handle is tied to.
- * For non-state-specific handles, isPresent() returns true if and only if
- * the object is present in the current state of the DC.
- * <p>
- * Certain methods on handles require that the object it represents be present
- * (these are called 'non-handle-only methods'), whereas others operate only on
- * the handles themselves and will work correctly whether or not the object
- * is present (these are called 'handle-only methods').
- * If a non-handle-only method is invoked on a handle whose object is not present,
- * a <code>NotPresentException</code> is thrown (except for the isPresent() method).
- * <p>
- * The development context tries to ensure that any objects obtained by navigating
- * from a present object are also present. For example, in Java, the classes
- * returned by Package.getAllClasses() will all be present.
- * For cases where an object referenced in the source is not present in the image,
- * the image builder either creates a <em>fictional</em> object to take its place or makes
- * it appear as if the reference never existed.
- * These fictional objects are considered to be present (although it is not generally
- * true that if an object is fictional then it is present).
- * For example, if a class B subclasses a class A, and B is present in the image
- * but A is not, then the image builder could invent a fictional class A. So the
- * navigation B.getSuperclass() would result in an object that is present.
- * For this reason, NotPresentException is an unchecked RuntimeException, to allow
- * clients to operate under the assumption that all reachable objects are present.
- * Special care must be taken when creating handles
- * (i.e. <code>Package.getClassHandle(String)</type), since the objects
- * referred to may not be present. Other methods where this assumption does not
- * hold are explicitly marked (e.g. <code>Package.getReferencedPackages()</code>).
- * <p>
- * The following table defines the identity criteria for the principle kinds
- * of Java handles. For two handles to be considered the same, they must satisfy
- * these criteria. In addition, the handles must either both be non-state-specific,
- * or both be state-specific on the same state.
- * <p>
- * <dl>
- * <b><dt>Kind of handle</dt> <dd>Identity criteria</dd></b>
- * <dt>Image</dt> <dd>Same development context.</dd>
- * <dt>Package</dt> <dd>Same development context, same package name.</dd>
- * <dt>Type</dt>
- * <dd>Same development context.
- * For classes and interfaces, same type name (same fully qualified name,
- * excluding package name) and same containing package.
- * For array types, same component type.
- * For primitive types, same primitive type name.</dd>
- * <dt>Field</dt> <dd>Same development context, same declaring type, same field name.</dd>
- * <dt>Method</dt>
- * <dd>Same development context, same declaring type, same method name,
- * same argument types.</dd>
- * <dt>Constructor</dt>
- * <dd>Same development context, same declaring type, same argument types.</dd>
- * </dl>
- *
- * @see IImage
- * @see IPackage
- * @see IType
- * @see IField
- * @see IMethod
- * @see IConstructor
- * @see INotPresentException
- *
- * @see #equals
- */
public interface IHandle
{
int K_JAVA_IMAGE = 1;
@@ -137,7 +47,7 @@ public interface IHandle
/**
* Returns a state-specific object which refers to the same object
* as this object, but restricted to the given state. This object
- * must be non-state-specific.
+ * must be non-state-specific.
* It is an error to invoke this on a state-specific object.
* This is a handle-only method; the object may or may not be present
* in the given state.
@@ -189,7 +99,7 @@ public interface IHandle
*/
IHandle nonStateSpecific() throws StateSpecificException;
/**
- * Return a string describing this handle.
+ * Return a string describing this handle.
* This is a handle-only method.
* Extending interfaces provide more details.
*
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IImageBuilder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IImageBuilder.java
index ffe56bceb1..6192f062a6 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IImageBuilder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IImageBuilder.java
@@ -1,17 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * An ImageBuilder represents the process of building
- * a state. It can be queried for the State being built.
- * If the state is being built incrementally as a change to
- * a previous state, this object can be queried for the
- * image delta between the old state and the new state.
- */
public interface IImageBuilder
{
@@ -45,12 +33,12 @@ public interface IImageBuilder
IState getOldState();
/**
* Return a string of the form:
- * batch image builder for:
- * new state: this.data.newstate
+ * batch image builder for:
+ * new state: this.data.newstate
* OR
- * incremental image builder for:
- * new state: this.data.newstate
- * old state: this.data.oldstate
+ * incremental image builder for:
+ * new state: this.data.newstate
+ * old state: this.data.oldstate
* Obviously, which string gets returned depends
* on the type of image builder.
* The string returned is only for debugging purposes,
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IImageContext.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IImageContext.java
index 9324d64c52..90deeba8aa 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IImageContext.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IImageContext.java
@@ -1,27 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The <code>IImageContext</code> represents a subset of
- * a Java image. ImageContext objects are used in queries, such as
- * getSubclasses(), which require more context than just the local
- * definition of a class. This is to allow the Image to contain
- * a very large (conceptually infinite) number of packages, without
- * forcing them all to be considered when performing such non-local
- * queries.
- *
- * <p>For now, an ImageContext is defined as a set of non-state-specific packages.
- * The ImageContext itself is conceptually non-state-specific.
- *
- * @see IImage#createImageContext
- * @see IImage#getPackages
- * @see IImage#getAllClasses
- * @see IType#getSubclasses
- */
public interface IImageContext
{
@@ -38,12 +16,12 @@ public interface IImageContext
IPackage[] getPackages();
/**
* Return a string of the form:
- * image context with packages:
- * this.data.package[0]
- * this.data.package[1]
- * ...
- * this.data.package[n-1]
- *
+ * image context with packages:
+ * this.data.package[0]
+ * this.data.package[1]
+ * ...
+ * this.data.package[n-1]
+ *
* The string returned is only for debugging purposes,
* and the contents of the string may change in the future.
* @return java.lang.String
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IMember.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IMember.java
index 41d9055e46..39401fe3b9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IMember.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IMember.java
@@ -1,19 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * Member is a mixin interface that represents identifying information about
- * a single member (a field or method), a constructor, or a nested class.
- *
- * @see IType
- * @see IField
- * @see IMethod
- * @see IConstructor
- */
public interface IMember extends IHandle {
@@ -48,8 +34,8 @@ public interface IMember extends IHandle {
* A binary member is one for which the declaring class is in
* .class file format in the workspace.
*
- * @return <code>true</code> if this object represents a binary member;
- * <code>false</code> otherwise.
+ * @return <code>true</code> if this object represents a binary member;
+ * <code>false</code> otherwise.
* @exception NotPresentException if this type is not present.
*/
boolean isBinary() throws NotPresentException;
@@ -59,8 +45,8 @@ public interface IMember extends IHandle {
* A deprecated object is one that has a 'deprecated' tag in
* its doc comment.
*
- * @return <code>true</code> if this object represents a deprecated member;
- * <code>false</code> otherwise.
+ * @return <code>true</code> if this object represents a deprecated member;
+ * <code>false</code> otherwise.
* @exception NotPresentException if this type is not present.
*/
boolean isDeprecated() throws NotPresentException;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IMethod.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IMethod.java
index b6eeafe761..2de8e6e17d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IMethod.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IMethod.java
@@ -1,26 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * A Method provides information about a single method
- * on a class or interface. The method may be a class method
- * or an instance method (including an abstract method).
- *
- * Changes from java.lang and java.lang.reflect:
- * <ul>
- * <li>toString() changed to be a handle-only method;
- * it ignores the modifiers, return type, and exceptions.</li>
- * </ul>
- *
- * @see IMember
- * @see IType
- * @see IType#getMethodHandle
- * @see IType#getDeclaredMethods()
- */
public interface IMethod extends IMember {
@@ -79,7 +58,7 @@ public interface IMethod extends IMember {
*/
boolean isPresent();
/**
- * Returns a string describing this Method handle. The string is
+ * Returns a string describing this Method handle. The string is
* formatted as the fully qualified name of the declaring class,
* followed by a period, followed by the method name,
* followed by a parenthesized, comma-separated list of the method's
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IPackage.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IPackage.java
index 3cfc9d3de3..6b98250e7f 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IPackage.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IPackage.java
@@ -1,13 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The <code>IPackage</code> represents a package.
- */
public interface IPackage extends IHandle {
@@ -66,8 +58,8 @@ public interface IPackage extends IHandle {
* string of this unnamed packaged.
* This is a handle-only method.
*
- * @return the fully qualified name of the package
- * represented by this object.
+ * @return the fully qualified name of the package
+ * represented by this object.
*/
String getName();
/**
@@ -96,7 +88,7 @@ public interface IPackage extends IHandle {
*
* @exception NotPresentException if this package is not present.
*/
- IPackage[] getReferencedPackages() throws NotPresentException;
+ IPackage[] getReferencedPackages() throws NotPresentException;
/**
* Returns an array of Package objects representing all packages
* in the given image context which directly reference this package.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IProblemDetail.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IProblemDetail.java
index e87937f6ec..fd1d212a01 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IProblemDetail.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IProblemDetail.java
@@ -1,16 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * <code>IProblemDetail</code> provides details about a problem
- * with the image.
- *
- * @see IState#getReportCard(IImageContext)
- */
public interface IProblemDetail {
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearch.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearch.java
index 68da8e82f7..353f64c65b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearch.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearch.java
@@ -1,31 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * An <code>ISearch</code> represents an image search and its results.
- * <code>ISearch</code>es are created by <code>ISearchFactory</code> objects.
- * They can be queried for results and report progress as the search runs. A
- * search can be stopped before it finishes and can be run again.
- * <code>ISearch</code> is implemented in a thread safe manner.
- * <p>
- * The search is not precise. Instead it provides a best-effort search.
- * No occurrences of what is being searched for will be missed, and no duplicate
- * results will be returned. However, the search may occasionally return additional
- * matches which don't actually relate to what was being searched for.
- * This will only be an issue when searching for source references. An
- * example of this would be if a search for references to a field called <code>io</code> was
- * performed. Any methods which contained a reference to <code>java.io.</code><i>something</i>
- * would be returned as matches, because in the source, it is unclear whether
- * <code>io</code> is a field in some class called <code>java</code> or not.
- * <p>
- * ISearchFactory shows examples of using ISearch.
- *
- * @see ISearchFactory
- */
public interface ISearch extends Runnable
{
/**
@@ -33,11 +7,11 @@ public interface ISearch extends Runnable
* from this search. Progress events occur as a search examines the types
* and packages in the search scope. Result events occur as a search finds
* matches to the search criteria.
- * @param listener the search listener
- * @see ISearchListener
- * @see SearchProgressEvent
- * @see SearchResultEvent
- * @see ISearch#removeSearchListener
+ * @param listener the search listener
+ * @see ISearchListener
+ * @see SearchProgressEvent
+ * @see SearchResultEvent
+ * @see ISearch#removeSearchListener
*/
void addSearchListener(ISearchListener listener);
/**
@@ -52,9 +26,9 @@ void cancelSearch();
* <ul>
* <li> neither is equal to null AND
* <li> both searches have the same kind (i.e.. search for type), name
- * (i.e., type named 'Foo') return type, number and type of parameters
- * (even if not used -- as in the case of search for type), and search
- * context (i.e., ISearchFactory.SEARCH_FOR_DECLS)
+ * (i.e., type named 'Foo') return type, number and type of parameters
+ * (even if not used -- as in the case of search for type), and search
+ * context (i.e., ISearchFactory.SEARCH_FOR_DECLS)
* <li> their scopes are equal (contain the same IPackage and IType handles, in any order)
* </ul>
*/
@@ -83,11 +57,11 @@ boolean isSearching();
/**
* Removes the specified action listener so that it no longer
* receives progress and result events from the search.
- * @param listener the search listener
- * @see ISearchListener
- * @see SearchProgressEvent
- * @see SearchResultEvent
- * @see ISearch#addSearchListener
+ * @param listener the search listener
+ * @see ISearchListener
+ * @see SearchProgressEvent
+ * @see SearchResultEvent
+ * @see ISearch#addSearchListener
*/
void removeSearchListener(ISearchListener listener);
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearchFactory.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearchFactory.java
index 3df5910324..217f472543 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearchFactory.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearchFactory.java
@@ -1,62 +1,7 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * <code>ISearchFactory</code> creates <code>ISearch</code> objects which can
- * search some subset of the image. These <code>ISearch</code> objects can
- * be configured with a name, a scope, and a search context.
- * <p>
- * <ul>
- * <li><b>Name:</b>
- * The name of the search specifies what the search is actually looking for.
- * It can be the name of a type, a field, a package, a method, or a constructor.
- * Searches for methods and constructors may also supply parameter and return
- * type information. Wildcarding is supported.
- * <li><b>Scope:</b>
- * The scope of the search defines the subset of the image that is to be searched.
- * Including a type in the scope includes all inner types, fields, methods and
- * constructors of that type in the search. Inner types also have all of their
- * inner types, fields, methods and constructors included in the scope of the
- * search, recursively. Including a package in the scope includes all types contained
- * in the package in the scope and, therefore, all inner types, fields, methods and
- * constructors. The items in the scope must belong to the same state as the
- * image from which this search engine was obtained. Results of the search will also
- * be in the same state as the image. If the image is non-state-specific, the
- * items in the scope must be non-state-specific as well. Furthermore, results
- * found by the search will also be non-state-specific.
- * <li><b>Context:</b>
- * The search context is defined using flags which specify whether the search is
- * looking for declarations or references. Furthermore, when looking for
- * references, the search can look either in the principle structure or the
- * source of each type in the search scope. The flags can be 'OR'ed
- * together to allow searches for declarations and references.
- * </ul>
- * <p>
- * <b>Example:</b><br>
- * Search for all references to a type named "String" in the scope of the
- * package "hanoiExample". Wait for the results, and then print them out.
- * <pre><code>
- * IImage image = dc.getImage();
- * ISearchFactory sf = image.newSearchFactory();
- * IHandle[] scope = {image.getPackageHandle("hanoiExample", false)};
- * ISearch search =
- * sf.searchForType(
- * "String",
- * scope,
- * ISearchFactory.SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS |
- * ISearchFactory.SEARCH_FOR_SOURCE_REFS);
- * search.run(); // perform the search
- * for (int i = 0; i < search.getItemCount(); i++)
- * System.out.println(search.getItem(i));
- * </code></pre>
- * @see ISearch
- */
public interface ISearchFactory
-{
+{
/* Flags for search context */
/**
@@ -90,26 +35,26 @@ public interface ISearchFactory
* name.
* <p>
* <b>Example:</b> Searching for declarations of fields named <code>width</code>
- * in package <code>java.awt</code>.
+ * in package <code>java.awt</code>.
* <pre><code>
* IImage image = dc.getImage();
* ISearchFactory sf = image.newSearchFactory();
* IHandle[] scope = {image.getPackageHandle("java.awt", false)};
* ISearch search =
- * sf.searchForField(
- * "width",
- * scope,
- * ISearchFactory.SEARCH_FOR_DECLS);
+ * sf.searchForField(
+ * "width",
+ * scope,
+ * ISearchFactory.SEARCH_FOR_DECLS);
* search.run();
* </code></pre>
* @param fieldName the name of the field to search for, possibly containing
- * wildcards ("*")
+ * wildcards ("*")
* @param scope the packages and types to search in
* @param context the context flags. SEARCH_FOR_DECLS, and
- * SEARCH_FOR_SOURCE_REFS are valid flags for field searches.
- * SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS will not have any effect on
- * the search because there are no field references in the principle
- * structure.
+ * SEARCH_FOR_SOURCE_REFS are valid flags for field searches.
+ * SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS will not have any effect on
+ * the search because there are no field references in the principle
+ * structure.
*
*
* @see ISearch
@@ -127,34 +72,34 @@ ISearch searchForField(
* <b>Example:</b> Search for declarations of methods named <code>toString</code>
* whose second argument is <code>int</code>. The search will be conducted
* in the scope of the <code>hanoiExample</code> package.
- * <code><pre>
+ * <code><pre>
* IImage image = dc.getImage();
* ISearchFactory factory = image.newSearchFactory();
* IHandle[] scope = {image.getPackageHandle("hanoiExample")};
* ISearch search =
- * factory.searchForMethod(
- * "toString",
- * new String[] {"*", "int"},
- * "*",
- * scope,
- * SEARCH_FOR_DECLS);
+ * factory.searchForMethod(
+ * "toString",
+ * new String[] {"*", "int"},
+ * "*",
+ * scope,
+ * SEARCH_FOR_DECLS);
* search.run();
- * </code></pre>
+ * </code></pre>
* <br>
* @param methodName the method name to search for, possibly containing wildcards ("*")
* @param paramTypes the names of parameter types the method being searched for must
- * have, possibly containing wildcards. An empty array indicates a method with
- * zero parameters.
+ * have, possibly containing wildcards. An empty array indicates a method with
+ * zero parameters.
* @param returnType the name of the return type the method being
- * searched for must have, possibly containing wildcards. A return type
- * of "*" effectively ignores the return type.
+ * searched for must have, possibly containing wildcards. A return type
+ * of "*" effectively ignores the return type.
* @param scope the packages and types to search in
* @param context the context flags. SEARCH_FOR_DECLS make sense as a flag for
- * this method search. Using SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS will have no effect since methods
- * cannot be referenced in the principle structure. When searching the source,
- * SEARCH_FOR_SOURCE_REFS will ignore the return type, and only use the
- * number of parameters, not the parameter types. This is because at the source
- * level only the method name and number of parameters are
+ * this method search. Using SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS will have no effect since methods
+ * cannot be referenced in the principle structure. When searching the source,
+ * SEARCH_FOR_SOURCE_REFS will ignore the return type, and only use the
+ * number of parameters, not the parameter types. This is because at the source
+ * level only the method name and number of parameters are
* known.
* @see ISearch
*/
@@ -175,50 +120,50 @@ ISearch searchForMethod(
* which have 2 arguments. The search will be conducted in the scope of the <code>hanoiExample</code>
* package. Note that the principle structure is not searched for references
* since it never contains information about references to methods.
- * <code><pre>
+ * <code><pre>
* IImage image = dc.getImage();
* ISearchFactory factory = image.newSearchFactory();
* IHandle[] scope = {image.getPackageHandle("hanoiExample")};
* ISearch search =
- * factory.searchForMethod(
- * "add",
- * 2,
- * "*",
- * scope,
- * SEARCH_FOR_DECLS |
- * SEARCH_FOR_SOURCE_REFS);
+ * factory.searchForMethod(
+ * "add",
+ * 2,
+ * "*",
+ * scope,
+ * SEARCH_FOR_DECLS |
+ * SEARCH_FOR_SOURCE_REFS);
* search.run();
- * </code></pre>
+ * </code></pre>
* <br>
* <b>Example 2:</b> Search for references to a constructor for a class named
* <code>Disk</code> which takes any number of arguments. The search will be conducted in
* the scope of the <code>hanoiExample</code> package. Note that the principle structure is not searched for references
* since it never contains information about references to methods.
- * <code><pre>
+ * <code><pre>
* IImage image = dc.getImage();
* ISearchFactory factory = image.newSearchFactory();
* IHandle[] scope = {image.getPackageHandle("hanoiExample")};
* ISearch search =
- * factory.searchForMethod(
- * "Disk",
- * -1,
- * "", // return type ignored for constructors
- * scope,
- * SEARCH_FOR_SOURCE_REFS);
+ * factory.searchForMethod(
+ * "Disk",
+ * -1,
+ * "", // return type ignored for constructors
+ * scope,
+ * SEARCH_FOR_SOURCE_REFS);
* search.run();
- * </code></pre>
+ * </code></pre>
*
* @param methodName the method name to search for, possibly containing wildcards ("*")
* @param parameterCount the number of parameters the method being
- * searched for has. Use -1 if number of parameters doesn't matter
+ * searched for has. Use -1 if number of parameters doesn't matter
* @param returnType the name of the return type the method being
- * searched for must have, possibly containing wildcards. A return type of
- * "*" effectively ignores return type.
+ * searched for must have, possibly containing wildcards. A return type of
+ * "*" effectively ignores return type.
* @param scope the packages and types to search in
* @param context the context flags. SEARCH_FOR_DECLS and
- * SEARCH_FOR_SOURCE_REFS make sense as flags for this method search.
- * SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS will not have any effect since
- * principle structures cannot reference methods.
+ * SEARCH_FOR_SOURCE_REFS make sense as flags for this method search.
+ * SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS will not have any effect since
+ * principle structures cannot reference methods.
*
* @see ISearch
*/
@@ -241,21 +186,21 @@ ISearch searchForMethod(
* ISearchFactory sf = image.newSearchFactory();
* IHandle[] scope = {image.getPackageHandle("hanoiExample", false)};
* ISearch search =
- * sf.searchForPackage(
- * "java.aw*",
- * scope,
- * ISearchFactory.SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS |
- * ISearchFactory.SEARCH_FOR_SOURCE_REFS);
+ * sf.searchForPackage(
+ * "java.aw*",
+ * scope,
+ * ISearchFactory.SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS |
+ * ISearchFactory.SEARCH_FOR_SOURCE_REFS);
* search.run();
* </code></pre>
*
* @param packageName the name of the package to search for, possibly
- * containing wildcards ("*")
+ * containing wildcards ("*")
* @param scope the packages and types to search in
* @param context the context flags. SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS,
- * and SEARCH_FOR_SOURCE_REFS make sense as flags for package
- * searches. Using SEARCH_FOR_DECLS will not have any effect because
- * packages are not declared anywhere.
+ * and SEARCH_FOR_SOURCE_REFS make sense as flags for package
+ * searches. Using SEARCH_FOR_DECLS will not have any effect because
+ * packages are not declared anywhere.
*
* @see ISearch
*/
@@ -275,17 +220,17 @@ ISearch searchForPackage(
* ISearchFactory sf = image.newSearchFactory();
* IHandle[] scope = {image.getPackageHandle("hanoiExample", false)};
* ISearch search =
- * sf.searchForType(
- * "Post",
- * scope,
- * ISearchFactory.SEARCH_FOR_DECLS);
+ * sf.searchForType(
+ * "Post",
+ * scope,
+ * ISearchFactory.SEARCH_FOR_DECLS);
* search.run();
* </code></pre>
* @param typeName the simple name of the type to search for, possibly
- * containing wildcards ("*")
+ * containing wildcards ("*")
* @param scope the packages and types to search in
* @param context the context flags. SEARCH_FOR_DECLS, SEARCH_FOR_PRINCIPLE_STRUCTURE_REFS,
- * and SEARCH_FOR_SOURCE_REFS all make sense as flags for type searches.
+ * and SEARCH_FOR_SOURCE_REFS all make sense as flags for type searches.
*
* @see ISearch
*/
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearchListener.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearchListener.java
index c37af37fdf..d4031d2387 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearchListener.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/ISearchListener.java
@@ -1,16 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The event listener interface for receiving progress and result updates
- * from an <code>ISearch</code>.
- *
- * @see ISearch
- */
public interface ISearchListener extends java.util.EventListener {
/**
* Reports that the search has been cancelled and is no longer running.
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IType.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IType.java
index 7cbe537fce..2603694e5b 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IType.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/IType.java
@@ -1,64 +1,10 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The <code>Type</code> interface represents classes, interfaces, array
- * types, the primitive Java types (boolean, byte, char, short, int,
- * long, float, and double) and the keyword void.
- *
- * <p>This interface is based on the <code>java.lang.Class</code> class in JDK 1.1.
- *
- * <p>The following terminology is used for inner classes, and applies also
- * to interfaces.
- * This terminology is consistent with the Java Inner Classes Specification.
- *
- * <p>A 'package member' class is declared as a member of a package.
- * That is, a 'normal' class, as defined in the <em>Java Language Specification</em>.
- *
- * <p>An 'inner class' is one which is declared in another class, either as a member
- * of that class or within a method or other block within that class.
- * The class in which an inner class is declared is referred to as its 'outer class'.
- * An inner class must be instantiated in the context of an instance of its outer class.
- * The instance of the outer class is referred to as the 'outer instance'.
- *
- * <p>A 'top-level class' is declared either as a package member or as a
- * static member of another top-level class. A top-level class can be referred to
- * by a fully qualified name (given the right access), and is instanciated
- * directly; it is not instanciated in the context of an outer instance.
- * A class can be either a top-level class or an inner class, but cannot be both.
- *
- * <p>A 'nested class' is one which is not a package member: either an
- * inner class, or a top-level class declared as a member of a class.
- *
- * <p>A 'local class' is an inner class declared within a method or other block
- * within its outer class. Since a local class is a kind of inner class,
- * it cannot be a top-level class.
- *
- * <p>An 'anonymous class' is a local inner class with no declared name.
- *
- * Changes from java.lang and java.lang.reflect:
- * <ul>
- * <li>renamed to Type from Class
- * <li>toString() clarified for array types</li>
- * <li>major additions (see below)</li>
- * <li>removed isAssignableFrom(Type)</li>
- * <li>removed getFields()</li>
- * <li>removed getMethods()</li>
- * <li>removed getConstructors()</li>
- * <li>removed getField(String), getMethod(String, Type[]), getConstructor(Type[])</li>
- * <li>removed getDeclaredField(String), getDeclaredMethod(String, Type[]), getDeclaredConstructor(Type[])</li>
- * <li>added handle methods getFieldHandle(String) etc.</li>
- * </ul>
- */
public interface IType extends IMember {
/**
- * Compares this Type handle against the specified object. Returns
+ * Compares this Type handle against the specified object. Returns
* true if the objects are the same. Two Types handles are the same if
* they both represent a class or interface and have the same fully qualified name,
* or if they both represent the same primitive type,
@@ -97,7 +43,7 @@ public interface IType extends IMember {
* This is a handle-only method; the specified constructor may
* or may not actually be present in the class or interface.
*
- * @see IConstructor
+ * @see IConstructor
*/
IConstructor getConstructorHandle(IType[] parameterTypes);
/**
@@ -209,8 +155,8 @@ public interface IType extends IMember {
* If this does not represent a class or interface, it returns
* a String of length 0.
*
- * @return the declared name of the class or interface
- * represented by this object.
+ * @return the declared name of the class or interface
+ * represented by this object.
* @exception NotPresentException if this class or interface is not present.
*/
String getDeclaredName() throws NotPresentException;
@@ -255,7 +201,7 @@ public interface IType extends IMember {
* Returns an array of length 0 if this object does not represent
* an interface.
* The resulting Types are in no particular order.
- * See <em>The Java Language Specification</em> section 8.1.4
+ * See <em>The Java Language Specification</em> section 8.1.4
* for more details.
*
* @param imageContext the ImageContext in which to restrict the search.
@@ -282,10 +228,10 @@ public interface IType extends IMember {
* object represents neither a class nor an interface, this method
* returns an array of length 0.
*
- * See <em>The Java Language Specification</em> sections 8.1.4 and 9.1.3
+ * See <em>The Java Language Specification</em> sections 8.1.4 and 9.1.3
* for more details.
*
- * @return an array of interfaces implemented by this class.
+ * @return an array of interfaces implemented by this class.
* @exception NotPresentException if this class or interface is not present.
*/
IType[] getInterfaces() throws NotPresentException;
@@ -300,7 +246,7 @@ public interface IType extends IMember {
* This is a handle-only method; the specified method may
* or may not actually be present in the class or interface.
*
- * @see IMethod
+ * @see IMethod
*/
IMethod getMethodHandle(String name, IType[] parameterTypes);
/**
@@ -335,7 +281,7 @@ public interface IType extends IMember {
* For primitive types, the name is the keyword for the primitive type.
* This is a handle-only method.
*
- * @return the fully qualified name of the type represented by this object.
+ * @return the fully qualified name of the type represented by this object.
*/
String getName();
/**
@@ -353,7 +299,7 @@ public interface IType extends IMember {
* For primitive types, this is the keyword for the primitive type.
* This is a handle-only method.
*
- * @return the simple name of the type represented by this object.
+ * @return the simple name of the type represented by this object.
*/
String getSimpleName();
/**
@@ -373,7 +319,7 @@ public interface IType extends IMember {
* Returns an array of length 0 if this object does not represent
* a class.
* The resulting Types are in no particular order.
- * See <em>The Java Language Specification</em> sections 8.1.3 and 20.3.4
+ * See <em>The Java Language Specification</em> sections 8.1.3 and 20.3.4
* for more details.
*
* @param imageContext the ImageContext in which to restrict the search.
@@ -387,7 +333,7 @@ public interface IType extends IMember {
* Returns an array of length 0 if this object does not represent
* an interface.
* The resulting Types are in no particular order.
- * See <em>The Java Language Specification</em> section 9.1.3
+ * See <em>The Java Language Specification</em> section 9.1.3
* for more details.
*
* @param imageContext the ImageContext in which to restrict the search.
@@ -405,10 +351,10 @@ public interface IType extends IMember {
* If this object represents an array type, then the Type that represents
* class <code>java.lang.Object</code> is returned.
* <p>
- * See <em>The Java Language Specification</em> sections 8.1.3 and 20.3.4
+ * See <em>The Java Language Specification</em> sections 8.1.3 and 20.3.4
* for more details.
*
- * @return the superclass of the class represented by this object.
+ * @return the superclass of the class represented by this object.
* @exception NotPresentException if this type is not present.
*/
IType getSuperclass() throws NotPresentException;
@@ -440,8 +386,8 @@ public interface IType extends IMember {
* A binary type is one which is in .class file format in the workspace.
* Returns <code>false</code> if this represents a primitive type or an array type.
*
- * @return <code>true</code> if this object represents a binary class or interface;
- * <code>false</code> otherwise.
+ * @return <code>true</code> if this object represents a binary class or interface;
+ * <code>false</code> otherwise.
* @exception NotPresentException if this type is not present.
*/
boolean isBinary() throws NotPresentException;
@@ -450,8 +396,8 @@ public interface IType extends IMember {
* This returns false if this object represents an interface,
* an array type, or a primitive type.
*
- * @return <code>true</code> if this object represents a class;
- * <code>false</code> otherwise.
+ * @return <code>true</code> if this object represents a class;
+ * <code>false</code> otherwise.
* @exception NotPresentException if this type is not present.
*
* @see #isArray
@@ -466,8 +412,8 @@ public interface IType extends IMember {
* its doc comment.
* Returns <code>false</code> if this represents a primitive type or an array type.
*
- * @return <code>true</code> if this object represents a deprecated member;
- * <code>false</code> otherwise.
+ * @return <code>true</code> if this object represents a deprecated member;
+ * <code>false</code> otherwise.
* @exception NotPresentException if this type is not present.
*/
boolean isDeprecated() throws NotPresentException;
@@ -475,8 +421,8 @@ public interface IType extends IMember {
* Returns true if this object represents an inner class or interface,
* false otherwise.
* An inner class is one which can only be created in the context of
- * an instance of its outer class. This does not include package member
- * classes or other top-level classes. Such a class cannot be static.
+ * an instance of its outer class. This does not include package member
+ * classes or other top-level classes. Such a class cannot be static.
* <p>
* See the <em>Java Inner Classes Specification</em> for more details.
*
@@ -490,8 +436,8 @@ public interface IType extends IMember {
* This returns false if this object represents a class,
* an array type, or a primitive type.
*
- * @return <code>true</code> if this object represents an interface;
- * <code>false</code> otherwise.
+ * @return <code>true</code> if this object represents an interface;
+ * <code>false</code> otherwise.
* @exception NotPresentException if this type is not present.
*
* @see #isArray
@@ -608,7 +554,7 @@ public interface IType extends IMember {
* If this represents an array type, the string representation is
* that of its component type followed by <code>"[]"</code>.
*
- * @return a string representation of this class object.
+ * @return a string representation of this class object.
* @see IHandle#toString
*/
String toString();
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/InvalidKeyException.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/InvalidKeyException.java
index 4028f02bd5..e633ea9d5d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/InvalidKeyException.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/InvalidKeyException.java
@@ -1,23 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * Thrown when a DeltaKey is invalid.
- *
- * This exception is indicative of design flaws in the code.
- * The offending code has constructed a key which could not possibly
- * appear in a Delta.
- * This is an unchecked exception (a subclass of RuntimeException)
- * so that client code does not have to worry about catching this exception,
- * which should never be thrown (or caught) in properly written code.
- *
- * @see DeltaKey
- * @see IDelta#follow
- */
public class InvalidKeyException extends RuntimeException {
/**
* Constructs an <code>InvalidKeyException</code> without a detail message.
@@ -28,7 +10,7 @@ public class InvalidKeyException extends RuntimeException {
/**
* Constructs an <code>InvalidKeyException</code> with a detail message.
*
- * @param s the detail message.
+ * @param s the detail message.
*/
public InvalidKeyException(String s) {
super(s);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NotPresentException.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NotPresentException.java
index 8547df487f..270104a3f9 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NotPresentException.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/NotPresentException.java
@@ -1,26 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * Thrown when a method is invoked on a handle whose object
- * is not present. See <code>IHandle</code> for more details.
- *
- * This is an unchecked exception (a subclass of RuntimeException)
- * because most of the time, code can ignore it if it is known to be
- * navigating a state (see <code>IHandle</code> for more details).
- * In some situations however, such as creating handles, the user
- * would have to either
- * <ol>
- * <li>catch the exception, or</li>
- * <li>test with <code>isPresent()</code> before performing the operation.</li>
- * </ol>
- *
- * @see IHandle
- */
public class NotPresentException extends RuntimeException
{
@@ -34,7 +13,7 @@ public class NotPresentException extends RuntimeException
/**
* Constructs a <code>NotPresentException</code> with a detail message.
*
- * @param s the detail message.
+ * @param s the detail message.
*/
public NotPresentException(String s) {
super(s);
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/SearchProgressEvent.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/SearchProgressEvent.java
index 1cad2fba1b..7e36a1aff5 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/SearchProgressEvent.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/SearchProgressEvent.java
@@ -1,17 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The listener event which is sent to all <code>ISearchListener</code>s
- * when an <code>ISearch</code> has progress to report.
- *
- * @see ISearch
- * @see ISearchListener
- */
public class SearchProgressEvent extends java.util.EventObject {
String name;
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/SearchResultEvent.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/SearchResultEvent.java
index 37c2e864c4..1e36d7cfd6 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/SearchResultEvent.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/SearchResultEvent.java
@@ -1,17 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The listener event which is sent to all <code>ISearchListener</code>s
- * when an <code>ISearch</code> has a result to report.
- *
- * @see ISearch
- * @see ISearchListener
- */
public class SearchResultEvent extends java.util.EventObject {
IHandle result;
int[] fMatchingPositions;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/StateSpecificException.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/StateSpecificException.java
index 972165afa6..c8d38bf711 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/StateSpecificException.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/StateSpecificException.java
@@ -1,25 +1,5 @@
package org.eclipse.jdt.internal.core.builder;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * Thrown when an operation is performed on a state-specific handle
- * when it should be non-state-specific, or vice-versa.
- * See <code>IHandle</code> for more details.
- *
- * This exception is indicative of design flaws in the code.
- * The offending code is confused as to whether it is on the state-specific
- * vs. non-state-specific side of the fence.
- * This is an unchecked exception (a subclass of RuntimeException)
- * so that client code does not have to worry about catching this exception,
- * which should never be thrown (or caught) in properly written code.
- *
- * @see IHandle
- * @see IState
- */
public class StateSpecificException extends RuntimeException
{
@@ -33,7 +13,7 @@ public class StateSpecificException extends RuntimeException
/**
* Constructs a <code>StateSpecificException</code> with a detail message.
*
- * @param s the detail message.
+ * @param s the detail message.
*/
public StateSpecificException(String s) {
super(s);
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 3440f6455c..e234733d98 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
@@ -5,7 +5,6 @@ package org.eclipse.jdt.internal.core.builder.impl;
* All Rights Reserved.
*/
import org.eclipse.jdt.internal.core.builder.*;
-import org.eclipse.jdt.internal.core.Util;
public abstract class AbstractMemberHandle extends NonStateSpecificHandleImpl implements IMember{
/**
@@ -24,7 +23,7 @@ public abstract class AbstractMemberHandle extends NonStateSpecificHandleImpl im
String computeSignature(String name, IType[] parameterTypes) {
if (parameterTypes.length == 0) {
- return name + "()"/*nonNLS*/;
+ return name + "()";
}
StringBuffer sb = new StringBuffer(name);
@@ -33,7 +32,7 @@ public abstract class AbstractMemberHandle extends NonStateSpecificHandleImpl im
try {
((TypeImpl)parameterTypes[i]).appendSignature(sb, true);
} catch (ClassCastException e) {
- throw new StateSpecificException("Incompatible parameter types"/*nonNLS*/);
+ throw new StateSpecificException("incompatible parameter types");
}
}
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 b6c4016445..1d390796ce 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("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();
+ return new StringBuffer("AbstractMethodCollaboratorIndictment(").append(fName).append(")").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 bb54ba75d5..20ecafa7eb 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
@@ -5,11 +5,12 @@ package org.eclipse.jdt.internal.core.builder.impl;
* All Rights Reserved.
*/
import org.eclipse.jdt.internal.core.Assert;
-import org.eclipse.jdt.internal.core.Util;
import org.eclipse.jdt.internal.core.builder.IType;
import org.eclipse.jdt.internal.core.util.Dumper;
import org.eclipse.jdt.internal.core.util.IDumpable;
+import java.util.*;
+
/**
* A node in the image builder dependency graph.
* @see IDependencyGraph
@@ -119,7 +120,7 @@ try {
/* add the dependent */
fDependents[min] = nodeThatDependsOnMe;
} catch (ArrayIndexOutOfBoundsException e) {
- System.out.println("ArrayIndexOutOfBoundsException in AbstractNode.copyAddDependent()"/*nonNLS*/);
+ System.out.println("ArrayIndexOutOfBoundsException in AbstractNode.copyAddDependent()");
}
}
/**
@@ -148,28 +149,28 @@ try {
* For debugging only.
*/
public void dump(Dumper dumper) {
- dumper.dump("element"/*nonNLS*/, getElement());
+ dumper.dump("element", getElement());
if (getKind() == JCU_NODE)
- dumper.dump("types"/*nonNLS*/, getTypes());
+ dumper.dump("types", getTypes());
Object[] dependencies = new Object[fDependencies.length];
for (int i = 0; i < fDependencies.length; ++i) {
dependencies[i] = fDependencies[i].getElement();
}
- dumper.dump("dependencies"/*nonNLS*/, dependencies);
+ dumper.dump("dependencies", dependencies);
Object[] dependents = new Object[fNumDependents];
for (int i = 0; i < fDependents.length; ++i) {
dependents[i] = fDependents[i].getElement();
}
- dumper.dump("dependents"/*nonNLS*/, dependents);
+ dumper.dump("dependents", 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"/*nonNLS*/);
+ Assert.isTrue(false, "Equality not defined for dependency graph nodes");
return false;
}
/**
@@ -239,8 +240,10 @@ public void dump(Dumper dumper) {
/**
* Returns the types that belong to this node
*/
- public abstract IType[] getTypes();
-
+ public IType[] getTypes() {
+ Assert.isTrue(false, "My subclass should have implemented this");
+ return null;
+ }
/**
* Invalidates the order number, for this node and all dependents.
*/
@@ -338,7 +341,7 @@ public void dump(Dumper dumper) {
for (int i = 0; i < recursionLevel; ++i)
sb.append(' ');
sb.append(this);
- sb.append(": "/*nonNLS*/);
+ sb.append(": ");
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 ac15d5b35f..48e86e7cde 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 += "[]"/*nonNLS*/;
+ name += "[]";
return name;
}
/**
@@ -111,7 +111,7 @@ int getNestingDepth() {
public String getSimpleName() {
String simpleName = fElementType.getSimpleName();
for (int i = 0; i < fNestingDepth; i++)
- simpleName += "[]"/*nonNLS*/;
+ simpleName += "[]";
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 453d8b1799..fb3ba82580 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
@@ -4,16 +4,11 @@ package org.eclipse.jdt.internal.core.builder.impl;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import java.util.Vector;
-
-import org.eclipse.jdt.internal.compiler.ConfigurableOption;
-import org.eclipse.jdt.internal.compiler.ICompilerRequestor;
import org.eclipse.jdt.internal.core.Assert;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.builder.IDelta;
-import org.eclipse.jdt.internal.core.builder.IImageBuilder;
-import org.eclipse.jdt.internal.core.builder.IImageContext;
-import org.eclipse.jdt.internal.core.builder.IPackage;
+import org.eclipse.jdt.internal.compiler.*;
+import org.eclipse.jdt.internal.core.builder.*;
+
+import java.util.*;
/**
* The batch image builder - builds a state from scratch.
@@ -54,15 +49,15 @@ public void build() {
fNotifier.begin();
try {
fNewState.readClassPath();
- fNotifier.subTask(Util.bind("build.scrubbingOutput"/*nonNLS*/));
+ fNotifier.subTask("Scrubbing output folder");
fNewState.getBinaryOutput().scrubOutput();
fNotifier.updateProgressDelta(0.05f);
- fNotifier.subTask(Util.bind("build.analyzingPackages"/*nonNLS*/));
+ fNotifier.subTask("Analyzing packages");
fNewState.buildInitialPackageMap();
fNotifier.updateProgressDelta(0.05f);
/* Force build all in build context */
- fNotifier.subTask(Util.bind("build.analyzingSources"/*nonNLS*/));
+ fNotifier.subTask("Analyzing sources");
IPackage[] pkgs = fNewState.getPackageMap().getAllPackagesAsArray();
for (int i = 0; i < pkgs.length; ++i) {
fNotifier.checkCancel();
@@ -105,13 +100,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"/*nonNLS*/);
+ Assert.isTrue(false, "Lazy building has been disabled.");
}
/**
* Returns a string describe the builder
* @see IImageBuilder
*/
public String toString() {
- return "batch image builder for:\n\tnew state: "/*nonNLS*/ + getNewState();
+ return "batch image builder for:\n\tnew state: " + 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 fb4f4c9251..43b6779b04 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
@@ -7,7 +7,6 @@ package org.eclipse.jdt.internal.core.builder.impl;
import org.eclipse.core.runtime.*;
import org.eclipse.jdt.internal.core.builder.*;
-import org.eclipse.jdt.internal.core.Util;
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
import java.text.NumberFormat;
@@ -46,10 +45,10 @@ public BuildNotifier(JavaDevelopmentContextImpl dc, boolean isBatch) {
}
public void begin() {
if (fBuildMonitor != null) {
- fBuildMonitor.beginBuild(fIsBatch ? Util.bind("build.beginBatch"/*nonNLS*/) : Util.bind("build.beginIncremental"/*nonNLS*/));
+ fBuildMonitor.beginBuild(fIsBatch ? "Begin batch build" : "Begin incremental build");
}
if (fProgress != null) {
- fProgress.beginTask(""/*nonNLS*/, fTotalWork);
+ fProgress.beginTask("", fTotalWork);
}
this.previousSubtask = null;
}
@@ -90,9 +89,9 @@ public void compiling(CompilerCompilationUnit unit) {
int start = message.indexOf('/', 1);
int end = message.lastIndexOf('/');
if (end <= start){
- message = Util.bind("build.compiling"/*nonNLS*/, message.substring(start+1));
+ message = "Compiling " + message.substring(start+1);
} else {
- message = Util.bind("build.compilingContent"/*nonNLS*/, message.substring(start+1, end));
+ message = "Compiling content of " + message.substring(start+1, end);
}
subTask(message);
updateProgressDelta(fProgressPerCompilationUnit/2);
@@ -100,12 +99,12 @@ public void compiling(CompilerCompilationUnit unit) {
}
public void done() {
updateProgress(1.0f);
- subTask(Util.bind("build.done"/*nonNLS*/));
+ subTask("Build done");
if (fProgress != null) {
fProgress.done();
}
if (fBuildMonitor != null) {
- fBuildMonitor.endBuild(fIsBatch ? Util.bind("build.endBatch"/*nonNLS*/) : Util.bind("build.endIncremental"/*nonNLS*/));
+ fBuildMonitor.endBuild(fIsBatch ? "->End batch build" : "->End incremental build");
}
this.previousSubtask = null;
}
@@ -154,16 +153,15 @@ protected String problemsMessage() {
int numNew = fNewErrorCount + fNewWarningCount;
int numFixed = fFixedErrorCount + fFixedWarningCount;
if (numNew == 0 && numFixed == 0) {
- return ""/*nonNLS*/;
+ return "";
}
if (numFixed == 0) {
- return '(' + numNew == 1 ? Util.bind("build.oneProblemFound"/*nonNLS*/, String.valueOf(numNew)) : Util.bind("build.problemsFound"/*nonNLS*/, String.valueOf(numNew)) +')';
+ return "(" + numNew + " " + (numNew == 1 ? "problem" : "problems") + " found)";
} else
if (numNew == 0) {
- return '(' + numFixed == 1 ? Util.bind("build.oneProblemFixed"/*nonNLS*/, String.valueOf(numFixed)) : Util.bind("build.problemsFixed"/*nonNLS*/, String.valueOf(numFixed)) + ')';
+ return "(" + numFixed + " " + (numFixed == 1 ? "problem" : "problems") + " fixed)";
} else {
- 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))) + ')';
+ return "(" + numFixed + " " + (numFixed == 1 ? "problem" : "problems") + " fixed, " + numNew + " " + (numNew == 1 ? "problem" : "problems") + " found)";
}
}
/**
@@ -183,7 +181,7 @@ public void setProgressPerCompilationUnit(float progress) {
}
public void subTask(String message) {
String pm = problemsMessage();
- String msg = pm.length() == 0 ? message : pm + " "/*nonNLS*/ + message;
+ String msg = pm.length() == 0 ? message : pm + " " + 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 6f5d52fc72..180016d0fa 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 ""/*nonNLS*/;
+ return "";
}
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 37a55091c4..daa0395ee0 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("/*nonNLS*/).append(getFileName()).append(")"/*nonNLS*/).toString();
+ return new StringBuffer("CompilationUnit(").append(getFileName()).append(")").toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConsoleProgressMonitor.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConsoleProgressMonitor.java
new file mode 100644
index 0000000000..6075165532
--- /dev/null
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/builder/impl/ConsoleProgressMonitor.java
@@ -0,0 +1,78 @@
+package org.eclipse.jdt.internal.core.builder.impl;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * This progress monitor is used as the default progress monitor in cases
+ * where none has been set. It is used mainly for test cases. The monitor
+ * simply echoes updates to the console (System.out).
+ */
+class ConsoleProgressMonitor implements IProgressMonitor {
+ protected int fTotalWork;
+ protected int fWorkDone;
+ /**
+ * beginTask method comment.
+ */
+ public void beginTask(String name, int totalWork) {
+ System.out.println(name + ", total work: " + totalWork);
+ fTotalWork = totalWork;
+ fWorkDone = 0;
+ }
+ /**
+ * done method comment.
+ */
+ public void done() {
+ System.out.println("Task Done");
+ fTotalWork = 0;
+ fWorkDone = 0;
+ }
+public void internalWorked(double work) {
+ fWorkDone += work;
+ double percent = (double)fWorkDone / (double)fTotalWork;
+ percent *= 100;
+ System.out.println("\t" + percent + "% work done");
+ }
+ /**
+ * isCanceled method comment.
+ */
+ public boolean isCanceled() {
+ return false;
+ }
+ /**
+ * setCanceled method comment.
+ */
+ public void setCanceled(boolean b) {
+ }
+ /**
+ * setTaskName method comment.
+ */
+ public void setTaskName(String name) {
+ System.out.println("\t" + name);
+ }
+ /**
+ * subTask method comment.
+ */
+ public void subTask(String name) {
+ System.out.println("\t" + name);
+ }
+ /**
+ * Returns a String that represents the value of this object.
+ * @return a string representation of the receiver
+ */
+ public String toString() {
+ return "Default ImageBuilder Progress Monitor";
+ }
+ /**
+ * worked method comment.
+ */
+ public void worked(int work) {
+ fWorkDone += work;
+ double percent = (double)fWorkDone / (double)fTotalWork;
+ percent *= 100;
+ System.out.println("\t" + percent + "% work done");
+ }
+}
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 260240acea..22f27bd519 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(""/*nonNLS*/, paramTypes);
+ fSignature = computeSignature("", 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 d023e60cd2..ae8714cb20 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 ? ""/*nonNLS*/ : "*"/*nonNLS*/) + "ConvertedCompilationResult("/*nonNLS*/ + fPackageElement + ")"/*nonNLS*/;
+ return (fProblems.length == 0 ? "" : "*") + "ConvertedCompilationResult(" + fPackageElement + ")";
}
}
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 5407ba1f24..dbf9941335 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"/*nonNLS*/;
+ public static final String fgImage = "Image";
- 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 fgPackageCategory = "Packages";
+ public static final String fgTypeCategory = "Types";
+ public static final String fgBinaryCategory = "Binaries";
+ public static final String fgMethodCategory = "Methods";
- 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*/;
+ public static final String fgPackage = "Package";
+ public static final String fgType = "Type";
+ public static final String fgBinary = "Binary";
+ public static final String fgMethod = "Method";
/* 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"/*nonNLS*/);
+ Assert.isTrue(false, "Invalid states");
}
fStatus = CHANGED;
fName = fgImage;
@@ -131,17 +131,16 @@ class DeltaImpl implements IDelta {
* Returns the child of this delta with the given object
*/
protected IDelta at(Object o) {
- if (fChildren != null){
- for (int i = 0; i < fChildren.length; i++) {
- if (o instanceof String) {
- if (o.equals(fChildren[i].getName())) {
- return fChildren[i];
- }
+ Assert.isNotNull(fChildren, "navigating off a leaf delta!");
+ for (int i = 0; i < fChildren.length; i++) {
+ if (o instanceof String) {
+ if (o.equals(fChildren[i].getName())) {
+ return fChildren[i];
}
- else {
- if (o.equals(fChildren[i].getObject())) {
- return fChildren[i];
- }
+ }
+ else {
+ if (o.equals(fChildren[i].getObject())) {
+ return fChildren[i];
}
}
}
@@ -200,7 +199,7 @@ protected int compareBuilderType(BuilderType type) {
*/
public int compareTo(IDelta anotherDelta) {
/* is this used? */
- Assert.isTrue(false, "TBD"/*nonNLS*/);
+ Assert.isTrue(false, "TBD");
return 0;
}
/**
@@ -396,6 +395,8 @@ protected int compareTypes(IType handle) {
for (Enumeration e = toRemove.elements(); e.hasMoreElements();) {
pkgs.removeElement(e.nextElement());
}
+
+ Assert.isTrue(vInfo.size() == pkgs.size(), "sanity check");
/* convert info vector to array */
PackageInfo[] infos = new PackageInfo[vInfo.size()];
@@ -606,7 +607,7 @@ protected int compareTypes(IType handle) {
}
protected static void dump(IDelta delta, int depth) {
for (int i = 0; i < depth; ++i)
- System.out.print(" "/*nonNLS*/);
+ System.out.print(" ");
System.out.println(delta);
IDelta[] children = delta.getAffectedSubdeltas();
for (int i = 0; i < children.length; ++i) {
@@ -893,23 +894,23 @@ public Enumeration getAffectedPackages() {
* @return java.lang.String
*/
public String toString() {
- StringBuffer sb = new StringBuffer("DeltaImpl("/*nonNLS*/);
+ StringBuffer sb = new StringBuffer("DeltaImpl(");
switch (fStatus) {
- case ADDED: sb.append("+"/*nonNLS*/);
+ case ADDED: sb.append("+");
break;
- case REMOVED: sb.append("-"/*nonNLS*/);
+ case REMOVED: sb.append("-");
break;
- case CHANGED: sb.append("*"/*nonNLS*/);
+ case CHANGED: sb.append("*");
break;
- case SAME: sb.append("="/*nonNLS*/);
+ case SAME: sb.append("=");
break;
- case UNKNOWN: sb.append("?"/*nonNLS*/);
+ case UNKNOWN: sb.append("?");
break;
- default: sb.append("(ERROR)"/*nonNLS*/);
+ default: sb.append("(ERROR)");
}
if (fKey.isRoot()) {
sb.append(fOldState);
- sb.append("-->"/*nonNLS*/);
+ sb.append("-->");
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 feeaac13a6..c23580edd2 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
@@ -9,7 +9,6 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.internal.core.Assert;
import org.eclipse.jdt.internal.core.builder.*;
import org.eclipse.jdt.internal.core.util.*;
-import org.eclipse.jdt.internal.core.Util;
import java.util.*;
@@ -106,7 +105,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()"/*nonNLS*/);
+ Assert.isTrue(false, "Unexpected clone exception in DependencyGraph.clone()");
return null;
}
}
@@ -186,7 +185,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"/*nonNLS*/);
+ Assert.isTrue(false, "Attempt to delete unknown node type from dependency graph");
}
return (INode)value;
}
@@ -194,7 +193,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"/*nonNLS*/, ""/*nonNLS*/);
+ dumper.dumpMessage("Namespaces", "");
dumper.indent();
for (Enumeration e = fNamespaces.elements(); e.hasMoreElements();) {
AbstractNode node = (AbstractNode) e.nextElement();
@@ -202,7 +201,7 @@ public void dump(Dumper dumper) {
}
dumper.outdent();
- dumper.dumpMessage("JCUs"/*nonNLS*/, ""/*nonNLS*/);
+ dumper.dumpMessage("JCUs", "");
dumper.indent();
for (Enumeration e = fCompilationUnits.elements(); e.hasMoreElements();) {
AbstractNode node = (AbstractNode) e.nextElement();
@@ -210,7 +209,7 @@ public void dump(Dumper dumper) {
}
dumper.outdent();
- dumper.dumpMessage("ZIPs"/*nonNLS*/, ""/*nonNLS*/);
+ dumper.dumpMessage("ZIPs", "");
dumper.indent();
for (Enumeration e = fZips.elements(); e.hasMoreElements();) {
AbstractNode node = (AbstractNode) e.nextElement();
@@ -312,7 +311,7 @@ public Enumeration getJCUNodes() {
return getNodeFor((IPath)o, create);
}
else {
- Assert.isTrue(false, "Unknown kind of node"/*nonNLS*/);
+ Assert.isTrue(false, "Unknown kind of node.");
return null;
}
}
@@ -477,7 +476,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"/*nonNLS*/;
+ String msg = "Internal Error: the dependency graph is corrupt, do a full build to workaround error.";
for (Enumeration e = table.elements(); e.hasMoreElements();) {
AbstractNode node = (AbstractNode) e.nextElement();
@@ -564,6 +563,6 @@ public void removePackage(IPackage pkg) {
return fNamespaces.size() + fTypes.size() + fCompilationUnits.size();
}
public String toString() {
- return "a DependencyGraph"/*nonNLS*/;
+ return "a DependencyGraph";
}
}
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 9f30f029a4..a83464f250 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
@@ -1,9 +1,4 @@
package org.eclipse.jdt.internal.core.builder.impl;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
class FieldCollaboratorIndictment extends Indictment {
/**
@@ -24,6 +19,6 @@ protected FieldCollaboratorIndictment(char[] name) {
*/
public String toString() {
// don't use + with char[]
- return new StringBuffer("FieldIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();
+ return new StringBuffer("FieldIndictment(").append(fName).append(")").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 c2762ae8c0..7349618dd8 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() + "."/*nonNLS*/ + getName();
+ return getDeclaringClass().getName() + "." + 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 3c67b9ee96..2dcd49ab54 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
@@ -1,14 +1,5 @@
package org.eclipse.jdt.internal.core.builder.impl;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * Exception thrown when there is an internal error in the image builder.
- * May wrapper another exception.
- */
public class ImageBuilderInternalException extends RuntimeException {
protected Throwable fThrowable;
/**
@@ -40,7 +31,7 @@ public Throwable getThrowable() {
public void printStackTrace() {
if (fThrowable != null) {
System.err.println(this);
- System.err.println("Stack trace of embedded throwable:"/*nonNLS*/);
+ System.err.println("Stack trace of embedded throwable:");
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 210df5cc37..99357092a1 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"/*nonNLS*/);
+ StringBuffer buf = new StringBuffer("ImageContext with packages: \n");
for (int i = 0; i < fPackages.length; i++)
- buf.append(" "/*nonNLS*/ + fPackages[i].getName() + "\n"/*nonNLS*/);
+ buf.append(" " + fPackages[i].getName() + "\n");
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 1bf30c241f..8838243750 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"/*nonNLS*/;
+ return "image";
}
/**
* 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 1d35cebf32..8b2329b04d 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"/*nonNLS*/) || extension.equals("class"/*nonNLS*/)) {
+ if (extension.equals("java") || extension.equals("class")) {
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 224ee43ae6..e01d6c8040 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
@@ -23,7 +23,7 @@ import org.eclipse.jdt.internal.core.builder.*;
import org.eclipse.jdt.internal.core.builder.IType;
import org.eclipse.jdt.internal.core.builder.NotPresentException;
import org.eclipse.jdt.internal.core.lookup.ReferenceInfo;
-import org.eclipse.jdt.internal.core.Util;
+
import org.eclipse.jdt.internal.compiler.util.*;
import org.eclipse.jdt.internal.core.*;
@@ -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"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/)) {
+ if (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class")) {
SourceEntry entry = new SourceEntry(path, null, null);
PackageElement element = new PackageElement(pkg, entry);
pkgTable.put(entry.getFileName(), element);
@@ -198,7 +198,7 @@ protected void addSourceElement(SourceEntry newEntry) {
public void applySourceDelta(Hashtable deltas) {
fNotifier = new BuildNotifier(fDC, false);
fNotifier.begin();
- fNotifier.subTask(Util.bind("build.preparingBuild"/*nonNLS*/));
+ fNotifier.subTask("Preparing for build");
fSourceDeltas = deltas;
fNewState = fOldState.copy(fNewProject, fImageContext);
@@ -208,7 +208,7 @@ public void applySourceDelta(Hashtable deltas) {
try {
/* find out what has changed at the package level */
- fNotifier.subTask(Util.bind("build.analyzingPackages"/*nonNLS*/));
+ fNotifier.subTask("Analyzing packages");
computeAllPackages();
checkCancel();
@@ -236,7 +236,7 @@ public void applySourceDelta(Hashtable deltas) {
}
/* find out what has changed at the package element level */
- fNotifier.subTask(Util.bind("build.analyzingSources"/*nonNLS*/));
+ fNotifier.subTask("Analyzing sources");
computeAllClasses();
checkCancel();
@@ -582,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"/*nonNLS*/)
- || extension.equalsIgnoreCase("jar"/*nonNLS*/)) {
+ || extension.equalsIgnoreCase("zip")
+ || extension.equalsIgnoreCase("jar")) {
// TBD: Currently rely on empty extension indicating folder
computeAllPackages(children[i], oldRoots, newRoots);
}
@@ -628,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"/*nonNLS*/, PackageImpl.readableName(pkg)));
+ fNotifier.subTask("Analyzing " + PackageImpl.readableName(pkg));
// Mark all dependents of missing namespace as needing compile.
markDependentsAsNeedingCompile(pkg);
@@ -643,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"/*nonNLS*/, PackageImpl.readableName(pkg)));
+ fNotifier.subTask("Analyzing " + PackageImpl.readableName(pkg));
// Mark all dependents of namespace as needing compile.
markDependentsAsNeedingCompile(pkg);
@@ -658,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"/*nonNLS*/, PackageImpl.readableName(pkg)));
+ fNotifier.subTask("Analyzing " + PackageImpl.readableName(pkg));
computeNamespaceChanges(pkg);
fNotifier.updateProgressDelta(progressDelta);
fNotifier.checkCancel();
@@ -671,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("$"/*nonNLS*/).append(typeName).toString();
+ typeName = new StringBuffer(len).append(parentTypeName).append("$").append(typeName).toString();
}
/* Remove it so that only non-matching ones remain in the table. */
TypeStructureEntry tsEntry = (TypeStructureEntry) oldTSEntries.remove(typeName);
@@ -914,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(" "/*nonNLS*/);
+ sb.append(" ");
}
switch (delta.getKind()) {
case IResourceDelta.ADDED:
@@ -1048,7 +1048,7 @@ protected Dictionary getSourceChanges(IPackage pkgHandle) {
/* skip non-java resources */
String extension = path.getFileExtension();
- if (extension != null && (extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/))) {
+ if (extension != null && (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class"))) {
set.put(path, path);
}
}
@@ -1072,7 +1072,7 @@ protected boolean hasPackageMapChanges() {
IResourceDelta changed = (IResourceDelta) e.nextElement();
String extension = changed.getFullPath().getFileExtension();
if (extension != null) {
- if (extension.equalsIgnoreCase("zip"/*nonNLS*/) || extension.equalsIgnoreCase("jar"/*nonNLS*/)) {
+ if (extension.equalsIgnoreCase("zip") || extension.equalsIgnoreCase("jar")) {
return true;
}
}
@@ -1127,7 +1127,7 @@ protected boolean hasSourceEntryChanges(IPackage pkgHandle) {
/* skip java resources */
String extension = path.getFileExtension();
if (extension != null) {
- if ((extension.equalsIgnoreCase("java"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/))) {
+ if ((extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class"))) {
/* 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) {
@@ -1423,7 +1423,7 @@ protected void sort(PackageElement[] compileArray) {
* @see IImageBuilder
*/
public String toString() {
- return "incremental image builder for:\n"/*nonNLS*/ + "\tnew state: "/*nonNLS*/ + getNewState() + "\n"/*nonNLS*/ + "\told state: "/*nonNLS*/ + getOldState();
+ return "incremental image builder for:\n" + "\tnew state: " + getNewState() + "\n" + "\told state: " + getOldState();
}
/**
* If this type is a subtype is the originator of an abstract method
@@ -1634,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"/*nonNLS*/;
+ String key = '<' + superclass.getDeclaredName() + ">/0";
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 b9040e53ca..09893daf91 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("<"/*nonNLS*/)) {
+ if (i.getName().startsWith("<")) {
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"/*nonNLS*/);
+ Assert.isTrue(false, "Unexpected kind of indictment");
break;
}
}
@@ -161,13 +161,13 @@ public void convictAll() {
*/
public String toString() {
return
- "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*/;
+ "IndictmentSet("
+ + "\n hierarchyChange: " + fHierarchyChange
+ + "\n types:\n" + fTypesTable
+ + "\n interfaces:\n" + fAbstractMethodTable
+ + "\n methods:\n" + fMethodsTable
+ + "\n fields:\n" + fFieldsTable
+ + "\n)";
}
/**
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 192d62644e..56b0d58445 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("/*nonNLS*/ + fUnit.getFileName() + ")"/*nonNLS*/;
+ return "JCUNode(" + fUnit.getFileName() + ")";
}
}
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 43dd321781..1edcf3571c 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"/*nonNLS*/), e));
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, -1, "Java Builder", 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"/*nonNLS*/));
+ if (monitor != null) monitor.subTask("Java build completed");
}
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"/*nonNLS*/, project.getName()));
+ if (monitor != null) monitor.subTask("Reading resource change information for :"+ project.getName());
IResourceDelta delta = getDelta(project);
if (delta == null){
//System.out.println("Missing delta for: "+ project.getName());
- if (monitor != null) monitor.subTask(""/*nonNLS*/);
+ if (monitor != null) monitor.subTask("");
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"/*nonNLS*/, prereqs[i].getName()));
+ if (monitor != null) monitor.subTask("Reading resource change information for :"+ prereqs[i].getName());
delta = getDelta(prereqs[i]);
if (delta == null){
//System.out.println("Missing delta for: "+ prereqs[i].getName());
- if (monitor != null) monitor.subTask(""/*nonNLS*/);
+ if (monitor != null) monitor.subTask("");
return null;
} else {
deltas.put(prereqs[i], delta);
}
}
- if (monitor != null) monitor.subTask(""/*nonNLS*/);
+ if (monitor != null) monitor.subTask("");
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"/*nonNLS*/, getProject().getFullPath().toString()), e));
+ new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, "Project "+ getProject().getFullPath() +" not present", e));
}
}
/**
@@ -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"/*nonNLS*/) || extension.equalsIgnoreCase("class"/*nonNLS*/));
- boolean isArchive = extension != null && (extension.equalsIgnoreCase("zip"/*nonNLS*/) || extension.equalsIgnoreCase("jar"/*nonNLS*/));
+ boolean isJavaOrClassFile = extension != null && (extension.equalsIgnoreCase("java") || extension.equalsIgnoreCase("class"));
+ boolean isArchive = extension != null && (extension.equalsIgnoreCase("zip") || extension.equalsIgnoreCase("jar"));
// 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"/*nonNLS*/, getProject().getFullPath().toString()), e));
+ throw new CoreException(new Status(IStatus.ERROR, JavaCore.PLUGIN_ID, Platform.PLUGIN_ERROR, "Project "+ getProject().getFullPath() +" not present", 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)"/*nonNLS*/;
+ return "JavaBuilder(no built state)";
} else {
- return "JavaBuilder("/*nonNLS*/ + lastBuiltState + ")"/*nonNLS*/;
+ return "JavaBuilder(" + lastBuiltState + ")";
}
}
}
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 3b894eac78..2f4dcc4374 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
@@ -4,35 +4,18 @@ package org.eclipse.jdt.internal.core.builder.impl;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Locale;
-import java.util.Vector;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.internal.core.builder.*;
+import java.io.*;
+import java.util.*;
import org.eclipse.jdt.internal.compiler.Compiler;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.internal.core.util.IProgressListener;
import org.eclipse.jdt.internal.compiler.ConfigurableOption;
import org.eclipse.jdt.internal.compiler.problem.AbortCompilation;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.builder.IBinaryBroker;
-import org.eclipse.jdt.internal.core.builder.IBuildListener;
-import org.eclipse.jdt.internal.core.builder.IBuildMonitor;
-import org.eclipse.jdt.internal.core.builder.IDevelopmentContext;
-import org.eclipse.jdt.internal.core.builder.IImage;
-import org.eclipse.jdt.internal.core.builder.IImageBuilder;
-import org.eclipse.jdt.internal.core.builder.IImageContext;
-import org.eclipse.jdt.internal.core.builder.IPackage;
-import org.eclipse.jdt.internal.core.builder.IProblemReporter;
-import org.eclipse.jdt.internal.core.builder.IState;
-import org.eclipse.jdt.internal.core.builder.IType;
-import org.eclipse.jdt.internal.core.builder.NotPresentException;
-import org.eclipse.jdt.internal.core.util.IProgressListener;
+
+import org.eclipse.core.runtime.IPath;
public class JavaDevelopmentContextImpl implements IDevelopmentContext {
@@ -70,12 +53,12 @@ public class JavaDevelopmentContextImpl implements IDevelopmentContext {
/**
* The default package.
*/
- private final IPackage fDefaultPackage = fImage.getPackageHandle("java.lang"/*nonNLS*/, false);
+ private final IPackage fDefaultPackage = fImage.getPackageHandle("java.lang", false);
/**
* The root class handle
*/
- private final IType fRootClass = fDefaultPackage.getClassHandle("Object"/*nonNLS*/);
+ private final IType fRootClass = fDefaultPackage.getClassHandle("Object");
/**
* Primitive types
@@ -195,7 +178,7 @@ protected Vector getBuildListeners() {
}
public IState getCurrentState() throws NotPresentException {
if (fCurrentState == null) {
- throw new NotPresentException("Internal Error - No current state"/*nonNLS*/);
+ throw new NotPresentException("no current state");
}
return fCurrentState;
}
@@ -303,7 +286,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(";"/*nonNLS*/) + 1;
+ int endIndex = localSig.indexOf(";") + 1;
parmType = classTypeFromName(localSig.substring(position, endIndex));
localSig = localSig.substring(endIndex);
} else {
@@ -356,10 +339,12 @@ public IState restoreState(IProject project, DataInputStream in) throws IOExcept
return new StateSnap().read(this, project, in);
}
catch (RuntimeException e) {
+ System.out.println("RuntimeException restoring state:");
e.printStackTrace();
throw e;
}
catch (Error e) {
+ System.out.println("Error restoring state:");
e.printStackTrace();
throw e;
}
@@ -372,14 +357,17 @@ public void saveState(IState state, DataOutputStream out) throws IOException {
new StateSnap().save((StateImpl) state, out);
}
catch (IOException e) {
+ System.out.println("IOException saving state: ");
e.printStackTrace();
throw e;
}
catch (RuntimeException e) {
+ System.out.println("RuntimeException saving state: ");
e.printStackTrace();
throw e;
}
catch (Error e) {
+ System.out.println("Error saving state:");
e.printStackTrace();
throw e;
}
@@ -429,6 +417,6 @@ public void setCurrentState(IState state) {
fProgressMonitor = monitor;
}
public String toString() {
- return "a JavaDevelopmentContextImpl("/*nonNLS*/ + fCurrentState + ")"/*nonNLS*/;
+ return "a JavaDevelopmentContextImpl(" + fCurrentState + ")";
}
}
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 b98c6abf38..1077ffebf6 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
@@ -128,7 +128,7 @@ protected void markerFromProblemDetail(IResource resource, IProblemDetail proble
if ((sev & ProblemDetailImpl.S_SYNTAX_ERROR) != 0) {
setFlags(marker, ProblemDetailImpl.S_SYNTAX_ERROR);
}
- marker.setAttribute("ID"/*nonNLS*/, new Integer(problem.getID()));
+ marker.setAttribute("ID", new Integer(problem.getID()));
int start = problem.getStartPos();
marker.setAttribute(IMarker.CHAR_START, new Integer(start));
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 4d8740ed2e..38374557e9 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("/*nonNLS*/);
+ StringBuffer buf = new StringBuffer("MethodIndictment(");
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 9f37f904a1..a42e18f76d 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 = "("/*nonNLS*/;
+ String sourceSig = "(";
/* append parameter types to signature */
IType[] parms = getParameterTypes();
for (int i = 0; i < parms.length; i++) {
sourceSig += parms[i].getSimpleName().replace('L', 'Q');
}
- sourceSig += ")"/*nonNLS*/;
+ sourceSig += ")";
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 283589f160..49e92da647 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("/*nonNLS*/);
- return buf.append(fOldTSEntry.getType().getName()).append(')').toString();
+ StringBuffer buf = new StringBuffer("ModifiedBuilderType(");
+ 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 852058220b..b05e970808 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
@@ -6,7 +6,6 @@ package org.eclipse.jdt.internal.core.builder.impl;
*/
import org.eclipse.jdt.internal.core.Assert;
import org.eclipse.jdt.internal.core.builder.IPackage;
-import org.eclipse.jdt.internal.core.builder.IType;
/**
*
@@ -19,13 +18,11 @@ public class NamespaceNode extends AbstractNode {
public NamespaceNode (IPackage pkg) {
fPackage = pkg;
}
- public IType[] getTypes(){
- return null;
- }
/**
* Adds a node that this node depends on. Backwards link is added automatically
*/
public void addDependency(INode nodeThatIDependOn) {
+ Assert.isTrue(false, "namespaces cannot have dependencies");
}
/**
* Returns a copy of this node, without copying dependencies. Used
@@ -62,6 +59,6 @@ public class NamespaceNode extends AbstractNode {
* purposes only.
*/
public String toString() {
- return "NamespaceNode("/*nonNLS*/ + fPackage.getName() + ")"/*nonNLS*/;
+ return "NamespaceNode(" + fPackage.getName() + ")";
}
}
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 1b40365c57..04dbed8581 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
@@ -1,13 +1,5 @@
package org.eclipse.jdt.internal.core.builder.impl;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * A type that only exists in the new state (an addition)
- */
public class NewBuilderType extends BuilderType {
/**
* The tsEntry in the new state
@@ -48,6 +40,6 @@ public void setNewTypeStructureEntry(TypeStructureEntry newEntry) {
* For debugging only
*/
public String toString() {
- return "NewBuilderType("/*nonNLS*/ + fNewTSEntry.getType().getName() + ")"/*nonNLS*/;
+ return "NewBuilderType(" + fNewTSEntry.getType().getName() + ")";
}
}
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 2b5be96a65..9d73832fe6 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"/*nonNLS*/);
+ Assert.isTrue(false, "TBD");
return false;
}
public IDevelopmentContext getDevelopmentContext() {
@@ -107,7 +107,7 @@ static IType[] nonStateSpecific(IType[] stateSpecific) {
return result;
}
public String toString() {
- Assert.isTrue(false, "TBD"/*nonNLS*/);
+ Assert.isTrue(false, "TBD");
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 7d947d4935..9f4fac066f 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("/*nonNLS*/ + fOldTSEntry.getType().getName() + ")"/*nonNLS*/;
+ return "OldBuilderType(" + fOldTSEntry.getType().getName() + ")";
}
}
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 a37998d4ef..d2d155b886 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
@@ -1,9 +1,4 @@
package org.eclipse.jdt.internal.core.builder.impl;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
public class OrderedSet {
protected int elementCount;
@@ -26,7 +21,7 @@ public OrderedSet() {
* Constructs a new OrderedSet using the specified capacity
* and the default load factor.
*
- * @param capacity the initial capacity
+ * @param capacity the initial capacity
*/
public OrderedSet (int capacity) {
this(capacity, 0.75f);
@@ -35,7 +30,7 @@ public OrderedSet (int capacity) {
* Constructs a new OrderedSet using the specified capacity
* and load factor.
*
- * @param loadFactor the initial load factor
+ * @param loadFactor the initial load factor
*/
public OrderedSet (int capacity, float loadFactor) {
if (capacity <= 0) throw new IllegalArgumentException();
@@ -67,11 +62,11 @@ private int findIndex (Object object, Object [] array) {
* Answers the object associated with the specified index in
* this OrderedSet.
*
- * @param index the index to use
- * @return the object associated with the specified index
+ * @param index the index to use
+ * @return the object associated with the specified index
* @throws ArrayIndexOutOfBoundsException if the index is out of range
*
- * @see #put
+ * @see #put
*/
public Object get(int index) {
if (index >= elementCount) {
@@ -83,10 +78,10 @@ public Object get(int index) {
* Answers whether the specified object is in
* this OrderedSet.
*
- * @param obj the object, which must not be null
- * @return true if the object is in the set, false otherwise
+ * @param obj the object, which must not be null
+ * @return true if the object is in the set, false otherwise
*
- * @see #put
+ * @see #put
*/
public boolean includes(Object obj) {
if (obj == null) {
@@ -99,11 +94,11 @@ public boolean includes(Object obj) {
* Answers the index associated with the specified object in
* this OrderedSet.
*
- * @param obj the object, which must not be null
- * @return the index associated with the object
+ * @param obj the object, which must not be null
+ * @return the index associated with the object
* @throws IllegalArgumentException if the key is not in the pool
*
- * @see #put
+ * @see #put
*/
public int index(Object obj) {
if (obj == null) {
@@ -122,11 +117,11 @@ public int index(Object obj) {
* But the object is retrievable using get(int index).
* The index must not yet have been assigned.
*
- * @param index the index of the object
- * @param obj the object to add
+ * @param index the index of the object
+ * @param obj the object to add
*
- * @see #get
- * @see java.lang.Object#equals
+ * @see #get
+ * @see java.lang.Object#equals
*/
public void put(int index, Object obj) {
if (obj == null) throw new NullPointerException ();
@@ -146,11 +141,11 @@ public void put(int index, Object obj) {
* Associate the given object with the next index in this OrderedSet.
* If the object is already present, its index is unchanged. The object cannot be null.
*
- * @param obj the object to add
- * @return the index associated with the specified obj
+ * @param obj the object to add
+ * @return the index associated with the specified obj
*
- * @see #index
- * @see java.lang.Object#equals
+ * @see #index
+ * @see java.lang.Object#equals
*/
public int put (Object obj) {
if (obj == null) throw new NullPointerException ();
@@ -197,7 +192,7 @@ protected void rehash () {
/**
* Answers the number of objects in this OrderedSet.
*
- * @return the number of objects in this OrderedSet
+ * @return the number of objects in this OrderedSet
*/
public int size () {
return elementCount;
@@ -205,7 +200,7 @@ public int size () {
/**
* Answers the string representation of this OrderedSet.
*
- * @return the string representation of this OrderedSet
+ * @return the string representation of this OrderedSet
*/
public String toString () {
Object key;
@@ -214,7 +209,7 @@ public String toString () {
for (int i=0; i<elementCount; i++) {
if (i != 0) buffer.append (',');
if (buffer.length() > 1000) {
- buffer.append("..."/*nonNLS*/);
+ buffer.append("...");
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 99c8630ce8..176c8bf757 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
@@ -4,22 +4,14 @@ package org.eclipse.jdt.internal.core.builder.impl;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.builder.IHandle;
-import org.eclipse.jdt.internal.core.builder.IImageContext;
-import org.eclipse.jdt.internal.core.builder.IPackage;
-import org.eclipse.jdt.internal.core.builder.ISourceFragment;
-import org.eclipse.jdt.internal.core.builder.IState;
-import org.eclipse.jdt.internal.core.builder.IType;
-import org.eclipse.jdt.internal.core.builder.NotPresentException;
-import org.eclipse.jdt.internal.core.builder.StateSpecificException;
+import org.eclipse.jdt.internal.core.builder.*;
public class PackageImpl extends NonStateSpecificHandleImpl implements IPackage {
JavaDevelopmentContextImpl fDevelopmentContext;
String fName;
boolean fIsUnnamed;
- public static final String DEFAULT_PACKAGE_PREFIX = "Default-"/*nonNLS*/;
+ public static final String DEFAULT_PACKAGE_PREFIX = "Default-";
/**
* Creates a new package
* @param name of package
@@ -203,9 +195,9 @@ public boolean isUnnamed() {
public static String readableName(IPackage pkg) {
String name = pkg.getName();
if (pkg.isUnnamed()) {
- return Util.bind("build.defaultPackageName"/*nonNLS*/, name.substring(DEFAULT_PACKAGE_PREFIX.length()));
+ return "default package for " + name.substring(DEFAULT_PACKAGE_PREFIX.length());
} else {
- return Util.bind("build.packageName"/*nonNLS*/, name);
+ return "package " + name;
}
}
/**
@@ -213,9 +205,9 @@ public static String readableName(IPackage pkg) {
* only (NON-NLS).
*/
public String toString() {
- String result = "package "/*nonNLS*/;
+ String result = "package ";
if (isUnnamed())
- result += "{unnamed, id="/*nonNLS*/ + getName() + "}"/*nonNLS*/;
+ result += "{unnamed, id=" + getName() + "}";
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 8bf3a153fa..79dc190a12 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
@@ -5,13 +5,10 @@ package org.eclipse.jdt.internal.core.builder.impl;
* All Rights Reserved.
*/
import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.builder.IHandle;
-import org.eclipse.jdt.internal.core.builder.IImageContext;
-import org.eclipse.jdt.internal.core.builder.IPackage;
-import org.eclipse.jdt.internal.core.builder.ISourceFragment;
-import org.eclipse.jdt.internal.core.builder.IType;
-import org.eclipse.jdt.internal.core.builder.NotPresentException;
+
+import org.eclipse.jdt.internal.core.builder.*;
+
+import java.util.*;
public class PackageImplSWH extends StateSpecificHandleImpl implements IPackage {
PackageImpl fHandle;
@@ -146,7 +143,7 @@ public IPackage[] getReferencedPackages() throws NotPresentException {
public IPackage[] getReferencingPackages(IImageContext context)
throws NotPresentException {
if (!isPresent())
- throw new NotPresentException(Util.bind("element.notPresent"/*nonNLS*/));
+ throw new NotPresentException("Not present");
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 8f88cf2b6e..47d23f4e63 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"/*nonNLS*/);
+ sb.append(super.toString() + ":\n");
for (int i = 0; i < pkgs.length; ++i) {
- sb.append(" "/*nonNLS*/ + pkgs[i].getName() + ": "/*nonNLS*/);
+ sb.append(" " + pkgs[i].getName() + ": ");
IPath[] fragments = getFragments(pkgs[i]);
for (int j = 0; j < fragments.length; ++j) {
- if (j != 0) sb.append(", "/*nonNLS*/);
+ if (j != 0) sb.append(", ");
sb.append(fragments[j]);
}
- sb.append("\n"/*nonNLS*/);
+ sb.append("\n");
}
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 6f80669b5e..8c5fdbb0b1 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
@@ -32,6 +32,7 @@ void addFragment(IPath fragment) {
} else {
for (int i = 0; i < fFragments.length; ++i) {
if (fFragments[i].equals(fragment)) {
+ System.out.println("Warning: internal error: attempt to add duplicate package fragment in image builder: " + fragment);
return;
}
}
@@ -73,9 +74,9 @@ void addFragment(IPath fragment) {
* This method is for debugging purposes only.
*/
public String toString() {
- StringBuffer buf = new StringBuffer("PackageMapEntry("/*nonNLS*/);
+ StringBuffer buf = new StringBuffer("PackageMapEntry(");
buf.append(fPkg);
- buf.append(")"/*nonNLS*/);
+ buf.append(")");
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 4a85e78bc8..6959bd807b 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
@@ -4,16 +4,9 @@ package org.eclipse.jdt.internal.core.builder.impl;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Dictionary;
-import java.util.Enumeration;
-import java.util.Vector;
-
import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.internal.core.Util;
import org.eclipse.jdt.internal.core.builder.IPackage;
+import java.util.*;
import org.eclipse.jdt.internal.core.util.LookupTable;
/**
@@ -61,10 +54,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"/*nonNLS*/, path.toString()));
+ throw new Error("Attempt to access packages for non-existent path:" + path);
}
if (pkgs.length != 1) {
- throw new Error(Util.bind("build.ambiguousPackage"/*nonNLS*/, path.toString()));
+ throw new Error("Didn't get exactly one package for " + path);
}
return pkgs[0];
}
@@ -120,23 +113,23 @@ IPackage[] packageHandlesFromPath(IPath path) {
}
Collections.sort(list, StateImpl.getPathComparator());
StringBuffer sb = new StringBuffer();
- sb.append(super.toString() + ":\n"/*nonNLS*/);
+ sb.append(super.toString() + ":\n");
for (int i = 0; i < list.size(); ++i) {
IPath path = (IPath) list.get(i);
- sb.append(" "/*nonNLS*/ + path + ": "/*nonNLS*/);
+ sb.append(" " + path + ": ");
IPackage[] pkgs = packageHandlesFromPath(path);
if (pkgs.length == 1) {
sb.append(pkgs[0].getName());
}
else {
Arrays.sort(pkgs, StateImpl.getPackageComparator());
- sb.append("("/*nonNLS*/ + pkgs.length + " packages)"/*nonNLS*/);
+ sb.append("(" + pkgs.length + " packages)");
for (int j = 0; j < pkgs.length; ++j) {
- sb.append("\n "/*nonNLS*/);
+ sb.append("\n ");
sb.append(pkgs[j].getName());
}
}
- sb.append("\n"/*nonNLS*/);
+ sb.append("\n");
}
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 ecf1893011..d388f182cb 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
@@ -98,6 +98,7 @@ void appendSignature(StringBuffer sb, boolean includeUnnamed) {
sig = 'V';
break;
default :
+ Assert.isTrue(false, "invalid type code");
sig = ' ';
}
sb.append(sig);
@@ -149,24 +150,25 @@ public String getName() {
public String getSimpleName() {
switch (fTypeCode) {
case TC_BOOLEAN :
- return "boolean"/*nonNLS*/;
+ return "boolean";
case TC_BYTE :
- return "byte"/*nonNLS*/;
+ return "byte";
case TC_CHAR :
- return "char"/*nonNLS*/;
+ return "char";
case TC_DOUBLE :
- return "double"/*nonNLS*/;
+ return "double";
case TC_FLOAT :
- return "float"/*nonNLS*/;
+ return "float";
case TC_INT :
- return "int"/*nonNLS*/;
+ return "int";
case TC_LONG :
- return "long"/*nonNLS*/;
+ return "long";
case TC_SHORT :
- return "short"/*nonNLS*/;
+ return "short";
case TC_VOID :
- return "void"/*nonNLS*/;
+ return "void";
default :
+ Assert.isTrue(false, "invalid type code");
}
return null;
}
@@ -219,25 +221,25 @@ public boolean isPrimitive() {
protected static String typeSignature(int typeCode) {
switch (typeCode) {
case TC_VOID :
- return "V"/*nonNLS*/;
+ return "V";
case TC_BOOLEAN :
- return "Z"/*nonNLS*/;
+ return "Z";
case TC_BYTE :
- return "B"/*nonNLS*/;
+ return "B";
case TC_CHAR :
- return "C"/*nonNLS*/;
+ return "C";
case TC_SHORT :
- return "S"/*nonNLS*/;
+ return "S";
case TC_INT :
- return "I"/*nonNLS*/;
+ return "I";
case TC_LONG :
- return "J"/*nonNLS*/;
+ return "J";
case TC_FLOAT :
- return "F"/*nonNLS*/;
+ return "F";
case TC_DOUBLE :
- return "D"/*nonNLS*/;
+ return "D";
default :
- return "unknown"/*nonNLS*/;
+ return "unknown";
}
}
}
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 812c53225b..12d9a9f5b9 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("/*nonNLS*/ + getMessage() + ")"/*nonNLS*/;
+ return "ProblemDetail(" + getMessage() + ")";
}
}
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 87c7237959..3a373ccdbb 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"/*nonNLS*/, locale);
+ fCompilerResources = ResourceBundle.getBundle("org.eclipse.jdt.internal.compiler.problem.Messages", locale); //$NON-NLS-1$
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: "/*nonNLS*/+ id + ". Check compiler resources."/*nonNLS*/;
+ return "Unable to retrieve the error message for problem id: " + id + ". Check compiler resources.";
}
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: "/*nonNLS*/ + (id & ProblemIrritants.IgnoreCategoriesMask) + ". Check compiler resources."/*nonNLS*/;
+ return "Corrupted compiler resources for problem id: " + (id & ProblemIrritants.IgnoreCategoriesMask) + ". Check compiler resources.";
}
} else {
output.append(message.substring(end, length));
@@ -98,7 +98,7 @@ protected void initializeMessageTemplates() {
fMessageTemplates = new String[500];
for (int i = 0; i < fMessageTemplates.length; i++) {
try {
- fMessageTemplates[i] = fCompilerResources.getString(String.valueOf(i));
+ fMessageTemplates[i] = fCompilerResources.getString(String.valueOf(i)); //$NON-NLS-1$
} catch (MissingResourceException e) {
}
}
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 3b7e49c40b..289b47417f 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"/*nonNLS*/);
- buf.append("type problems: "/*nonNLS*/);
+ StringBuffer buf = new StringBuffer("ProblemTable(\n\t");
+ buf.append("type problems: ");
buf.append(fTable);
- buf.append("\n\timage problems: "/*nonNLS*/);
+ buf.append("\n\timage problems: ");
buf.append(fImageProblems);
- buf.append(")"/*nonNLS*/);
+ buf.append(")");
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 2f891aeca5..817ead2866 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
@@ -29,6 +29,10 @@ public class ProjectBinaryOutput extends BinaryOutput {
private IPath outputPath;
private JavaDevelopmentContextImpl dc;
+ public final static String ADDED = "ADDED";
+ public final static String MODIFIED = "MODIFIED";
+ public final static String DELETED = "DELETED";
+
/**
* Creates a new ProjectBinaryOutput for the given project and output path
* in this project.
@@ -103,7 +107,7 @@ private void deleteClassesInContainer(IContainer container) {
IResource resource = (IResource) members[i];
switch (resource.getType()) {
case IResource.FILE :
- if (resource.getName().toLowerCase().endsWith(".class"/*nonNLS*/)) {
+ if (resource.getName().toLowerCase().endsWith(".class")) {
resource.delete(true, null);
}
break;
@@ -175,7 +179,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"/*nonNLS*/);
+ return getOutputPath().append(type.getName().replace('.', '/') + ".class");
}
/**
* 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 628a23699b..6180ae05d3 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
@@ -5,21 +5,12 @@ package org.eclipse.jdt.internal.core.builder.impl;
* All Rights Reserved.
*/
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.IResourceVisitor;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.core.Util;
+import org.eclipse.core.resources.*;
+import org.eclipse.core.runtime.*;
+
+import org.eclipse.jdt.core.*;
+
+import java.util.*;
public class ProjectResourceCopier implements IResourceVisitor {
@@ -65,7 +56,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"/*nonNLS*/));
+ if (notifier != null) notifier.subTask("Copying all resources on the classpath");
}
this.sourceFolders[i].accept(this);
}
@@ -87,7 +78,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"/*nonNLS*/.equals(resource.getFileExtension())){ // ignore source files
+ if (!"java".equals(resource.getFileExtension())){ // ignore source files
IFile currentFile = (IFile) resource;
IPath pathSuffix = resourcePath.removeFirstSegments(sourceFolderPath.segmentCount());
@@ -140,7 +131,7 @@ private boolean deleteResourceCopyFromOutput(IResource resource) {
switch (resource.getType()){
case IResource.FILE :
- if (!"java"/*nonNLS*/.equals(resource.getFileExtension())){ // ignore source files
+ if (!"java".equals(resource.getFileExtension())){ // ignore source files
IFile currentFile = (IFile) resource;
pathSuffix = resourcePath.removeFirstSegments(sourceFolderPath.segmentCount());
@@ -149,6 +140,7 @@ private boolean deleteResourceCopyFromOutput(IResource resource) {
IFile previousFile = this.root.getFile(targetPath);
if (previousFile.exists()) previousFile.delete(true, true, null);
} catch(CoreException e){
+ //throw this.devContext.internalException(e);
}
}
break;
@@ -161,6 +153,7 @@ private boolean deleteResourceCopyFromOutput(IResource resource) {
try {
targetFolder.delete(true, false, null);
} catch(CoreException e){
+ //throw this.devContext.internalException(e);
}
}
break;
@@ -195,7 +188,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"/*nonNLS*/));
+ if (notifier != null) notifier.subTask("Updating resources on the classpath");
}
}
}
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 10bef72e28..f2728f8a56 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"/*nonNLS*/) || extension.toLowerCase().equals("class"/*nonNLS*/))) {
+ if (extension != null && (extension.toLowerCase().equals("java") || extension.toLowerCase().equals("class"))) {
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 48067b1fe7..8d8446a91e 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
@@ -75,6 +75,7 @@ SourceEntry getSourceEntry(IPackage pkg, String fileName) {
Assert.isTrue(!pkg.isStateSpecific());
LookupTable pkgTable = getPackageTable(pkg);
if (pkgTable != null) {
+ Assert.isTrue(fileName.indexOf('.') != -1, "name must have extension");
return (SourceEntry) pkgTable.get(fileName);
}
return null;
@@ -123,6 +124,6 @@ SourceEntry removeSourceEntry(IPackage pkg, String fileName) {
* @return a string representation of the receiver
*/
public String toString() {
- return "SourceElementTable("/*nonNLS*/ + fPackageTable + ")"/*nonNLS*/;
+ return "SourceElementTable(" + fPackageTable + ")";
}
}
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 d42409f719..b90a098504 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 + "/"/*nonNLS*/ + fZipEntryFileName;
+ return fZipEntryPath == null ? fZipEntryFileName : fZipEntryPath + "/" + 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"/*nonNLS*/);
+ return fZipEntryFileName.endsWith(".class");
}
String extension = fPath.getFileExtension();
- return extension != null && extension.equalsIgnoreCase("class"/*nonNLS*/);
+ return extension != null && extension.equalsIgnoreCase("class");
}
/**
* 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"/*nonNLS*/);
+ return fZipEntryFileName.endsWith(".java");
}
String extension = fPath.getFileExtension();
- return extension != null && extension.equalsIgnoreCase("java"/*nonNLS*/);
+ return extension != null && extension.equalsIgnoreCase("java");
}
/**
* 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: "/*nonNLS*/ + this.getZipEntryName();
+ return fZipEntryFileName == null ? fPath.toString() : fPath.toString() + ", entry: " + 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 76a1bf438d..3ed0bf877c 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("/*nonNLS*/ + fPath
- + (fZipEntryName == null ? ""/*nonNLS*/ : " : "/*nonNLS*/ + fZipEntryName) + ")"/*nonNLS*/;
+ "SourceFragmentImpl(" + fPath
+ + (fZipEntryName == null ? "" : " : " + fZipEntryName) + ")";
}
}
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 0dce2cd329..2f8a4148de 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
@@ -4,65 +4,35 @@ package org.eclipse.jdt.internal.core.builder.impl;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.Hashtable;
-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;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
+
+import org.eclipse.core.resources.*;
+
+import org.eclipse.core.resources.*;
+import org.eclipse.jdt.internal.core.builder.*;
+
+import java.io.*;
+import java.util.*;
+import java.util.zip.*;
+
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.compiler.env.*;
import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.internal.compiler.*;
+import org.eclipse.jdt.core.IClassFile;
+
+import org.eclipse.jdt.internal.core.util.*;
+import org.eclipse.jdt.internal.compiler.classfmt.*;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.core.runtime.*;
+import org.eclipse.jdt.internal.compiler.util.*;
+import org.eclipse.jdt.internal.core.lookup.*;
+import org.eclipse.jdt.internal.core.*;
import org.eclipse.jdt.internal.compiler.ClassFile;
-import org.eclipse.jdt.internal.compiler.CompilationResult;
-import org.eclipse.jdt.internal.compiler.ConfigurableOption;
-import org.eclipse.jdt.internal.compiler.IProblem;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader;
-import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException;
-import org.eclipse.jdt.internal.compiler.env.IBinaryType;
-import org.eclipse.jdt.internal.core.CompilationUnit;
-import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.core.JavaProject;
-import org.eclipse.jdt.internal.core.PackageFragment;
-import org.eclipse.jdt.internal.core.PackageFragmentRoot;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.builder.BinaryBrokerKey;
-import org.eclipse.jdt.internal.core.builder.IDelta;
-import org.eclipse.jdt.internal.core.builder.IDependencyGraph;
-import org.eclipse.jdt.internal.core.builder.IDevelopmentContext;
-import org.eclipse.jdt.internal.core.builder.IImage;
-import org.eclipse.jdt.internal.core.builder.IImageBuilder;
-import org.eclipse.jdt.internal.core.builder.IImageContext;
-import org.eclipse.jdt.internal.core.builder.IPackage;
-import org.eclipse.jdt.internal.core.builder.IProblemDetail;
-import org.eclipse.jdt.internal.core.builder.IProblemReporter;
-import org.eclipse.jdt.internal.core.builder.IReportCard;
-import org.eclipse.jdt.internal.core.builder.IState;
-import org.eclipse.jdt.internal.core.builder.IType;
-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.
@@ -198,7 +168,7 @@ public class StateImpl implements IState {
/**
* Name for namespace node representing unknown dependencies.
*/
- private static final String UNKNOWN_DEPENDENCIES= "$UNKNOWN_DEPENDENCIES$"/*nonNLS*/;
+ private static final String UNKNOWN_DEPENDENCIES= "$UNKNOWN_DEPENDENCIES$";
/**
* Random number generator, used for generating fingerprints.
@@ -425,7 +395,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"/*nonNLS*/, className);
+ String msg= "Error parsing binary for " + className;
ProblemDetailImpl problem= new ProblemDetailImpl(msg, sEntry);
vProblems.addElement(problem);
// skip it
@@ -444,7 +414,7 @@ public class StateImpl implements IState {
if (!typePkg.isUnnamed()) {
path= path.append(typePkg.getName().replace('.', IPath.SEPARATOR));
}
- String msg= Util.bind("build.packageMismatch"/*nonNLS*/, path.toString());
+ String msg= "Package declaration does not match folder. Expected folder is " + path + ".";
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).
@@ -544,7 +514,7 @@ public class StateImpl implements IState {
}
if (lazyBuildCU && binaryType == null) {
/* couldn't parse the class file */
- ProblemDetailImpl problem= new ProblemDetailImpl(Util.bind("build.errorParsingBinary"/*nonNLS*/, type.getName()), sEntry);
+ ProblemDetailImpl problem= new ProblemDetailImpl("unable to parse class file: " + type.getName(), sEntry);
fProblemReporter.putProblem(sEntry, problem);
}
return binaryType;
@@ -658,7 +628,7 @@ public class StateImpl implements IState {
/* 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"/*nonNLS*/, tsEntry.getSourceEntry().getFileName()));
+ throw new NotPresentException("Unable to build type: " + tsEntry.getSourceEntry().getFileName());
}
return binaryType;
}
@@ -723,7 +693,7 @@ public class StateImpl implements IState {
if (!fSourceElementTable.containsPackage(pkg)) {
getSourceEntries(pkg);
}
- SourceEntry entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java"/*nonNLS*/);
+ SourceEntry entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java");
if (entry == null)
return null;
return new PackageElement(pkg, entry);
@@ -776,24 +746,32 @@ public class StateImpl implements IState {
JavaModelManager manager= (JavaModelManager) JavaModelManager.getJavaModelManager();
zipFile= manager.getZipFile(path);
if (zipFile == null) {
+ //throw internalException("Error reading file " + entry + "due to missing zip/jar file");
return new byte[0];
}
ZipEntry zipEntry= zipFile.getEntry(entry.getZipEntryName());
if (zipEntry == null) {
+ //throw internalException("Error reading file " + entry + " due to missing zip/jar entry");
return new byte[0];
}
InputStream input= zipFile.getInputStream(zipEntry);
if (input == null){
+ //throw internalException("Error reading file " + entry + " due to missing zip/jar entry");
return new byte[0];
}
byte[] contents= Util.readContentsAsBytes(input);
if (contents == null) {
+ //throw internalException("Error reading file " + entry + " due to error reading contents");
return new byte[0];
}
return contents;
} catch (CoreException e) {
+ //throw internalException(e);
return new byte[0];
} catch (IOException e) {
+ String message= e.getMessage();
+ message= (message == null ? "." : " due to " + message + ".");
+ //throw internalException("Error reading file " + entry + message);
return new byte[0];
} finally {
if (zipFile != null) {
@@ -814,7 +792,8 @@ public class StateImpl implements IState {
return fDevelopmentContext.getBinaryFromFileSystem(file);
} catch (IOException e) {
String message= e.getMessage();
- message= (message == null ? "."/*nonNLS*/ : " due to "/*nonNLS*/ + message + "."/*nonNLS*/);
+ message= (message == null ? "." : " due to " + message + ".");
+ //throw internalException("Error reading file " + entry + message);
return new byte[0];
}
}
@@ -852,7 +831,9 @@ public class StateImpl implements IState {
} catch(IOException ioe) {
}
}
- return new char[0];
+ String message= e.getMessage();
+ message= (message == null ? "." : " due to " + message + ".");
+ throw internalException("Error reading file " + entry + message);
}
}
/**
@@ -931,7 +912,7 @@ public class StateImpl implements IState {
}
}
if (frag == null) {
- throw internalException(Util.bind("build.missingFile"/*nonNLS*/, sEntry.toString()));
+ throw internalException("Missing file for " + sEntry);
}
String fileName= sEntry.getPath().lastSegment();
if (sEntry.isSource()) {
@@ -1118,6 +1099,7 @@ static Comparator getPathComparator() {
try {
return ((CompilationUnit)unit).getReferenceInfo();
} catch (JavaModelException e) {
+ System.out.println("Caught not present exception for unit: " + unit + e);
return null;
}
}
@@ -1219,9 +1201,9 @@ static Comparator getPathComparator() {
ICompilationUnit unit= units[i];
String fileName= unit.getElementName();
// get the corresponding .class file name
- String classFileName = ""/*nonNLS*/;
+ String classFileName = "";
if (Util.isJavaFileName(fileName)) { // paranoia check
- classFileName = fileName.substring(0, fileName.length()-5).concat(".class"/*nonNLS*/);
+ classFileName = fileName.substring(0, fileName.length()-5).concat(".class");
}
// see if a source entry exists for this file name
// or for the corresponding .class file
@@ -1245,7 +1227,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 = ""/*nonNLS*/;
+ String javaFileName = "";
if (Util.isClassFileName(fileName)) { // paranoia check
// strip off any nested types
javaFileName = fileName.substring(0, fileName.length()-6);
@@ -1253,7 +1235,7 @@ static Comparator getPathComparator() {
if (dol != -1) {
javaFileName = javaFileName.substring(0, dol);
}
- javaFileName = javaFileName.concat(".java"/*nonNLS*/);
+ javaFileName = javaFileName.concat(".java");
}
// see if a source entry exists for this file name
// or for the corresponding .java file
@@ -1315,7 +1297,7 @@ static Comparator getPathComparator() {
protected SourceEntry getSourceEntry(String qualifiedNameWithSuffix) {
int dot= qualifiedNameWithSuffix.lastIndexOf('.');
dot= qualifiedNameWithSuffix.lastIndexOf('.', dot - 1);
- String pkgName= (dot == -1 ? ".default"/*nonNLS*/ : qualifiedNameWithSuffix.substring(0, dot));
+ String pkgName= (dot == -1 ? ".default" : qualifiedNameWithSuffix.substring(0, dot));
String fileName= (dot == -1 ? qualifiedNameWithSuffix : qualifiedNameWithSuffix.substring(dot + 1));
IPackage pkg= fDevelopmentContext.getImage().getPackageHandle(pkgName, false);
getSourceEntries(pkg); // force
@@ -1344,16 +1326,16 @@ static Comparator getPathComparator() {
getSourceEntries(pkg);
}
String simpleName= type.getSimpleName();
- SourceEntry entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java"/*nonNLS*/);
+ SourceEntry entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java");
if (entry == null) {
- entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".class"/*nonNLS*/);
+ entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".class");
if (entry == null) {
int firstDollar= simpleName.indexOf('$');
if (firstDollar != -1) {
simpleName= simpleName.substring(0, firstDollar);
- entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java"/*nonNLS*/);
+ entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".java");
if (entry == null) {
- entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".class"/*nonNLS*/);
+ entry= fSourceElementTable.getSourceEntry(pkg, simpleName + ".class");
}
}
}
@@ -1452,7 +1434,7 @@ static Comparator getPathComparator() {
*/
protected TypeStructureEntry getTypeStructureEntry(String qualifiedNameWithoutSuffix) {
int dot= qualifiedNameWithoutSuffix.lastIndexOf('.');
- String pkgName= (dot == -1 ? ".default"/*nonNLS*/ : qualifiedNameWithoutSuffix.substring(0, dot));
+ String pkgName= (dot == -1 ? ".default" : 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);
@@ -1532,7 +1514,7 @@ static Comparator getPathComparator() {
*/
protected static boolean isZipElement(IPath path) {
String extension= path.getFileExtension();
- return extension != null && (extension.equalsIgnoreCase("zip"/*nonNLS*/) || extension.equalsIgnoreCase("jar"/*nonNLS*/));
+ return extension != null && (extension.equalsIgnoreCase("zip") || extension.equalsIgnoreCase("jar"));
}
/**
* Given a project-relative path, returns an absolute path.
@@ -1618,7 +1600,7 @@ 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"/*nonNLS*/, typeHandle.getName(), tsExisting.getSourceEntry().getFileName());
+ String msg= "Type " + typeHandle.getName() + " already provided by " + tsExisting.getSourceEntry().getFileName();
ProblemDetailImpl problem= new ProblemDetailImpl(msg, sEntry);
fProblemReporter.putProblem(sEntry, problem);
// skip it
@@ -1816,7 +1798,7 @@ static Comparator getPathComparator() {
* Returns a string representation of the receiver.
*/
public String toString() {
- return "StateImpl("/*nonNLS*/ + fStateNumber + ")"/*nonNLS*/;
+ return "StateImpl(" + fStateNumber + ")";
}
/**
* Returns the type handle for the given type name,
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 52fcb91c38..7ab1aa8840 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
@@ -4,14 +4,12 @@ package org.eclipse.jdt.internal.core.builder.impl;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.Hashtable;
-
import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.builder.IPackage;
+
+import org.eclipse.jdt.internal.core.builder.*;
+
+import java.io.*;
+import java.util.*;
/**
* This class takes and restores snapshots of a State.
@@ -75,7 +73,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"/*nonNLS*/));
+ throw new IOException("Unrecognized format");
}
/* dispatch to appropriate reader */
@@ -85,7 +83,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"/*nonNLS*/));
+ throw new IOException("Unrecognized state format");
}
}
/**
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 7584b6f8fb..c03075bb8f 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
@@ -4,22 +4,12 @@ package org.eclipse.jdt.internal.core.builder.impl;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
+import org.eclipse.core.runtime.*;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.internal.core.Assert;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.builder.IConstructor;
-import org.eclipse.jdt.internal.core.builder.IDevelopmentContext;
-import org.eclipse.jdt.internal.core.builder.IField;
-import org.eclipse.jdt.internal.core.builder.IHandle;
-import org.eclipse.jdt.internal.core.builder.IImage;
-import org.eclipse.jdt.internal.core.builder.IMethod;
-import org.eclipse.jdt.internal.core.builder.IPackage;
-import org.eclipse.jdt.internal.core.builder.IType;
+import org.eclipse.jdt.internal.core.builder.*;
+
+import java.io.*;
class StateSnapConstantPool {
OrderedSet fSet;
@@ -114,14 +104,14 @@ public void add(IHandle handle) {
// NOP
break;
default:
- Assert.isTrue(false, "Unknown kind of handle"/*nonNLS*/);
+ Assert.isTrue(false, "Unknown kind of handle");
}
}
/**
* Add a SourceEntry to the pool.
*/
public void add(SourceEntry entry) {
- Assert.isNotNull(entry, "Null SourceEntry being added to StateSnapConstantPool"/*nonNLS*/);
+ Assert.isNotNull(entry, "Null SourceEntry being added to StateSnapConstantPool");
if (!fSet.includes(entry)) {
add(entry.getPath());
String zipEntryPath = entry.fZipEntryPath;
@@ -171,12 +161,12 @@ public IHandle getHandle(int index) throws IOException {
try {
IHandle result = (IHandle)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
}
/**
@@ -192,12 +182,12 @@ public IPackage getPackage(int index) throws IOException {
try {
IPackage result = (IPackage)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
}
/**
@@ -207,12 +197,12 @@ public IPath getPath(int index) throws IOException {
try {
IPath result = (IPath)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
}
/**
@@ -222,12 +212,12 @@ public SourceEntry getSourceEntry(int index) throws IOException {
try {
SourceEntry result = (SourceEntry)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
}
/**
@@ -237,12 +227,12 @@ public String getString(int index) throws IOException {
try {
String result = (String)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
}
/**
@@ -263,7 +253,7 @@ public Object getStringOrNumber(int index) throws IOException {
return result;
}
else {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
}
/**
@@ -273,12 +263,12 @@ public IType getType(int index) throws IOException {
try {
IType result = (IType)fSet.get(index);
if (result == null) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
return result;
}
catch (ClassCastException e) {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Error in format");
}
}
/**
@@ -306,10 +296,10 @@ public String histogram() {
++nN;
}
else {
- Assert.isTrue(false, "Unexpected pool item"/*nonNLS*/);
+ Assert.isTrue(false, "Unexpected pool item");
}
}
- return "nStr="/*nonNLS*/ + nStr + ", nID="/*nonNLS*/ + nID + ", nSE="/*nonNLS*/ + nSE + ", nH="/*nonNLS*/ + nH + ",nN="/*nonNLS*/ + nN;
+ return "nStr=" + nStr + ", nID=" + nID + ", nSE=" + nSE + ", nH=" + nH + ",nN=" + nN;
}
/**
@@ -323,7 +313,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: "/*nonNLS*/ + obj);
+ throw new IllegalArgumentException("Internal error in state serialization. Expected object missing from constant pool: " + obj);
}
}
/**
@@ -397,7 +387,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"/*nonNLS*/);
+ throw new IOException("Unexpected kind of pool item");
}
}
}
@@ -415,7 +405,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"/*nonNLS*/);
+ throw new IOException("Internal error");
}
case 6: {
// array type
@@ -433,7 +423,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"/*nonNLS*/);
+ throw new IOException("Bad format");
}
String name = getString(in.readInt());
int numParams = in.readByte() & 0xFF;
@@ -447,7 +437,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"/*nonNLS*/);
+ throw new IOException("Bad format");
}
int numParams = in.readByte() & 0xFF;
IType[] params = new IType[numParams];
@@ -460,7 +450,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"/*nonNLS*/);
+ throw new IOException("Bad format");
}
String name = getString(in.readInt());
return declaringClass.getFieldHandle(name);
@@ -469,7 +459,7 @@ private IHandle readHandle(IDevelopmentContext dc, DataInputStream in, int tag)
// image
return dc.getImage();
default:
- throw new IOException("Unexpected kind of pool item"/*nonNLS*/);
+ throw new IOException("Unexpected kind of pool item");
}
}
/**
@@ -490,7 +480,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"/*nonNLS*/);
+ throw new IOException("Unexpeced kind of Number");
}
}
/**
@@ -539,7 +529,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"/*nonNLS*/);
+ Assert.isTrue(false, "Unexpected pool item");
}
}
}
@@ -559,7 +549,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"/*nonNLS*/);
+ throw new IOException("Internal error");
}
else if (t.isArray()) {
ArrayTypeHandleImpl at = (ArrayTypeHandleImpl)t;
@@ -611,7 +601,7 @@ private void writeHandle(IHandle h, DataOutputStream out) throws IOException {
out.writeByte(11);
break;
default:
- Assert.isTrue(false, "Unknown kind of handle"/*nonNLS*/);
+ Assert.isTrue(false, "Unknown handle type");
}
}
/**
@@ -635,7 +625,7 @@ private void writeNumber(Number num, DataOutputStream out) throws IOException {
out.writeLong(Double.doubleToLongBits(num.doubleValue()));
}
else {
- Assert.isTrue(false, "Unexpected type of number"/*nonNLS*/);
+ Assert.isTrue(false, "Unexpeced kind of Number");
}
}
}
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 e7f9d4f4fd..202d0368fd 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
@@ -4,26 +4,18 @@ package org.eclipse.jdt.internal.core.builder.impl;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.*;
+
import org.eclipse.jdt.internal.core.Assert;
-import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.builder.IDevelopmentContext;
-import org.eclipse.jdt.internal.core.builder.IImageContext;
-import org.eclipse.jdt.internal.core.builder.IPackage;
-import org.eclipse.jdt.internal.core.builder.IProblemReporter;
-import org.eclipse.jdt.internal.core.builder.IState;
-import org.eclipse.jdt.internal.core.builder.IType;
+import org.eclipse.jdt.internal.core.builder.*;
import org.eclipse.jdt.internal.core.util.LookupTable;
+import java.io.*;
+import java.util.*;
+
+import org.eclipse.jdt.internal.core.JavaModelManager;
+
/**
* StateSnap for state file format version 5.
* @see StateSnap
@@ -75,7 +67,7 @@ protected void addDependencyGraphToPool(StateImpl state, StateSnapConstantPool p
pool.add(((ZipNode)node).getZipFile());
break;
default:
- Assert.isTrue(false, "Unexpected kind of node"/*nonNLS*/);
+ Assert.isTrue(false, "Unexpected kind of node");
}
// 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 +145,7 @@ protected void addTypeStructureEntryToPool(TypeStructureEntry tsEntry, StateSnap
pool.add(tsEntry.getType());
}
protected void badFormat() throws IOException {
- throw new IOException("Error in format"/*nonNLS*/);
+ throw new IOException("Bad format");
}
/**
* Check that the next section has the given name.
@@ -202,7 +194,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"/*nonNLS*/);
+ checkSection(in, "BuildContext");
int numPkgs = in.readInt();
if (numPkgs == -1) {
return null;
@@ -218,7 +210,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"/*nonNLS*/);
+ checkSection(in, "DependencyGraph");
DependencyGraph graph = new DependencyGraph();
// Avoid creating package elements for each node and dependency.
@@ -268,7 +260,7 @@ protected DependencyGraph readDependencyGraph(StateSnapConstantPool pool, DataIn
* Read the package map.
*/
protected PackageMap readPackageMap(StateSnapConstantPool pool, DataInputStream in) throws IOException {
- checkSection(in, "PackageMap"/*nonNLS*/);
+ checkSection(in, "PackageMap");
PackageMap map = new PackageMap();
int size = in.readInt();
for (int i = 0; i < size; ++i) {
@@ -286,7 +278,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"/*nonNLS*/);
+ checkSection(in, "PrincipalStructureTable");
int numEntries = in.readInt();
Hashtable table = new Hashtable(numEntries * 2 + 1);
for (int i = 0; i < numEntries; ++i) {
@@ -314,7 +306,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"/*nonNLS*/);
+ checkSection(in, "Problems");
IProblemReporter reporter = null;
boolean isProblemTable = in.readBoolean();
if (isProblemTable) {
@@ -330,14 +322,14 @@ protected IProblemReporter readProblemReporter(IProject project, StateSnapConsta
try {
clazz = Class.forName(className);
} catch (ClassNotFoundException e) {
- throw new IOException("Class "/*nonNLS*/ + className + " was not found."/*nonNLS*/);
+ throw new IOException("Class " + className + " was not found.");
}
try {
reporter = (IProblemReporter) clazz.newInstance();
} catch (InstantiationException e) {
- throw new IOException("Could not instanciate "/*nonNLS*/ + clazz.getName());
+ throw new IOException("Could not instanciate " + clazz.getName());
} catch (IllegalAccessException e) {
- throw new IOException("Could not instanciate "/*nonNLS*/ + clazz.getName());
+ throw new IOException("Could not instanciate " + clazz.getName());
}
reporter.initialize(project, JavaModelManager.getJavaModelManager().getDevelopmentContext(project));
}
@@ -347,7 +339,7 @@ protected IProblemReporter readProblemReporter(IProject project, StateSnapConsta
* Read the source element table.
*/
protected SourceElementTable readSourceElementTable(StateSnapConstantPool pool, DataInputStream in) throws IOException {
- checkSection(in, "SourceElementTable"/*nonNLS*/);
+ checkSection(in, "SourceElementTable");
SourceElementTable table = new SourceElementTable();
int numPackages = in.readInt();
for (int i = 0; i < numPackages; ++i) {
@@ -476,7 +468,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"/*nonNLS*/);
+ out.writeUTF("BuildContext");
IImageContext ctx = state.getBuildContext();
if (ctx == null) {
out.writeInt(-1);
@@ -493,7 +485,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"/*nonNLS*/);
+ out.writeUTF("DependencyGraph");
DependencyGraph graph = state.getInternalDependencyGraph();
graph.integrityCheck();
/**
@@ -508,7 +500,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: "/*nonNLS*/ + jcu.getPackageElement() + ". Skipping..."/*nonNLS*/);
+ System.out.println("Warning: StatSnap: Attempt to serialize dependency graph node for missing JCU: " + jcu.getPackageElement() + ". Skipping...");
} else {
Assert.isNotNull(sEntry);
out.writeInt(pool.index(sEntry));
@@ -572,7 +564,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"/*nonNLS*/);
+ out.writeUTF("PackageMap");
PackageMap map = state.getPackageMap();
out.writeInt(map.size());
int count = 0;
@@ -592,7 +584,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"/*nonNLS*/);
+ out.writeUTF("PrincipalStructureTable");
Hashtable table = state.getPrincipalStructureTable();
int num = table.size();
out.writeInt(num);
@@ -621,7 +613,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"/*nonNLS*/);
+ out.writeUTF("Problems");
IProblemReporter reporter = state.getProblemReporter();
if (reporter instanceof ProblemTable) {
out.writeBoolean(true);
@@ -645,7 +637,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"/*nonNLS*/);
+ out.writeUTF("SourceElementTable");
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 622b1e5361..f9c2dc2015 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
@@ -1,14 +1,5 @@
package org.eclipse.jdt.internal.core.builder.impl;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * These indictments are issued when there is a T1 change to a
- * type, including change of visibility, change of gender, abstractness, etc.
- */
class TypeCollaboratorIndictment extends Indictment {
/**
* Creates a new TypeCollaboratorIndictment.
@@ -28,6 +19,6 @@ protected TypeCollaboratorIndictment(char[] name) {
*/
public String toString() {
// don't use + with char[]
- return new StringBuffer("TypeIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();
+ return new StringBuffer("TypeIndictment(").append(fName).append(")").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 cf0bf75dfa..af0233329b 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
@@ -1,14 +1,5 @@
package org.eclipse.jdt.internal.core.builder.impl;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * Type hierarchy indictments are issued whenever there is any
- * change to the supertype hierarchy graph for a given type.
- */
public class TypeHierarchyIndictment extends Indictment {
/**
* Creates a new TypeHierarchyIndictment.
@@ -28,6 +19,6 @@ protected TypeHierarchyIndictment(char[] name) {
*/
public String toString() {
// don't use + with char[]
- return new StringBuffer("TypeHierarchyIndictment("/*nonNLS*/).append(fName).append(")"/*nonNLS*/).toString();
+ return new StringBuffer("TypeHierarchyIndictment(").append(fName).append(")").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 a7b9c0dc34..ffd1b9b064 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"/*nonNLS*/);
+ Assert.isTrue(false, "Should only be comparing ITypes");
}
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 ""/*nonNLS*/;
+ return "";
}
/**
* 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 "/*nonNLS*/ + getName();
+ return "type " + 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 373d85435e..7c14badc37 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 ""/*nonNLS*/;
+ return "";
}
/**
* 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 bd9a84b627..3ae8509102 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("/*nonNLS*/ + fType.getFileName() + ")"/*nonNLS*/;
+ return "TypeNode(" + fType.getFileName() + ")";
}
}
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 3e11a4f827..dd67c9da07 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("/*nonNLS*/);
+ StringBuffer buf = new StringBuffer("TypeStructureEntry(");
if (fType != null) {
buf.append(fType.getName());
}
- buf.append(")"/*nonNLS*/);
+ buf.append(")");
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 21812de253..fe514db5a6 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("/*nonNLS*/ + fNewTSEntry.getType().getName() + ")"/*nonNLS*/;
+ return "UnmodifiedBuilderType(" + fNewTSEntry.getType().getName() + ")";
}
}
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 8f263a08a0..0d05f5966c 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: "/*nonNLS*/ + element);
+ System.out.println("Warning: image builder wants to recompile already compiled element: " + 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: "/*nonNLS*/ + element);
+ System.out.println("Warning: Java builder compiled the same element twice: " + 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: "/*nonNLS*/ + needsCompileList;
+ return "WorkQueue: " + 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 2f51cb3f79..3149537914 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
@@ -5,7 +5,6 @@ package org.eclipse.jdt.internal.core.builder.impl;
* All Rights Reserved.
*/
import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.internal.core.builder.IType;
/**
* A node in the dependency graph representing a jar or zip file. All
@@ -24,10 +23,6 @@ public class ZipNode extends AbstractNode {
protected ZipNode(IPath zipPath) {
fZipFile = zipPath;
}
-
-public IType[] getTypes(){
- return null;
-}
/**
* Creates and returns a copy of this node.
*/
@@ -57,6 +52,6 @@ public IPath getZipFile() {
* purposes only.
*/
public String toString() {
- return "ZipNode("/*nonNLS*/ + fZipFile + ")"/*nonNLS*/;
+ return "ZipNode(" + fZipFile + ")";
}
}
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 2e7995f41a..005df908d8 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
@@ -52,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"/*nonNLS*/)));
+ throw new JavaModelException(new JavaModelStatus(IJavaModelStatusConstants.EVALUATION_ERROR, "Cannot evaluate if the project has not been built once"));
}
}
/**
@@ -75,7 +75,7 @@ public IJavaElement[] codeSelect(String codeSnippet, int offset, int length) thr
this.context.select(
codeSnippet.toCharArray(),
offset,
- offset + length - 1,
+ offset + length,
this.project.getSearchableNameEnvironment(),
requestor,
JavaModelManager.convertConfigurableOptions(JavaCore.getOptions())
@@ -90,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"/*nonNLS*/);
+ throw new Error("Unknown implementation of IGlobalVariable");
}
}
/**
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 3e82004c7d..4ca34f8aa1 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 "/*nonNLS*/);
+ buffer.append("public ");
}
if (this.isClass()) {
- buffer.append("class "/*nonNLS*/);
+ buffer.append("class ");
} else {
- buffer.append("interface "/*nonNLS*/);
+ buffer.append("interface ");
}
if (this.name != null) {
buffer.append(this.name);
}
if (this.superclass != null) {
- buffer.append("\n extends "/*nonNLS*/);
+ buffer.append("\n extends ");
buffer.append(this.superclass);
}
int length;
if (this.superInterfaces != null && (length = this.superInterfaces.length) != 0) {
- buffer.append("\n implements "/*nonNLS*/);
+ buffer.append("\n implements ");
for (int i = 0; i < length; i++) {
buffer.append(this.superInterfaces[i]);
if (i != length - 1) {
- buffer.append(", "/*nonNLS*/);
+ buffer.append(", ");
}
}
}
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 1b204e594d..0fda2a87ad 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
@@ -24,7 +24,6 @@ import org.eclipse.jdt.internal.compiler.util.CharOperation;
import org.eclipse.jdt.internal.compiler.env.IGenericType;
import org.eclipse.jdt.internal.core.search.indexing.AbstractIndexer;
import org.eclipse.jdt.internal.core.*;
-import org.eclipse.jdt.internal.core.Util;
import org.eclipse.jdt.internal.compiler.util.HashtableOfObject;
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
@@ -75,7 +74,7 @@ public class IndexBasedHierarchyBuilder extends HierarchyBuilder {
return name;
}
public String toString(){
- StringBuffer buffer = new StringBuffer("Queue:\n"/*nonNLS*/);
+ StringBuffer buffer = new StringBuffer("Queue:\n");
for (int i = this.start; i <= this.end; i++){
buffer.append(names[i]).append('\n');
}
@@ -269,16 +268,7 @@ private void buildFromPotentialSubtypes(String[] allPotentialSubTypes) {
this.buildForProject((JavaProject)currentProject, infos, units);
} catch (JavaModelException e) {
}
-
- // Compute hierarchy of focus type if not already done (case of a type with potential subtypes that are not real subtypes)
- if (!this.hierarchy.contains(focusType)) {
- try {
- currentProject = focusType.getJavaProject();
- this.buildForProject((JavaProject)currentProject, new Vector(), new Vector());
- } catch (JavaModelException e) {
- }
- }
-
+
// Add focus if not already in (case of a type with no explicit super type)
if (!this.hierarchy.contains(focusType)) {
this.hierarchy.addRootClass(focusType);
@@ -319,7 +309,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('.', '/') + "/"/*nonNLS*/ + classFile.getElementName();
+ String classFilePath = pkg.getElementName().replace('.', '/') + "/" + classFile.getElementName();
IGenericType info = null;
java.util.zip.ZipFile zipFile = null;
try {
@@ -443,7 +433,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"/*nonNLS*/)){
+ if (resourcePath.endsWith("class")){
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 de684ca051..8fa6da89f4 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
@@ -22,7 +22,6 @@ import org.eclipse.jdt.core.ITypeHierarchyChangedListener;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.*;
import org.eclipse.jdt.internal.core.*;
-import org.eclipse.jdt.internal.core.Util;
import org.eclipse.jdt.internal.core.search.*;
import java.util.*;
@@ -1022,7 +1021,7 @@ public void refresh(IProgressMonitor monitor) throws JavaModelException {
}
fProgressMonitor = monitor;
if (monitor != null) {
- monitor.beginTask(Util.bind("hierarchy.creating"/*nonNLS*/), IProgressMonitor.UNKNOWN);
+ monitor.beginTask("Creating type hierarchy...", IProgressMonitor.UNKNOWN);
}
compute();
if (fType != null) {
@@ -1097,7 +1096,7 @@ private boolean subtypesIncludeSupertypeOf(IType type) {
return false;
}
if (superclassName == null) {
- superclassName = "Object"/*nonNLS*/;
+ superclassName = "Object";
}
int dot = -1;
String simpleSuper = (dot = superclassName.lastIndexOf('.')) > -1 ?
@@ -1133,24 +1132,24 @@ private boolean subtypesIncludeSupertypeOf(IType type) {
*/
public String toString() {
StringBuffer buffer = new StringBuffer();
- buffer.append("Focus: "/*nonNLS*/);
- buffer.append(fType == null ? "<NONE>"/*nonNLS*/ : fType.getFullyQualifiedName());
- buffer.append("\n"/*nonNLS*/);
+ buffer.append("Focus: ");
+ buffer.append(fType == null ? "<NONE>" : fType.getFullyQualifiedName());
+ buffer.append("\n");
if (exists()) {
if (fType != null) {
- buffer.append("Super types:\n"/*nonNLS*/);
+ buffer.append("Super types:\n");
toString(buffer, fType, 1, true);
- buffer.append("Sub types:\n"/*nonNLS*/);
+ buffer.append("Sub types:\n");
toString(buffer, fType, 1, false);
} else {
- buffer.append("Sub types of root classes:\n"/*nonNLS*/);
+ buffer.append("Sub types of root classes:\n");
IType[] roots= getRootClasses();
for (int i= 0; i < roots.length; i++) {
toString(buffer, roots[i], 1, false);
}
}
} else {
- buffer.append("(Hierarchy became stale)"/*nonNLS*/);
+ buffer.append("(Hierarchy became stale)");
}
return buffer.toString();
}
@@ -1161,7 +1160,7 @@ public String toString() {
*/
private void toString(StringBuffer buffer, IType type, int indent, boolean ascendant) {
for (int i= 0; i < indent; i++) {
- buffer.append(" "/*nonNLS*/);
+ buffer.append(" ");
}
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 b7454d9e55..4583cd92e2 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("/"/*nonNLS*/) + 1;
- if (start == 0 || start < file.lastIndexOf("\\"/*nonNLS*/))
- start = file.lastIndexOf("\\"/*nonNLS*/) + 1;
+ int start = file.lastIndexOf("/") + 1;
+ if (start == 0 || start < file.lastIndexOf("\\"))
+ start = file.lastIndexOf("\\") + 1;
- int end = file.lastIndexOf("."/*nonNLS*/);
+ int end = file.lastIndexOf(".");
if (end == -1)
end = file.length();
@@ -42,6 +42,6 @@ public char[] getMainTypeName() {
return fMainTypeName;
}
public String toString() {
- return "CompilationUnit["/*nonNLS*/ + new String(fFileName) + "]"/*nonNLS*/;
+ return "CompilationUnit[" + new String(fFileName) + "]";
}
}
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 421510efea..b78a0dfcbb 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
@@ -10,7 +10,6 @@ import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.jdom.*;
-import org.eclipse.jdt.internal.core.Util;
import org.eclipse.jdt.internal.core.util.*;
import java.util.Vector;
@@ -33,7 +32,7 @@ class DOMCompilationUnit extends DOMNode implements IDOMCompilationUnit {
* Creates a new empty COMPILATION_UNIT document fragment.
*/
DOMCompilationUnit() {
- fHeader=""/*nonNLS*/;
+ fHeader="";
}
/**
* Creates a new COMPILATION_UNIT on the given range of the document.
@@ -47,7 +46,7 @@ DOMCompilationUnit() {
*/
DOMCompilationUnit(char[] document, int[] sourceRange) {
super(document, sourceRange, null, new int[]{-1, -1});
- fHeader = ""/*nonNLS*/;
+ fHeader = "";
}
/**
* @see DOMNode#appendContents(CharArrayBuffer)
@@ -75,7 +74,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"/*nonNLS*/));
+ throw new IllegalArgumentException("Illegal parent argument");
}
}
/**
@@ -102,7 +101,7 @@ public String getName() {
topLevelType= firstType;
}
if (topLevelType != null) {
- return topLevelType.getName() + ".java"/*nonNLS*/;
+ return topLevelType.getName() + ".java";
} else {
return null;
}
@@ -174,6 +173,6 @@ protected void shareContents(DOMNode node) {
* @see IDOMNode#toString()
*/
public String toString() {
- return "COMPILATION_UNIT: "/*nonNLS*/ + getName();
+ return "COMPILATION_UNIT: " + 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 e9d22f5c3a..07554b0b72 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
@@ -4,17 +4,17 @@ package org.eclipse.jdt.internal.core.jdom;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import java.util.Enumeration;
+import org.eclipse.core.resources.*;
+import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.jdom.DOMException;
-import org.eclipse.jdt.core.jdom.IDOMField;
-import org.eclipse.jdt.core.jdom.IDOMNode;
+import org.eclipse.jdt.core.jdom.*;
import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.util.CharArrayBuffer;
-import org.eclipse.jdt.internal.core.util.CharArrayOps;
+import org.eclipse.jdt.internal.core.util.*;
+
+import java.util.Enumeration;
/**
* DOMField provides an implementation of IDOMField.
@@ -163,7 +163,7 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
if (hasInitializer()) {
if (fInitializerRange[0] < 0) {
buffer
- .append('=')
+ .append("=")
.append(fInitializer)
.append(fDocument, fNameRange[1] + 1, fSourceRange[1] - fNameRange[1]);
} else {
@@ -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"/*nonNLS*/));
+ throw new DOMException("Unable to generate detailed source indexes.");
} 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"/*nonNLS*/));
+ throw new IllegalArgumentException("Illegal parent argument");
}
}
/**
@@ -358,7 +358,7 @@ protected char[] getSingleVariableDeclaratorContents() {
first.appendMemberHeaderFragment(buffer);
buffer.append(getType());
if (isVariableDeclarator()) {
- buffer.append(' ');
+ buffer.append(" ");
} else {
buffer.append(fDocument, fTypeRange[1] + 1, fNameRange[0] - fTypeRange[1] - 1);
}
@@ -370,7 +370,7 @@ protected char[] getSingleVariableDeclaratorContents() {
if (hasInitializer()) {
if (fInitializerRange[0] < 0) {
buffer
- .append('=')
+ .append("=")
.append(fInitializer)
.append(';')
.append(JavaModelManager.LINE_SEPARATOR);
@@ -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"/*nonNLS*/));
+ throw new IllegalArgumentException("illegal to set name to null");
} 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"/*nonNLS*/));
+ throw new IllegalArgumentException("Illegal to set field type to null");
}
becomeDetailed();
expand();
@@ -603,6 +603,6 @@ protected void shareContents(DOMNode node) {
* @see IDOMNode#toString()
*/
public String toString() {
- return "FIELD: "/*nonNLS*/ + getName();
+ return "FIELD: " + 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 5a9baf69fb..759a59e176 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
@@ -4,13 +4,15 @@ package org.eclipse.jdt.internal.core.jdom;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
+import org.eclipse.core.resources.*;
+
+import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.jdom.IDOMImport;
-import org.eclipse.jdt.core.jdom.IDOMNode;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.jdom.*;
import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.util.CharArrayBuffer;
+import org.eclipse.jdt.internal.core.util.*;
/**
* DOMImport provides an implementation of IDOMImport.
@@ -27,7 +29,7 @@ class DOMImport extends DOMNode implements IDOMImport {
* Creates a new empty IMPORT node.
*/
DOMImport() {
- fName = "java.lang.*"/*nonNLS*/;
+ fName = "java.lang.*";
setMask(MASK_DETAILED_SOURCE_INDEXES, true);
}
/**
@@ -78,7 +80,7 @@ DOMImport(char[] document, int[] sourceRange, String name, boolean onDemand) {
protected void appendFragmentedContents(CharArrayBuffer buffer) {
if (fNameRange[0] < 0) {
buffer
- .append("import "/*nonNLS*/)
+ .append("import ")
.append(fName)
.append(';')
.append(JavaModelManager.LINE_SEPARATOR);
@@ -112,7 +114,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"/*nonNLS*/));
+ throw new IllegalArgumentException("Illegal parent argument");
}
}
/**
@@ -138,16 +140,16 @@ protected DOMNode newDOMNode() {
*/
public void setName(String name) {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));
+ throw new IllegalArgumentException("illegal to set name to null");
}
becomeDetailed();
super.setName(name);
- fOnDemand = name.endsWith(".*"/*nonNLS*/);
+ fOnDemand = name.endsWith(".*");
}
/**
* @see IDOMNode#toString()
*/
public String toString() {
- return "IMPORT: "/*nonNLS*/ + getName();
+ return "IMPORT: " + 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 0a1e6a2a44..55164d926d 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
@@ -4,14 +4,16 @@ package org.eclipse.jdt.internal.core.jdom;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
+import org.eclipse.core.resources.*;
+
+import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.jdom.IDOMInitializer;
-import org.eclipse.jdt.core.jdom.IDOMNode;
+import org.eclipse.jdt.core.jdom.*;
import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.util.CharArrayBuffer;
-import org.eclipse.jdt.internal.core.util.CharArrayOps;
+import org.eclipse.jdt.internal.core.util.*;
+import org.w3c.dom.DOMImplementation;
/**
* DOMInitializer provides an implementation of IDOMInitializer.
@@ -102,7 +104,7 @@ protected void appendMemberBodyContents(CharArrayBuffer buffer) {
.append(getBody())
.append(fDocument, fBodyRange[1] + 1, fSourceRange[1] - fBodyRange[1]);
} else {
- buffer.append("{}"/*nonNLS*/).append(JavaModelManager.LINE_SEPARATOR);
+ buffer.append("{}").append(JavaModelManager.LINE_SEPARATOR);
}
}
/**
@@ -156,7 +158,7 @@ public IJavaElement getJavaElement(IJavaElement parent) throws IllegalArgumentEx
}
return ((IType) parent).getInitializer(count);
} else {
- throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));
+ throw new IllegalArgumentException("Illegal parent argument");
}
}
/**
@@ -219,6 +221,6 @@ protected void shareContents(DOMNode node) {
* @see IDOMNode#toString()
*/
public String toString() {
- return "INITIALIZER"/*nonNLS*/;
+ return "INITIALIZER";
}
}
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 76e25ee0b8..ebbd1f874f 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"/*nonNLS*/) >= 0) {
+ if (commentString.indexOf("@deprecated") >= 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 921ef4cf5a..58a3665657 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
@@ -4,15 +4,16 @@ package org.eclipse.jdt.internal.core.jdom;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
+import org.eclipse.core.resources.*;
+
+import org.eclipse.jdt.core.Flags;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.Signature;
-import org.eclipse.jdt.core.jdom.IDOMMethod;
-import org.eclipse.jdt.core.jdom.IDOMNode;
+import org.eclipse.jdt.core.jdom.*;
import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.util.CharArrayBuffer;
-import org.eclipse.jdt.internal.core.util.CharArrayOps;
+import org.eclipse.jdt.internal.core.util.*;
/**
* DOMMethod provides an implementation of IDOMMethod.
@@ -226,7 +227,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"/*nonNLS*/));
+ throw new IllegalArgumentException("Cannot add null exception");
}
if (fExceptions == null) {
fExceptions= new String[1];
@@ -241,10 +242,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"/*nonNLS*/));
+ throw new IllegalArgumentException("Cannot add parameter with null type");
}
if (name == null) {
- throw new IllegalArgumentException(Util.bind("dom.nullNameParameter"/*nonNLS*/));
+ throw new IllegalArgumentException("Cannot add parameter with null name");
}
if (fParameterNames == null) {
fParameterNames= new String[1];
@@ -284,7 +285,7 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
if (fReturnTypeRange[0] >= 0) {
buffer.append(fDocument, fReturnTypeRange[1] + 1, fNameRange[0] - fReturnTypeRange[1] - 1);
} else {
- buffer.append(' ');
+ buffer.append(" ");
}
buffer
.append(getNameContents())
@@ -306,7 +307,7 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
if (fExceptionRange[0] >= 0) {
buffer.append(fDocument, start, fExceptionRange[0] - start);
} else {
- buffer.append(" throws "/*nonNLS*/);
+ buffer.append(" throws ");
}
// add exception list
if (fExceptionList != null) {
@@ -414,7 +415,7 @@ public IJavaElement getJavaElement(IJavaElement parent) throws IllegalArgumentEx
}
return ((IType)parent).getMethod(name, sigs);
} else {
- throw new IllegalArgumentException(Util.bind("element.illegalParent"/*nonNLS*/));
+ throw new IllegalArgumentException("Illegal parent argument");
}
}
/**
@@ -573,7 +574,7 @@ public void setBody(String body) {
fBody= body;
setHasBody(body != null);
if (!hasBody()) {
- fBody= ";"/*nonNLS*/+JavaModelManager.LINE_SEPARATOR;
+ fBody= ";"+JavaModelManager.LINE_SEPARATOR;
}
}
/**
@@ -615,7 +616,7 @@ public void setExceptions(String[] names) {
*/
public void setName(String name) {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));
+ throw new IllegalArgumentException("illegal to set method name to null");
} else {
super.setName(name);
}
@@ -631,17 +632,17 @@ public void setParameters(String[] types, String[] names) throws IllegalArgument
fParameterNames= null;
fParameterList= new char[] {'(',')'};
} else {
- throw new IllegalArgumentException(Util.bind("dom.mismatchArgNamesAndTypes"/*nonNLS*/));
+ throw new IllegalArgumentException("types and names must have identical length");
}
} else if (names.length != types.length) {
- throw new IllegalArgumentException(Util.bind("dom.mismatchArgNamesAndTypes"/*nonNLS*/));
+ throw new IllegalArgumentException("types and names must have identical length");
} else if (names.length == 0) {
setParameters(null, null);
} else {
fParameterNames= names;
fParameterTypes= types;
CharArrayBuffer parametersBuffer = new CharArrayBuffer();
- parametersBuffer.append("("/*nonNLS*/);
+ parametersBuffer.append("(");
char[] comma = new char[] {',', ' '};
for (int i = 0; i < names.length; i++) {
if (i > 0) {
@@ -649,10 +650,10 @@ public void setParameters(String[] types, String[] names) throws IllegalArgument
}
parametersBuffer
.append(types[i])
- .append(' ')
+ .append(" ")
.append(names[i]);
}
- parametersBuffer.append(')');
+ parametersBuffer.append(")");
fParameterList= parametersBuffer.getContents();
}
fragment();
@@ -662,7 +663,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"/*nonNLS*/));
+ throw new IllegalArgumentException("illegal return type of null");
}
becomeDetailed();
fragment();
@@ -705,9 +706,9 @@ protected void shareContents(DOMNode node) {
*/
public String toString() {
if (isConstructor()) {
- return "CONSTRUCTOR"/*nonNLS*/;
+ return "CONSTRUCTOR";
} else {
- return "METHOD: "/*nonNLS*/ + getName();
+ return "METHOD: " + 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 660f13c795..d3a1181038 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
@@ -4,16 +4,11 @@ package org.eclipse.jdt.internal.core.jdom;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import java.util.Enumeration;
+import org.eclipse.jdt.core.jdom.*;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.internal.core.util.*;
-import org.eclipse.jdt.core.jdom.DOMException;
-import org.eclipse.jdt.core.jdom.DOMFactory;
-import org.eclipse.jdt.core.jdom.IDOMCompilationUnit;
-import org.eclipse.jdt.core.jdom.IDOMFactory;
-import org.eclipse.jdt.core.jdom.IDOMMethod;
-import org.eclipse.jdt.core.jdom.IDOMNode;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.util.CharArrayBuffer;
+import java.util.*;
/**
* DOMNode provides an implementation for <code>IDOMNode</code>.
@@ -331,23 +326,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"/*nonNLS*/));
+ throw new DOMException("attempt to add child to node that cannot have children");
}
if (child == null) {
- throw new IllegalArgumentException(Util.bind("dom.addNullChild"/*nonNLS*/));
+ throw new IllegalArgumentException("attempt to add null child");
}
if (!isAllowableChild(child)) {
- throw new DOMException(Util.bind("dom.addIncompatibleChild"/*nonNLS*/));
+ throw new DOMException("attempt to add child of incompatible type");
}
if (child.getParent() != null) {
- throw new DOMException(Util.bind("dom.addChildWithParent"/*nonNLS*/));
+ throw new DOMException("attempt to add child that is already parented");
}
/* 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"/*nonNLS*/));
+ throw new DOMException("attempt to add ancestor as child");
}
DOMNode node= (DOMNode)child;
@@ -379,7 +374,7 @@ protected void becomeDetailed() throws DOMException {
if (!isDetailed()) {
DOMNode detailed= getDetailedNode();
if (detailed == null) {
- throw new DOMException(Util.bind("dom.cannotDetail"/*nonNLS*/));
+ throw new DOMException("Unable to generate detailed source indexes.");
}
if (detailed != this) {
shareContents(detailed);
@@ -652,23 +647,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"/*nonNLS*/));
+ throw new IllegalArgumentException("attempt to insert null sibling");
}
if (fParent == null) {
- throw new DOMException(Util.bind("dom.addSiblingBeforeRoot"/*nonNLS*/));
+ throw new DOMException("attempt to insert sibling before root node");
}
if (!fParent.isAllowableChild(sibling)) {
- throw new DOMException(Util.bind("dom.addIncompatibleSibling"/*nonNLS*/));
+ throw new DOMException("attempt to insert sibling of incompatible type");
}
if (sibling.getParent() != null) {
- throw new DOMException(Util.bind("dom.addSiblingWithParent"/*nonNLS*/));
+ throw new DOMException("attempt to insert sibling that is already parented");
}
/* 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"/*nonNLS*/));
+ throw new DOMException("attempt to insert ancestor as sibling");
}
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 dec2d57e07..ca015deea4 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
@@ -4,13 +4,15 @@ package org.eclipse.jdt.internal.core.jdom;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
+import org.eclipse.core.resources.*;
+
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.jdom.IDOMNode;
-import org.eclipse.jdt.core.jdom.IDOMPackage;
+import org.eclipse.jdt.core.IPackageFragment;
+import org.eclipse.jdt.core.Flags;
+import org.eclipse.jdt.core.jdom.*;
import org.eclipse.jdt.internal.core.JavaModelManager;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.util.CharArrayBuffer;
+import org.eclipse.jdt.internal.core.util.*;
/**
* DOMPackage provides an implementation of IDOMPackage.
@@ -70,7 +72,7 @@ DOMPackage(char[] document, int[] sourceRange, String name, int[] nameRange) {
protected void appendFragmentedContents(CharArrayBuffer buffer) {
if (fNameRange[0] < 0) {
buffer
- .append("package "/*nonNLS*/)
+ .append("package ")
.append(fName)
.append(';')
.append(JavaModelManager.LINE_SEPARATOR);
@@ -104,7 +106,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"/*nonNLS*/));
+ throw new IllegalArgumentException("Illegal parent argument");
}
}
/**
@@ -130,6 +132,6 @@ public void setName(String name) {
* @see IDOMNode#toString()
*/
public String toString() {
- return "PACKAGE: "/*nonNLS*/ + getName();
+ return "PACKAGE: " + 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 f1132242f7..f4631c72c8 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
@@ -4,20 +4,19 @@ package org.eclipse.jdt.internal.core.jdom;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import java.util.Enumeration;
+import org.eclipse.core.resources.*;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.jdom.IDOMMethod;
-import org.eclipse.jdt.core.jdom.IDOMNode;
-import org.eclipse.jdt.core.jdom.IDOMType;
+import org.eclipse.jdt.core.jdom.*;
+import org.eclipse.jdt.internal.core.util.*;
import org.eclipse.jdt.internal.compiler.parser.InvalidInputException;
import org.eclipse.jdt.internal.compiler.parser.Scanner;
import org.eclipse.jdt.internal.compiler.parser.TerminalSymbols;
-import org.eclipse.jdt.internal.core.Util;
-import org.eclipse.jdt.internal.core.util.CharArrayBuffer;
-import org.eclipse.jdt.internal.core.util.CharArrayOps;
+
+import java.util.Enumeration;
/**
* DOMType provides an implementation of IDOMType.
@@ -226,7 +225,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"/*nonNLS*/));
+ throw new IllegalArgumentException("Cannot add null interface");
}
if (fSuperInterfaces == null) {
fSuperInterfaces= new String[1];
@@ -264,7 +263,7 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
if (getMask(MASK_TYPE_HAS_SUPERCLASS)) {
hasSuperclass = true;
if (fExtendsRange[0] < 0) {
- buffer.append(" extends "/*nonNLS*/);
+ buffer.append(" extends ");
} else {
buffer.append(fDocument, fExtendsRange[0], fExtendsRange[1] + 1 - fExtendsRange[0]);
}
@@ -277,7 +276,7 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
if (getMask(MASK_TYPE_HAS_INTERFACES)) {
hasInterfaces = true;
if (fImplementsRange[0] < 0) {
- buffer.append(" implements "/*nonNLS*/);
+ buffer.append(" implements ");
} else {
buffer.append(fDocument, fImplementsRange[0], fImplementsRange[1] + 1 - fImplementsRange[0]);
}
@@ -289,14 +288,14 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
}
if (hasInterfaces) {
if (fImplementsRange[0] < 0) {
- buffer.append(' ');
+ buffer.append(" ");
} else {
buffer.append(fDocument, fInterfacesRange[1] + 1, fOpenBodyRange[0] - fInterfacesRange[1] - 1);
}
} else {
if (hasSuperclass) {
if (fSuperclassRange[0] < 0) {
- buffer.append(' ');
+ buffer.append(" ");
} else {
buffer.append(fDocument, fSuperclassRange[1] + 1, fOpenBodyRange[0] - fSuperclassRange[1] - 1);
}
@@ -307,13 +306,13 @@ protected void appendMemberDeclarationContents(CharArrayBuffer buffer) {
} else {
if (getMask(MASK_TYPE_HAS_INTERFACES)) {
if (fExtendsRange[0] < 0) {
- buffer.append(" extends "/*nonNLS*/);
+ buffer.append(" extends ");
} else {
buffer.append(fDocument, fExtendsRange[0], fExtendsRange[1] + 1 - fExtendsRange[0]);
}
if (fInterfaces != null) {
buffer.append(fInterfaces);
- buffer.append(' ');
+ buffer.append(" ");
} else {
buffer.append(fDocument, fInterfacesRange[0], fInterfacesRange[1] + 1 - fInterfacesRange[0]);
}
@@ -377,7 +376,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"/*nonNLS*/));
+ throw new IllegalArgumentException("Illegal parent argument");
}
}
/**
@@ -527,9 +526,9 @@ public void setClass(boolean b) {
fragment();
setMask(MASK_TYPE_IS_CLASS, b);
if (b) {
- fTypeKeyword= "class"/*nonNLS*/;
+ fTypeKeyword= "class";
} else {
- fTypeKeyword= "interface"/*nonNLS*/;
+ fTypeKeyword= "interface";
setSuperclass(null);
}
}
@@ -556,7 +555,7 @@ void setCloseBodyRangeStart(int start) {
*/
public void setName(String name) throws IllegalArgumentException {
if (name == null) {
- throw new IllegalArgumentException(Util.bind("element.nullName"/*nonNLS*/));
+ throw new IllegalArgumentException("illegal to set type name to null");
}
super.setName(name);
Enumeration children= getChildren();
@@ -588,7 +587,7 @@ public void setSuperclass(String superclassName) {
public void setSuperInterfaces(String[] names) {
becomeDetailed();
if (names == null) {
- throw new IllegalArgumentException(Util.bind("dom.nullInterfaces"/*nonNLS*/));
+ throw new IllegalArgumentException("illegal to set super interfaces to null");
}
fragment();
fSuperInterfaces= names;
@@ -601,7 +600,7 @@ public void setSuperInterfaces(String[] names) {
CharArrayBuffer buffer = new CharArrayBuffer();
for (int i = 0; i < names.length; i++) {
if (i > 0) {
- buffer.append(", "/*nonNLS*/);
+ buffer.append(", ");
}
buffer.append(names[i]);
}
@@ -636,6 +635,6 @@ protected void shareContents(DOMNode node) {
* @see IDOMNode#toString()
*/
public String toString() {
- return "TYPE: "/*nonNLS*/ + getName();
+ return "TYPE: " + getName();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/ILineStartFinder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/ILineStartFinder.java
index e3b2d87f52..0c8ee08788 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/ILineStartFinder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/ILineStartFinder.java
@@ -1,14 +1,5 @@
package org.eclipse.jdt.internal.core.jdom;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The <coe>ILineSeparatorFinder</code> finds previous and next line separators
- * in source.
- */
interface ILineStartFinder {
/**
* Returns the position of the start of the line at or before the given source position.
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 49830eb364..643fe9f04a 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
@@ -18,6 +18,12 @@ import java.util.Stack;
* A DOM builder that uses the SourceElementParser
*/
public class SimpleDOMBuilder extends AbstractDOMBuilder implements ISourceElementRequestor {
+
+
+
+
+
+
/**
@@ -27,7 +33,7 @@ public void acceptImport(int declarationStart, int declarationEnd, char[] name,
String importName = new String(name);
/** name is set to contain the '*' */
if (onDemand) {
- importName+=".*"/*nonNLS*/;
+ importName+=".*";
}
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 6a73282029..dcbbe0e209 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
@@ -1,9 +1,4 @@
package org.eclipse.jdt.internal.core.lookup;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
public class ReferenceInfo {
@@ -28,7 +23,7 @@ public class ReferenceInfo {
public static final byte REFTYPE_type = 0x20;
public static final byte REFTYPE_class = 0x40;
public static final byte REFTYPE_constant = (byte)0x80;
-// public static final byte REFTYPE_label = 256;
+// public static final byte REFTYPE_label = 256;
/**
* Creates a new ReferenceInfo object. There should be one per compilation unit.
@@ -53,12 +48,12 @@ public char[][] getNames() {
* For debugging only
*/
public String toString() {
- StringBuffer buf = new StringBuffer("ReferenceInfo("/*nonNLS*/);
+ StringBuffer buf = new StringBuffer("ReferenceInfo(");
for (int i = 0; i < fNames.length; i++) {
buf.append(fNames[i]);
- buf.append(" "/*nonNLS*/);
+ buf.append(" ");
}
- buf.append(")"/*nonNLS*/);
+ buf.append(")");
return buf.toString();
}
}
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 e846e1ac14..67182ba3ab 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."/*nonNLS*/);
+ throw new IllegalArgumentException("Directory arguments should be a directory.");
}
fDirectory = directory;
}
@@ -30,7 +30,7 @@ public AnonymousFileSource(File directory) {
synchronized public RandomAccessFile allocateAnonymousFile() throws IOException {
File file = getAnonymousFile();
- return new RandomAccessFile(file, "rw"/*nonNLS*/);
+ return new RandomAccessFile(file, "rw");
}
/**
* 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"/*nonNLS*/).digest(bytes);
+ byte hasharray[] = java.security.MessageDigest.getInstance("SHA").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"/*nonNLS*/);
+ sb.append(".jnk");
String fileName = sb.toString();
File file = fileForName(fileName);
if (!file.exists()) {
- RandomAccessFile raf = new RandomAccessFile(file, "rw"/*nonNLS*/);
+ RandomAccessFile raf = new RandomAccessFile(file, "rw");
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"/*nonNLS*/, ""/*nonNLS*/, "/"/*nonNLS*/ + path);
+ return new URL("file", "", "/" + 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"/*nonNLS*/);
+ sb.append(".jnk");
return sb.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CharArrayBuffer.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CharArrayBuffer.java
index 37fa2e55ae..00b18b29a3 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CharArrayBuffer.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CharArrayBuffer.java
@@ -1,26 +1,5 @@
package org.eclipse.jdt.internal.core.util;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The <code>CharArrayBuffer</code> is intended as a lightweight partial implementation
- * of the StringBuffer class, but using <code>char[]'s</code> instead of Strings.
- *
- * <p>The <code>CharArrayBuffer</code> maintains a list of <code>char[]'s</code>
- * which don't get appended until the user asks for them. The following
- * code illustrates how to use the class.
- *
- * <code>
- * CharArrayBuffer buffer = new CharArrayBuffer(myCharArray);
- * buffer.append(moreBytes, 0, someLength);
- * myCharArray = buffer.getContents();
- * </code>
- *
- * <p>NOTE: This class is not Thread safe!
- */
public class CharArrayBuffer {
/**
* This is the buffer of char arrays which must be appended together
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CharArrayOps.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CharArrayOps.java
index 66c4306f0c..f8c98a9c9c 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CharArrayOps.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/CharArrayOps.java
@@ -1,14 +1,5 @@
package org.eclipse.jdt.internal.core.util;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * A class to do characters operations so that we can use
- * char arrays more effectively.
- */
public class CharArrayOps {
/**
* Returns the char arrays as an array of Strings
@@ -89,9 +80,9 @@ public static int indexOf(char character, char[] buffer, int offset) {
* Extracts a sub-array from the given array, starting
* at the given startIndex and proceeding for length characters.
* Returns null if:
- * 1. the src array is null
- * 2. the start index is out of bounds
- * 3. the length parameter specifies a end point which is out of bounds
+ * 1. the src array is null
+ * 2. the start index is out of bounds
+ * 3. the length parameter specifies a end point which is out of bounds
* Does not return a copy of the array if possible, i.e. if start is zero
* and length equals the length of the src array.
*
@@ -119,9 +110,9 @@ public static char[] subarray(char[] src, int start, int length) {
* Extracts a substring from the given array, starting
* at the given startIndex and proceeding for length characters.
* Returns null if:
- * 1. the src array is null
- * 2. the start index is out of bounds
- * 3. the length parameter specifies a end point which is out of bounds
+ * 1. the src array is null
+ * 2. the start index is out of bounds
+ * 3. the length parameter specifies a end point which is out of bounds
* Does not return a copy of the array if possible, i.e. if start is zero
* and length equals the length of the src array.
*
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 7213985e80..4ad9234622 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
@@ -4,8 +4,6 @@ package org.eclipse.jdt.internal.core.util;
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
-import org.eclipse.jdt.internal.core.Util;
-
import java.io.*;
import java.util.*;
@@ -171,9 +169,9 @@ public class DiskCache {
EntryCache fEntryCache;
- 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*/;
+ static final String CONTENTS_FILE_NAME = "contents";
+ static final String TEMP_CONTENTS_FILE_NAME = "tempcont";
+ static final String CONTENTS_VERSION = "DiskCache.V1.0";
/**
* Set to true when cache is modified, cleared when saved.
@@ -217,7 +215,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"/*nonNLS*/);
+ throw new IOException("Entry size greater than cache size");
}
final File file;
OutputStream output;
@@ -518,7 +516,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"/*nonNLS*/));
+ throw new IOException("Invalid format");
}
/* Read to a temp. array of entries. The entries are in most- to
@@ -736,7 +734,7 @@ public synchronized void removeAll(Vector keys) {
}
}
};
- fPeriodicSaveThread.setName("DiskCache periodic save"/*nonNLS*/);
+ fPeriodicSaveThread.setName("DiskCache periodic save");
fPeriodicSaveThread.start();
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCacheEntry.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCacheEntry.java
index 085b429f7d..d5d374fbcd 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCacheEntry.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/DiskCacheEntry.java
@@ -1,15 +1,5 @@
package org.eclipse.jdt.internal.core.util;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * A <code>DiskCacheEntry</code> represents the results of looking up an
- * entry in a <code>DiskCache</code>. It is part of the DiskCache API and is
- * not necessarily used as the internal representation.
- */
public class DiskCacheEntry {
String fKey;
int fSize;
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 2f61613f59..6d3096148d 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("["/*nonNLS*/);
+ fWriter.print("[");
for (int i = 0; i < len; ++i) {
if (!oneLine) {
if ((i % maxPerLine) == 0) {
fWriter.println();
tabIfNeeded();
fWriter.print(i);
- fWriter.print(": "/*nonNLS*/);
+ fWriter.print(": ");
}
}
fWriter.print(val[i]);
if (i + 1 < len) {
- fWriter.print(", "/*nonNLS*/);
+ fWriter.print(", ");
}
}
if (oneLine) {
- fWriter.print("]"/*nonNLS*/);
+ fWriter.print("]");
fWriter.println();
}
else {
fWriter.println();
--fTabLevel;
tabIfNeeded();
- fWriter.print("]"/*nonNLS*/);
+ fWriter.print("]");
fWriter.println();
}
}
@@ -94,7 +94,7 @@ public void dump(int[] val, int maxPerLine) {
*/
public void dump(Object[] val) {
int len = val.length;
- fWriter.print("["/*nonNLS*/);
+ fWriter.print("[");
if (len > 0) {
fWriter.println();
++fTabLevel;
@@ -104,7 +104,7 @@ public void dump(Object[] val) {
--fTabLevel;
tabIfNeeded();
}
- fWriter.println("]"/*nonNLS*/);
+ fWriter.println("]");
}
/**
* Dumps the given array.
@@ -116,20 +116,20 @@ public void dump(String[] val, int maxPerLine) {
if (!oneLine) {
++fTabLevel;
}
- fWriter.print("["/*nonNLS*/);
+ fWriter.print("[");
boolean newLine = !oneLine;
for (int i = 0; i < len; ++i) {
if (newLine) {
fWriter.println();
tabIfNeeded();
}
- fWriter.print("\""/*nonNLS*/ + val[i] + "\""/*nonNLS*/);
+ fWriter.print("\"" + val[i] + "\"");
if (i + 1 < len) {
- fWriter.print(", "/*nonNLS*/);
+ fWriter.print(", ");
}
newLine = (i != 0 && (i % maxPerLine) == 0);
}
- fWriter.print("]"/*nonNLS*/);
+ fWriter.print("]");
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) + " {"/*nonNLS*/);
+ fWriter.println(classNameFor(val) + " {");
int originalLevel = fTabLevel;
++fTabLevel;
try {
dumpable.dump(this);
}
catch (Throwable t) {
- fWriter.println("*ERR*"/*nonNLS*/);
+ fWriter.println("*ERR*");
}
fTabLevel = originalLevel;
tabIfNeeded();
- fWriter.println("}"/*nonNLS*/);
+ fWriter.println("}");
}
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"/*nonNLS*/ : "\""/*nonNLS*/ + val + "\""/*nonNLS*/);
+ fWriter.println(val == null ? "null" : "\"" + val + "\"");
}
/**
* 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(": "/*nonNLS*/);
+ fWriter.print(": ");
}
/**
* 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(" "/*nonNLS*/);
+ fWriter.print(" ");
}
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HackFinder.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HackFinder.java
index 71aae5a621..a060884a13 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HackFinder.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/HackFinder.java
@@ -1,9 +1,4 @@
package org.eclipse.jdt.internal.core.util;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
public class HackFinder {
/**
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/IComparator.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/IComparator.java
index 24dfa25b2e..80b583db40 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/IComparator.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/IComparator.java
@@ -1,13 +1,5 @@
package org.eclipse.jdt.internal.core.util;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * An interface for comparing two objects according to a partial order.
- */
public interface IComparator {
/**
* Returns an integer < 0 if o1 is less than o2, > 0 if o1 is greater
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ILRUCacheable.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ILRUCacheable.java
index 5b1e6d30e0..e73634a8c7 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ILRUCacheable.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ILRUCacheable.java
@@ -1,17 +1,5 @@
package org.eclipse.jdt.internal.core.util;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * Types implementing this interface can occupy a variable amount of space
- * in an LRUCache. Cached items that do not implement this interface are
- * considered to occupy one unit of space.
- *
- * @see LRUCache
- */
public interface ILRUCacheable {
/**
* Returns the space the receiver consumes in an LRU Cache. The default space
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/IProgressListener.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/IProgressListener.java
index 226cb7c6ae..ffce4a37a1 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/IProgressListener.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/IProgressListener.java
@@ -1,27 +1,5 @@
package org.eclipse.jdt.internal.core.util;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-
-/**
-The <code>IProgressListener</code> interface is implemented
-by objects that monitor the progress of an activity.
-<p> All activity is broken down into a linear sequence of tasks against
-which progress is reported. When a task begins, a <code>begin</code>
-notification is reported, followed by any number and mixture of progress
-reports (<code>worked()</code>) and subtask
-notifications (<code>nowDoing()</code>). When the task
-is eventually completed, a <code>done()</code> notification is reported.
-
-<p> Since notification is synchronous with the activity itself,
-the listener should provide a fast and robust implementation.
-If the handling of notifications would involve blocking operations,
-or operations which might throw uncaught exceptions, the notifications
-should be queued, and the actual processing delegated to a separate thread.
- */
public interface IProgressListener {
/** Notifies that the main task is beginning.
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 fbac18a93b..933c6e1fbf 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 ["/*nonNLS*/ + _fKey + "-->"/*nonNLS*/ + _fValue + "]"/*nonNLS*/;
+ return "LRUCacheEntry [" + _fKey + "-->" + _fValue + "]";
}
}
@@ -444,7 +444,7 @@ public class LRUCache implements Cloneable {
*/
public String toString() {
return
- "LRUCache "/*nonNLS*/ + (fCurrentSpace * 100.0 / fSpaceLimit) + "% full\n"/*nonNLS*/ +
+ "LRUCache " + (fCurrentSpace * 100.0 / fSpaceLimit) + "% full\n" +
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(" -> "/*nonNLS*/);
+ result.append(" -> ");
result.append(value);
- result.append("\n"/*nonNLS*/);
+ result.append("\n");
}
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 74888e9e6b..ee1bf5c9f0 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"/*nonNLS*/);
+ throw new NoSuchElementException("LookupTable Enumerator");
}
}
/**
@@ -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: "/*nonNLS*/+
+ throw new IllegalArgumentException("Illegal Capacity: "+
initialCapacity);
if (loadFactor <= 0)
- throw new IllegalArgumentException("Illegal Load: "/*nonNLS*/+loadFactor);
+ throw new IllegalArgumentException("Illegal Load: "+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 "/*nonNLS*/ + where + ": key is null, but value isn't at index "/*nonNLS*/ + i);
+ System.err.println("LookupTable sanity check in " + where + ": key is null, but value isn't at index " + i);
throw new Error();
}
}
else {
if (values[i] == null) {
- System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": value is null, but key isn't at index "/*nonNLS*/ + i);
+ System.err.println("LookupTable sanity check in " + where + ": value is null, but key isn't at index " + i);
throw new Error();
}
else {
++n;
Object value = get(keys[i]);
if (value == null || value != values[i]) {
- System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": key doesn't hash to proper value: "/*nonNLS*/ + keys[i]);
+ System.err.println("LookupTable sanity check in " + where + ": key doesn't hash to proper value: " + keys[i]);
throw new Error();
}
}
}
}
if (n != count) {
- System.err.println("LookupTable sanity check in "/*nonNLS*/ + where + ": count is "/*nonNLS*/ + count + " but there are "/*nonNLS*/ + n + " entries"/*nonNLS*/);
+ System.err.println("LookupTable sanity check in " + where + ": count is " + count + " but there are " + n + " entries");
throw new Error();
}
}
@@ -473,7 +473,7 @@ public class LookupTable extends Dictionary implements Cloneable {
*/
public synchronized String toString() {
StringBuffer buf = new StringBuffer();
- buf.append("{"/*nonNLS*/);
+ buf.append("{");
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(", "/*nonNLS*/);
+ buf.append(", ");
}
if (buf.length() > 1000) {
- buf.append("..."/*nonNLS*/);
+ buf.append("...");
break;
}
else {
- buf.append(keys[i]).append("="/*nonNLS*/).append(values[i]);
+ buf.append(keys[i]).append("=").append(values[i]);
}
}
}
- buf.append("}"/*nonNLS*/);
+ buf.append("}");
return buf.toString();
}
}
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.java
index 1ad3ebfc66..6c6e7c5dec 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ReferenceInfoAdapter.java
@@ -1,14 +1,5 @@
package org.eclipse.jdt.internal.core.util;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * An adapter which implements the methods for handling
- * reference information from the parser.
- */
public abstract class ReferenceInfoAdapter {
/**
* Does nothing.
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 6846b44865..75cc7be99e 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
@@ -1,13 +1,5 @@
package org.eclipse.jdt.internal.core.util;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * A hash table keyed by strings and with int values.
- */
public class StringHashtableOfInt {
// to avoid using Enumerations, walk the individual tables skipping nulls
public String[] keyTable;
@@ -117,9 +109,9 @@ public String toString() {
String key = this.keyTable[i];
if (key != null) {
buffer.append(key);
- buffer.append(" -> "/*nonNLS*/);
+ buffer.append(" -> ");
buffer.append(this.valueTable[i]);
- buffer.append("\n"/*nonNLS*/);
+ buffer.append("\n");
}
}
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 3d161d9018..84ed9ca0e4 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("*"/*nonNLS*/))
+ if(fPattern.startsWith("*"))
fHasLeadingStar = true;
- if(fPattern.endsWith("*"/*nonNLS*/)) {
+ if(fPattern.endsWith("*")) {
/* make sure it's not an escaped wildcard */
if (fLength > 1 && fPattern.charAt(fLength - 2) != '\\') {
fHasTrailingStar = true;
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ToStringSorter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ToStringSorter.java
index d2e6e662ca..ede2146800 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ToStringSorter.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/ToStringSorter.java
@@ -1,28 +1,17 @@
package org.eclipse.jdt.internal.core.util;
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved.
- */
-import org.eclipse.jdt.core.*;
-/**
- * The SortOperation takes a collection of objects and returns
- * a sorted collection of these objects. The sorting of these
- * objects is based on their toString(). They are sorted in
- * alphabetical order.
- */
public class ToStringSorter {
Object[] sortedObjects;
String[] sortedStrings;
/**
- * Returns true if stringTwo is 'greater than' stringOne
- * This is the 'ordering' method of the sort operation.
+ * Returns true if stringTwo is 'greater than' stringOne
+ * This is the 'ordering' method of the sort operation.
*/
public boolean compare(String stringOne, String stringTwo) {
return stringOne.compareTo(stringTwo) < 0;
}
/**
- * Sort the objects in sorted collection and return that collection.
+ * Sort the objects in sorted collection and return that collection.
*/
private void quickSort(int left, int right) {
int originalLeft = left;
@@ -54,15 +43,15 @@ private void quickSort(int left, int right) {
quickSort(left, originalRight);
}
/**
- * Return a new sorted collection from this unsorted collection.
- * Sort using quick sort.
+ * Return a new sorted collection from this unsorted collection.
+ * Sort using quick sort.
*/
public void sort(Object[] unSortedObjects, String[] unsortedStrings) {
int size = unSortedObjects.length;
this.sortedObjects = new Object[size];
this.sortedStrings = new String[size];
- //copy the array so can return a new sorted collection
+ //copy the array so can return a new sorted collection
System.arraycopy(unSortedObjects, 0, this.sortedObjects, 0, size);
System.arraycopy(unsortedStrings, 0, this.sortedStrings, 0, size);
if (size > 1)

Back to the top