Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » wrong dead code detection with eclispre 4.4rc1 and jdk1.8
wrong dead code detection with eclispre 4.4rc1 and jdk1.8 [message #1378617] Sat, 24 May 2014 10:00 Go to next message
Nicola Zanaga is currently offline Nicola ZanagaFriend
Messages: 56
Registered: July 2009
Member
This code generates a "dead code" warning:

public class Test4 {
Object o = null;

void test(int i) {
switch( i ) {
case 0:
o = new Object();
break;
case 1:
if( o == null ) {
System.out.println("");
}
}
}
}
Re: wrong dead code detection with eclispre 4.4rc1 and jdk1.8 [message #1379006 is a reply to message #1378617] Sat, 24 May 2014 14:03 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Not for me on I20140522-1330

Tom

On 24.05.14 12:01, Nicola Zanaga wrote:
> This code generates a "dead code" warning:
>
> public class Test4 {
> Object o = null;
> void test(int i) { switch( i ) {
> case 0:
> o = new Object();
> break;
> case 1:
> if( o == null ) {
> System.out.println("");
> }
> }
> }
> }
>
Re: wrong dead code detection with eclispre 4.4rc1 and jdk1.8 [message #1379140 is a reply to message #1379006] Sat, 24 May 2014 15:21 Go to previous messageGo to next message
Nicola Zanaga is currently offline Nicola ZanagaFriend
Messages: 56
Registered: July 2009
Member
I'have download eclipse 4.4rc2 64bit, jdk 1.8.0_05-b13

I confirm the warning when "compiler compliance level" = 1.8 (the warning disappears when set to 1.7)

Re: wrong dead code detection with eclispre 4.4rc1 and jdk1.8 [message #1379429 is a reply to message #1379140] Sat, 24 May 2014 18:18 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
I cannot reproduce either, using 4.4RC2 indeed, and compliance 1.8.

Have you checked that the example in your post is exact?

Any non-standard options?
Previous Topic:"Runnable Jar" option not visible in Export Wizard
Next Topic:eclipse source code
Goto Forum:
  


Current Time: Sat Nov 09 01:30:15 GMT 2024

Powered by FUDForum. Page generated in 0.05275 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top