This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 237339 - Add support for Java ME Specific hints and warnings for inefficient structures
Summary: Add support for Java ME Specific hints and warnings for inefficient structures
Status: NEW
Alias: None
Product: javame
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 7.4
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-19 00:23 UTC by pavel.petroshenko
Modified: 2013-10-21 09:30 UTC (History)
0 users

See Also:
Issue Type: TASK
Exception Reporter:


Attachments
Sample class for Java Compiler plugin tests. (1.17 KB, text/x-java-source)
2013-10-19 00:23 UTC, pavel.petroshenko
Details
Sample Java Compiler output for the Example class. (1.79 KB, text/plain)
2013-10-19 00:24 UTC, pavel.petroshenko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pavel.petroshenko 2013-10-19 00:23:25 UTC
Created attachment 141283 [details]
Sample class for Java Compiler plugin tests.

Support for Java ME specific hints and warnings should be added. This should provide a) inline interactive hints when developer is typing a code b) log warnings in the build output window with the source code navigation.

This can be implemented by:

1) Leveraging the output of the Java Compiler plugin
2) Implementing the NetBeans plugin for extended warnings with fine-grained control over the level of warnings from the NetBeans settings.
3) Combination of 1 and 2

The structures that should be flagged:

  - boxing and unboxing
  - assertions
  - switch using string or enum
  - vararg methods declaration and usage
  - finalizers
  - lambda expressions
  - default and static methods in interfaces

More information on the ME specific Java Compiler plugin:

Javac plugin generates warnings for source code constructions which not supported in CLDC or have significant footprint and/or memory overhead.

Example:

HelloWorld.java:15: warning: int is boxed into Integer
        I2 = 1;
           ^
Usage:
   javac -processorpath me_plugin.jar [-AdebugMEPlugin] <other javac parameters>
   javac -classpath me_plugin.jar -processor cldc.plugin.Processor [-AdebugMEPlugin] <other javac parameters>

Plugin silently ignores most errors. Command line option -AdebugMEPlugin allows to get additional information about internal errors, it should be used for testing.

JDK 8 is required. Plugin uses new API to receive control at later compilation stage than usual annotation processors.
Comment 1 pavel.petroshenko 2013-10-19 00:24:28 UTC
Created attachment 141284 [details]
Sample Java Compiler output for the Example class.