Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Configuration() Deprecated
Configuration() Deprecated [message #1723304] Sun, 14 February 2016 01:41 Go to next message
Brian Smither is currently offline Brian SmitherFriend
Messages: 13
Registered: February 2016
Location: Rocky Mountains, USA
Junior Member
From a tutorial, I entered:
Configuration cfg = new Configuration();

Eclipse 4.5.1 styled the statement as:
Configuration cfg = new --Configuration--(); (where -- is strikethru)
and said this is deprecated.

Disclaimer: I just started getting involved with Java programming a week ago.

The first question is: How does Eclipse know this is deprecated? Is this fact coded into Eclipse, or is it determined by information contained in the JRE/JDK?

I'm not finding any concrete, on-point discussion about Configuration() being deprecated from an Internet search.

So the second question is: Where would I find that discussion which would suggest what to do about it?

(I have plenty of experience dealing with deprecated functions in PHP, and the PHP documentation pages give guidance on what to use.)
Re: Configuration() Deprecated [message #1723326 is a reply to message #1723304] Sun, 14 February 2016 11:30 Go to previous messageGo to next message
Patrik Suzzi is currently offline Patrik SuzziFriend
Messages: 2
Registered: February 2018
Junior Member
Brian,

A class/method is deprecated when marked with the @Deprecated annotation in its source code.
If so, Eclipse shows a strike-through over the class /method name.

The name "Configuration" is a very common one, and it is probably used in many java libraries.
Therefore I cannot understand which class are talking about, unless you provide the full package name.

From this level, I can only suggest you to check carefully the "java full class name" of the Configuration class:.
- check the full class name of the Configuration class mentioned in the tutorial,
- compare it with the full class name of the Configuration class used in your class - check in the java imports .

As I develop in Java since a while, I'd suggest you to keep clearly in mind the name of java packages containing the classes you're using.
This will save you from lot of headaches.

Regards.
Patrik
Re: Configuration() Deprecated [message #1723332 is a reply to message #1723326] Sun, 14 February 2016 15:08 Go to previous message
Brian Smither is currently offline Brian SmitherFriend
Messages: 13
Registered: February 2016
Location: Rocky Mountains, USA
Junior Member
I see.

It apparently is coming from the freemarker.template.Configuration class in the FreeMarker jar. I conclude then that the tutorials that include the mentioned statement was written for a version of the jar that had use for this statement.

Looking at the FreeMarker documentation, I find that the lastest syntax is:
Configuration cfg = new Configuration(Configuration.VERSION_2_3_23);

Thank you.

[Updated on: Sun, 14 February 2016 15:14]

Report message to a moderator

Previous Topic:Displaying a jsp shows just binary junk
Next Topic:Create a toolbar programmatically and attach to an ID...
Goto Forum:
  


Current Time: Fri Apr 19 22:44:02 GMT 2024

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

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

Back to the top