Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Eclipse 3.3 -> 3.4: Warning no longer reported
Eclipse 3.3 -> 3.4: Warning no longer reported [message #255091] Wed, 16 July 2008 15:11 Go to next message
Eclipse UserFriend
I'm using Eclipse 3.3 and am looking at using 3.4 on an existing project.
When I build the project with 3.4 one of the warnings reported under 3.3
is no longer reported.

The warning is "The method {methodName} does not override the inherited
method from {parent class} since it is private to a different package".
This can be seen in the following code:

Parent.java
-----------
package com.bar;

public class Parent {
static Object getSomething() {
return "parent";
}
}

Child.java
----------
package com.foo;

import com.bar.Parent;

public class Child extends Parent{
static Object getSomething() {
return "child";
}
}


This code in Eclipse 3.3 will display the warning at the getSomething() in
Child. The same code in Eclipse 3.4 displays no warning.

Is this a bug in 3.4? Or was 3.3 broken?

Thanks!
Re: Eclipse 3.3 -> 3.4: Warning no longer reported [message #255105 is a reply to message #255091] Thu, 17 July 2008 07:42 Go to previous message
Eclipse UserFriend
> Is this a bug in 3.4? Or was 3.3 broken?

3.3 was wrong, since static methods are not technically overriding each
other:

Try for instance:

class Parent {
static Object getSomething() {
return "parent";
}
}

class Child extends Parent {
@Override
static Object getSomething() {
return "child";
}
}

It will report an error which is valid.
Previous Topic:Question regarding copySubtree Method
Next Topic:Eclipse often freezes when cleaning projects
Goto Forum:
  


Current Time: Tue Jul 15 16:26:26 EDT 2025

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

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

Back to the top