Bug 264991 - Wrong 'unused' problem reported
Summary: Wrong 'unused' problem reported
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-16 04:42 EST by Dani Megert CLA
Modified: 2009-03-09 13:57 EDT (History)
3 users (show)

See Also:


Attachments
Interim patch (5.55 KB, patch)
2009-02-17 07:09 EST, Srikanth Sankaran CLA
frederic_fusier: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2009-02-16 04:42:55 EST
N20090215-2000.


public class A {
	public A(String s) {
		B.test();
	}

	private static class B extends A {
		public B() {
			super("");
		}

		private static void test() {
		};
	}

}

==> reports that B's constructor is unused. While this might be technically true it is required in order to correctly compile.
Comment 1 Dani Megert CLA 2009-02-16 04:43:59 EST
Caused by fix for bug 201912.
Comment 2 Philipe Mulet CLA 2009-02-16 10:06:37 EST
Maybe all constructors with explicit super constructor call being non trivial (the default super constructor) should be marked as used to avoid being complained against.
Comment 3 Srikanth Sankaran CLA 2009-02-17 05:14:34 EST

    We are incorrectly flagging some constructors as being unused. We need to
recognize the cases where the super class has no no-arg constructor and not
complain about "seemingly useless" constructors in these cases.

    Looking at delivering an interim fix for the next integration build, and the full and final fix subsequent to that.

Comment 4 Srikanth Sankaran CLA 2009-02-17 07:09:05 EST
Created attachment 125879 [details]
Interim patch


Suppress unused constructor warning on inner class constructors for the time being. Restored original behavior from ConstructorDeclaration.java version 1.100

Other warnings introduced by fix for bug#201912 are still in effect.
Comment 5 Frederic Fusier CLA 2009-02-17 07:38:47 EST
(In reply to comment #4)
> Created an attachment (id=125879) [details]
> Interim patch
> 
Released for 3.5M6 in HEAD stream.
Comment 6 Frederic Fusier CLA 2009-03-09 13:57:08 EDT
Verified for 3.5M6 using I20090309-0100