Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java9
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexInput.java5
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexOutput.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/EntryResult.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/FileDocument.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/HashtableOfObject.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IFileDocument.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IIndexConstants.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/Index.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexInput.java14
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexSummary.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexedFile.java12
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/JarFileDocument.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/JarFileEntryDocument.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/LRUCache.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/ObjectVector.java4
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/Util.java91
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddClassFileToIndex.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddCompilationUnitToIndex.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java16
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java40
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java26
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java12
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java12
27 files changed, 188 insertions, 101 deletions
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java
index f6df0d67b0..ef7e7589a8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/SearchEngine.java
@@ -19,6 +19,7 @@ import org.eclipse.jdt.internal.core.search.JavaSearchScope;
import org.eclipse.jdt.internal.core.search.JavaWorkspaceScope;
import org.eclipse.jdt.internal.core.search.PatternSearchJob;
import org.eclipse.jdt.internal.core.search.PathCollector;
+import org.eclipse.jdt.internal.core.search.Util;
import org.eclipse.jdt.internal.core.search.indexing.*;
import org.eclipse.jdt.internal.core.search.matching.*;
@@ -245,7 +246,7 @@ public void search(IWorkspace workspace, ISearchPattern searchPattern, IJavaSear
/* initialize progress monitor */
IProgressMonitor progressMonitor = resultCollector.getProgressMonitor();
if (progressMonitor != null) {
- progressMonitor.beginTask("Searching...", 105); // 5 for getting paths, 100 for locating matches
+ progressMonitor.beginTask(Util.bind("engine.searching"/*nonNLS*/), 105); // 5 for getting paths, 100 for locating matches
}
/* index search */
@@ -416,7 +417,7 @@ public void searchAllTypeNames(
*/
public void searchDeclarationsOfAccessedFields(IWorkspace workspace, IJavaElement enclosingElement, IJavaSearchResultCollector resultCollector) throws JavaModelException {
MatchLocator locator = new MatchLocator(
- (SearchPattern)createSearchPattern("*", IJavaSearchConstants.FIELD, IJavaSearchConstants.REFERENCES, true),
+ (SearchPattern)createSearchPattern("*"/*nonNLS*/, IJavaSearchConstants.FIELD, IJavaSearchConstants.REFERENCES, true),
IInfoConstants.DeclarationInfo,
resultCollector,
new JavaWorkspaceScope());
@@ -463,7 +464,7 @@ public void searchDeclarationsOfAccessedFields(IWorkspace workspace, IJavaElemen
*/
public void searchDeclarationsOfReferencedTypes(IWorkspace workspace, IJavaElement enclosingElement, IJavaSearchResultCollector resultCollector) throws JavaModelException {
MatchLocator locator = new MatchLocator(
- (SearchPattern)createSearchPattern("*", IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, true),
+ (SearchPattern)createSearchPattern("*"/*nonNLS*/, IJavaSearchConstants.TYPE, IJavaSearchConstants.REFERENCES, true),
IInfoConstants.DeclarationInfo,
resultCollector,
new JavaWorkspaceScope());
@@ -513,7 +514,7 @@ public void searchDeclarationsOfReferencedTypes(IWorkspace workspace, IJavaEleme
*/
public void searchDeclarationsOfSentMessages(IWorkspace workspace, IJavaElement enclosingElement, IJavaSearchResultCollector resultCollector) throws JavaModelException {
MatchLocator locator = new MatchLocator(
- (SearchPattern)createSearchPattern("*", IJavaSearchConstants.METHOD, IJavaSearchConstants.REFERENCES, true),
+ (SearchPattern)createSearchPattern("*"/*nonNLS*/, IJavaSearchConstants.METHOD, IJavaSearchConstants.REFERENCES, true),
IInfoConstants.DeclarationInfo,
resultCollector,
new JavaWorkspaceScope());
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexInput.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexInput.java
index 7411051c4a..67bf68deeb 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexInput.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexInput.java
@@ -5,6 +5,7 @@ package org.eclipse.jdt.internal.core.index.impl;
* All Rights Reserved.
*/
import org.eclipse.jdt.internal.core.index.*;
+import org.eclipse.jdt.internal.core.search.Util;
import org.eclipse.jdt.internal.compiler.util.*;
import java.io.*;
@@ -189,10 +190,10 @@ public class BlocksIndexInput extends IndexInput {
public void open() throws IOException {
if (!opened) {
- raf= new SafeRandomAccessFile(indexFile, "r");
+ raf= new SafeRandomAccessFile(indexFile, "r"/*nonNLS*/);
String sig= raf.readUTF();
if (!sig.equals(IIndexConstants.SIGNATURE))
- throw new IOException("Wrong format");
+ throw new IOException(Util.bind("exception.wrongFormat"/*nonNLS*/));
int summaryBlockNum= raf.readInt();
raf.seek(summaryBlockNum * (long) IIndexConstants.BLOCK_SIZE);
summary= new IndexSummary();
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexOutput.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexOutput.java
index a0577e714c..a48657d6a8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexOutput.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/BlocksIndexOutput.java
@@ -152,7 +152,7 @@ public class BlocksIndexOutput extends IndexOutput {
firstInBlock= true;
firstIndexBlock= true;
firstFileListBlock= true;
- indexOut= new SafeRandomAccessFile(this.indexFile, "rw");
+ indexOut= new SafeRandomAccessFile(this.indexFile, "rw"/*nonNLS*/);
opened= true;
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/EntryResult.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/EntryResult.java
index 2dff5061c7..8ede6b7ef8 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/EntryResult.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/EntryResult.java
@@ -46,15 +46,15 @@ public int hashCode(){
}
public String toString(){
StringBuffer buffer = new StringBuffer(word.length * 2);
- buffer.append("EntryResult: word=");
+ buffer.append("EntryResult: word="/*nonNLS*/);
buffer.append(word);
- buffer.append(", refs={");
+ buffer.append(", refs={"/*nonNLS*/);
for (int i = 0; i < fileRefs.length; i++){
if (i > 0) buffer.append(',');
buffer.append(' ');
buffer.append(fileRefs[i]);
}
- buffer.append(" }");
+ buffer.append(" }"/*nonNLS*/);
return buffer.toString();
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/FileDocument.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/FileDocument.java
index 975a818990..701ec7815f 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/FileDocument.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/FileDocument.java
@@ -48,7 +48,7 @@ public class FileDocument extends PropertyDocument {
public String getType() {
int lastDot= file.getPath().lastIndexOf('.');
if (lastDot == -1)
- return "";
+ return ""/*nonNLS*/;
return file.getPath().substring(lastDot + 1);
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/HashtableOfObject.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/HashtableOfObject.java
index 41a966d6a9..d1e22b009e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/HashtableOfObject.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/HashtableOfObject.java
@@ -79,11 +79,11 @@ public final class HashtableOfObject {
return elementSize;
}
public String toString() {
- String s= "";
+ String s= ""/*nonNLS*/;
Object object;
for (int i= 0, length= valueTable.length; i < length; i++)
if ((object= valueTable[i]) != null)
- s += new String(keyTable[i]) + " -> " + object.toString() + "\n";
+ s += new String(keyTable[i]) + " -> "/*nonNLS*/ + object.toString() + "\n"/*nonNLS*/;
return s;
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IFileDocument.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IFileDocument.java
index 940dab27a6..33b33d4081 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IFileDocument.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IFileDocument.java
@@ -75,7 +75,7 @@ public class IFileDocument extends PropertyDocument {
public String getType() {
String extension= file.getFileExtension();
if (extension == null)
- return "";
+ return ""/*nonNLS*/;
return extension;
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IIndexConstants.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IIndexConstants.java
index 55fd6d3f57..512ebab730 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IIndexConstants.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IIndexConstants.java
@@ -4,7 +4,7 @@ public interface IIndexConstants {
/**
* The signature of the index file.
*/
- public static final String SIGNATURE= "INDEX FILE 0.001";
+ public static final String SIGNATURE= "INDEX FILE 0.001"/*nonNLS*/;
/**
* The signature of the index file.
*/
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/Index.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/Index.java
index 4148024005..f989c1f96a 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/Index.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/Index.java
@@ -53,7 +53,7 @@ public class Index implements IIndex {
*/
private String toString;
public Index(File indexDirectory) throws IOException {
- this(indexDirectory,".index");
+ this(indexDirectory,".index"/*nonNLS*/);
}
public Index(File indexDirectory, String indexName) throws IOException {
super();
@@ -215,7 +215,7 @@ public class Index implements IIndex {
//System.out.println("merge");
//initialisation of tempIndex
- File tempFile= new File(indexFile.getAbsolutePath() + "TempVA");
+ File tempFile= new File(indexFile.getAbsolutePath() + "TempVA"/*nonNLS*/);
boolean exists= indexFile.exists();
IndexInput mainIndexInput= new BlocksIndexInput(indexFile);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexInput.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexInput.java
index 5bb973b060..3aab5b9282 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexInput.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexInput.java
@@ -1,12 +1,12 @@
package org.eclipse.jdt.internal.core.index.impl;
-
+
/*
* (c) Copyright IBM Corp. 2000, 2001.
* All Rights Reserved.
*/
import java.io.*;
import org.eclipse.jdt.internal.core.index.*;
-
+
/**
* This class provides an input on an index, after it has been generated.<br>
* You can access all the files of an index via getNextFile(), getCurrentFile()
@@ -15,12 +15,12 @@ import org.eclipse.jdt.internal.core.index.*;
* (the open() method), usage, and closing (the close() method), to release the
* data source used by this input.
*/
-
+
public abstract class IndexInput {
protected int filePosition;
protected WordEntry currentWordEntry;
protected int wordPosition;
-
+
public IndexInput() {
super();
wordPosition= 1;
@@ -101,12 +101,6 @@ public abstract class IndexInput {
* Open the Source where the input gets the information from.
*/
public abstract void open() throws IOException;
- public void printStats(PrintStream out) {
- out.println("Index stats :");
- int numFiles= getNumFiles();
- out.println(" files: " + numFiles);
- out.println(" total words indexed (unique): " + this.getNumWords());
- }
/**
* Returns the list of the files containing the given word in the index.
*/
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexSummary.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexSummary.java
index fda0669e01..b5cf187257 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexSummary.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexSummary.java
@@ -45,7 +45,7 @@ public class IndexSummary {
char[] word;
int blockNum;
public String toString(){
- return "FirstWordInBlock: " + new String(word) + ", blockNum: " +blockNum;
+ return "FirstWordInBlock: "/*nonNLS*/ + new String(word) + ", blockNum: "/*nonNLS*/ + blockNum;
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexedFile.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexedFile.java
index 0f5256c5fd..d115c7d659 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexedFile.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/IndexedFile.java
@@ -20,10 +20,10 @@ import org.eclipse.jdt.internal.core.index.*;
public class IndexedFile implements IQueryResult {
protected String path;
protected int fileNumber;
- protected static final String INFO_BEGIN= "(";
- protected static final String INFO_END= ")";
- protected static final String INFO_SEPARATOR= ",";
- protected static final String INFO_VALUE_SEPARATOR= ":";
+ protected static final String INFO_BEGIN= "("/*nonNLS*/;
+ protected static final String INFO_END= ")"/*nonNLS*/;
+ protected static final String INFO_SEPARATOR= ","/*nonNLS*/;
+ protected static final String INFO_VALUE_SEPARATOR= ":"/*nonNLS*/;
protected static final int MAX_PROPERTIES_SIZE= 2 * 1024;
protected Hashtable properties;
protected int propertiesSize= 2 * (INFO_BEGIN.length() + INFO_END.length());
@@ -131,7 +131,7 @@ public class IndexedFile implements IQueryResult {
}
public String propertiesToString() {
if (properties.isEmpty())
- return "";
+ return ""/*nonNLS*/;
StringBuffer prop= new StringBuffer(INFO_BEGIN);
for (Enumeration e= getPropertyNames(); e.hasMoreElements();) {
String property= (String) e.nextElement();
@@ -160,6 +160,6 @@ public class IndexedFile implements IQueryResult {
properties.put(propertyName, value);
}
public String toString() {
- return "IndexedFile(" + fileNumber + ": " + path + ")";
+ return "IndexedFile("/*nonNLS*/ + fileNumber + ": "/*nonNLS*/ + path + ")"/*nonNLS*/;
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/JarFileDocument.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/JarFileDocument.java
index f689a1ff5f..bae4d88d5d 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/JarFileDocument.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/JarFileDocument.java
@@ -56,7 +56,7 @@ public String getStringContent() throws java.io.IOException {
public String getType() {
String extension= file.getFileExtension();
if (extension == null)
- return "";
+ return ""/*nonNLS*/;
return extension;
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/JarFileEntryDocument.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/JarFileEntryDocument.java
index d8dd5fe37a..db9f920441 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/JarFileEntryDocument.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/JarFileEntryDocument.java
@@ -19,7 +19,7 @@ public class JarFileEntryDocument extends PropertyDocument {
protected ZipEntry zipEntry;
protected byte[] byteContents;
protected Path zipFilePath;
- public static final String JAR_FILE_ENTRY_SEPARATOR = "|";
+ public static final String JAR_FILE_ENTRY_SEPARATOR = "|"/*nonNLS*/;
/**
* JarFileEntryDocument constructor comment.
*/
@@ -59,7 +59,7 @@ public String getStringContent() throws java.io.IOException {
* @see IDocument#getType
*/
public String getType() {
- return "class";
+ return "class"/*nonNLS*/;
}
public void setBytes(byte[] byteContents) {
this.byteContents = byteContents;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/LRUCache.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/LRUCache.java
index cdf8025586..7ca6386ab0 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/LRUCache.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/LRUCache.java
@@ -86,7 +86,7 @@ public class LRUCache implements Cloneable {
*/
public String toString() {
- return "LRUCacheEntry [" + _fKey + "-->" + _fValue + "]";
+ return "LRUCacheEntry ["/*nonNLS*/ + _fKey + "-->"/*nonNLS*/ + _fValue + "]"/*nonNLS*/;
}
}
@@ -451,7 +451,7 @@ public class LRUCache implements Cloneable {
*/
public String toString() {
- return "LRUCache " + (getCurrentSpace() * 100.0 / getSpaceLimit()) + "% full";
+ return "LRUCache "/*nonNLS*/ + (getCurrentSpace() * 100.0 / getSpaceLimit()) + "% full"/*nonNLS*/;
}
/**
* Updates the timestamp for the given entry, ensuring that the queue is
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/ObjectVector.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/ObjectVector.java
index bd7ba12ad8..ff99f5290e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/ObjectVector.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/index/impl/ObjectVector.java
@@ -56,9 +56,9 @@ public final class ObjectVector {
size= 0;
}
public String toString() {
- String s= "";
+ String s= ""/*nonNLS*/;
for (int i= 0; i < size; i++)
- s += elements[i].toString() + "\n";
+ s += elements[i].toString() + "\n"/*nonNLS*/;
return s;
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
index 8c5b5319d9..6e468c8852 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/HierarchyScope.java
@@ -67,7 +67,7 @@ private void buildResourceVector() throws JavaModelException {
zipFileName +
JAR_FILE_ENTRY_SEPARATOR +
type.getFullyQualifiedName().replace('.', '/') +
- ".class";
+ ".class"/*nonNLS*/;
this.resourcePaths.put(resourcePath, resourcePath);
paths.put(jar.getPath(), type);
} else {
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
index 3c9d79f192..5d3a2a46be 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/PatternSearchJob.java
@@ -74,7 +74,7 @@ public boolean execute() {
isComplete &= search(searchIndexes[i]);
}
if (JobManager.VERBOSE){
- System.out.println("-> execution time: " + executionTime + " ms. for : "+this);
+ System.out.println("-> execution time: "/*nonNLS*/ + executionTime + " ms. for : "/*nonNLS*/+this);
}
return isComplete;
}
@@ -96,7 +96,7 @@ public boolean search(IIndex index) {
try {
monitor.exitRead(); // free read lock
monitor.enterWrite(); // ask permission to write
- if (IndexManager.VERBOSE) System.out.println("-> merging index : "+index.getIndexFile());
+ if (IndexManager.VERBOSE) System.out.println("-> merging index : "/*nonNLS*/+index.getIndexFile());
index.save();
} catch(IOException e){
return FAILED;
@@ -116,6 +116,6 @@ public boolean search(IIndex index) {
}
}
public String toString(){
- return "searching " + pattern.toString();
+ return "searching "/*nonNLS*/ + pattern.toString();
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java
index 28ded259d9..a24d5c697e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/SubTypeSearchJob.java
@@ -56,7 +56,7 @@ public boolean search(IIndex index) {
try {
monitor.exitRead(); // free read lock
monitor.enterWrite(); // ask permission to write
- if (IndexManager.VERBOSE) System.out.println("-> merging index : "+index.getIndexFile());
+ if (IndexManager.VERBOSE) System.out.println("-> merging index : "/*nonNLS*/+index.getIndexFile());
index.save();
} catch(IOException e){
return FAILED;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/Util.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/Util.java
new file mode 100644
index 0000000000..93e6aaaac2
--- /dev/null
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/Util.java
@@ -0,0 +1,91 @@
+package org.eclipse.jdt.internal.core.search;
+
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+public class Util {
+ /* Bundle containing messages */
+ protected static ResourceBundle bundle;
+ private final static String bundleName = "org.eclipse.jdt.internal.core.search.Messages"/*nonNLS*/;
+ static {
+ relocalize();
+ }
+/**
+ * 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});
+}
+/**
+ * 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 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
+ */
+public static String bind(String id) {
+ return bind(id, (String[])null);
+}
+/**
+ * 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/search/org/eclipse/jdt/internal/core/search/indexing/AddClassFileToIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddClassFileToIndex.java
index ecadacfc8e..3f6d3ed475 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddClassFileToIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddClassFileToIndex.java
@@ -68,6 +68,6 @@ public void initializeContents() {
}
}
public String toString(){
- return "indexing " + resource.getName();
+ return "indexing "/*nonNLS*/ + resource.getName();
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddCompilationUnitToIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddCompilationUnitToIndex.java
index 41dc2dfc3a..5b1bd84a7b 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddCompilationUnitToIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddCompilationUnitToIndex.java
@@ -69,6 +69,6 @@ public void initializeContents() {
}
}
public String toString(){
- return "indexing " + resource.getName();
+ return "indexing "/*nonNLS*/ + resource.getName();
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
index 54da1f0655..bc57a19ed6 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java
@@ -73,11 +73,11 @@ public boolean execute() {
}
if (JobManager.VERBOSE)
- System.out.println("INDEX : " + zip.getName());
+ System.out.println("INDEX : "/*nonNLS*/ + zip.getName());
long initialTime = System.currentTimeMillis();
final Hashtable indexedFileNames = new Hashtable(100);
- IQueryResult[] results = index.queryInDocumentNames(""); // all file names
+ IQueryResult[] results = index.queryInDocumentNames(""/*nonNLS*/); // all file names
int resultLength = results == null ? 0 : results.length;
if (resultLength != 0) {
/* check integrity of the existing index file
@@ -135,11 +135,11 @@ public boolean execute() {
}
if (JobManager.VERBOSE)
System.out.println(
- "INDEX : "
+ "INDEX : "/*nonNLS*/
+ zip.getName()
- + " COMPLETE in "
+ + " COMPLETE in "/*nonNLS*/
+ (System.currentTimeMillis() - initialTime)
- + " ms");
+ + " ms"/*nonNLS*/);
} finally {
if (zip != null)
zip.close();
@@ -160,12 +160,12 @@ public String toString() {
if (resource != null) {
IPath location = resource.getLocation();
if (location == null){
- toString = "indexing ";
+ toString = "indexing "/*nonNLS*/;
} else {
- toString = "indexing " + location.toFile().toString();
+ toString = "indexing "/*nonNLS*/ + location.toFile().toString();
}
} else {
- toString = "indexing " + this.path.toFile().toString();
+ toString = "indexing "/*nonNLS*/ + this.path.toFile().toString();
}
}
return toString;
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java
index 2ade21d11d..e9756c4f2e 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/BinaryIndexer.java
@@ -13,16 +13,16 @@ import java.util.*;
import java.util.zip.*;
public class BinaryIndexer extends AbstractIndexer {
- public static final String[] FILE_TYPES= new String[] {"class"};
- private static final char[] BYTE = "byte".toCharArray();
- private static final char[] CHAR = "char".toCharArray();
- private static final char[] DOUBLE = "double".toCharArray();
- private static final char[] FLOAT = "float".toCharArray();
- private static final char[] INT = "int".toCharArray();
- private static final char[] LONG = "long".toCharArray();
- private static final char[] SHORT = "short".toCharArray();
- private static final char[] BOOLEAN = "boolean".toCharArray();
- private static final char[] VOID = "void".toCharArray();
+ public static final String[] FILE_TYPES= new String[] {"class"/*nonNLS*/};
+ private static final char[] BYTE = "byte"/*nonNLS*/.toCharArray();
+ private static final char[] CHAR = "char"/*nonNLS*/.toCharArray();
+ private static final char[] DOUBLE = "double"/*nonNLS*/.toCharArray();
+ private static final char[] FLOAT = "float"/*nonNLS*/.toCharArray();
+ private static final char[] INT = "int"/*nonNLS*/.toCharArray();
+ private static final char[] LONG = "long"/*nonNLS*/.toCharArray();
+ private static final char[] SHORT = "short"/*nonNLS*/.toCharArray();
+ private static final char[] BOOLEAN = "boolean"/*nonNLS*/.toCharArray();
+ private static final char[] VOID = "void"/*nonNLS*/.toCharArray();
private boolean needReferences;
@@ -442,14 +442,14 @@ private void indexClassFile(byte[] contents, char[] documentName) throws IOExcep
char[][] superinterfaces = replace('/', '.', reader.getInterfaceNames());
if (DEBUG) {
if (packageName != null) {
- System.out.println("package name = " + new String(packageName));
+ System.out.println("package name = "/*nonNLS*/ + new String(packageName));
}
if (name != null) {
- System.out.println("class name = " + new String(name));
+ System.out.println("class name = "/*nonNLS*/ + new String(name));
}
if (superinterfaces != null) {
for (int i = 0, max = superinterfaces.length; i < max; i++) {
- System.out.println("superinterfaces[" + i + "]= " + new String(superinterfaces[i]));
+ System.out.println("superinterfaces["/*nonNLS*/ + i + "]= "/*nonNLS*/ + new String(superinterfaces[i]));
}
}
}
@@ -460,7 +460,7 @@ private void indexClassFile(byte[] contents, char[] documentName) throws IOExcep
char[] superclass = replace('/', '.', reader.getSuperclassName());
if (DEBUG) {
if (superclass != null) {
- System.out.println("superclass name = " + new String(superclass));
+ System.out.println("superclass name = "/*nonNLS*/ + new String(superclass));
}
}
addClassDeclaration(reader.getModifiers(), packageName, name, enclosingTypeNames, superclass, superinterfaces);
@@ -477,19 +477,19 @@ private void indexClassFile(byte[] contents, char[] documentName) throws IOExcep
char[][] exceptionTypes = replace('/', '.', method.getExceptionTypeNames());
if (DEBUG) {
if (method.getSelector() != null) {
- System.out.println("method selector = " + new String(method.getSelector()));
+ System.out.println("method selector = "/*nonNLS*/ + new String(method.getSelector()));
}
if (parameterTypes != null) {
for (int j = 0, max2 = parameterTypes.length; j < max2; j++) {
- System.out.println("parameterTypes[" + j + "]= " + new String(parameterTypes[j]));
+ System.out.println("parameterTypes["/*nonNLS*/ + j + "]= "/*nonNLS*/ + new String(parameterTypes[j]));
}
}
if (returnType != null) {
- System.out.println("return type = " + new String(returnType));
+ System.out.println("return type = "/*nonNLS*/ + new String(returnType));
}
if (exceptionTypes != null) {
for (int j = 0, max2 = exceptionTypes.length; j < max2; j++) {
- System.out.println("exceptionTypes[" + j + "]= " + new String(exceptionTypes[j]));
+ System.out.println("exceptionTypes["/*nonNLS*/ + j + "]= "/*nonNLS*/ + new String(exceptionTypes[j]));
}
}
}
@@ -510,10 +510,10 @@ private void indexClassFile(byte[] contents, char[] documentName) throws IOExcep
char[] fieldType = decodeFieldType(replace('/', '.', field.getTypeName()));
if (DEBUG) {
if (fieldName != null) {
- System.out.println("field name = " + new String(fieldName));
+ System.out.println("field name = "/*nonNLS*/ + new String(fieldName));
}
if (fieldType != null) {
- System.out.println("field type = " + new String(fieldType));
+ System.out.println("field type = "/*nonNLS*/ + new String(fieldType));
}
}
addFieldDeclaration(fieldType, fieldName);
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java
index 1397c72c52..e74bdad95a 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IIndexConstants.java
@@ -9,20 +9,20 @@ import org.eclipse.jdt.internal.core.search.processing.*;
public interface IIndexConstants extends IJobConstants {
/* index encoding */
- char[] REF= "ref/".toCharArray();
- char[] FIELD_REF= "fieldRef/".toCharArray();
- char[] METHOD_REF= "methodRef/".toCharArray();
- char[] CONSTRUCTOR_REF= "constructorRef/".toCharArray();
- char[] TYPE_REF= "typeRef/".toCharArray();
- char[] SUPER_REF = "superRef/".toCharArray();
- char[] TYPE_DECL = "typeDecl/".toCharArray();
+ char[] REF= "ref/"/*nonNLS*/.toCharArray();
+ char[] FIELD_REF= "fieldRef/"/*nonNLS*/.toCharArray();
+ char[] METHOD_REF= "methodRef/"/*nonNLS*/.toCharArray();
+ char[] CONSTRUCTOR_REF= "constructorRef/"/*nonNLS*/.toCharArray();
+ char[] TYPE_REF= "typeRef/"/*nonNLS*/.toCharArray();
+ char[] SUPER_REF = "superRef/"/*nonNLS*/.toCharArray();
+ char[] TYPE_DECL = "typeDecl/"/*nonNLS*/.toCharArray();
int TYPE_DECL_LENGTH = 9;
- char[] CLASS_DECL= "typeDecl/C/".toCharArray();
- char[] INTERFACE_DECL= "typeDecl/I/".toCharArray();
- char[] METHOD_DECL= "methodDecl/".toCharArray();
- char[] CONSTRUCTOR_DECL= "constructorDecl/".toCharArray();
- char[] FIELD_DECL= "fieldDecl/".toCharArray();
- char[] OBJECT = "Object".toCharArray();
+ char[] CLASS_DECL= "typeDecl/C/"/*nonNLS*/.toCharArray();
+ char[] INTERFACE_DECL= "typeDecl/I/"/*nonNLS*/.toCharArray();
+ char[] METHOD_DECL= "methodDecl/"/*nonNLS*/.toCharArray();
+ char[] CONSTRUCTOR_DECL= "constructorDecl/"/*nonNLS*/.toCharArray();
+ char[] FIELD_DECL= "fieldDecl/"/*nonNLS*/.toCharArray();
+ char[] OBJECT = "Object"/*nonNLS*/.toCharArray();
char[][] COUNTS=
new char[][] { new char[] {'0'}, new char[] {'1'}, new char[] {'2'}, new char[] {'3'}, new char[] {'4'}, new char[] {'5'}, new char[] {'6'}, new char[] {'7'}, new char[] {'8'}, new char[] {'9'}
};
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java
index 6f33dcb46e..b51827be20 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexAllProject.java
@@ -45,7 +45,7 @@ public boolean execute(){
try {
monitor.exitRead(); // free read lock
monitor.enterWrite(); // ask permission to write
- if (IndexManager.VERBOSE) System.out.println("-> merging index : "+index.getIndexFile());
+ if (IndexManager.VERBOSE) System.out.println("-> merging index : "/*nonNLS*/+index.getIndexFile());
index.save();
} catch(IOException e){
return FAILED;
@@ -54,12 +54,12 @@ public boolean execute(){
monitor.enterRead(); // reacquire read permission
}
}
- final String OK = "OK";
- final String DELETED = "DELETED";
+ final String OK = "OK"/*nonNLS*/;
+ final String DELETED = "DELETED"/*nonNLS*/;
final long indexLastModified = index.getIndexFile().lastModified();
final Hashtable indexedFileNames = new Hashtable(100);
- IQueryResult[] results = index.queryInDocumentNames(""); // all file names
+ IQueryResult[] results = index.queryInDocumentNames(""/*nonNLS*/); // all file names
for (int i = 0, max = results == null ? 0 : results.length; i < max; i++){
String fileName = results[i].getPath();
indexedFileNames.put(fileName, DELETED);
@@ -68,7 +68,7 @@ public boolean execute(){
public boolean visit(IResource resource) {
if (resource.getType() == IResource.FILE) {
String extension = resource.getFileExtension();
- if ((extension != null) && extension.equalsIgnoreCase("java")) {
+ if ((extension != null) && extension.equalsIgnoreCase("java"/*nonNLS*/)) {
IPath path = resource.getLocation();
if (path != null){
File resourceFile = path.toFile();
@@ -108,6 +108,6 @@ public boolean execute(){
return COMPLETE;
}
public String toString(){
- return "indexing project "+ project.getName();
+ return "indexing project "/*nonNLS*/ + project.getName();
}
}
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
index ad4fcd7177..65e277dd61 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/IndexManager.java
@@ -56,13 +56,13 @@ public void activateProcessing() {
public void add(IFile resource){
if (JavaCore.getPlugin() == null || this.workspace == null) return;
String extension = resource.getFileExtension();
- if ("java".equals(extension)){
+ if ("java"/*nonNLS*/.equals(extension)){
AddCompilationUnitToIndex job = new AddCompilationUnitToIndex(resource, this);
if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {
job.initializeContents();
}
request(job);
- } else if ("class".equals(extension)){
+ } else if ("class"/*nonNLS*/.equals(extension)){
AddClassFileToIndex job = new AddClassFileToIndex(resource, this);
if (this.awaitingJobsCount() < MAX_FILES_IN_MEMORY) {
job.initializeContents();
@@ -76,7 +76,7 @@ public void add(IFile resource){
*/
public void checkIndexConsistency() {
- if (VERBOSE) System.out.println("STARTING - ensuring consistency");
+ if (VERBOSE) System.out.println("STARTING - ensuring consistency"/*nonNLS*/);
boolean wasEnabled = isEnabled();
try {
@@ -93,15 +93,15 @@ public void checkIndexConsistency() {
}
} finally {
if (wasEnabled) enable();
- if (VERBOSE) System.out.println("DONE - ensuring consistency");
+ if (VERBOSE) System.out.println("DONE - ensuring consistency"/*nonNLS*/);
}
}
private String computeIndexName(String pathString) {
byte[] pathBytes = pathString.getBytes();
checksumCalculator.reset();
checksumCalculator.update(pathBytes);
- String fileName = Long.toString(checksumCalculator.getValue()) + ".index";
- if (VERBOSE) System.out.println(" index name: " + pathString + " <----> " + fileName);
+ String fileName = Long.toString(checksumCalculator.getValue()) + ".index"/*nonNLS*/;
+ if (VERBOSE) System.out.println(" index name: "/*nonNLS*/ + pathString + " <----> "/*nonNLS*/ + fileName);
IPath indexPath = getJavaPluginWorkingLocation();
String indexDirectory = indexPath.toOSString();
if (indexDirectory.endsWith(File.separator)) {

Back to the top