Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » Configuration() Deprecated
Configuration() Deprecated [message #1723304] Sat, 13 February 2016 20:41 Go to next message
Eclipse UserFriend
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 06:30 Go to previous messageGo to next message
Eclipse UserFriend
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 10:08 Go to previous message
Eclipse UserFriend
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 10:14] by 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: Wed Jul 23 11:03:52 EDT 2025

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

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

Back to the top