Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorptff2004-09-22 17:15:46 +0000
committerptff2004-09-22 17:15:46 +0000
commit6635f8a9a49dfb93a63a851a607addfcd6d83842 (patch)
treefdce176fa5d3396921df45832ea778e23a5e6d8f /org.eclipse.jdt.core
parent3b9b7a7d0a241f57946c2f7535b52039d498213e (diff)
downloadeclipse.jdt.core-6635f8a9a49dfb93a63a851a607addfcd6d83842.tar.gz
eclipse.jdt.core-6635f8a9a49dfb93a63a851a607addfcd6d83842.tar.xz
eclipse.jdt.core-6635f8a9a49dfb93a63a851a607addfcd6d83842.zip
R3_0_maintenance: rollback to 3.0.1 (version v_452_R30x)R3_0_1
Diffstat (limited to 'org.eclipse.jdt.core')
-rw-r--r--org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java24
-rw-r--r--org.eclipse.jdt.core/buildnotes_jdt-core.html31
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java27
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java4
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java3
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java56
-rw-r--r--org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java30
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java8
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java4
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/Indents.java12
-rw-r--r--org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.java6
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java2
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/SourceMapper.java7
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java4
-rw-r--r--org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/jdom/DOMCompilationUnit.java2
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/indexing/AddJarFileToIndex.java6
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java32
-rw-r--r--org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java17
18 files changed, 100 insertions, 175 deletions
diff --git a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
index 7bc82be539..a38edc9e4e 100644
--- a/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
+++ b/org.eclipse.jdt.core/batch/org/eclipse/jdt/internal/compiler/batch/Main.java
@@ -101,8 +101,8 @@ public class Main implements ProblemSeverities, SuffixConstants {
/**
* Lookup the message with the given ID in this catalog
- * @param id String
- * @return String
+ * @param id
+ * @return
*/
public static String bind(String id) {
return bind(id, (String[]) null);
@@ -111,9 +111,9 @@ public class Main implements ProblemSeverities, SuffixConstants {
/**
* Lookup the message with the given ID in this catalog and bind its
* substitution locations with the given string.
- * @param id String
- * @param binding String
- * @return String
+ * @param id
+ * @param binding
+ * @return
*/
public static String bind(String id, String binding) {
return bind(id, new String[] { binding });
@@ -122,10 +122,10 @@ public class Main implements ProblemSeverities, SuffixConstants {
/**
* Lookup the message with the given ID in this catalog and bind its
* substitution locations with the given strings.
- * @param id String
- * @param binding1 String
- * @param binding2 String
- * @return String
+ * @param id
+ * @param binding1
+ * @param binding2
+ * @return
*/
public static String bind(String id, String binding1, String binding2) {
return bind(id, new String[] { binding1, binding2 });
@@ -134,9 +134,9 @@ public class Main implements ProblemSeverities, SuffixConstants {
/**
* Lookup the message with the given ID in this catalog and bind its
* substitution locations with the given string values.
- * @param id String
- * @param bindings String[]
- * @return String
+ * @param id
+ * @param bindings
+ * @return
*/
public static String bind(String id, String[] bindings) {
if (id == null)
diff --git a/org.eclipse.jdt.core/buildnotes_jdt-core.html b/org.eclipse.jdt.core/buildnotes_jdt-core.html
index 7953c123cb..e2447c59bf 100644
--- a/org.eclipse.jdt.core/buildnotes_jdt-core.html
+++ b/org.eclipse.jdt.core/buildnotes_jdt-core.html
@@ -35,37 +35,6 @@
</tr>
</table>
-<a name="v_453"></a>
-<p><hr><h1>
-Eclipse Platform Build Notes&nbsp;<br>
-Java Development Tooling Core</h1>
-Eclipse SDK 3.0.1 Build - ? September 2004 - 3.0.2
-<br>Project org.eclipse.jdt.core v_453_R30x
-(<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/?only_with_tag=v_453_R30x">cvs</a>).
-<h2>
-What's new in this drop</h2>
-<ul>
-</ul>
-
-<h3>Problem Reports Fixed</h3>
-<a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73497">73497</a>
-Problem methods don't point to the right position in source
-<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=74014">74014</a>
-prefix path for source attachements - automatic detection does not seem to work
-<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73330">73330</a>
-NullPointerException in search
-<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73995">73995</a>
-[Javadoc] Wrong warning for missing return type description for @return {@inheritDoc}
-<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73551">73551</a>
-[Search] NPE while searching package declaration
-<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=71267">71267</a>
-[Search][Javadoc] SearchMatch in class javadoc reported with element of type IImportDeclaration
-<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73112">73112</a>
-[Search] SearchEngine doesn't find all fields multiple field declarations
-<br><a href="http://bugs.eclipse.org/bugs/show_bug.cgi?id=73348">73348</a>
-[Javadoc] Missing description for return tag is not always warned
-
-
<a name="v_452"></a>
<p><hr><h1>
Eclipse Platform Build Notes&nbsp;<br>
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
index 274b4946ad..e575af546b 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ClassFile.java
@@ -67,6 +67,7 @@ public class ClassFile
public boolean ownSharedArrays = false; // flag set when header/contents are set to shared arrays
public static final int INNER_CLASSES_SIZE = 5;
public CodeStream codeStream;
+ protected int problemLine; // used to create line number attributes for problem methods
public long targetJDK;
/**
@@ -558,7 +559,6 @@ public class ClassFile
generateCodeAttributeHeader();
codeStream.resetForProblemClinit(this);
String problemString = "" ; //$NON-NLS-1$
- int problemLine = 0;
if (problems != null) {
int max = problems.length;
StringBuffer buffer = new StringBuffer(25);
@@ -591,8 +591,7 @@ public class ClassFile
.scope
.referenceCompilationUnit()
.compilationResult
- .lineSeparatorPositions,
- problemLine);
+ .lineSeparatorPositions);
contents[attributeOffset++] = (byte) (attributeNumber >> 8);
contents[attributeOffset] = (byte) attributeNumber;
}
@@ -621,7 +620,6 @@ public class ClassFile
generateCodeAttributeHeader();
codeStream.reset(method, this);
String problemString = "" ; //$NON-NLS-1$
- int problemLine = 0;
if (problems != null) {
int max = problems.length;
StringBuffer buffer = new StringBuffer(25);
@@ -654,8 +652,7 @@ public class ClassFile
.scope
.referenceCompilationUnit()
.compilationResult
- .lineSeparatorPositions,
- problemLine);
+ .lineSeparatorPositions);
completeMethodInfo(methodAttributeOffset, attributeNumber);
}
@@ -707,7 +704,6 @@ public class ClassFile
generateCodeAttributeHeader();
codeStream.reset(method, this);
String problemString = "" ; //$NON-NLS-1$
- int problemLine = 0;
if (problems != null) {
int max = problems.length;
StringBuffer buffer = new StringBuffer(25);
@@ -744,8 +740,7 @@ public class ClassFile
.scope
.referenceCompilationUnit()
.compilationResult
- .lineSeparatorPositions,
- problemLine);
+ .lineSeparatorPositions);
completeMethodInfo(methodAttributeOffset, attributeNumber);
}
@@ -863,7 +858,7 @@ public class ClassFile
buffer.append("\t" + problem.getMessage() + "\n" ); //$NON-NLS-1$ //$NON-NLS-2$
buffer.insert(0, Util.bind("compilation.unresolvedProblem" )); //$NON-NLS-1$
String problemString = buffer.toString();
- int problemLine = problem.getSourceLineNumber();
+ this.problemLine = problem.getSourceLineNumber();
codeStream.init(this);
codeStream.preserveUnusedLocals = true;
@@ -875,8 +870,7 @@ public class ClassFile
completeCodeAttributeForMissingAbstractProblemMethod(
methodBinding,
codeAttributeOffset,
- compilationResult.lineSeparatorPositions,
- problemLine);
+ compilationResult.lineSeparatorPositions);
completeMethodInfo(methodAttributeOffset, attributeNumber);
}
@@ -887,8 +881,7 @@ public class ClassFile
public void completeCodeAttributeForMissingAbstractProblemMethod(
MethodBinding binding,
int codeAttributeOffset,
- int[] startLineIndexes,
- int problemLine) {
+ int[] startLineIndexes) {
// reinitialize the localContents with the byte modified by the code stream
this.contents = codeStream.bCodeStream;
int localContentsOffset = codeStream.classFileOffset;
@@ -1619,8 +1612,7 @@ public class ClassFile
*/
public void completeCodeAttributeForClinit(
int codeAttributeOffset,
- int[] startLineIndexes,
- int problemLine) {
+ int[] startLineIndexes) {
// reinitialize the contents with the byte modified by the code stream
this.contents = codeStream.bCodeStream;
int localContentsOffset = codeStream.classFileOffset;
@@ -1734,8 +1726,7 @@ public class ClassFile
AbstractMethodDeclaration method,
MethodBinding binding,
int codeAttributeOffset,
- int[] startLineIndexes,
- int problemLine) {
+ int[] startLineIndexes) {
// reinitialize the localContents with the byte modified by the code stream
this.contents = codeStream.bCodeStream;
int localContentsOffset = codeStream.classFileOffset;
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
index 40503c6c29..7170bbf40d 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/ConstructorDeclaration.java
@@ -326,8 +326,8 @@ public class ConstructorDeclaration extends AbstractMethodDeclaration {
* Given most constructors aren't, we only allocate the visited list
* lazily.
*
- * @param visited ArrayList
- * @return String
+ * @param visited
+ * @return
*/
public boolean isRecursive(ArrayList visited) {
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java
index 4633195db6..8a53e1bac7 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/JavadocReturnStatement.java
@@ -16,7 +16,6 @@ import org.eclipse.jdt.internal.compiler.lookup.*;
public class JavadocReturnStatement extends ReturnStatement {
public char[] description;
- public boolean empty = true;
public JavadocReturnStatement(int s, int e, char[] descr) {
super(null, s, e);
@@ -35,8 +34,6 @@ public class JavadocReturnStatement extends ReturnStatement {
: VoidBinding;
if (methodType == null || methodType == VoidBinding) {
scope.problemReporter().javadocUnexpectedTag(this.sourceStart, this.sourceEnd);
- } else if (this.empty) {
- scope.problemReporter().javadocInvalidTag(this.sourceStart, this.sourceEnd);
}
}
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
index ba54dd0819..ca99505046 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/AbstractCommentParser.java
@@ -15,7 +15,6 @@ import java.util.List;
import org.eclipse.jdt.core.compiler.CharOperation;
import org.eclipse.jdt.core.compiler.InvalidInputException;
-import org.eclipse.jdt.internal.compiler.ast.JavadocReturnStatement;
import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
/**
@@ -61,9 +60,6 @@ public abstract class AbstractCommentParser {
protected boolean lineStarted = false, inlineTagStarted = false;
protected int kind;
protected int[] lineEnds;
-
- // Store when return tag is parsed
- protected int returnTagPtr= -2;
// Private fields
private int currentTokenType = -1;
@@ -113,7 +109,7 @@ public abstract class AbstractCommentParser {
readChar(); // first '*'
char nextCharacter= readChar(); // second '*'
- // Init variables
+ // Init local variables
this.astLengthPtr = -1;
this.astPtr = -1;
this.currentTokenType = -1;
@@ -123,7 +119,6 @@ public abstract class AbstractCommentParser {
this.returnStatement = null;
this.inherited = false;
this.deprecated = false;
- this.returnTagPtr = -2;
this.linePtr = getLineNumber(javadocStart);
this.lastLinePtr = getLineNumber(javadocEnd);
this.lineEnd = (this.linePtr == this.lastLinePtr) ? this.endComment : this.scanner.getLineEnd(this.linePtr);
@@ -196,14 +191,6 @@ public abstract class AbstractCommentParser {
this.scanner.resetTo(this.index, this.endComment);
this.currentTokenType = -1; // flush token cache at line begin
try {
- // In case of previous return tag, set it to not empty if parsing an inline tag
- if (this.kind == COMPIL_PARSER && this.returnTagPtr != -2 && this.returnStatement != null) {
- this.returnTagPtr = -2;
- JavadocReturnStatement javadocReturn = (JavadocReturnStatement) this.returnStatement;
- javadocReturn.empty = javadocReturn.empty && !this.inlineTagStarted;
- }
-
- // Read tag name
int token = readTokenAndConsume();
this.tagSourceStart = this.scanner.getCurrentTokenStartPosition();
this.tagSourceEnd = this.scanner.getCurrentTokenEndPosition();
@@ -302,14 +289,13 @@ public abstract class AbstractCommentParser {
break;
case TerminalTokens.TokenNamereturn :
valid = parseReturn();
- /* verify characters after return tag (we're expecting text description)
+ // verify characters after return tag (we're expecting text description)
if(!verifyCharsAfterReturnTag(this.index)) {
if (this.sourceParser != null) {
int end = this.starPosition == -1 || this.lineEnd<this.starPosition ? this.lineEnd : this.starPosition;
this.sourceParser.problemReporter().javadocInvalidTag(this.tagSourceStart, end);
}
}
- */
break;
case TerminalTokens.TokenNamethrows :
valid = parseThrows(true);
@@ -1332,28 +1318,40 @@ public abstract class AbstractCommentParser {
/*
* Verify that some text exists after a @return tag. Text must be different than
* end of comment which may be preceeding by several '*' chars.
- *
+ */
private boolean verifyCharsAfterReturnTag(int startPosition) {
// Whitespace or inline tag closing brace
int previousPosition = this.index;
char ch = readChar();
- this.starPosition = -1;
- while (Character.isWhitespace(ch) || ch == '*') {
+ boolean malformed = true;
+ while (Character.isWhitespace(ch)) {
+ malformed = false;
previousPosition = this.index;
- if (ch == '*') {
- // valid whatever the number of star before last '/'
- this.starPosition = previousPosition;
- }
ch = readChar();
}
- // Look at possible end of comment
- if (this.starPosition >= startPosition) { // valid only if a star was previous character
- return ch == '/';
+ // End of comment
+ this.starPosition = -1;
+ nextChar: while (this.index<this.source.length) {
+ switch (ch) {
+ case '*':
+ // valid whatever the number of star before last '/'
+ this.starPosition = previousPosition;
+ break;
+ case '/':
+ if (this.starPosition >= startPosition) { // valid only if a star was previous character
+ return false;
+ }
+ default :
+ // valid if any other character is encountered, even white spaces
+ this.index = startPosition;
+ return !malformed;
+
+ }
+ previousPosition = this.index;
+ ch = readChar();
}
-
- // valid if next encountered is not, even white spaces
this.index = startPosition;
- return ch != '@';
+ return false;
}
/*
diff --git a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
index 58727cbf1d..7786636fff 100644
--- a/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
+++ b/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/parser/JavadocParser.java
@@ -271,7 +271,6 @@ public class JavadocParser extends AbstractCommentParser {
protected boolean parseReturn() {
if (this.returnStatement == null) {
this.returnStatement = createReturnStatement();
- this.returnTagPtr = this.astPtr;
return true;
}
if (this.sourceParser != null) this.sourceParser.problemReporter().javadocDuplicatedReturnTag(
@@ -371,34 +370,7 @@ public class JavadocParser extends AbstractCommentParser {
* @see org.eclipse.jdt.internal.compiler.parser.AbstractCommentParser#pushText(int, int)
*/
protected void pushText(int start, int end) {
- // In case of previous return tag, verify that text make it not empty
- if (this.returnTagPtr != -2 && this.returnStatement != null) {
- int position = this.index;
- this.index = start;
- boolean empty = true;
- boolean star = false;
- char ch = readChar();
- // Look for first character other than white or '*'
- if (Character.isWhitespace(ch) || start>(this.tagSourceEnd+1)) {
- while (this.index <= end && empty) {
- if (!star) {
- empty = Character.isWhitespace(ch) || ch == '*';
- star = ch == '*';
- } else if (ch != '*') {
- empty = false;
- break;
- }
- ch = readChar();
- }
- }
- // Store result in previous return tag
- ((JavadocReturnStatement)this.returnStatement).empty = empty;
- // Reset position and current ast ptr if we are on a different tag than previous return one
- this.index = position;
- if (this.returnTagPtr != this.astPtr) {
- this.returnTagPtr = -2;
- }
- }
+ // compiler does not matter of text
}
/*
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
index 2a2fe4a09b..c642c18f20 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/core/dom/ASTParser.java
@@ -689,10 +689,10 @@ public class ASTParser {
}
/**
- * @param monitor IProgressMonitor
- * @param compilationUnitDeclaration CompilationUnitDeclaration
- * @param source char[]
- * @return ASTNode
+ * @param monitor
+ * @param compilationUnitDeclaration
+ * @param source
+ * @return
*/
private ASTNode convert(IProgressMonitor monitor, CompilationUnitDeclaration compilationUnitDeclaration, char[] source, boolean needToResolveBindings) {
BindingResolver resolver = null;
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
index 2a5ed8f465..b1476ee7d8 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/ASTRewriteFormatter.java
@@ -209,8 +209,8 @@ import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
/**
* Creates a string that represents the given number of indents (can be spaces or tabs..)
- * @param indent int
- * @return String
+ * @param indent
+ * @return
*/
public String createIndentString(int indent) {
StringBuffer buf= new StringBuffer(indent * this.singleIndentString.length());
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/Indents.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/Indents.java
index 046c4ee998..540481b561 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/Indents.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/Indents.java
@@ -32,8 +32,8 @@ public class Indents {
/**
* Indent char is a space char but not a line delimiters.
* <code>== Character.isWhitespace(ch) && ch != '\n' && ch != '\r'</code>
- * @param ch char
- * @return boolean
+ * @param ch
+ * @return
*/
public static boolean isIndentChar(char ch) {
return Character.isWhitespace(ch) && !isLineDelimiterChar(ch);
@@ -78,13 +78,13 @@ public class Indents {
}
/**
- * Removes the given number of indents from the line. Asserts that the given line
+ * Removes the given number of idents from the line. Asserts that the given line
* has the requested number of indents. If <code>indentsToRemove <= 0</code>
* the line is returned.
* @param line The line to trim the indent
* @param indentsToRemove The indent level to remove
* @param tabWidth The current tab width
- * @return String The trimmed string
+ * @return
*/
public static String trimIndent(String line, int indentsToRemove, int tabWidth) {
if (line == null || indentsToRemove <= 0)
@@ -197,8 +197,8 @@ public class Indents {
* @param codeIndentLevel The indent level of the code
* @param tabWidth The current tab width setting
* @param newIndent The new Indent string
- * @param lineDelim The current line delimiter
- * @return String The changed string
+ * @param lineDelim THe current line delimiter
+ * @return
*/
public static String changeIndent(String code, int codeIndentLevel, int tabWidth, String newIndent, String lineDelim) {
try {
diff --git a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.java b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.java
index 3cdda7bdea..584b46a202 100644
--- a/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.java
+++ b/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/RewriteEventStore.java
@@ -374,9 +374,9 @@ public final class RewriteEventStore {
/**
* Kind is either ORIGINAL, NEW, or BOTH
- * @param value Object
- * @param kind int
- * @return RewriteEvent
+ * @param value
+ * @param kind
+ * @return
*/
public RewriteEvent findEvent(Object value, int kind) {
for (int i= 0; i < this.events.size(); i++) {
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java
index c6ad71e316..90b43ef64d 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/SourceElementRequestorAdapter.java
@@ -218,7 +218,7 @@ public class SourceElementRequestorAdapter implements ISourceElementRequestor {
}
/**
- * @see ISourceElementRequestor#exitField(int, int, int)
+ * @see ISourceElementRequestor#exitField(int)
*/
public void exitField(int initializationStart, int declarationEnd, int declarationSourceEnd) {
// default implementation: do nothing
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 8e4b2c7372..d969ade44d 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
@@ -387,15 +387,14 @@ public class SourceMapper
zip = manager.getZipFile(this.sourcePath);
for (Enumeration entries = zip.entries(); entries.hasMoreElements(); ) {
ZipEntry entry = (ZipEntry) entries.nextElement();
- String entryName;
- if (!entry.isDirectory() && Util.isJavaFileName(entryName = entry.getName())) {
- IPath path = new Path(entryName);
+ if (!entry.isDirectory()) {
+ IPath path = new Path(entry.getName());
int segmentCount = path.segmentCount();
if (segmentCount > 1) {
loop: for (int i = 0, max = path.segmentCount() - 1; i < max; i++) {
if (firstLevelPackageNames.contains(path.segment(i))) {
this.rootPaths.add(path.uptoSegment(i).toString());
- // don't break here as this path could contain other first level package names (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=74014)
+ break loop;
}
if (i == max - 1 && containsADefaultPackage) {
this.rootPaths.add(path.uptoSegment(max).toString());
diff --git a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java
index 53ed3aefab..33e7a622aa 100644
--- a/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java
+++ b/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/HierarchyResolver.java
@@ -744,8 +744,8 @@ private void setEnvironment(LookupEnvironment lookupEnvironment, HierarchyBuilde
/**
* Set the focus type (ie. the type that this resolver is computing the hierarch for.
* Returns the binding of this focus type or null if it could not be found.
- * @param compoundName char[]
- * @return ReferenceBinding
+ * @param compoundName
+ * @return
*/
public ReferenceBinding setFocusType(char[][] compoundName) {
if (compoundName == null || this.lookupEnvironment == null) return null;
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 97b2cdebf8..aab682b02f 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
@@ -159,7 +159,7 @@ void normalize(ILineStartFinder finder) {
initalizeHeader();
}
/**
- * @see IDOMCompilationUnit#setHeader(String)
+ * @see IDOMCompilationUnit@setHeader(String)
*/
public void setHeader(String comment) {
fHeader= comment;
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 2878e2b381..e263d9e611 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
@@ -158,12 +158,6 @@ class AddJarFileToIndex extends IndexRequest {
// index already existed: recreate it so that we forget about previous entries
SearchParticipant participant = SearchEngine.getDefaultSearchParticipant();
index = manager.recreateIndex(this.containerPath);
- if (index == null) {
- // failed to recreate index, see 73330
- manager.removeIndex(this.containerPath);
- return false;
- }
-
for (Enumeration e = zip.entries(); e.hasMoreElements();) {
if (this.isCancelled) {
if (JobManager.VERBOSE)
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
index 7d6be42cb1..99427d8661 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java
@@ -1027,8 +1027,6 @@ public SearchMatch newDeclarationMatch(
return new MethodDeclarationMatch(element, accuracy, offset, length, participant, resource);
case IJavaElement.LOCAL_VARIABLE:
return new LocalVariableDeclarationMatch(element, accuracy, offset, length, participant, resource);
- case IJavaElement.PACKAGE_DECLARATION:
- return new PackageDeclarationMatch(element, accuracy, offset, length, participant, resource);
default:
return null;
}
@@ -1409,6 +1407,32 @@ protected void reportMatching(CompilationUnitDeclaration unit, boolean mustResol
? unit.scope.getTypeOrPackage(CharOperation.subarray(importRef.tokens, 0, importRef.tokens.length))
: unit.scope.getTypeOrPackage(importRef.tokens);
this.patternLocator.matchLevelAndReportImportRef(importRef, binding, this);
+ } else {
+ if (node instanceof JavadocSingleTypeReference) {
+ // special case for javadoc single type reference
+ JavadocSingleTypeReference singleRef = (JavadocSingleTypeReference) node;
+ if (singleRef.packageBinding != null) {
+ char[][] tokens = new char[][] { singleRef.token };
+ long[] positions = new long[] { (((long) singleRef.sourceStart) << 32) + singleRef.sourceEnd };
+ int tagStart = singleRef.tagSourceStart;
+ int tagEnd = singleRef.tagSourceEnd;
+ JavadocImportReference importRef = new JavadocImportReference(tokens, positions, tagStart, tagEnd);
+ this.patternLocator.matchLevelAndReportImportRef(importRef, singleRef.packageBinding, this);
+ continue;
+ }
+ } else if (node instanceof JavadocQualifiedTypeReference) {
+ // special case for javadoc qualified type reference
+ JavadocQualifiedTypeReference qualifRef = (JavadocQualifiedTypeReference) node;
+ if (qualifRef.packageBinding != null) {
+ char[][] tokens = qualifRef.tokens;
+ long[] positions = qualifRef.sourcePositions;
+ int tagStart = qualifRef.tagSourceStart;
+ int tagEnd = qualifRef.tagSourceEnd;
+ JavadocImportReference importRef = new JavadocImportReference(tokens, positions, tagStart, tagEnd);
+ this.patternLocator.matchLevelAndReportImportRef(importRef, qualifRef.packageBinding, this);
+ continue;
+ }
+ }
}
nodeSet.addMatch(node, this.patternLocator.resolveLevel(node));
}
@@ -1474,9 +1498,7 @@ protected void reportMatching(FieldDeclaration field, TypeDeclaration type, IJav
}
if (typeInHierarchy) {
- // limit scan to end part position for multiple fields declaration (see bug 73112)
- int end = field.endPart2Position==0 ? field.declarationSourceEnd : field.endPart2Position;
- ASTNode[] nodes = nodeSet.matchingNodes(field.declarationSourceStart, end);
+ ASTNode[] nodes = nodeSet.matchingNodes(field.declarationSourceStart, field.declarationSourceEnd);
if (nodes != null) {
if ((this.matchContainer & PatternLocator.FIELD_CONTAINER) == 0) {
for (int i = 0, l = nodes.length; i < l; i++)
diff --git a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java
index d6f4015018..77d76a99f4 100644
--- a/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java
+++ b/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/PackageReferenceLocator.java
@@ -179,11 +179,6 @@ protected void matchReportReference(ASTNode reference, IJavaElement element, int
QualifiedTypeReference qTypeRef = (QualifiedTypeReference) reference;
positions = qTypeRef.sourcePositions;
typeBinding = qTypeRef.resolvedType;
- } else if (reference instanceof JavadocSingleTypeReference) {
- JavadocSingleTypeReference jsTypeRef = (JavadocSingleTypeReference) reference;
- positions = new long[1];
- positions[0] = (((long)jsTypeRef.sourceStart) << 32) + jsTypeRef.sourceEnd;
- typeBinding = jsTypeRef.resolvedType;
}
if (typeBinding instanceof ArrayBinding)
typeBinding = ((ArrayBinding) typeBinding).leafComponentType;
@@ -209,18 +204,6 @@ protected int referenceType() {
return IJavaElement.PACKAGE_FRAGMENT;
}
public int resolveLevel(ASTNode node) {
- if (node instanceof JavadocQualifiedTypeReference) {
- JavadocQualifiedTypeReference qualifRef = (JavadocQualifiedTypeReference) node;
- if (qualifRef.packageBinding != null)
- return resolveLevel(qualifRef.packageBinding);
- return resolveLevel(qualifRef.resolvedType);
- }
- if (node instanceof JavadocSingleTypeReference) {
- JavadocSingleTypeReference singleRef = (JavadocSingleTypeReference) node;
- if (singleRef.packageBinding != null)
- return resolveLevel(singleRef.packageBinding);
- return IMPOSSIBLE_MATCH;
- }
if (node instanceof QualifiedTypeReference)
return resolveLevel(((QualifiedTypeReference) node).resolvedType);
if (node instanceof QualifiedNameReference)

Back to the top