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 163510 Details for
Bug 282141
[1.5][compiler] Raw type warning on instanceof
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Plausible patch
patch.txt (text/plain), 6.33 KB, created by
Srikanth Sankaran
on 2010-03-31 06:22:11 EDT
(
hide
)
Description:
Plausible patch
Filename:
MIME Type:
Creator:
Srikanth Sankaran
Created:
2010-03-31 06:22:11 EDT
Size:
6.33 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java,v >retrieving revision 1.60 >diff -u -r1.60 InstanceOfExpression.java >--- compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java 16 Mar 2010 14:36:12 -0000 1.60 >+++ compiler/org/eclipse/jdt/internal/compiler/ast/InstanceOfExpression.java 31 Mar 2010 10:16:26 -0000 >@@ -24,6 +24,7 @@ > public InstanceOfExpression(Expression expression, TypeReference type) { > this.expression = expression; > this.type = type; >+ type.bits |= IgnoreRawTypeCheck; // https://bugs.eclipse.org/bugs/show_bug.cgi?id=282141 > this.bits |= INSTANCEOF << OperatorSHIFT; > this.sourceStart = expression.sourceStart; > this.sourceEnd = type.sourceEnd; >#P org.eclipse.jdt.core.tests.compiler >Index: src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java,v >retrieving revision 1.817 >diff -u -r1.817 GenericTypeTest.java >--- src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 18 Mar 2010 16:22:35 -0000 1.817 >+++ src/org/eclipse/jdt/core/tests/compiler/regression/GenericTypeTest.java 31 Mar 2010 10:16:46 -0000 >@@ -5325,11 +5325,6 @@ > " } else if (t instanceof T) {\n" + > " ^^^^^^^^^^^^^^\n" + > "Cannot perform instanceof check against type parameter T. Use instead its erasure Object instead since further generic type information will be erased at runtime\n" + >- "----------\n" + >- "4. WARNING in X.java (at line 12)\n" + >- " } else if (t instanceof X) {\n" + >- " ^\n" + >- "X is a raw type. References to generic type X<T> should be parameterized\n" + > "----------\n", > null, > true, >@@ -26649,42 +26644,37 @@ > "}\n", > }, > "----------\n" + >- "1. WARNING in X.java (at line 4)\n" + >- " boolean b = o instanceof X;\n" + >- " ^\n" + >- "X is a raw type. References to generic type X<T> should be parameterized\n" + >- "----------\n" + >- "2. WARNING in X.java (at line 5)\n" + >+ "1. WARNING in X.java (at line 5)\n" + > " X x = (X) o;\n" + > " ^\n" + > "X is a raw type. References to generic type X<T> should be parameterized\n" + > "----------\n" + >- "3. WARNING in X.java (at line 5)\n" + >+ "2. WARNING in X.java (at line 5)\n" + > " X x = (X) o;\n" + > " ^\n" + > "X is a raw type. References to generic type X<T> should be parameterized\n" + > "----------\n" + >- "4. WARNING in X.java (at line 6)\n" + >+ "3. WARNING in X.java (at line 6)\n" + > " X<String> xs = (X<String>)o;\n" + > " ^^^^^^^^^^^^\n" + > "Type safety: Unchecked cast from Object to X<String>\n" + > "----------\n" + >- "5. ERROR in X.java (at line 7)\n" + >+ "4. ERROR in X.java (at line 7)\n" + > " Zork z;\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + > "----------\n" + >- "6. WARNING in X.java (at line 10)\n" + >+ "5. WARNING in X.java (at line 10)\n" + > " List l = (List) al;\n" + > " ^^^^\n" + > "List is a raw type. References to generic type List<E> should be parameterized\n" + > "----------\n" + >- "7. WARNING in X.java (at line 10)\n" + >+ "6. WARNING in X.java (at line 10)\n" + > " List l = (List) al;\n" + > " ^^^^^^^^^\n" + > "Unnecessary cast from ArrayList<String> to List\n" + > "----------\n" + >- "8. WARNING in X.java (at line 10)\n" + >+ "7. WARNING in X.java (at line 10)\n" + > " List l = (List) al;\n" + > " ^^^^\n" + > "List is a raw type. References to generic type List<E> should be parameterized\n" + >@@ -47867,12 +47857,7 @@ > "}\n", > }, > "----------\n" + >- "1. WARNING in A.java (at line 3)\n" + >- " boolean b=null instanceof A; \n" + >- " ^\n" + >- "A is a raw type. References to generic type A<T> should be parameterized\n" + >- "----------\n" + >- "2. ERROR in A.java (at line 4)\n" + >+ "1. ERROR in A.java (at line 4)\n" + > " Zork z;\n" + > " ^^^^\n" + > "Zork cannot be resolved to a type\n" + >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java,v >retrieving revision 1.294 >diff -u -r1.294 ASTConverter15Test.java >--- src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 3 Mar 2010 19:52:40 -0000 1.294 >+++ src/org/eclipse/jdt/core/tests/dom/ASTConverter15Test.java 31 Mar 2010 10:16:54 -0000 >@@ -662,9 +662,8 @@ > CompilationUnit compilationUnit = (CompilationUnit) result; > String expectedProblems = > "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" + >- "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" + > "Pair is a raw type. References to generic type Pair<A,B> should be parameterized"; >- assertProblemsSize(compilationUnit, 3, expectedProblems); >+ assertProblemsSize(compilationUnit, 2, expectedProblems); > ASTNode node = getASTNode(compilationUnit, 0, 5); > assertEquals("Wrong first character", '<', source[node.getStartPosition()]); > } >@@ -890,9 +889,8 @@ > CompilationUnit compilationUnit = (CompilationUnit) result; > String expectedProblems = > "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" + >- "Pair is a raw type. References to generic type Pair<A,B> should be parameterized\n" + > "Pair is a raw type. References to generic type Pair<A,B> should be parameterized"; >- assertProblemsSize(compilationUnit, 3, expectedProblems); >+ assertProblemsSize(compilationUnit, 2, expectedProblems); > ASTNode node = getASTNode(compilationUnit, 0, 5); > assertEquals("Not a method declaration", ASTNode.METHOD_DECLARATION, node.getNodeType()); > MethodDeclaration methodDeclaration = (MethodDeclaration) node;
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 282141
: 163510