Bug 48402 - Eclipse fails to compile Jakarta OptionBuilder static uses
Summary: Eclipse fails to compile Jakarta OptionBuilder static uses
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: 3.0 M6   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-10 05:34 EST by Juergen Weber CLA
Modified: 2003-12-10 06:04 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Weber CLA 2003-12-10 05:34:41 EST
The code below (from http://jakarta.apache.org/commons/cli/usage.html) compiles
with javac (tested 1.4.2 and IBM 1.3.0), but not with Eclipse.

Eclipse error:
The static method create(String) from the type OptionBuilder should be accessed
in a static way	OptionBuilderTest.java	


import org.apache.commons.cli.Option;
import org.apache.commons.cli.OptionBuilder;

public class OptionBuilderTest
{
	public static void main(String[] args)
	{
		Option logfile   = OptionBuilder.withArgName( "file" )
		.hasArg()
		.withDescription(  "use given file for log" )
		.create( "file" );
	}
}
Comment 1 Philipe Mulet CLA 2003-12-10 06:04:04 EST
Set Preferences>Java>Compiler>Style>Non-static access to static member>Warning 
or Ignore.

Note that by default this was not an error. You must have enabled it manually 
in order to get this diagnosis.