[messages] [Developers] Custom class version checks

Tim M timothy.mccarron at sbcglobal.net
Thu Jul 24 22:17:52 CEST 2014

"uckelman" wrote:
> I've looked into adding a class version check which happens when at
> class is imported in the Editor. Unfortunately, doing this is quite
> awkward because the place where class importation happens,
> ConfigureTree.importConfigurable(), is relying on the DataArchive's
> implementation of ClassLoader.  The only place you have the bytes
> which comprise the class file is inside one of the ClassLoader
> methods, and you have to have the bytes at offsets 5-8 in the class
> file to get the version information. The Class class doesn't provide
> any mechanism for getting them. So, we never have access to the bytes
> comprising the class file inside importConfigurable(), nor do we even
> know where to look for them from there---it's all hidden by the way
> that ClassLoaders work.
> I think this means that a check at import time is not feasible without
> some invasive restructuring.
> What do you guys think in light of that---introduce the check I
> originallly proposed, or not?

Go with the original. Seeing as we can't check the files on import we
could still target the Designers albeit without any verification -
simply change the Right click/Dialog text the designer sees from "import
custom class" to "import java5 custom class" - better than nothing,
maybe they see it, maybe they don't, might help a little

Read this topic online here:

More information about the messages mailing list