Bug 281733 - [fiximprove]: Correct/Improve preverification
Summary: [fiximprove]: Correct/Improve preverification
Status: CLOSED WORKSFORME
Alias: None
Product: MTJ (Archived)
Classification: Tools
Component: Project Builder (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: 1.0.1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate, needinfo
Depends on:
Blocks:
 
Reported: 2009-06-27 04:02 EDT by Wolfgang Grossinger CLA
Modified: 2009-10-28 08:46 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Grossinger CLA 2009-06-27 04:02:41 EDT
I wrote the following class:

public class MathUtils {

    public static float floor(float value) {
    	return new Float(value).intValue();
    }

}

After that, I get an error 'Error preverifying class...'.
I think, the problem is, that floats are not allowed in the current configuration. My problem here is, that it only see the error for the whole class. It would be good to have a specific message an 
the line number because if I have another problem, I probably have no
idea what the problem is.

The next thing I don't understand is the following: When I open Preferences->JavaME->DeviceManagement and look at the description of e.g. Java ME SDK 3.0 - DefaultCldcPhone2, I see 1.0 for Configuration and 2.0 for Profile. I am not sure if Configuration means CLDC and Profile is MIDP, but if I open the details, I see CLDC 1.1 and MIDP 2.1 in tab 'Symbol Set' and then floats should work!!!

Regards,

Wolfgang
Comment 1 Gustavo de Paula CLA 2009-06-29 16:58:00 EDT
which host are you using? which mtj version? 

i wasn't able to reproduce the issue here. i did i quick test here with wtk 3 (is that the one you used?) and my defaultcldc devices shows as cldc 1.1. i was also able to create a project and add the same code you have there.

about the error message, this is not easy to implement since the preverifier is an external executable that is called by mtj. we would need to query the text output in order to do that and each sdk might have a different output on its preverifier
 
:)
gep
Comment 2 Wolfgang Grossinger CLA 2009-06-29 17:22:11 EDT
I used Eclipse 3.5 Pulsar and imported MTK 3.0.

I think, when you test it with that configuration it should not be hard to reproduce. It was not so hard to fix that manually but it is quite confusing and misleading and should be changed (I think this worked in a previous version)

Well, I understand what you mean with parsing text of an external component but wouldn't it possible to show at least a more descriptive message? I think just showing a general preprocessing message could be a real problem in some situations.

Comment 3 Wolfgang Grossinger CLA 2009-07-03 13:39:40 EDT
I found another problem regarding to this:
Preverification->Enable project specific settings don't work: 
I had CLDC 1.0 in my JAD and changed the settings for the project to CLDC 1.1. in the settings dialog. You can specify settings here but when you reopen the settings dialog, the old settings are displayed. This works only if you have also CLDC 1.1 specified in the JAD file which is misleading (Either it works also in the setting dialog or the settings should be disabled or an error should occur.)  
Comment 4 Jon Dearden CLA 2009-07-27 10:05:27 EDT
I have investigated this bug and found the following...

Issue 1:

The first complaint is that when using a float method with CLDC 1.0 specified, the error message generated is not specific enough. I was not able to find this result in my tests using MTJ trunk (July 20) and WTK 2.5.2. What I do see when using floats (on a project I have specified as CDLC 1.0) is an error in the Problem view showing the specific class and line number where the float is used. It may be that the SDK the user had installed did not report its Preverifier error.

Issue 2:

The second problem is that when a user imports devices from WTK 3.0.0, the Configuration and Profile values are misreported in the Preferences/Java ME/Device management page. This is correct. The values do not match the value indicated in the symbol sets or libraries for those devices. 

Gustavo reported that he did not experience the problem, but he was using an early access version of WTK 3. Switching to a later official release confirmed the problem.

Issue 3:

The third complaint is that device-specific preverification settings do not persist. Using MTJ trunk (July 20) and WTK 2.5.2 I was not able to reproduce this. The Preferences/Java ME/Preverification "Use specific configuration" setting appears to work independently from the JAD editor values as is expected. The preference setting appears to be retained after the change.
Comment 5 Diego Madruga Sandin CLA 2009-07-28 08:13:36 EDT
Bug 284768 was opened concerning Issue 3.

For issue 1, we depend on the messages from the preverifier which are not standard. i don't think we need to fix this for now. I'll closing this bug, and I'll open new ones for the future releases to make the preverifier results more human readable.
	
(In reply to comment #4)
> I have investigated this bug and found the following...
> 
> Issue 1:
> 
> The first complaint is that when using a float method with CLDC 1.0 specified,
> the error message generated is not specific enough. I was not able to find this
> result in my tests using MTJ trunk (July 20) and WTK 2.5.2. What I do see when
> using floats (on a project I have specified as CDLC 1.0) is an error in the
> Problem view showing the specific class and line number where the float is
> used. It may be that the SDK the user had installed did not report its
> Preverifier error.
> 
> Issue 2:
> 
> The second problem is that when a user imports devices from WTK 3.0.0, the
> Configuration and Profile values are misreported in the Preferences/Java
> ME/Device management page. This is correct. The values do not match the value
> indicated in the symbol sets or libraries for those devices. 
> 
> Gustavo reported that he did not experience the problem, but he was using an
> early access version of WTK 3. Switching to a later official release confirmed
> the problem.
> 
> Issue 3:
> 
> The third complaint is that device-specific preverification settings do not
> persist. Using MTJ trunk (July 20) and WTK 2.5.2 I was not able to reproduce
> this. The Preferences/Java ME/Preverification "Use specific configuration"
> setting appears to work independently from the JAD editor values as is
> expected. The preference setting appears to be retained after the change.
> 

Comment 6 Diego Madruga Sandin CLA 2009-10-28 08:46:13 EDT
Released