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 23728 Details for
Bug 101208
[compiler] instanceof check cannot be unnecessary on null values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for CastTest
101208-tests-compiler.txt (text/plain), 1.85 KB, created by
Philipe Mulet
on 2005-06-22 09:41:21 EDT
(
hide
)
Description:
Patch for CastTest
Filename:
MIME Type:
Creator:
Philipe Mulet
Created:
2005-06-22 09:41:21 EDT
Size:
1.85 KB
patch
obsolete
>Index: CastTest.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java,v >retrieving revision 1.27 >diff -u -r1.27 CastTest.java >--- CastTest.java 31 May 2005 15:34:05 -0000 1.27 >+++ CastTest.java 22 Jun 2005 13:40:01 -0000 >@@ -346,7 +346,7 @@ > " public static void main(String[] args) {\n" + > " boolean b1 = new XM1() instanceof X; // UNnecessary\n" + > " boolean b2 = new X() instanceof XM1; // necessary\n" + >- " boolean b3 = null instanceof X; // UNnecessary\n" + >+ " boolean b3 = null instanceof X;\n" + > " }\n" + > " static class XM1 extends X {}\n" + > "}\n" >@@ -356,11 +356,6 @@ > " boolean b1 = new XM1() instanceof X; // UNnecessary\n" + > " ^^^^^^^^^^^^^^^^^^^^^^\n" + > "The expression of type X.XM1 is already an instance of type X\n" + >- "----------\n" + >- "2. ERROR in X.java (at line 5)\n" + >- " boolean b3 = null instanceof X; // UNnecessary\n" + >- " ^^^^^^^^^^^^^^^^^\n" + >- "The expression of type null is already an instance of type X\n" + > "----------\n", > null, > true, >@@ -1428,6 +1423,26 @@ > "Cannot cast from Integer[] to int[]\n" + > "----------\n"); > } >+//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101208 >+public void test038() { >+ this.runNegativeTest( >+ new String[] { >+ "X.java", >+ "public class X {\n" + >+ " void foo() {\n" + >+ " System.out.println(null instanceof Object);\n" + >+ " Zork z;\n" + >+ " }\n" + >+ "}\n" >+ }, >+ "----------\n" + >+ "1. ERROR in X.java (at line 4)\r\n" + >+ " Zork z;\r\n" + >+ " ^^^^\n" + >+ "Zork cannot be resolved to a type\n" + >+ "----------\n"); >+} >+ > public static Class testClass() { > return CastTest.class; > }
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 101208
:
23727
| 23728