[Clirr-devel] CVS: clirr/src/testinput/testlib-v1/testlib/modifiers EffectivelyFinal.java,NONE,1.1 N
Status: Alpha
Brought to you by:
lkuehne
From: Simon K. <s_k...@us...> - 2004-06-21 07:18:03
|
Update of /cvsroot/clirr/clirr/src/testinput/testlib-v1/testlib/modifiers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9524 Added Files: EffectivelyFinal.java NonFinalBecomesFinal.java Log Message: tests for ClassModifierCheck --- NEW FILE --- package testlib.modifiers; /** * Because this class has a package-scope constructor, no subclass of this * class can ever be created. And because of that, it is not a problem if * this class is declared "final" in a later version. * <p> * Classes with only private constructors are commonly used to implement * an "enumerated type" in java, as is done here. */ public class EffectivelyFinal { int val; public static final EffectivelyFinal ZERO = new EffectivelyFinal(0); public static final EffectivelyFinal ONE = new EffectivelyFinal(1); private EffectivelyFinal(int i) { val = i; } public int getValue() { return val; } } --- NEW FILE --- package testlib.modifiers; /** * It is a binary compatibility error for a non-final class to become * final in a later version, because users may have created classes which * are derived from it. Such classes will fail to load with the new version * of the class present. */ public class NonFinalBecomesFinal { } |