Came accross this the other day when a coworker used sun.misc.Base64Decoder, something didn't feel right about the package name, but I had no justification on why he shouldn't use it. After a bit of searching I found the following link:
Sun Packages FAQ
Quote:
The java.*, javax.* and org.* packages documented in the Java 2 Platform Standard Edition API Specification make up the official, supported, public interface.
If a Java program directly calls only API in these packages, it will operate on all Java-compatible platforms, regardless of the underlying OS platform.
The sun.* packages are not part of the supported, public interface.
A Java program that directly calls into sun.* packages is not guaranteed to work on all Java-compatible platforms. In fact, such a program is not guaranteed to work even in future versions on the same platform.
Makes obvious sense now, but it was actually something I was not aware of.
Thursday, August 2, 2012
Subscribe to:
Post Comments (Atom)
Popular Posts
-
I have recently been slacking on content on my blog, between long stressful hours at work and to the wonderful toy that is an iPhone, I have...
-
I make no claim to be a "computer scientist" or a software "engineer", those titles alone can spark some debate, I regar...
-
I saw an article (well more of a rant) the other day, by Rob Williams Brain Drain in enterprise Dev . I have to say, I do agree with some o...
-
This series of posts will be about me getting to grips with JBoss Drools . The reasoning behind it is: SAP bought out my company's curre...
-
I recently finished 97 Things every programmer should know . Well to be completely honest I did skim over a couple of the 97, but all and al...

Checkstyle verwenden! Warnung bei sun.* Packages ist Standard für den IllegalImport Check (http://checkstyle.sourceforge.net/config_imports.html). Man kann Checkstyle Konfigurationen in die IDE laden oder z.B. in Maven Builds als Plugin integrieren. Noch komfortabler wird es mit Sonar (http://www.sonarsource.org/). Auch gleich mit Findbug kombinieren, damit andere typische Programmierfehler erkannt werden.
ReplyDeleteOk, my german isnt great, but I do get Checkstyle & Sonar, config, IDE, warning, illegalimport :)
ReplyDeleteYes we do use checkstyle (probably the reason I had not run into the issue before), it just happened that this bit of code wasn't in our standard maven / code setup yet.
I have seen Java with many packages which helpful in developing application.but i don't know more about sun.*.I just came to know from your site.
ReplyDeleteMany interesting information I can find what I am very happy.
ReplyDelete