Still working, little progress

Posted in open-source, update on March 24, 2009 by nkhan26

I’m still working on Bug 227760. As mentioned earlier in the description of the bug, the save dialogue is prompted twice. Once, where mentioned earlier, and the second place I found is, in the “org.eclipse.debug.ui”, in the “org.eclipse.debug.internal.ui”. The file getting called is the “SaveScopeREsourcesHandler.java” and the prompt occurs in the handle status method.
The dialogue gets called in this condition:

if (projects != null) {
            IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
            String save = store.getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
            int ret = showSaveDialog(projects, !save.equals(MessageDialogWithToggle.NEVER), save.equals(MessageDialogWithToggle.PROMPT));
            if(ret == IDialogConstants.OK_ID) {
            	doSave();
            	return Boolean.TRUE;
            }
            return Boolean.FALSE;
        }
        else {
            boolean cancel = DebugUIPlugin.preLaunchSave();
            return Boolean.valueOf(cancel);
        }

The DebugUIPlugin.java class is called in the else condition, which invokes the second dialogue.The DebugUIPlugin class has the method that checks and calls the save prompt:

public static boolean preLaunchSave() {
        String saveDirty = getDefault().getPreferenceStore().getString(IInternalDebugUIConstants.PREF_SAVE_DIRTY_EDITORS_BEFORE_LAUNCH);
        if (saveDirty.equals(MessageDialogWithToggle.NEVER)) {
            return true;
        }
        return saveAllEditors(saveDirty.equals(MessageDialogWithToggle.PROMPT));
    }

Playing around with this code, for example disabling the “.PROMPT”, did not display the message. Therefore, we may be dealing with the “saveDirty”. Someone worked on a similar saveDirty dialogue in the class, and I will ask him & look into his blog for help on this. Will update again soon.

Useful Research

Posted in open-source, update on February 24, 2009 by nkhan26

Using the Eclipse help documentation online, useful information was found that can be helpful towards understanding how the “org.eclipse.wst.server.ui” package functions.

First off, in the API Reference for org.eclipse.wst.server.ui, only three classes are mentioned in the class summary: ServerUICore, ServerUIUtil and ServerLaunchConfigurationTab. This is a description of the main package, where the ServerUICore is the most important class:

“ServerUICore is the main entry-point for the API. From here, clients can get the wizard pages for a particular server type, get a label provider for all server types, or launch Run on Server directly.”

Very little else is offered in the eclipse help about this package. However, much more useful information can be found in the Web Application Development User Guide in the eclipse help documentation.

This guide contains lots of information about web application, including server tools, which Bug 227760 is related to. In the server tools section, one can understand the usages and how to’s on servers. Reading these, I came across some veru useful information that can help me out. In theStarting a server section, it gives the instructions on how to start a server.It also mentions:

“If you have selected the Automatically publish when starting servers check box on the Server preferences page (Window > Preferences > Server ), the workbench checks to see if your project and files on the server are synchronized prior to starting the server.”

This makes sense of what a server does when starting, as this can be seen while debugging my bug. There are more useful information in this documentation and I need to read more into it.

Bug 227760 Source Code Location

Posted in open-source, update on February 19, 2009 by nkhan26

Following the details on the Bug 227760 description page, and from detials of the “depends on” bug, the location of this bug lies primarily with the  “org.eclipse.wst.server.ui.internal.view.servers” in the “org.eclipse.wst.server.ui” package. Placing break points in various files, they were all hit, so a general understanding of how the save dialogue works was revealed.

The first breakpoint was inserted in the “StartAction.java” file at line 152 – “start(server, launchMode, shell)”. This is hit just before the save dialogue, just after the user has started the tomcat server. It then checks the server state and hits the “if (!ServerUIPlugin.saveEditors())”. This leads to the “ServerUIPlugin.java” – SaveEditors() method, which leads to the GetSaveEditors() method in the “ServerUIPreferences.java” class. It the goes through some “.class” files, before the WTP prompts the first “Save Dialogue”. When “No” is selected, it starts again in the “StartAction.java” class, followed by the “ServerUIPlugin.java” class. It then goes through many “.class” files and stays within the “Workbench.class” for a while before hitting the second “Save Dialogue”.

Through debuggin, it can safely be assumed that this bug is within the “org.eclipse.wst.server” package. Now, variable tracing and a lot more debugging is required to start resolving this bug.

Researching Bug 227760

Posted in open-source, update on February 12, 2009 by nkhan26

Currently researching to find the source related to Bug 227760. From what I found so far, the bug seems to be in the

org.eclipse.wst.server.ui.internal.view.servers

package. I’ve inserted some breakpoints in the “StartAction”, “SErverUIPlugin” and “ServerUIPreferences”, which all has connections to the save dialogue. When runing, all breakpoins were hit, so I have something to work with. Very close to finishing 0.1 release.

Current Screenshot:

Run & Debuggin in package

Run & Debuggin in package

Elclipse WTP Bug 227760 Replicated Successfully

Posted in open-source, update on February 8, 2009 by nkhan26

Bug 227760 was replicated successfully.

Steps taken to replicate bug successfully.

– Open any java source file.

Open and java file

Open and java file

– Make changes anywhere to that java file, but do NOT save.

Edit, but do NOT save

Edit, but do NOT save

– Start any server in the servers box (This replication used Tomcat v6.0)

Start any server

Start any server

– The “Save changes to modified file” dialog appears, select “No”. Upon selecting “No”, the same exact dialogue was prompted again.

"Save" dialog prompted twice

"Save" dialogue prompted twice

This is the bug. The “Save” dialogue is prompted twice, therefore, successful replication of Bug 227760.

Time to start looking through the source files.

Eclipse WTP Bug chosen – Bug 227760

Posted in open-source, update on February 3, 2009 by nkhan26

Bug chosen to work on is Bug# 22776 . Will try reporduceing the bug very soon and post an update.

Installed WTP & Plugin version of Eclipse

Posted in update on January 22, 2009 by nkhan26

Installed the WTP version of eclipse that we will be working on, and the developer Plug-in version. Also accessed the cvs repository for eclipse. Next step is to decide on a bug, and set up wiki pages.