Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 96565 - Use "ide" component if appropriate module was not found
Use "ide" component if appropriate module was not found
Status: CLOSED FIXED
Product: ide
Classification: Unclassified
Component: Exceptions Reporter
6.x
All All
: P2 (vote)
: 6.x
Assigned To: Jindrich Sedek
logger-issues@ide
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-26 12:07 UTC by Marian Mirilovic
Modified: 2007-11-14 18:51 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
improvement to avoid core/code in everytime (3.34 KB, patch)
2007-02-28 17:40 UTC, pzajac
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2007-02-26 12:07:11 UTC
see :
http://anna.nbextras.org/exceptions/detail.do?id=417

Exception comes from "org.yourorghere.module5.MyAction.performAction" that is
not in the NB code base (of course ;) ), but selected component/subcomponent is
"openide/actions" - that's wrong. 

I think we recommend "ide" as default in case reporter doesn't know which
component has to be used.
Comment 1 pzajac 2007-02-26 19:28:05 UTC
The last NetBeans Class is:
at org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:96)

Are you really sure that 

component: openide
subcomponent: actions 

is incorrect for this use case? Please look at the stacktrace. 
                
java.lang.NullPointerException
        at org.yourorghere.module5.MyAction.performAction(MyAction.java:12)
        at
org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:96)
        at
org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:55)
        at
org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:92)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerf
Comment 2 Marian Mirilovic 2007-02-27 07:27:46 UTC
Zajo, I wrote module5.MyAction so I am sure ;) 

----------------------------
    String lll = null;

    public void performAction() {
        lll.toString();
    }
----------------------------
Comment 3 pzajac 2007-02-27 08:55:30 UTC
You are probably sure... 

But there are some other usecases. What do you think about for example this 
one?

java.lang.NullPointerException
        at java.io.FileInputStream.read
        at
org.openide.util.actions.CallableSystemAction$1.run(CallableSystemAction.java:96)
        at
org.netbeans.modules.openide.util.ActionsBridge.doPerformAction(ActionsBridge.java:55)
        at
org.openide.util.actions.CallableSystemAction.actionPerformed(CallableSystemAction.java:92)

Is the ide component appropriate now?

And about this?
http://anna.nbextras.org/exceptions/detail.do?id=284

There are some other issue:
- exception is thrown from org.netbeans.module.unknown. The ide compontent is 
appropriate for this case
- Issue #96051


Please tell us much better algorithm. We would like to improve it. 

Comment 4 pzajac 2007-02-28 17:40:20 UTC
Created attachment 38984 [details]
improvement to avoid core/code in everytime
Comment 5 pzajac 2007-03-02 17:48:36 UTC
I found solution for Marian's problem: 
org.yourorghere.module5.MyAction.performAction

I experimentied with class resources url:
System.out.println(getClass().getResource("bbbb.class"));

It printed to system.out:
jar:file:/tmp/org-yourorghere-module136364-test.jar!/org/yourorghere/module13/bbbb.class

We can distinguish amount jar types:
1) developed application
jar:file:/tmp/org-yourorghere-module136364-test.jar

We can ignore exceptions for this line...  

2) NetBeans module in netbeans home:
jar:file:${netbeans.home}/${cluster}/modules/${code-name-base}.jar

3) External libraries in netbeans home:
Other jars:
jar:file:${netbeans.home}/*/${name}.jar

4) NetBeans module in userdir:
jar:file:${user.home}/modules/${code-name-base}.jar

5) External libraries in userdir:
Other jars:
jar:file:${user.home}/*/${name}.jar

6) Exceptios from rt.jar
jar:file:${java.home}/jre/lib/rt.jar!/*

7) Exception from other jars in jre/lib (Sometimes is usefull)
jar:file:${java.home}/jre/lib/*

8) Exceptions in other location
*

I propose:
 
1)to create another one table in Exceptions db:
JAR_FILE with columns:
integer ID  - primary key
varchar(500) relpath   - ralative path of jar  
byte type - (type of jar 1..8)

add one more column to method item in stacktrace
Integer JAR_FILE 

2) If no issueazilla component was found for jar file we add special component
for jar (iside reproter)type:

1 - "Developped module" (we can ignore these records)
2 - "Installed Module"
3 - "Installed Library"
4 - "User Modulle" 
5 - "User Library"
6 - JDK
7 - JDK  
8 - External Librrary

Subcomponent name is:
- code name base name - for regular
- name of jar

3) Add UI (Excpetions web) for assigning correct component and subcomponent to 
jar file 

4) Assigning correct component when someone called invalid API


Typical Example:

java.lang.IllegalArgumentException
        at org.openide.FileUtil.toFile... 
        at org.marian.Experiments..  

The issue is automatically reported against 
og.openide.filesystems 

Bit it is caused by 
        at org.marian.Experiments..  


I propose two solutions:
a) based on statistics
If there are reported a lot issues against: 
openide/filesystem
The component is predicted from mapping:
        at org.openide.filesystems.FileUtil.toFile... 
org.openide.util -> openide/filesystems

User users often changed the component and subcomponent to something else.

We expects that that they changes it to different component (for example 5).
We will ignore mapping for 
org.openide.util -> openide/filesystems

and try use mapping for next item (recursion)
(
org.marian.Experiments ->   Developped Module
...
  
b)Add UI for ignoring this line
Comment 6 pzajac 2007-04-05 12:03:05 UTC
The patch for core/code component was applied.

Checking in src/java/org/netbeans/server/componentsmatch/Matcher.java;
/cvs/logger/uihandlerserver/src/java/org/netbeans/server/componentsmatch/Matcher.java,v
 <--  Matcher.java
new revision: 1.3; previous revision: 1.2
done
Checking in test/org/netbeans/server/componentsmatch/MatcherTest.java;
/cvs/logger/uihandlerserver/test/org/netbeans/server/componentsmatch/MatcherTest.java,v
 <--  MatcherTest.java
new revision: 1.3; previous revision: 1.2
done
Comment 7 Jindrich Sedek 2007-04-12 11:24:06 UTC
*** Issue 99686 has been marked as a duplicate of this issue. ***
Comment 8 Jindrich Sedek 2007-04-12 11:30:19 UTC
2) jar files suggestions are done now, 
http://logger.netbeans.org/source/browse/logger/uihandlerserver/src/java/org/netbeans/server/componentsmatch/Matcher.java?r1=1.3&r2=1.4

reassinging components should be done in web application 

Comment 9 Jindrich Sedek 2007-04-12 12:31:36 UTC
*** Issue 99686 has been marked as a duplicate of this issue. ***
Comment 10 Jindrich Sedek 2007-09-04 10:50:38 UTC
using ide/code for unknown components
Checking in DbInsertion.java;
/cvs/logger/uihandlerserver/src/java/org/netbeans/server/uihandler/DbInsertion.java,v  <--  DbInsertion.java
new revision: 1.38; previous revision: 1.37
done
Comment 11 Marian Mirilovic 2007-11-14 18:51:05 UTC
verified


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo