Question

I am using a UI component from J2ME Polish. I found a simple bug in the code, and want to quickly fix it but cannot find any build scripts in the download package, although source-code is included.

The problem cannot be solved by extending the class as it involves members with private access.

How should I go about fixing it? Should I simply compile the class in question with Javac or should try to locate build script in their repository?

Was it helpful?

Solution

There is no binary code for J2MEPolish UI library, because these classes are also preprocessed during your application compilation. This is why there is also no build script for J2MEPolish UI part - the resulting binary, if it compiles, would not make any sense :)

If you are using this UI class directly (there is no Polish magic involved) I would suggest to copy it into your own project, make the changes there and you should be just fine.

But there is a small issue. I'm not 100% sure, but Polish build process should be as follows: first your classes are preprocessed and then Polish classes will be preprocessed. If the UI component, that you copied into your project, will stay in the same java package, it could happen that your changes will be overwritten by buggy Polish implementation. You can check it by running the application or looking at the final java code in build directory.

If the overwriting problem happens, then you have two options - move UI class in your project into different package (I'm 99% sure this should be fine if you use it directly) or you need to modify Polish build process, so that it would preprocess Polish classes first and you could overwrite changes done by it.

/JaanusSiim

OTHER TIPS

I know this question has been answered and accepted but an easier method would be to used their built in property (for any one coming here via the magic search engines)

polish.client.source=/projecthome/j2me-polish-source

which is simply a copy of their sources packaged with the installer. You can copy this into your own source tree and thus have version history of your changes.

While JaanusSiim's method might work I would not recommend it as it becomes confusing having de.enough.** packages in your own source tree I normally create a src for my personal source and a src-j2mepolish for their source files this was it is VERY explicit what I have added to the standard versions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top