Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 101018 Details for
Bug 232803
Reconcile doesn't find methods with a $ in parameter types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix and regression test
232803.txt (text/plain), 6.15 KB, created by
Jerome Lanneluc
on 2008-05-20 05:23:59 EDT
(
hide
)
Description:
Proposed fix and regression test
Filename:
MIME Type:
Creator:
Jerome Lanneluc
Created:
2008-05-20 05:23:59 EDT
Size:
6.15 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/BinaryTypeConverter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryTypeConverter.java,v >retrieving revision 1.17 >diff -u -r1.17 BinaryTypeConverter.java >--- model/org/eclipse/jdt/internal/core/BinaryTypeConverter.java 3 Apr 2008 11:17:59 -0000 1.17 >+++ model/org/eclipse/jdt/internal/core/BinaryTypeConverter.java 20 May 2008 09:23:10 -0000 >@@ -16,6 +16,7 @@ > import org.eclipse.jdt.core.IType; > import org.eclipse.jdt.core.ITypeParameter; > import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.core.Signature; > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.CompilationResult; > import org.eclipse.jdt.internal.compiler.ast.ASTNode; >@@ -47,7 +48,7 @@ > private HashSetOfCharArrayArray typeNames; > > public BinaryTypeConverter(ProblemReporter problemReporter, CompilationResult compilationResult, HashSetOfCharArrayArray typeNames) { >- super(problemReporter); >+ super(problemReporter, Signature.C_DOLLAR); > this.compilationResult = compilationResult; > this.typeNames = typeNames; > } >Index: model/org/eclipse/jdt/internal/compiler/parser/TypeConverter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/TypeConverter.java,v >retrieving revision 1.1 >diff -u -r1.1 TypeConverter.java >--- model/org/eclipse/jdt/internal/compiler/parser/TypeConverter.java 3 Apr 2008 11:17:58 -0000 1.1 >+++ model/org/eclipse/jdt/internal/compiler/parser/TypeConverter.java 20 May 2008 09:23:10 -0000 >@@ -36,10 +36,12 @@ > > protected ProblemReporter problemReporter; > protected boolean has1_5Compliance; >+ private char memberTypeSeparator; > >- protected TypeConverter(ProblemReporter problemReporter) { >+ protected TypeConverter(ProblemReporter problemReporter, char memberTypeSeparator) { > this.problemReporter = problemReporter; > this.has1_5Compliance = problemReporter.options.complianceLevel >= ClassFileConstants.JDK1_5; >+ this.memberTypeSeparator = memberTypeSeparator; > } > > private void addIdentifiers(String typeSignature, int start, int endExclusive, int identCount, ArrayList fragments) { >@@ -248,8 +250,10 @@ > nameFragmentEnd = this.namePos-1; > this.namePos++; > break typeLoop; >- case Signature.C_DOT : > case Signature.C_DOLLAR: >+ if (this.memberTypeSeparator != Signature.C_DOLLAR) >+ break; >+ case Signature.C_DOT : > if (!nameStarted) { > nameFragmentStart = this.namePos+1; > nameStarted = true; >@@ -545,7 +549,8 @@ > int charIndex = start; > int i = 0; > while (charIndex < endInclusive) { >- if (typeSignature.charAt(charIndex) == Signature.C_DOT || typeSignature.charAt(charIndex) == Signature.C_DOLLAR) { >+ char currentChar; >+ if ((currentChar = typeSignature.charAt(charIndex)) == this.memberTypeSeparator || currentChar == Signature.C_DOT) { > typeSignature.getChars(start, charIndex, result[i++] = new char[charIndex - start], 0); > start = ++charIndex; > } else >Index: model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java,v >retrieving revision 1.59 >diff -u -r1.59 SourceTypeConverter.java >--- model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java 3 Apr 2008 11:17:58 -0000 1.59 >+++ model/org/eclipse/jdt/internal/compiler/parser/SourceTypeConverter.java 20 May 2008 09:23:10 -0000 >@@ -29,6 +29,7 @@ > import org.eclipse.jdt.core.IJavaElement; > import org.eclipse.jdt.core.ISourceRange; > import org.eclipse.jdt.core.JavaModelException; >+import org.eclipse.jdt.core.Signature; > import org.eclipse.jdt.core.compiler.CharOperation; > import org.eclipse.jdt.internal.compiler.CompilationResult; > import org.eclipse.jdt.internal.compiler.ast.*; >@@ -70,7 +71,7 @@ > private char[] source; > > private SourceTypeConverter(int flags, ProblemReporter problemReporter) { >- super(problemReporter); >+ super(problemReporter, Signature.C_DOT); > this.flags = flags; > } > >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java,v >retrieving revision 1.130 >diff -u -r1.130 ReconcilerTests.java >--- src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 21 Apr 2008 12:54:43 -0000 1.130 >+++ src/org/eclipse/jdt/core/tests/model/ReconcilerTests.java 20 May 2008 09:23:13 -0000 >@@ -3434,6 +3434,43 @@ > } > } > /* >+ * Ensures that a working copy with a type with a dollar name can be reconciled against without errors. >+ * (regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=232803 ) >+ */ >+public void testTypeWithDollarName3() throws CoreException { >+ ICompilationUnit workingCopy2 = null; >+ try { >+ WorkingCopyOwner owner = this.workingCopy.getOwner(); >+ workingCopy2 = getWorkingCopy( >+ "/Reconciler/src/p1/Cl$ss.java", >+ "package p1;\n" + >+ "public interface Cl$ss {\n" + >+ " public void test(Cl$ss c);\n" + >+ " public void foo();\n" + >+ "}", >+ owner >+ ); >+ setWorkingCopyContents( >+ "package p1;\n" + >+ "public class X {\n" + >+ " void m(Cl$ss c2) {\n" + >+ " c2.test(c2);\n" + >+ " c2.foo();\n" + >+ " }\n" + >+ "}" >+ ); >+ this.workingCopy.reconcile(ICompilationUnit.NO_AST, false, owner, null); >+ assertProblems( >+ "Unexpected problems", >+ "----------\n" + >+ "----------\n" >+ ); >+ } finally { >+ if (workingCopy2 != null) >+ workingCopy2.discardWorkingCopy(); >+ } >+} >+/* > * Ensures that a varargs method can be referenced from another working copy. > */ > public void testVarargs() throws CoreException {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 232803
:
100915
| 101018