如何覆盖 J2ME Polish 二进制文件中的类?

发布于 2024-07-08 02:43:22 字数 191 浏览 11 评论 0原文

我正在使用 J2ME Polish 中的 UI 组件。 我在代码中发现了一个简单的错误,想要快速修复它,但在下载包中找不到任何构建脚本,尽管包含源代码。

该问题无法通过扩展类来解决,因为它涉及具有私有访问权限的成员。

我应该如何修复它? 我应该简单地使用 Javac 编译有问题的类还是应该尝试在其存储库中找到构建脚本?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

季末如歌 2024-07-15 02:43:22

J2MEPolish UI 库没有二进制代码,因为这些类也在应用程序编译期间进行了预处理。 这就是为什么 J2MEPolish UI 部分也没有构建脚本 - 如果编译生成的二进制文件没有任何意义:)

如果您直接使用这个 UI 类(不涉及波兰魔法),我建议复制将其放入您自己的项目中,在那里进行更改,您应该就可以了。

但有一个小问题。 我不是 100% 确定,但 Polish 构建过程应该如下:首先对您的类进行预处理,然后对 Polish 类进行预处理。 如果您复制到项目中的 UI 组件将保留在同一个 java 包中,则您的更改可能会被有问题的 Polish 实现覆盖。 您可以通过运行应用程序或查看构建目录中的最终 java 代码来检查它。

如果发生覆盖问题,那么你有两个选择 - 将项目中的 UI 类移动到不同的包中(我 99% 确定如果你直接使用它应该没问题)或者你需要修改 Polish 构建过程,以便它将首先预处理波兰语类,您可以覆盖它所做的更改。

/贾努斯·西姆

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

趴在窗边数星星i 2024-07-15 02:43:22

我知道这个问题已经得到回答并接受,但一种更简单的方法是使用它们的内置属性(对于通过神奇搜索引擎来到这里的任何人),

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

这只是与安装程序打包在一起的源代码的副本。 您可以将其复制到您自己的源代码树中,从而获得更改的版本历史记录。

虽然 JaanusSiim 的方法可能有效,但我不推荐它,因为在您自己的源代码树中使用 de.enough.** 包会让人感到困惑。我通常为我的个人源代码创建一个 src ,并为我的个人源代码创建一个 src- j2mepolish 对于他们的源文件,这是我添加到标准版本中的非常明确的内容。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文