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 74317 - Get rid of references to Java file extensions
Summary: Get rid of references to Java file extensions
Status: NEW
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: Martin Entlicher
Depends on:
Reported: 2006-04-03 15:49 UTC by Martin Entlicher
Modified: 2008-04-25 12:36 UTC (History)
4 users (show)

See Also:
Issue Type: TASK
Exception Reporter:

Possible implementation to resolve the issue with ToggleBreakpoint action (3.05 KB, patch)
2006-08-18 18:50 UTC, Torbjorn Norbye
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2006-04-03 15:49:31 UTC
There are checks for .java file extensions at several places in debuggerjpda
module. This is causing problems when other languages that compile to class
files are to be debugged. Therefore we should not reference .java extensions

Usages of ".java":
(-this might be O.K.)
Comment 1 Torbjorn Norbye 2006-06-16 02:23:51 UTC
The behavior in ToggleBreakPointProvider is blocking our non-Java (but Java
VM-language) debugger from being usable.
Comment 2 Torbjorn Norbye 2006-08-18 18:48:53 UTC
I thought I would make a patch for this to hopefully speed up the resolution of
this issue.

When I looked at it, I discovered that it's difficult from within the
ActionProvider to get a handle on the Document corresponding to the current
editor, since the context API doesn't provide it.

Furthermore, I realized that it's not ideal to assume that whoever owns the
DataObject will know whether or not the data type is debuggable.

It seems much better if a module can independently register knowledge about
whether a particular file type is debuggable (or more specifically,
breakpointable) or not.

Thus, one way to fix this is for the ToggleBreakpointAction to be changed from
looking at the particular MIME type, and hardcode checking it against
text/x-java, to look up in the layer filesystem and check whether the given MIME
type is known to be debuggable.

The attached patch will do that.

The debuggerjpda module will first register in Debugging/Breakpoints/text/x-java
that the text/x-java MIME type is known to be debuggable.  Then, the Toggle
action will instead of doing an equals comparison on text/x-java, simply look in
the SystemFileSystem and check whether the current MIME type is in the
Breakpoints folder.  Obviously, rather than just check the existence of a folder
you could use more fancy lookup here, or actually look up a specific instance
which could be queried (if more dynamic determination of debuggability needs to
be made).

But this simple change at least removes this barrier to non-Java VM languages.
With this change I can register my own MIME type and everything seems to be
working smoothly (well, once I implemented the org.openide.src API too.... is
that going to be replaced soon?)
Comment 3 Torbjorn Norbye 2006-08-18 18:50:41 UTC
Created attachment 33076 [details]
Possible implementation to resolve the issue with ToggleBreakpoint action
Comment 4 Torbjorn Norbye 2006-08-18 18:51:41 UTC
I'll look at the other actions with hardcoded java references (such as
RunToCursorActionProvider) pending your thoughts on this idea.
Comment 5 Peter Pis 2008-04-10 22:53:14 UTC
Changing TM for open issues.