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 36616 - Incorrect status bar message when saving Java file.
Summary: Incorrect status bar message when saving Java file.
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Actions (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: REGRESSION
Depends on: 40427
Blocks: 32143
  Show dependency tree
 
Reported: 2003-10-15 14:20 UTC by Jiri Kovalsky
Modified: 2008-12-22 21:15 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Returns back the 3.5 behaviour (7.45 KB, patch)
2004-02-23 08:42 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2003-10-15 14:20:54 UTC
Development version #200310150100 of NetBeans 4.0
Windows 2000 SP 2 with JDK 1.4.2 build #28

Description:
============
Confirmation message about successfull saving
process depends on position of cursor in the file.
If it is at declaration line of main method,
message says: "main saved." instead of correct
"<classname> saved."

Steps to reproduce:
===================
1. Mount some local directory.
2. Open some Java file and modify it.
3. Place cursor at the end of line with main
method declaration so that its properties are
displayed.
4. Press CTRL+S and observe incorrect status bar
message.
Comment 1 Martin Roskanin 2003-11-19 10:47:26 UTC
Reassigning to openide.
Comment 2 _ tboudreau 2004-02-21 18:31:15 UTC
Passing to the Java module.  I have modified SaveAction as follows:  When finding a 
message name, it will first call Node.getValue("saveName").  If that returns non-null, the 
string returned will be used.

So you should be able to simply override getValue() in MemberElement (or whatever) to 
return the name of the owning file, data object or whatever.
Comment 3 _ tboudreau 2004-02-21 21:20:23 UTC
Jesse suggests this should go through fast track API review process.  Also mentioned a 
possible alternative: 

IMHO better to add a nested interface to SaveCookie:

interface Named extends SaveCookie {
    String getDisplayName();
}

which e.g. EditorSupport.EntryEnv should then implement to return 
getDataObject().getNodeDelegate().getDisplayName() (or 
getDataObject().getPrimaryFile().getNameExt(), which would as a pleasant side-effect avoid 
putting the stupid VCS status label in the message).
Comment 4 Jesse Glick 2004-02-22 02:16:29 UTC
BTW far from being after "lo these many years", this is in fact a
regression introduced in 3.6 in SaveAction.java:

revision 1.27
date: 2003/04/02 09:46:13;  author: jtulach;  state: Exp;  lines: +0 -8
branches:  1.27.12;
#32143 openide-loaders.jar is separated from openide.jar

that patch removing the special treatment of data nodes that formerly
served as the workaround for this issue.

Downgrading because it doesn't seem like a P3 issue to me, but change
back if you disagree.
Comment 5 Jaroslav Tulach 2004-02-23 08:09:41 UTC
That is right, this behaviour has been introduced early in 3.6 cycle
as the old one was found not important enough to be supported. That is
why I would suggest to close as wontfix.

But as I am the one who removed it, I am ready to fix it. The simplest
solution that would guarantee exactly the same behaviour is to check
for DataObject in the SaveAction. Given the state of development we
are in, this would be my second prefered solution.

If we want real fix, then I belive SaveCookie.Named is good solution,
definitively better than check for node.getValue.
Comment 6 Jaroslav Tulach 2004-02-23 08:42:18 UTC
Created attachment 13565 [details]
Returns back the 3.5 behaviour
Comment 7 _ tboudreau 2004-02-23 09:03:16 UTC
Go for it - I didn't know this had been fixed in 3.5, just assumed I coincidentally never 
typed ctrl-S when the caret was in the right place in 3.5.
Comment 8 Jiri Kovalsky 2004-02-23 10:12:45 UTC
I can't at all agree with WONTFIX resolution. If you even have a
solution, please fix it in 3.6 although it is only P3. This behaviour
might confuse users: "What should I do to save also myMethod() and not
only main(String[] args) ?" and in addition I think is not definitely
proffesional.
Comment 9 Jan Pokorsky 2004-02-23 10:46:28 UTC
The regression is in openide code not java module. Reassigned back to
openide.
Comment 10 Jesse Glick 2004-02-23 17:08:00 UTC
Yarda's patch looks like an OK workaround for 3.6 but I would like to
see it replaced by a proper API for D, at least.
Comment 11 Jaroslav Tulach 2004-02-24 10:16:30 UTC
I'll apply the patch to mimic behaviour of 3.5
Comment 12 Jaroslav Tulach 2004-02-24 10:32:25 UTC
Checking in src/org/openide/actions/SaveAction.java;
/cvs/openide/src/org/openide/actions/SaveAction.java,v  <-- 
SaveAction.java
new revision: 1.31; previous revision: 1.30
done
Processing log script arguments...
More commits to come...
RCS file:
/cvs/openide/test/unit/src/org/openide/actions/SaveActionTest.java,v
done
Checking in test/unit/src/org/openide/actions/SaveActionTest.java;
/cvs/openide/test/unit/src/org/openide/actions/SaveActionTest.java,v 
<--  SaveActionTest.java
initial revision: 1.1
Comment 13 Jesse Glick 2004-02-24 16:48:23 UTC
Opened issue #40427 for the future.
Comment 14 Marian Mirilovic 2005-07-13 13:23:10 UTC
closed