Skip to content

Commit ac23816

Browse files
datho7561mickaelistria
authored andcommitted
Revert some changes in jdt.core to match upstream
- Undo `@since` and cosmetic changes - Remove changes from CompletionEngine Signed-off-by: David Thompson <[email protected]>
1 parent aae2745 commit ac23816

File tree

4 files changed

+21
-29
lines changed

4 files changed

+21
-29
lines changed

org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
import org.eclipse.jdt.core.search.SearchPattern;
5252
import org.eclipse.jdt.core.search.SearchRequestor;
5353
import org.eclipse.jdt.internal.codeassist.complete.*;
54-
import org.eclipse.jdt.internal.codeassist.impl.AssistOptions;
5554
import org.eclipse.jdt.internal.codeassist.impl.AssistParser;
5655
import org.eclipse.jdt.internal.codeassist.impl.Engine;
5756
import org.eclipse.jdt.internal.codeassist.impl.Keywords;
@@ -4183,7 +4182,7 @@ private void computeAlreadyDefinedName(
41834182
}
41844183
}
41854184

4186-
static int computeBaseRelevance(){
4185+
int computeBaseRelevance(){
41874186
return R_DEFAULT;
41884187
}
41894188

@@ -4803,22 +4802,18 @@ int computeRelevanceForCaseMatching(char[][] tokens, char[] proposalName) {
48034802
}
48044803

48054804
int computeRelevanceForCaseMatching(char[] token, char[] proposalName) {
4806-
return computeRelevanceForCaseMatching(token, proposalName, this.options);
4807-
}
4808-
4809-
static int computeRelevanceForCaseMatching(char[] token, char[] proposalName, AssistOptions options) {
48104805
if (CharOperation.equals(token, proposalName, true)) {
48114806
return R_EXACT_NAME + R_CASE;
48124807
} else if (CharOperation.equals(token, proposalName, false)) {
48134808
return R_EXACT_NAME;
48144809
} else if (CharOperation.prefixEquals(token, proposalName, false)) {
48154810
if (CharOperation.prefixEquals(token, proposalName, true))
48164811
return R_CASE;
4817-
} else if (options.camelCaseMatch && CharOperation.camelCaseMatch(token, proposalName)) {
4812+
} else if (this.options.camelCaseMatch && CharOperation.camelCaseMatch(token, proposalName)) {
48184813
return R_CAMEL_CASE;
4819-
} else if (options.substringMatch && CharOperation.substringMatch(token, proposalName)) {
4814+
} else if (this.options.substringMatch && CharOperation.substringMatch(token, proposalName)) {
48204815
return R_SUBSTRING;
4821-
} else if (options.subwordMatch && CharOperation.subWordMatch(token, proposalName)) {
4816+
} else if (this.options.subwordMatch && CharOperation.subWordMatch(token, proposalName)) {
48224817
return R_SUBWORD;
48234818
}
48244819
return 0;
@@ -5017,18 +5012,18 @@ int computeRelevanceForQualification(boolean prefixRequired) {
50175012
return 0;
50185013
}
50195014

5020-
static int computeRelevanceForResolution(){
5015+
int computeRelevanceForResolution(){
50215016
return computeRelevanceForResolution(true);
50225017
}
50235018

5024-
static int computeRelevanceForResolution(boolean isResolved){
5019+
int computeRelevanceForResolution(boolean isResolved){
50255020
if (isResolved) {
50265021
return R_RESOLVED;
50275022
}
50285023
return 0;
50295024
}
50305025

5031-
static int computeRelevanceForRestrictions(int accessRuleKind) {
5026+
int computeRelevanceForRestrictions(int accessRuleKind) {
50325027
if(accessRuleKind == IAccessRule.K_ACCESSIBLE) {
50335028
return R_NON_RESTRICTED;
50345029
}
@@ -13662,20 +13657,15 @@ private boolean isAllowingLongComputationProposals() {
1366213657
* <code>false</code> otherwise
1366313658
*/
1366413659
private boolean isFailedMatch(char[] token, char[] name) {
13665-
return isFailedMatch(token, name, this.options);
13666-
}
13667-
13668-
static boolean isFailedMatch(char[] token, char[] name, AssistOptions opt) {
13669-
if ((opt.substringMatch && CharOperation.substringMatch(token, name))
13670-
|| (opt.camelCaseMatch && CharOperation.camelCaseMatch(token, name))
13660+
if ((this.options.substringMatch && CharOperation.substringMatch(token, name))
13661+
|| (this.options.camelCaseMatch && CharOperation.camelCaseMatch(token, name))
1367113662
|| CharOperation.prefixEquals(token, name, false)
13672-
|| (opt.subwordMatch && CharOperation.subWordMatch(token, name))) {
13663+
|| (this.options.subwordMatch && CharOperation.subWordMatch(token, name))) {
1367313664
return false;
1367413665
}
1367513666

1367613667
return true;
1367713668
}
13678-
1367913669
private boolean isForbidden(ReferenceBinding binding) {
1368013670
for (int i = 0; i <= this.forbbidenBindingsPtr; i++) {
1368113671
if(this.forbbidenBindings[i] == binding) {

org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/CompilationUnit.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
*/
7070
public class CompilationUnit extends Openable implements ICompilationUnit, org.eclipse.jdt.internal.compiler.env.ICompilationUnit, SuffixConstants {
7171
public static boolean DOM_BASED_OPERATIONS = Boolean.getBoolean(CompilationUnit.class.getSimpleName() + ".DOM_BASED_OPERATIONS"); //$NON-NLS-1$
72-
7372
private static final IImportDeclaration[] NO_IMPORTS = new IImportDeclaration[0];
7473

7574
protected final String name;
@@ -448,10 +447,14 @@ public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyO
448447

449448
@Override
450449
public void codeComplete(int offset, CompletionRequestor requestor, WorkingCopyOwner workingCopyOwner, IProgressMonitor monitor) throws JavaModelException {
451-
452-
codeComplete(this,
450+
codeComplete(
451+
this,
453452
isWorkingCopy() ? (org.eclipse.jdt.internal.compiler.env.ICompilationUnit) getOriginalElement() : this,
454-
offset, requestor, workingCopyOwner, this, monitor);
453+
offset,
454+
requestor,
455+
workingCopyOwner,
456+
this,
457+
monitor);
455458
}
456459

457460
/**

org.eclipse.jdt.core/search/org/eclipse/jdt/core/search/IJavaSearchDelegate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* This interface makes use of internal classes and is not considered stable or API.
2626
*
27-
* @since 3.42
27+
* @since 3.41
2828
*/
2929
public interface IJavaSearchDelegate {
3030

@@ -41,4 +41,4 @@ public interface IJavaSearchDelegate {
4141
*/
4242
void locateMatches(MatchLocator locator, IJavaProject javaProject, PossibleMatch[] possibleMatches, int start, int length) throws CoreException;
4343

44-
}
44+
}

org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchingNodeSet.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public class MatchingNodeSet {
5252
SimpleSet possibleMatchingNodesSet = new SimpleSet(7);
5353
private final HashtableOfLong possibleMatchingNodesKeys = new HashtableOfLong(7);
5454

55+
5556
public MatchingNodeSet(boolean mustResolvePattern) {
5657
super();
5758
this.mustResolve = mustResolvePattern;
@@ -87,7 +88,6 @@ public int addMatch(ASTNode node, int matchLevel) {
8788
}
8889
return matchLevel;
8990
}
90-
9191
public void addPossibleMatch(ASTNode node) {
9292
// remove existing node at same position from set
9393
// (case of recovery that created the same node several time
@@ -103,6 +103,7 @@ public void addPossibleMatch(ASTNode node) {
103103
}
104104
public void addTrustedMatch(ASTNode node, boolean isExact) {
105105
addTrustedMatch(node, isExact ? EXACT_MATCH : POTENTIAL_MATCH);
106+
106107
}
107108
void addTrustedMatch(ASTNode node, Integer level) {
108109
// remove existing node at same position from set
@@ -117,7 +118,6 @@ void addTrustedMatch(ASTNode node, Integer level) {
117118
this.matchingNodes.put(node, level);
118119
this.matchingNodesKeys.put(key, node);
119120
}
120-
121121
protected boolean hasPossibleNodes(int start, int end) {
122122
Object[] nodes = this.possibleMatchingNodesSet.values;
123123
for (Object n : nodes) {
@@ -131,7 +131,6 @@ protected boolean hasPossibleNodes(int start, int end) {
131131
}
132132
return false;
133133
}
134-
135134
/**
136135
* Returns the matching nodes that are in the given range in the source order.
137136
*/

0 commit comments

Comments
 (0)