Java impose final programmatically -


what's proper way ensure value gets set once, although time set unknown (ie: not in constructor). null check or keep track of flag , throw exception - exception should throw? it's small, localized library , prefer not create own valuealreadyassigned exception such seemingly generic case.

the method throw illegalstateexception, since it's javadocs say:

signals method has been invoked @ illegal inappropriate time.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -