Java Compiler Defect when compiling with Java Compliance level.
I recently came across an interesting little bug with the Java compiler. On my Maximo development environment, I have Eclipse installed with Java 1.6. I use the compiler compliance level to make class files for both Maximo 7 (which is Java 1.5) and Maximo 6 (which is Java 1.4). However, when working on a class file for 1.4 level, I had the following lines of code.
String color = “blue”;
color = color.replace(“e”,”u”);
The above lines of code compiles without error and when tested on a JVM 1.5 or higher, runs without error. However, when I try to run this on a JVM 1.4, I get the error:
Method not found “color.replace”
This was a bit of a surprise to me since I know that replace does exist for JVM 1.4. After a bit of research I found my problem. (Bonus points if you can see it.) The problem is that in JVM 1.4, the only replace method for the String object only takes chars not strings. Java added the strings version in 1.5. I understand my bug and was easy to fix. What got me was that the compiler did not catch it, even though it was supposed to be making sure my end class was was 1.4 compliant.
Moral of the store is watch carefully when you are using Java compliance levels on your projects. It might not be doing such a good job for you.
PM forecast logic for Time-Based PMs
Here is an article on how the estimated Next Due Date is calculated.
Hard and Soft Reservations in Maximo 7.5
Here is an article on how to use hard and soft reservations in Maximo.
Crontask in cluster environment cause continuous duplicate values error in Crontaskhistory table
Here is an article on how to resolve an error when running crontasks in a clustered environment.
Crontask in cluster environment cause continuous duplicate values error in Crontaskhistory table
How to enable SMS messages and secondary email addresses in Maximo
Here is an article on how to enable SMS messages and secondary email addresses in Maximo
How to fix when Direct Print is not working after Security Update for Windows Internet Explorer 8
Here is an article on how to fix the problem with Direct Print after a Security Update has been applied to IE.
Direct Print is not working after Security Update for Windows Internet Explorer 8
How to designate a location as a repair location
Here is an article on how to enable repair facilities and then assign a location as a repair location.
How to install Weblogic 9 as a service on Windows
Here is an article on how to install Weblogic 9 as a service on Windows
How to install Weblogic 10 as a Service on Windows
Here is an article on how to install Weblogic 10 as a service on Windows.
How to change the size of image on Login Page
Here is an article on how to change the size of an image on the login page.
