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 235585 - Hyperlink classes and methods from error messages
Summary: Hyperlink classes and methods from error messages
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.4
Hardware: All All
: P3 normal (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-06 06:44 UTC by David Strupl
Modified: 2013-09-06 15:57 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Strupl 2013-09-06 06:44:10 UTC
Take the following example (with appropriate imports):

public static void main(String[] args) {
        List<Number> x = new ArrayList<>();
        x.add("asdf");
}

The error message say:

error: no suitable method found for add(String)
        x.add("asdf");
    method List.add(int,Number) is not applicable
      (actual and formal argument lists differ in length)
    method List.add(Number) is not applicable
      (actual argument String cannot be converted to Number by method invocation conversion)

We display this message on different places in the IDE:

1. Tooltip when you hoover with mouse over the underlined text
2. If you move caret to the affected area it is shown
  a. In the status message
  b. after hitting Alt-Enter it is shown in place in the editor
3. In the output window if you hit compile
4. In the Window --> Action Items view

The error message mentions several classes and methods - at least on some places we can provide hyperlink either to source or to JavaDoc.

Also the error message has 2 parts: summary and details. On some places we might consider showing only the summary (e.g. in 4.) on some places we might split the message and show the details only after the user e.g. clicks "Details".
Comment 1 jjg 2013-09-06 15:57:47 UTC
Please consider using multi-font text, such as a serif font for natural language and monopspace for code elements.   The structure of the underlying diagnostic has enough info for you to be able to identify the difference.

For example, text from the resource is natural language, argument values to be plugged into the placeholders in the resource string are strongly typed, (Symbol, TYpe, sub-diagnostic, etc) so you can (recursively) complete the determination of what font to use.