issue_id
int64
2.04k
425k
title
stringlengths
9
251
body
stringlengths
4
32.8k
status
stringclasses
6 values
after_fix_sha
stringlengths
7
7
project_name
stringclasses
6 values
repo_url
stringclasses
6 values
repo_name
stringclasses
6 values
language
stringclasses
1 value
issue_url
null
before_fix_sha
null
pull_url
null
commit_datetime
timestamp[us, tz=UTC]
report_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
23
187
chunk_content
stringlengths
1
22k
16,392
Bug 16392 Exception removing search results
build 2002-05-19 on WinXP. IBM JRE 1.3.1. I did a text search and got over 100 hits. I selected a handful of them and then chose "remove entries" from the context menu. I got error dialogs for each result I wanted to remove. Looks like the markers have been removed and the search view is trying to access attributes? I will attach the log file.
resolved fixed
1ca9446
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T09:38:18Z
2002-05-19T17:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchUtil.java
for (int j= 0; j < workingSets.length; j++) names[j]= workingSets[j].getName(); fgSettingsStore.put(STORE_LRU_WORKING_SET_NAMES + i, names); i++; } } public static LRUWorkingSetsList getLRUWorkingSets() { if (fgLRUWorkingSets == null) { restoreState(); } return fgLRUWorkingSets; } static void restoreState() { fgLRUWorkingSets= new LRUWorkingSetsList(LRU_WORKINGSET_LIST_SIZE); fgSettingsStore= JavaPlugin.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS_KEY); if (fgSettingsStore == null) fgSettingsStore= JavaPlugin.getDefault().getDialogSettings().addNewSection(DIALOG_SETTINGS_KEY); boolean foundLRU= false; for (int i= LRU_WORKINGSET_LIST_SIZE - 1; i >= 0; i--) { String[] lruWorkingSetNames= fgSettingsStore.getArray(STORE_LRU_WORKING_SET_NAMES + i); if (lruWorkingSetNames != null) { Set workingSets= new HashSet(2); for (int j= 0; j < lruWorkingSetNames.length; j++) { IWorkingSet workingSet= PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(lruWorkingSetNames[j]); if (workingSet != null) { workingSets.add(workingSet); } } foundLRU= true;
16,392
Bug 16392 Exception removing search results
build 2002-05-19 on WinXP. IBM JRE 1.3.1. I did a text search and got over 100 hits. I selected a handful of them and then chose "remove entries" from the context menu. I got error dialogs for each result I wanted to remove. Looks like the markers have been removed and the search view is trying to access attributes? I will attach the log file.
resolved fixed
1ca9446
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T09:38:18Z
2002-05-19T17:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchUtil.java
if (!workingSets.isEmpty()) fgLRUWorkingSets.add((IWorkingSet[])workingSets.toArray(new IWorkingSet[workingSets.size()])); } } if (!foundLRU) restoreFromOldFormat(); } private static void restoreFromOldFormat() { fgLRUWorkingSets= new LRUWorkingSetsList(LRU_WORKINGSET_LIST_SIZE); fgSettingsStore= JavaPlugin.getDefault().getDialogSettings().getSection(DIALOG_SETTINGS_KEY); if (fgSettingsStore == null) fgSettingsStore= JavaPlugin.getDefault().getDialogSettings().addNewSection(DIALOG_SETTINGS_KEY); boolean foundLRU= false; String[] lruWorkingSetNames= fgSettingsStore.getArray(STORE_LRU_WORKING_SET_NAMES); if (lruWorkingSetNames != null) { for (int i= lruWorkingSetNames.length - 1; i >= 0; i--) { IWorkingSet workingSet= PlatformUI.getWorkbench().getWorkingSetManager().getWorkingSet(lruWorkingSetNames[i]); if (workingSet != null) { foundLRU= true; fgLRUWorkingSets.add(new IWorkingSet[]{workingSet}); } } } if (foundLRU) saveState(); } }
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopyResourcesToClipboardAction.java
package org.eclipse.jdt.internal.ui.reorg; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IResource; import org.eclipse.swt.SWTError; import org.eclipse.swt.dnd.Clipboard; import org.eclipse.swt.dnd.DND; import org.eclipse.swt.dnd.FileTransfer; import org.eclipse.swt.dnd.TextTransfer; import org.eclipse.swt.dnd.Transfer; import org.eclipse.jface.action.IAction; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.ui.IWorkbenchSite; import org.eclipse.ui.part.ResourceTransfer; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.ui.JavaElementLabelProvider; import org.eclipse.jdt.ui.actions.SelectionDispatchAction; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.corext.refactoring.Assert; public class CopyResourcesToClipboardAction extends SelectionDispatchAction {
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopyResourcesToClipboardAction.java
private static final String fgLineDelim= System.getProperty("line.separator"); private Clipboard fClipboard; protected CopyResourcesToClipboardAction(IWorkbenchSite site, Clipboard clipboard) { super(site); Assert.isNotNull(clipboard); setText(ReorgMessages.getString("CopyResourcesToClipboardAction.copy")); fClipboard= clipboard; }
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopyResourcesToClipboardAction.java
protected void selectionChanged(IStructuredSelection selection) { setEnabled(canOperateOn(selection)); } public void run(IStructuredSelection selection) { IResource[] resources= getSelectedResources(selection); try{ getClipboard().setContents( new Object[] { resources, getFileLocations(resources), getFileNamesText(resources)}, new Transfer[] { ResourceTransfer.getInstance(), FileTransfer.getInstance(), TextTransfer.getInstance()}); } catch (SWTError e){ if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD) throw e; if (MessageDialog.openQuestion(getShell(), "Problem Copying to Clipboard", "There was a problem when accessing the system clipboard. Retry?")) run(selection); } } public static boolean canOperateOn(IStructuredSelection selection){ if (StructuredSelectionUtil.hasNonResources(selection)) return false; for (Iterator iter= selection.iterator(); iter.hasNext();) { Object each= iter.next();
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopyResourcesToClipboardAction.java
if (each instanceof IPackageFragment && ((IPackageFragment)each).isDefaultPackage()) return false; } IResource[] selectedResources= StructuredSelectionUtil.getResources(selection); if (selectedResources.length == 0) return false; if (! areResourcesOfValidType(selectedResources)) return false; if (ClipboardActionUtil.isOneOpenProject(selectedResources)) return true; if (! haveCommonParent(selectedResources)) return false; SelectionDispatchAction ca= ReorgActionFactory.createDnDCopyAction(selection.toList(), ClipboardActionUtil.getFirstResource(selection)); ca.update(ca.getSelection()); return ca.isEnabled(); } private static boolean areResourcesOfValidType(IResource[] resources){ boolean onlyProjectsSelected= ClipboardActionUtil.resourcesAreOfType(resources, IResource.PROJECT); boolean onlyFilesFoldersSelected= ClipboardActionUtil.resourcesAreOfType(resources, IResource.FILE | IResource.FOLDER); if (!onlyFilesFoldersSelected && !onlyProjectsSelected) return false; if (onlyFilesFoldersSelected && onlyProjectsSelected) return false; return true;
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopyResourcesToClipboardAction.java
} private static boolean haveCommonParent(IResource[] resources){ if (haveCommonParentAsResources(resources)) return true; /* * special case - must be able to select packages: * p * p.q */ if (! ClipboardActionUtil.resourcesAreOfType(resources, IResource.FOLDER)) return false; IPackageFragment[] packages= getPackages(resources); if (packages.length != resources.length) return false; IJavaElement firstJavaParent= packages[0].getParent(); if (firstJavaParent == null) return false; for (int i= 0; i < packages.length; i++) { if (! firstJavaParent.equals(packages[i].getParent())) return false; } return true; } private static IPackageFragment[] getPackages(IResource[] resources){ List packages= new ArrayList(resources.length);
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopyResourcesToClipboardAction.java
for (int i= 0; i < resources.length; i++) { IJavaElement element= JavaCore.create(resources[i]); if (element != null && element.getElementType() == IJavaElement.PACKAGE_FRAGMENT) packages.add(element); } return (IPackageFragment[]) packages.toArray(new IPackageFragment[packages.size()]); } private static boolean haveCommonParentAsResources(IResource[] resources){ IContainer firstParent = resources[0].getParent(); if (firstParent == null) return false; for (int i= 0; i < resources.length; i++) { if (!resources[i].getParent().equals(firstParent)) return false; } return true; } private IResource[] getSelectedResources(IStructuredSelection selection) { return StructuredSelectionUtil.getResources(selection); } private static String getFileNamesText(IResource[] resources) { ILabelProvider labelProvider= getLabelProvider(); StringBuffer buf= new StringBuffer(); for (int i= 0; i < resources.length; i++) { if (i > 0) buf.append(fgLineDelim); buf.append(getName(resources[i], labelProvider)); }
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopyResourcesToClipboardAction.java
return buf.toString(); } private static ILabelProvider getLabelProvider(){ return new JavaElementLabelProvider( JavaElementLabelProvider.SHOW_VARIABLE + JavaElementLabelProvider.SHOW_PARAMETERS + JavaElementLabelProvider.SHOW_TYPE ); } private static String getName(IResource resource, ILabelProvider labelProvider){ IJavaElement javeElement= JavaCore.create(resource); if (javeElement == null) return labelProvider.getText(resource); else return labelProvider.getText(javeElement); } private static String[] getFileLocations(IResource[] resources) { String[] fileLocations= new String[resources.length]; for (int i= 0; i < resources.length; i++) { fileLocations[i]= resources[i].getLocation().toOSString(); } return fileLocations; } private Clipboard getClipboard() { return fClipboard; } }
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopySourceReferencesToClipboardAction.java
package org.eclipse.jdt.internal.ui.reorg; import java.util.ArrayList; import java.util.List; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.swt.SWTError; import org.eclipse.swt.dnd.Clipboard; import org.eclipse.swt.dnd.DND; import org.eclipse.swt.dnd.TextTransfer; import org.eclipse.swt.dnd.Transfer; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IWorkbenchSite; import org.eclipse.ui.part.ResourceTransfer; import org.eclipse.jdt.core.ISourceReference; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.corext.refactoring.Assert; import org.eclipse.jdt.internal.corext.refactoring.util.JavaElementUtil; import org.eclipse.jdt.internal.corext.refactoring.util.ResourceUtil; import org.eclipse.jdt.internal.ui.JavaPlugin; public class CopySourceReferencesToClipboardAction extends SourceReferenceAction{
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopySourceReferencesToClipboardAction.java
private Clipboard fClipboard; protected CopySourceReferencesToClipboardAction(IWorkbenchSite site, Clipboard clipboard) { super(site); Assert.isNotNull(clipboard); fClipboard= clipboard; } protected void perform(IStructuredSelection selection) throws JavaModelException { copyToOSClipbard(getElementsToProcess(selection)); } private Clipboard getSystemClipboard() { return fClipboard; } private void copyToOSClipbard(ISourceReference[] refs) throws JavaModelException { try{ getSystemClipboard().setContents(createClipboardInput(refs), createTransfers()); } catch (SWTError e){ if (e.code != DND.ERROR_CANNOT_SET_CLIPBOARD) throw e; if (MessageDialog.openQuestion(getShell(), "Problem Copying to Clipboard", "There was a problem when accessing the system clipboard. Retry?")) copyToOSClipbard(refs);
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopySourceReferencesToClipboardAction.java
} } private static Object[] createClipboardInput(ISourceReference[] refs) throws JavaModelException { TypedSource[] typedSources= convertToTypedSourceArray(refs); return new Object[] { convertToInputForTextTransfer(typedSources), typedSources, getResourcesForMainTypes(refs)}; } private static Transfer[] createTransfers() { return new Transfer[] { TextTransfer.getInstance(), TypedSourceTransfer.getInstance(), ResourceTransfer.getInstance()}; } private static String convertToInputForTextTransfer(TypedSource[] typedSources) throws JavaModelException { String lineDelim= System.getProperty("line.separator", "\n"); StringBuffer buff= new StringBuffer(); for (int i= 0; i < typedSources.length; i++) { buff.append(typedSources[i].getSource()).append(lineDelim); } return buff.toString(); } private static TypedSource[] convertToTypedSourceArray(ISourceReference[] refs) throws JavaModelException { TypedSource[] elems= new TypedSource[refs.length]; for (int i= 0; i < refs.length; i++) { elems[i]= new TypedSource(refs[i]); } return elems; } private static IResource[] getResourcesForMainTypes(ISourceReference[] refs){ IType[] mainTypes= getMainTypes(refs); List resources= new ArrayList(); for (int i= 0; i < mainTypes.length; i++) {
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CopySourceReferencesToClipboardAction.java
IResource resource= getResource(mainTypes[i]); if (resource != null) resources.add(resource); } return (IResource[]) resources.toArray(new IResource[resources.size()]); } private static IType[] getMainTypes(ISourceReference[] refs){ List mainTypes= new ArrayList(); for (int i= 0; i < refs.length; i++) { try { if ((refs[i] instanceof IType) && JavaElementUtil.isMainType((IType)refs[i])) mainTypes.add(refs[i]); } catch(JavaModelException e) { JavaPlugin.log(e); } } return (IType[]) mainTypes.toArray(new IType[mainTypes.size()]); } private static IResource getResource(IType type){ try { return ResourceUtil.getResource(type); } catch(JavaModelException e) { JavaPlugin.log(e); return null; } } }
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CutSourceReferencesToClipboardAction.java
package org.eclipse.jdt.internal.ui.reorg; import java.util.Iterator; import org.eclipse.core.runtime.CoreException; import org.eclipse.swt.dnd.Clipboard; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.IWorkbenchSite; import org.eclipse.jdt.core.IType; public class CutSourceReferencesToClipboardAction extends SourceReferenceAction { CopySourceReferencesToClipboardAction fCopy; DeleteSourceReferencesAction fDelete; protected CutSourceReferencesToClipboardAction(IWorkbenchSite site, Clipboard clipboard) { super(site); setText(ReorgMessages.getString("CutSourceReferencesToClipboardAction.cut")); fCopy= new CopySourceReferencesToClipboardAction(site, clipboard);
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/CutSourceReferencesToClipboardAction.java
fDelete= new DeleteSourceReferencesAction(site); update(getSelection()); } protected void perform(IStructuredSelection selection) throws CoreException { fCopy.perform(selection); fDelete.perform(selection); } protected void selectionChanged(IStructuredSelection selection) { /* * cannot cut top-level types. this deltes the cu and then you cannot paste because the cu is gone. */ if (containsTopLevelTypes(selection)){ setEnabled(false); return; } fCopy.selectionChanged(selection); fDelete.selectionChanged(selection); setEnabled(fCopy.isEnabled() && fDelete.isEnabled()); } private static boolean containsTopLevelTypes(IStructuredSelection selection) { for (Iterator iter = selection.iterator(); iter.hasNext();) { Object each= iter.next(); if ((each instanceof IType) && ((IType)each).getDeclaringType() == null) return true; } return false; } }
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgActionFactory.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.reorg; import java.util.ArrayList; import java.util.List; import org.eclipse.core.resources.IResource; import org.eclipse.swt.dnd.Clipboard; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.ui.IWorkbenchSite; import org.eclipse.jdt.core.ISourceReference; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.ui.IContextMenuConstants; import org.eclipse.jdt.ui.actions.SelectionDispatchAction; import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgRefactoring; public class ReorgActionFactory { private static final String GROUP_NAME= IContextMenuConstants.GROUP_REORGANIZE; private ReorgActionFactory(){
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgActionFactory.java
} public static SelectionDispatchAction createCutAction(IWorkbenchSite site, Clipboard clipboard){ SelectionDispatchAction a1= new CutSourceReferencesToClipboardAction(site, clipboard); return a1; } public static SelectionDispatchAction createCopyAction(IWorkbenchSite site, Clipboard clipboard){ SelectionDispatchAction a1= new CopyResourcesToClipboardAction(site, clipboard); SelectionDispatchAction a2= new CopySourceReferencesToClipboardAction(site, clipboard); SelectionDispatchAction dual= new DualReorgAction(site, ReorgMessages.getString("ReorgGroup.copy"), ReorgMessages.getString("copyAction.description"), a1, a2); return dual; } public static SelectionDispatchAction createPasteAction(IWorkbenchSite site, Clipboard clipboard){ SelectionDispatchAction a1= new PasteResourcesFromClipboardAction(site, clipboard); SelectionDispatchAction a2= new PasteSourceReferencesFromClipboardAction(site, clipboard); SelectionDispatchAction dual= new DualReorgAction(site, ReorgMessages.getString("ReorgGroup.paste"), ReorgMessages.getString("ReorgGroup.pasteAction.description"), a1, a2); return dual; } public static SelectionDispatchAction createDeleteAction(IWorkbenchSite site){ DeleteResourcesAction a1= new DeleteResourcesAction(site); DeleteSourceReferencesAction a2= new DeleteSourceReferencesAction(site); DualReorgAction dual= new DualReorgAction(site, ReorgMessages.getString("ReorgGroup.delete"), ReorgMessages.getString("deleteAction.description"), a1, a2); return dual; } public static SelectionDispatchAction createPasteAction(final ISourceReference[] elements, Object target){ return new PasteSourceReferencesFromClipboardAction(new MockWorkbenchSite(new Object[]{target}), null){ protected TypedSource[] getContentsToPaste(){
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgActionFactory.java
List result= new ArrayList(elements.length); for(int i= 0; i < elements.length; i++){ try { result.add(new TypedSource(elements[i])); } catch(JavaModelException e) { } } return (TypedSource[])result.toArray(new TypedSource[result.size()]); } }; } public static DeleteSourceReferencesAction createDeleteSourceReferencesAction(ISourceReference[] elements){ return new DeleteSourceReferencesAction(new MockWorkbenchSite(elements)); } public static JdtCopyAction createDnDCopyAction(List elems, final IResource destination){ JdtCopyAction action= new JdtCopyAction(new MockWorkbenchSite(elems)){ protected Object selectDestination(ReorgRefactoring ref) { return ClipboardActionUtil.tryConvertingToJava(destination); } }; return action; } public static JdtCopyAction createDnDCopyAction(IResource[] resourceData, final IResource destination){ return createDnDCopyAction(ClipboardActionUtil.getConvertedResources(resourceData), destination); } }
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/CCPActionGroup.java
/******************************************************************************* * Copyright (c) 2002 International Business Machines Corp. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v0.5 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v05.html *
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/CCPActionGroup.java
* Contributors: * IBM Corporation - initial API and implementation ******************************************************************************/ package org.eclipse.jdt.ui.actions; import org.eclipse.swt.dnd.Clipboard; import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.viewers.IInputSelectionProvider; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IViewPart; import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.IWorkbenchSite; import org.eclipse.ui.actions.ActionGroup; import org.eclipse.ui.part.Page; import org.eclipse.ui.texteditor.IUpdate; import org.eclipse.jdt.ui.IContextMenuConstants; import org.eclipse.jdt.internal.ui.reorg.ReorgActionFactory; /** * Action group that adds the copy, cut, paste actions to a view parts context * menu and retargets the corresponding global menu actions. * * @since 2.0 */ public class CCPActionGroup extends ActionGroup { private IWorkbenchSite fSite; private Clipboard fClipboard; private SelectionDispatchAction[] fActions; private SelectionDispatchAction fDeleteAction; private SelectionDispatchAction fCopyAction;
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/CCPActionGroup.java
private SelectionDispatchAction fPasteAction; private SelectionDispatchAction fCutAction; /** * Creates a new <code>CCPActionGroup</code>. * * @param part the view part that owns this action group */ public CCPActionGroup(IViewPart part) { this(part.getSite()); } /** * Creates a new <code>CCPActionGroup</code>. * * @param page the page that owns this action group */ public CCPActionGroup(Page page) { this(page.getSite()); } private CCPActionGroup(IWorkbenchSite site) { fSite= site; fClipboard= new Clipboard(site.getShell().getDisplay()); fActions= new SelectionDispatchAction[] { fCutAction= ReorgActionFactory.createCutAction(fSite, fClipboard), fCopyAction= ReorgActionFactory.createCopyAction(fSite, fClipboard), fPasteAction= ReorgActionFactory.createPasteAction(fSite, fClipboard), fDeleteAction= ReorgActionFactory.createDeleteAction(fSite), }; registerActionsAsSelectionChangeListeners();
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/CCPActionGroup.java
} private void registerActionsAsSelectionChangeListeners() { ISelectionProvider provider = fSite.getSelectionProvider(); for (int i= 0; i < fActions.length; i++) { provider.addSelectionChangedListener(fActions[i]); } } private void deregisterActionsAsSelectionChangeListeners() { ISelectionProvider provider = fSite.getSelectionProvider(); for (int i= 0; i < fActions.length; i++) { provider.removeSelectionChangedListener(fActions[i]); } } /** * Returns the delete action managed by this action * group. * * @return the delete action. Returns <code>null</code> if the group * doesn't provide any delete action */ public IAction getDeleteAction() { return fDeleteAction; } /* (non-Javadoc) * Method declared in ActionGroup */ public void fillActionBars(IActionBars actionBars) {
16,271
Bug 16271 copy action must talk to paste action
problem: select a file ctrl+c ctrl+v (without changing selection) nothing happens beacuse nobody told the paste action that stuff is available in the clipboard (there're no callback here) see the plaftorm CopyAction on how to solve it (should be not difficult) marking as major - does not allow you to do the usual thing of hitting ctlr+c/ctlr+c in a row
resolved fixed
82de74f
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-21T12:23:10Z
2002-05-17T15:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/CCPActionGroup.java
super.fillActionBars(actionBars); actionBars.setGlobalActionHandler(IWorkbenchActionConstants.DELETE, fDeleteAction); actionBars.setGlobalActionHandler(IWorkbenchActionConstants.COPY, fCopyAction); actionBars.setGlobalActionHandler(IWorkbenchActionConstants.CUT, fCutAction); actionBars.setGlobalActionHandler(IWorkbenchActionConstants.PASTE, fPasteAction); } /* (non-Javadoc) * Method declared in ActionGroup */ public void fillContextMenu(IMenuManager menu) { super.fillContextMenu(menu); for (int i= 0; i < fActions.length; i++) { menu.appendToGroup(IContextMenuConstants.GROUP_REORGANIZE, fActions[i]); } } /* * @see ActionGroup#dispose() */ public void dispose() { super.dispose(); if (fClipboard != null){ fClipboard.dispose(); fClipboard= null; } deregisterActionsAsSelectionChangeListeners(); } }
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
package org.eclipse.jdt.internal.ui.javaeditor; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.StyledText; import org.eclipse.swt.graphics.Color;
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Layout; import org.eclipse.swt.widgets.Shell; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Path; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IMenuManager; import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferenceConverter; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.DocumentCommand; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.ILineTracker;
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.ITextOperationTarget; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.text.Position; import org.eclipse.jface.text.contentassist.ContentAssistant; import org.eclipse.jface.text.contentassist.IContentAssistant; import org.eclipse.jface.text.source.Annotation; import org.eclipse.jface.text.source.IAnnotationModel; import org.eclipse.jface.text.source.ISourceViewer; import org.eclipse.jface.text.source.IVerticalRuler; import org.eclipse.jface.text.source.SourceViewerConfiguration; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.IViewPart; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.actions.ActionContext; import org.eclipse.ui.actions.ActionGroup; import org.eclipse.ui.actions.WorkspaceModifyOperation; import org.eclipse.ui.dialogs.SaveAsDialog; import org.eclipse.ui.part.FileEditorInput; import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.ITextEditorActionConstants; import org.eclipse.ui.texteditor.IUpdate; import org.eclipse.ui.texteditor.MarkerAnnotation; import org.eclipse.ui.texteditor.TextOperationAction;
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
import org.eclipse.ui.views.tasklist.TaskList; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.ui.IWorkingCopyManager; import org.eclipse.jdt.ui.actions.GenerateActionGroup; import org.eclipse.jdt.ui.actions.IJavaEditorActionDefinitionIds; import org.eclipse.jdt.ui.actions.RefactorActionGroup; import org.eclipse.jdt.ui.text.JavaTextTools; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.CompositeActionGroup; import org.eclipse.jdt.internal.ui.compare.LocalHistoryActionGroup; import org.eclipse.jdt.internal.ui.javaeditor.structureselection.SelectionHistory; import org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectEnclosingAction; import org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectHistoryAction; import org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectNextAction; import org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectPreviousAction; import org.eclipse.jdt.internal.ui.javaeditor.structureselection.StructureSelectionAction; import org.eclipse.jdt.internal.ui.preferences.JavaEditorPreferencePage; import org.eclipse.jdt.internal.ui.text.ContentAssistPreference; import org.eclipse.jdt.internal.ui.text.correction.JavaCorrectionSourceViewer; import org.eclipse.jdt.internal.ui.text.java.IReconcilingParticipant; /** * Java specific text editor. */ public class CompilationUnitEditor extends JavaEditor implements IReconcilingParticipant {
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
interface ITextConverter { void customizeDocumentCommand(IDocument document, DocumentCommand command); }; class AdaptedRulerLayout extends Layout { protected int fGap; protected AdaptedSourceViewer fAdaptedSourceViewer; protected AdaptedRulerLayout(int gap, AdaptedSourceViewer asv) { fGap= gap; fAdaptedSourceViewer= asv; } protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache) { Control[] children= composite.getChildren(); Point s= children[children.length - 1].computeSize(SWT.DEFAULT, SWT.DEFAULT, flushCache); if (fAdaptedSourceViewer.isVerticalRulerVisible()) s.x += fAdaptedSourceViewer.getVerticalRuler().getWidth() + fGap; return s; }
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
protected void layout(Composite composite, boolean flushCache) { Rectangle clArea= composite.getClientArea(); if (fAdaptedSourceViewer.isVerticalRulerVisible()) { StyledText textWidget= fAdaptedSourceViewer.getTextWidget(); Rectangle trim= textWidget.computeTrim(0, 0, 0, 0); int scrollbarHeight= trim.height; IVerticalRuler vr= fAdaptedSourceViewer.getVerticalRuler(); int vrWidth=vr.getWidth(); int orWidth= 0; if (fAdaptedSourceViewer.isOverviewRulerVisible()) { OverviewRuler or= fAdaptedSourceViewer.getOverviewRuler(); orWidth= or.getWidth(); or.getControl().setBounds(clArea.width - orWidth, scrollbarHeight, orWidth, clArea.height - 3*scrollbarHeight); } textWidget.setBounds(vrWidth + fGap, 0, clArea.width - vrWidth - orWidth - 2*fGap, clArea.height); vr.getControl().setBounds(0, 0, vrWidth, clArea.height - scrollbarHeight); } else { StyledText textWidget= fAdaptedSourceViewer.getTextWidget(); textWidget.setBounds(0, 0, clArea.width, clArea.height); } } }; class AdaptedSourceViewer extends JavaCorrectionSourceViewer {
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
private List fTextConverters; private OverviewRuler fOverviewRuler; private boolean fIsOverviewRulerVisible; private IVerticalRuler fCachedVerticalRuler; private boolean fCachedIsVerticalRulerVisible; public AdaptedSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { super(parent, ruler, styles, CompilationUnitEditor.this); fCachedVerticalRuler= ruler; fCachedIsVerticalRulerVisible= (ruler != null); fOverviewRuler= new OverviewRuler(VERTICAL_RULER_WIDTH); delayedCreateControl(parent, styles); } /* * @see ISourceViewer#showAnnotations(boolean) */ public void showAnnotations(boolean show) {
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
fCachedIsVerticalRulerVisible= (show && fCachedVerticalRuler != null); super.showAnnotations(show); } public IContentAssistant getContentAssistant() { return fContentAssistant; } /* * @see ITextOperationTarget#doOperation(int) */ public void doOperation(int operation) { if (getTextWidget() == null) return; switch (operation) { case CONTENTASSIST_PROPOSALS: String msg= fContentAssistant.showPossibleCompletions(); setStatusLineErrorMessage(msg); return; } super.doOperation(operation); } public void insertTextConverter(ITextConverter textConverter, int index) { throw new UnsupportedOperationException(); }
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
public void addTextConverter(ITextConverter textConverter) { if (fTextConverters == null) { fTextConverters= new ArrayList(1); fTextConverters.add(textConverter); } else if (!fTextConverters.contains(textConverter)) fTextConverters.add(textConverter); } public void removeTextConverter(ITextConverter textConverter) { if (fTextConverters != null) { fTextConverters.remove(textConverter); if (fTextConverters.size() == 0) fTextConverters= null; } } /* * @see TextViewer#customizeDocumentCommand(DocumentCommand) */ protected void customizeDocumentCommand(DocumentCommand command) { super.customizeDocumentCommand(command); if (fTextConverters != null) { for (Iterator e = fTextConverters.iterator(); e.hasNext();) ((ITextConverter) e.next()).customizeDocumentCommand(getDocument(), command); } } public IVerticalRuler getVerticalRuler() { return fCachedVerticalRuler; }
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
public boolean isVerticalRulerVisible() { return fCachedIsVerticalRulerVisible; } public OverviewRuler getOverviewRuler() { return fOverviewRuler; } /* * @see TextViewer#createControl(Composite, int) */ protected void createControl(Composite parent, int styles) { } protected void delayedCreateControl(Composite parent, int styles) { super.createControl(parent, styles); Control control= getControl(); if (control instanceof Composite) { Composite composite= (Composite) control; composite.setLayout(new AdaptedRulerLayout(GAP_SIZE, this)); fOverviewRuler.createControl(composite, this); } } public void hideOverviewRuler() { fIsOverviewRulerVisible= false;
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
Control control= getControl(); if (control instanceof Composite) { Composite composite= (Composite) control; composite.layout(); } } public void showOverviewRuler() { fIsOverviewRulerVisible= true; Control control= getControl(); if (control instanceof Composite) { Composite composite= (Composite) control; composite.layout(); } } public boolean isOverviewRulerVisible() { return fIsOverviewRulerVisible; } /* * @see ISourceViewer#setDocument(IDocument, IAnnotationModel, int, int) */ public void setDocument(IDocument document, IAnnotationModel annotationModel, int visibleRegionOffset, int visibleRegionLength) { super.setDocument(document, annotationModel, visibleRegionOffset, visibleRegionLength); fOverviewRuler.setModel(annotationModel); } }; static class TabConverter implements ITextConverter {
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
private int fTabRatio; private ILineTracker fLineTracker; public TabConverter() { } public void setNumberOfSpacesPerTab(int ratio) { fTabRatio= ratio; } public void setLineTracker(ILineTracker lineTracker) { fLineTracker= lineTracker;
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} private int insertTabString(StringBuffer buffer, int offsetInLine) { if (fTabRatio == 0) return 0; int remainder= offsetInLine % fTabRatio; remainder= fTabRatio - remainder; for (int i= 0; i < remainder; i++) buffer.append(' '); return remainder; } public void customizeDocumentCommand(IDocument document, DocumentCommand command) { String text= command.text; if (text == null) return; int index= text.indexOf('\t'); if (index > -1) { StringBuffer buffer= new StringBuffer(); fLineTracker.set(command.text); int lines= fLineTracker.getNumberOfLines(); try { for (int i= 0; i < lines; i++) {
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
int offset= fLineTracker.getLineOffset(i); int endOffset= offset + fLineTracker.getLineLength(i); String line= text.substring(offset, endOffset); int position= 0; if (i == 0) { IRegion firstLine= document.getLineInformationOfOffset(command.offset); position= command.offset - firstLine.getOffset(); } int length= line.length(); for (int j= 0; j < length; j++) { char c= line.charAt(j); if (c == '\t') { position += insertTabString(buffer, position); } else { buffer.append(c); ++ position; } } } command.text= buffer.toString(); } catch (BadLocationException x) { } } }
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
}; private final static String CODE_FORMATTER_TAB_SIZE= JavaCore.FORMATTER_TAB_SIZE; private final static String CODE_FORMATTER_TAB_CHAR= JavaCore.FORMATTER_TAB_CHAR; public final static String MATCHING_BRACKETS= "matchingBrackets"; public final static String MATCHING_BRACKETS_COLOR= "matchingBracketsColor"; public final static String CURRENT_LINE= "currentLine"; public final static String CURRENT_LINE_COLOR= "currentLineColor"; public final static String PRINT_MARGIN= "printMargin"; public final static String PRINT_MARGIN_COLOR= "printMarginColor"; public final static String PRINT_MARGIN_COLUMN= "printMarginColumn"; public final static String SPACES_FOR_TABS= "spacesForTabs"; public final static String PROBLEM_INDICATION= "problemIndication"; public final static String PROBLEM_INDICATION_COLOR= "problemIndicationColor"; public final static String LINKED_POSITION_COLOR= "linkedPositionColor";
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
public final static String OVERVIEW_RULER= "overviewRuler"; protected ISelectionChangedListener fStatusLineClearer; protected ISavePolicy fSavePolicy; private JavaEditorErrorTickUpdater fJavaEditorErrorTickUpdater; private PaintManager fPaintManager; private BracketPainter fBracketPainter; private LinePainter fLinePainter; private PrintMarginPainter fPrintMarginPainter; private ProblemPainter fProblemPainter; private TabConverter fTabConverter; private SelectionHistory fSelectionHistory; private GenerateActionGroup fGenerateActionGroup; private CompositeActionGroup fContextMenuGroup; /**
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
* Creates a new compilation unit editor. */ public CompilationUnitEditor() { super(); setDocumentProvider(JavaPlugin.getDefault().getCompilationUnitDocumentProvider()); setEditorContextMenuId("#CompilationUnitEditorContext"); setRulerContextMenuId("#CompilationUnitRulerContext"); setOutlinerContextMenuId("#CompilationUnitOutlinerContext"); fSavePolicy= null; fJavaEditorErrorTickUpdater= new JavaEditorErrorTickUpdater(this); } /* * @see AbstractTextEditor#createActions() */ protected void createActions() { super.createActions(); Action action= new TextOperationAction(JavaEditorMessages.getResourceBundle(), "CorrectionAssistProposal.", this, JavaCorrectionSourceViewer.CORRECTIONASSIST_PROPOSALS); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.CORRECTION_ASSIST_PROPOSALS); setAction("CorrectionAssistProposal", action); action= new TextOperationAction(JavaEditorMessages.getResourceBundle(), "ContentAssistProposal.", this, ISourceViewer.CONTENTASSIST_PROPOSALS); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); setAction("ContentAssistProposal", action); action= new TextOperationAction(JavaEditorMessages.getResourceBundle(), "ContentAssistContextInformation.", this, ISourceViewer.CONTENTASSIST_CONTEXT_INFORMATION, true); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.CONTENT_ASSIST_CONTEXT_INFORMATION); setAction("ContentAssistContextInformation", action); action= new TextOperationAction(JavaEditorMessages.getResourceBundle(), "Comment.", this, ITextOperationTarget.PREFIX);
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
action.setActionDefinitionId(IJavaEditorActionDefinitionIds.COMMENT); setAction("Comment", action); action= new TextOperationAction(JavaEditorMessages.getResourceBundle(), "Uncomment.", this, ITextOperationTarget.STRIP_PREFIX); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.UNCOMMENT); setAction("Uncomment", action); action= new TextOperationAction(JavaEditorMessages.getResourceBundle(), "Format.", this, ISourceViewer.FORMAT); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.FORMAT); setAction("Format", action); markAsStateDependentAction("CorrectionAssistProposal", true); markAsStateDependentAction("ContentAssistProposal", true); markAsStateDependentAction("Comment", true); markAsStateDependentAction("Uncomment", true); markAsStateDependentAction("Format", true); fSelectionHistory= new SelectionHistory(this); action= new StructureSelectEnclosingAction(this, fSelectionHistory); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.SELECT_ENCLOSING); setAction(StructureSelectionAction.ENCLOSING, action); action= new StructureSelectNextAction(this, fSelectionHistory); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.SELECT_NEXT); setAction(StructureSelectionAction.NEXT, action); action= new StructureSelectPreviousAction(this, fSelectionHistory); action.setActionDefinitionId(IJavaEditorActionDefinitionIds.SELECT_PREVIOUS); setAction(StructureSelectionAction.PREVIOUS, action); StructureSelectHistoryAction historyAction= new StructureSelectHistoryAction(this, fSelectionHistory); historyAction.setActionDefinitionId(IJavaEditorActionDefinitionIds.SELECT_LAST); setAction(StructureSelectionAction.HISTORY, historyAction); fSelectionHistory.setHistoryAction(historyAction); fGenerateActionGroup= new GenerateActionGroup(this, ITextEditorActionConstants.GROUP_EDIT); ActionGroup rg= new RefactorActionGroup(this, ITextEditorActionConstants.GROUP_EDIT);
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
fActionGroups.addGroup(rg); fActionGroups.addGroup(fGenerateActionGroup); fContextMenuGroup= new CompositeActionGroup(new ActionGroup[] { fGenerateActionGroup, rg, new LocalHistoryActionGroup(this, ITextEditorActionConstants.GROUP_EDIT)}); } /* * @see JavaEditor#getElementAt(int) */ protected IJavaElement getElementAt(int offset) { IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager(); ICompilationUnit unit= manager.getWorkingCopy(getEditorInput()); if (unit != null) { synchronized (unit) { try { unit.reconcile(); return unit.getElementAt(offset); } catch (JavaModelException x) { } } } return null; }
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
/* * @see JavaEditor#getCorrespondingElement(IJavaElement) */ protected IJavaElement getCorrespondingElement(IJavaElement element) { try { return EditorUtility.getWorkingCopy(element, true); } catch (JavaModelException x) { } return null; } /* * @see AbstractTextEditor#editorContextMenuAboutToShow(IMenuManager) */ public void editorContextMenuAboutToShow(IMenuManager menu) { super.editorContextMenuAboutToShow(menu); addActionIfEnabled(menu, ITextEditorActionConstants.GROUP_EDIT, ITextEditorActionConstants.REVERT_TO_SAVED); addAction(menu, ITextEditorActionConstants.GROUP_EDIT, "Format"); ActionContext context= new ActionContext(getSelectionProvider().getSelection()); fContextMenuGroup.setContext(context); fContextMenuGroup.fillContextMenu(menu); fContextMenuGroup.setContext(null); } private void addActionIfEnabled(IMenuManager menu, String group, String actionId) { IAction action= getAction(actionId); if (action != null) {
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
if (action instanceof IUpdate) ((IUpdate) action).update(); if (!action.isEnabled()) return; IMenuManager subMenu= menu.findMenuUsingPath(group); if (subMenu != null) subMenu.add(action); else menu.appendToGroup(group, action); } } /* * @see JavaEditor#setOutlinePageInput(JavaOutlinePage, IEditorInput) */ protected void setOutlinePageInput(JavaOutlinePage page, IEditorInput input) { if (page != null) { IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager(); page.setInput(manager.getWorkingCopy(input)); } } /* * @see AbstractTextEditor#performSaveOperation(WorkspaceModifyOperation, IProgressMonitor) */ protected void performSaveOperation(WorkspaceModifyOperation operation, IProgressMonitor progressMonitor) { IDocumentProvider p= getDocumentProvider(); if (p instanceof CompilationUnitDocumentProvider) { CompilationUnitDocumentProvider cp= (CompilationUnitDocumentProvider) p;
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
cp.setSavePolicy(fSavePolicy); } try { super.performSaveOperation(operation, progressMonitor); } finally { if (p instanceof CompilationUnitDocumentProvider) { CompilationUnitDocumentProvider cp= (CompilationUnitDocumentProvider) p; cp.setSavePolicy(null); } } } /* * @see AbstractTextEditor#doSave(IProgressMonitor) */ public void doSave(IProgressMonitor progressMonitor) { IDocumentProvider p= getDocumentProvider(); if (p == null) return; if (p.isDeleted(getEditorInput())) { if (isSaveAsAllowed()) { /* * 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors. * Changed Behavior to make sure that if called inside a regular save (because * of deletion of input element) there is a way to report back to the caller.
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
*/ performSaveAs(progressMonitor); } else { /* * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there * Missing resources. */ Shell shell= getSite().getShell(); MessageDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title1"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message1")); } } else { setStatusLineErrorMessage(null); IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager(); ICompilationUnit unit= manager.getWorkingCopy(getEditorInput()); if (unit != null) { synchronized (unit) { performSaveOperation(createSaveOperation(false), progressMonitor); } } else performSaveOperation(createSaveOperation(false), progressMonitor); } } /**
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
* Jumps to the error next according to the given direction. */ public void gotoError(boolean forward) { ISelectionProvider provider= getSelectionProvider(); if (fStatusLineClearer != null) { provider.removeSelectionChangedListener(fStatusLineClearer); fStatusLineClearer= null; } ITextSelection s= (ITextSelection) provider.getSelection(); Position errorPosition= new Position(0, 0); IProblemAnnotation nextError= getNextError(s.getOffset(), forward, errorPosition); if (nextError != null) { selectAndReveal(errorPosition.getOffset(), errorPosition.getLength()); IMarker marker= null; if (nextError instanceof MarkerAnnotation) marker= ((MarkerAnnotation) nextError).getMarker(); else { Iterator e= nextError.getOverlaidIterator(); if (e != null) { while (e.hasNext()) { Object o= e.next(); if (o instanceof MarkerAnnotation) { marker= ((MarkerAnnotation) o).getMarker(); break;
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} } } } if (marker != null) { IWorkbenchPage page= getSite().getPage(); IViewPart view= view= page.findView("org.eclipse.ui.views.TaskList"); if (view instanceof TaskList) { StructuredSelection ss= new StructuredSelection(marker); ((TaskList) view).setSelection(ss, true); } } } else { setStatusLineErrorMessage(null); } } /** * Sets the given message as error message to this editor's status line. * @param msg message to be set */ protected void setStatusLineErrorMessage(String msg) { getStatusLineManager().setErrorMessage(msg); if (msg == null || msg.trim().length() == 0) {
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
if (fStatusLineClearer != null) { getSelectionProvider().removeSelectionChangedListener(fStatusLineClearer); fStatusLineClearer= null; } } else if (fStatusLineClearer == null) { fStatusLineClearer= new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { getSelectionProvider().removeSelectionChangedListener(fStatusLineClearer); fStatusLineClearer= null; getStatusLineManager().setErrorMessage(null); } }; getSelectionProvider().addSelectionChangedListener(fStatusLineClearer); } } private IProblemAnnotation getNextError(int offset, boolean forward, Position errorPosition) { IProblemAnnotation nextError= null; Position nextErrorPosition= null; IDocument document= getDocumentProvider().getDocument(getEditorInput()); int endOfDocument= document.getLength(); int distance= 0; IAnnotationModel model= getDocumentProvider().getAnnotationModel(getEditorInput()); Iterator e= new ProblemAnnotationIterator(model, false); while (e.hasNext()) { IProblemAnnotation a= (IProblemAnnotation) e.next();
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
if (a.hasOverlay()) continue; Position p= model.getPosition((Annotation) a); if (!p.includes(offset)) { int currentDistance= 0; if (forward) { currentDistance= p.getOffset() - offset; if (currentDistance < 0) currentDistance= endOfDocument - offset + p.getOffset(); } else { currentDistance= offset - p.getOffset(); if (currentDistance < 0) currentDistance= offset + endOfDocument - p.getOffset(); } if (nextError == null || currentDistance < distance) { distance= currentDistance; nextError= a; nextErrorPosition= p; } } } if (nextErrorPosition != null) { errorPosition.setOffset(nextErrorPosition.getOffset()); errorPosition.setLength(nextErrorPosition.getLength()); }
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
return nextError; } /* * @see AbstractTextEditor#isSaveAsAllowed() */ public boolean isSaveAsAllowed() { return true; } /* * 1GF7WG9: ITPJUI:ALL - EXCEPTION: "Save As..." always fails */ protected IPackageFragment getPackage(IWorkspaceRoot root, IPath path) { if (path.segmentCount() == 1) { IProject project= root.getProject(path.toString()); if (project != null) { IJavaProject jProject= JavaCore.create(project); if (jProject != null) { try { IJavaElement element= jProject.findElement(new Path("")); if (element instanceof IPackageFragment) { IPackageFragment fragment= (IPackageFragment) element; IJavaElement parent= fragment.getParent(); if (parent instanceof IPackageFragmentRoot) { IPackageFragmentRoot pRoot= (IPackageFragmentRoot) parent; if ( !pRoot.isArchive() && !pRoot.isExternal() && path.equals(pRoot.getPath()))
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
return fragment; } } } catch (JavaModelException x) { } } } return null; } else if (path.segmentCount() > 1) { IFolder folder= root.getFolder(path); IJavaElement element= JavaCore.create(folder); if (element instanceof IPackageFragment) return (IPackageFragment) element; } return null; } /* * 1GEUSSR: ITPUI:ALL - User should never loose changes made in the editors. * Changed behavior to make sure that if called inside a regular save (because * of deletion of input element) there is a way to report back to the caller. */ protected void performSaveAs(IProgressMonitor progressMonitor) { Shell shell= getSite().getShell();
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
SaveAsDialog dialog= new SaveAsDialog(shell); IEditorInput input = getEditorInput(); IFile original= null; if (input instanceof IFileEditorInput) original= ((IFileEditorInput) input).getFile(); if (original != null) dialog.setOriginalFile(original); if (dialog.open() == Dialog.CANCEL) { if (progressMonitor != null) progressMonitor.setCanceled(true); return; } IPath filePath= dialog.getResult(); if (filePath == null) { if (progressMonitor != null) progressMonitor.setCanceled(true); return; } filePath= filePath.removeTrailingSeparator(); final String fileName= filePath.lastSegment(); IPath folderPath= filePath.removeLastSegments(1); if (folderPath == null) { if (progressMonitor != null) progressMonitor.setCanceled(true);
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
return; } IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); /* * 1GF7WG9: ITPJUI:ALL - EXCEPTION: "Save As..." always fails */ final IPackageFragment fragment= getPackage(root, folderPath); IFile file= root.getFile(filePath); /* * Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=8873 * Problem caused by http://dev.eclipse.org/bugs/show_bug.cgi?id=9351 * Will be removed if #9351 is solved. */ if (original != null && original.equals(file) && original.exists()) { doSave(progressMonitor); return; } final FileEditorInput newInput= new FileEditorInput(file); final boolean originalExists= original.exists(); WorkspaceModifyOperation op= new WorkspaceModifyOperation() { public void execute(final IProgressMonitor monitor) throws CoreException { if (fragment != null && originalExists) {
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
IWorkingCopyManager manager= JavaPlugin.getDefault().getWorkingCopyManager(); ICompilationUnit unit= manager.getWorkingCopy(getEditorInput()); /* * 1GJXY0L: ITPJUI:WINNT - NPE during save As in Java editor * Introduced null check, just go on in the null case */ if (unit != null) { /* * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there * Changed false to true. */ unit.copy(fragment, null, fileName, true, monitor); return; } } /* * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there * Changed false to true. */ getDocumentProvider().saveDocument(monitor, newInput, getDocumentProvider().getDocument(getEditorInput()), true); } };
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
boolean success= false; try { if (fragment == null) getDocumentProvider().aboutToChange(newInput); new ProgressMonitorDialog(shell).run(false, true, op); setInput(newInput); success= true; } catch (InterruptedException x) { } catch (InvocationTargetException x) { /* * 1GF5YOX: ITPJUI:ALL - Save of delete file claims it's still there * Missing resources. */ Throwable t= x.getTargetException(); if (t instanceof CoreException) { CoreException cx= (CoreException) t; ErrorDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title2"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message2"), cx.getStatus()); } else { MessageDialog.openError(shell, JavaEditorMessages.getString("CompilationUnitEditor.error.saving.title3"), JavaEditorMessages.getString("CompilationUnitEditor.error.saving.message3") + t.getMessage()); } } finally { if (fragment == null) getDocumentProvider().changed(newInput);
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
if (progressMonitor != null) progressMonitor.setCanceled(!success); } } /* * @see AbstractTextEditor#doSetInput(IEditorInput) */ protected void doSetInput(IEditorInput input) throws CoreException { super.doSetInput(input); configureTabConverter(); } private void startBracketHighlighting() { if (fBracketPainter == null) { ISourceViewer sourceViewer= getSourceViewer(); fBracketPainter= new BracketPainter(sourceViewer); fBracketPainter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR)); fPaintManager.addPainter(fBracketPainter); } } private void stopBracketHighlighting() { if (fBracketPainter != null) { fPaintManager.removePainter(fBracketPainter); fBracketPainter.deactivate(true); fBracketPainter.dispose(); fBracketPainter= null; } }
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
private boolean isBracketHighlightingEnabled() { IPreferenceStore store= getPreferenceStore(); return store.getBoolean(MATCHING_BRACKETS); } private void startLineHighlighting() { if (fLinePainter == null) { ISourceViewer sourceViewer= getSourceViewer(); fLinePainter= new LinePainter(sourceViewer); fLinePainter.setHighlightColor(getColor(CURRENT_LINE_COLOR)); fPaintManager.addPainter(fLinePainter); } } private void stopLineHighlighting() { if (fLinePainter != null) { fPaintManager.removePainter(fLinePainter); fLinePainter.deactivate(true); fLinePainter.dispose(); fLinePainter= null; } } private boolean isLineHighlightingEnabled() { IPreferenceStore store= getPreferenceStore(); return store.getBoolean(CURRENT_LINE); } private void showPrintMargin() {
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
if (fPrintMarginPainter == null) { fPrintMarginPainter= new PrintMarginPainter(getSourceViewer()); fPrintMarginPainter.setMarginRulerColor(getColor(PRINT_MARGIN_COLOR)); fPrintMarginPainter.setMarginRulerColumn(getPreferenceStore().getInt(PRINT_MARGIN_COLUMN)); fPaintManager.addPainter(fPrintMarginPainter); } } private void hidePrintMargin() { if (fPrintMarginPainter != null) { fPaintManager.removePainter(fPrintMarginPainter); fPrintMarginPainter.deactivate(true); fPrintMarginPainter.dispose(); fPrintMarginPainter= null; } } private boolean isPrintMarginVisible() { IPreferenceStore store= getPreferenceStore(); return store.getBoolean(PRINT_MARGIN); } private void startProblemIndication() { if (fProblemPainter == null) { fProblemPainter= new ProblemPainter(this, getSourceViewer()); fProblemPainter.setHighlightColor(getColor(PROBLEM_INDICATION_COLOR)); fPaintManager.addPainter(fProblemPainter); } }
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
private void stopProblemIndication() { if (fProblemPainter != null) { fPaintManager.removePainter(fProblemPainter); fProblemPainter.deactivate(true); fProblemPainter.dispose(); fProblemPainter= null; } } private boolean isProblemIndicationEnabled() { IPreferenceStore store= getPreferenceStore(); return store.getBoolean(PROBLEM_INDICATION); } private void configureTabConverter() { if (fTabConverter != null) { IDocumentProvider provider= getDocumentProvider(); if (provider instanceof CompilationUnitDocumentProvider) { CompilationUnitDocumentProvider cup= (CompilationUnitDocumentProvider) provider; fTabConverter.setLineTracker(cup.createLineTracker(getEditorInput())); } } } private void startTabConversion() { if (fTabConverter == null) { fTabConverter= new TabConverter(); configureTabConverter(); fTabConverter.setNumberOfSpacesPerTab(getPreferenceStore().getInt(CODE_FORMATTER_TAB_SIZE)); AdaptedSourceViewer asv= (AdaptedSourceViewer) getSourceViewer();
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
asv.addTextConverter(fTabConverter); } } private void stopTabConversion() { if (fTabConverter != null) { AdaptedSourceViewer asv= (AdaptedSourceViewer) getSourceViewer(); asv.removeTextConverter(fTabConverter); fTabConverter= null; } } private boolean isTabConversionEnabled() { IPreferenceStore store= getPreferenceStore(); return store.getBoolean(SPACES_FOR_TABS); } private void showOverviewRuler() { AdaptedSourceViewer asv= (AdaptedSourceViewer) getSourceViewer(); asv.showOverviewRuler(); } private void hideOverviewRuler() { AdaptedSourceViewer asv= (AdaptedSourceViewer) getSourceViewer(); asv.hideOverviewRuler(); } private boolean isOverviewRulerVisible() { IPreferenceStore store= getPreferenceStore(); return store.getBoolean(OVERVIEW_RULER);
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} private Color getColor(String key) { RGB rgb= PreferenceConverter.getColor(getPreferenceStore(), key); return getColor(rgb); } private Color getColor(RGB rgb) { JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools(); return textTools.getColorManager().getColor(rgb); } /* * @see AbstractTextEditor#dispose() */ public void dispose() { if (fJavaEditorErrorTickUpdater != null) { fJavaEditorErrorTickUpdater.dispose(); fJavaEditorErrorTickUpdater= null; } if (fSelectionHistory != null) fSelectionHistory.dispose(); stopBracketHighlighting(); stopLineHighlighting(); if (fPaintManager != null) { fPaintManager.dispose(); fPaintManager= null;
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} if (fActionGroups != null) fActionGroups.dispose(); super.dispose(); } /* * @see AbstractTextEditor#createPartControl(Composite) */ public void createPartControl(Composite parent) { super.createPartControl(parent); fPaintManager= new PaintManager(getSourceViewer()); if (isBracketHighlightingEnabled()) startBracketHighlighting(); if (isLineHighlightingEnabled()) startLineHighlighting(); if (isPrintMarginVisible()) showPrintMargin(); if (isProblemIndicationEnabled()) startProblemIndication(); if (isTabConversionEnabled()) startTabConversion(); if (isOverviewRulerVisible()) showOverviewRuler(); } /* * @see AbstractTextEditor#handlePreferenceStoreChanged(PropertyChangeEvent)
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
*/ protected void handlePreferenceStoreChanged(PropertyChangeEvent event) { try { AdaptedSourceViewer asv= (AdaptedSourceViewer) getSourceViewer(); if (asv != null) { String p= event.getProperty(); if (CODE_FORMATTER_TAB_SIZE.equals(p) || CODE_FORMATTER_TAB_CHAR.equals(p)) { SourceViewerConfiguration configuration= getSourceViewerConfiguration(); String[] types= configuration.getConfiguredContentTypes(asv); for (int i= 0; i < types.length; i++) asv.setIndentPrefixes(configuration.getIndentPrefixes(asv, types[i]), types[i]); if (fTabConverter != null) fTabConverter.setNumberOfSpacesPerTab(getPreferenceStore().getInt(CODE_FORMATTER_TAB_SIZE)); } if (SPACES_FOR_TABS.equals(p)) { if (isTabConversionEnabled()) startTabConversion(); else stopTabConversion(); return; } if (MATCHING_BRACKETS.equals(p)) { if (isBracketHighlightingEnabled()) startBracketHighlighting();
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
else stopBracketHighlighting(); return; } if (MATCHING_BRACKETS_COLOR.equals(p)) { if (fBracketPainter != null) fBracketPainter.setHighlightColor(getColor(MATCHING_BRACKETS_COLOR)); return; } if (CURRENT_LINE.equals(p)) { if (isLineHighlightingEnabled()) startLineHighlighting(); else stopLineHighlighting(); return; } if (CURRENT_LINE_COLOR.equals(p)) { if (fLinePainter != null) { stopLineHighlighting(); startLineHighlighting(); } return; } if (PRINT_MARGIN.equals(p)) { if (isPrintMarginVisible()) showPrintMargin();
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
else hidePrintMargin(); return; } if (PRINT_MARGIN_COLOR.equals(p)) { if (fPrintMarginPainter != null) fPrintMarginPainter.setMarginRulerColor(getColor(PRINT_MARGIN_COLOR)); return; } if (PRINT_MARGIN_COLUMN.equals(p)) { if (fPrintMarginPainter != null) fPrintMarginPainter.setMarginRulerColumn(getPreferenceStore().getInt(PRINT_MARGIN_COLUMN)); return; } if (PROBLEM_INDICATION.equals(p)) { if (isProblemIndicationEnabled()) startProblemIndication(); else stopProblemIndication(); return; } if (PROBLEM_INDICATION_COLOR.equals(p)) { if (fProblemPainter != null) fProblemPainter.setHighlightColor(getColor(PROBLEM_INDICATION_COLOR)); return; }
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
if (OVERVIEW_RULER.equals(p)) { if (isOverviewRulerVisible()) showOverviewRuler(); else hideOverviewRuler(); return; } IContentAssistant c= asv.getContentAssistant(); if (c instanceof ContentAssistant) ContentAssistPreference.changeConfiguration((ContentAssistant) c, getPreferenceStore(), event); } } finally { super.handlePreferenceStoreChanged(event); } } /* * @see AbstractTextEditor#affectsTextPresentation(PropertyChangeEvent) */ protected boolean affectsTextPresentation(PropertyChangeEvent event) { String p= event.getProperty(); boolean affects=MATCHING_BRACKETS_COLOR.equals(p) || CURRENT_LINE_COLOR.equals(p) || PROBLEM_INDICATION_COLOR.equals(p); return affects ? affects : super.affectsTextPresentation(event);
17,423
Bug 17423 Revert apears twice in the popup menu.
Build F1. 1) Open a java editor. 2) Popup the menu. There is only one Revert option disable as it should be. 3) Make the editor dirty. 4) Popup the menu. There are two Revert option in the menu. One after UNDO and other before FORMAT.
verified fixed
249c5e9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T09:48:38Z
2002-05-23T18:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitEditor.java
} /* * @see JavaEditor#createJavaSourceViewer(Composite, IVerticalRuler, int) */ protected ISourceViewer createJavaSourceViewer(Composite parent, IVerticalRuler ruler, int styles) { return new AdaptedSourceViewer(parent, ruler, styles); } /* * @see IReconcilingParticipant#reconciled() */ public void reconciled() { if (!JavaEditorPreferencePage.synchronizeOutlineOnCursorMove()) { Shell shell= getSite().getShell(); if (shell != null && !shell.isDisposed()) { shell.getDisplay().asyncExec(new Runnable() { public void run() { synchronizeOutlinePageSelection(); } }); } } } protected void updateStateDependentActions() { super.updateStateDependentActions(); fGenerateActionGroup.editorStateChanged(); } }
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.junit.ui; import java.net.MalformedURLException; import java.text.NumberFormat; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Vector; import org.eclipse.core.runtime.CoreException;
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
import org.eclipse.debug.core.*; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.SashForm; import org.eclipse.swt.custom.ViewForm; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.ProgressBar; import org.eclipse.swt.widgets.ToolBar; import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IStatusLineManager; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.ui.IActionBars; import org.eclipse.ui.IEditorActionBarContributor; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IViewPart; import org.eclipse.ui.IViewSite;
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
import org.eclipse.ui.IWorkbenchActionConstants; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PartInitException; import org.eclipse.ui.part.EditorActionBarContributor; import org.eclipse.ui.part.ViewPart; import org.eclipse.jdt.core.ElementChangedEvent; import org.eclipse.jdt.core.IElementChangedListener; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaElementDelta; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.internal.junit.runner.ITestRunListener; /** * A ViewPart that shows the results of a test run. */ public class TestRunnerViewPart extends ViewPart implements ITestRunListener, IPropertyChangeListener { public static final String NAME= "org.eclipse.jdt.junit.ResultView"; /** * Number of executed tests during a test run */ protected int fExecutedTests; /** * Number of errors during this test run */ protected int fErrors; /** * Number of failures during this test run
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
*/ protected int fFailures; /** * Number of tests run */ private int fTestCount; /** * Map storing TestInfos for each executed test keyed by * the test name. */ private Map fTestInfos = new HashMap(); /** * The first failure of a test run. Used to reveal the * first failed tests at the end of a run. */ private TestRunInfo fFirstFailure; private ProgressBar fProgressBar; private ProgressImages fProgressImages; private Image fViewImage; private CounterPanel fCounterPanel; private boolean fShowOnErrorOnly= false; /** * The view that shows the stack trace of a failure */ private FailureTraceView fFailureView; /** * The collection of ITestRunViews */ private Vector fTestRunViews = new Vector(); /**
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
* The currently active run view */ private ITestRunView fActiveRunView; /** * Is the UI disposed */ private boolean fIsDisposed= false; /** * The launched test type */ private IType fTestType; /** * The launcher that has started the test */ private String fLaunchMode; private ILaunch fLastLaunch= null; /** * The client side of the remote test runner */ private RemoteTestRunnerClient fTestRunnerClient; final Image fStackViewIcon= TestRunnerViewPart.createImage("cview16/stackframe.gif"); final Image fTestRunOKIcon= TestRunnerViewPart.createImage("cview16/junitsucc.gif"); final Image fTestRunFailIcon= TestRunnerViewPart.createImage("cview16/juniterr.gif"); final Image fTestRunOKDirtyIcon= TestRunnerViewPart.createImage("cview16/junitsuccq.gif"); final Image fTestRunFailDirtyIcon= TestRunnerViewPart.createImage("cview16/juniterrq.gif"); Image fOriginalViewImage= null; IElementChangedListener fDirtyListener= null; private class StopAction extends Action{
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
public StopAction() { setText(JUnitMessages.getString("TestRunnerViewPart.stopaction.text")); setToolTipText(JUnitMessages.getString("TestRunnerViewPart.stopaction.tooltip")); setDisabledImageDescriptor(JUnitPlugin.getImageDescriptor("dlcl16/stop.gif")); setHoverImageDescriptor(JUnitPlugin.getImageDescriptor("clcl16/stop.gif")); setImageDescriptor(JUnitPlugin.getImageDescriptor("elcl16/stop.gif")); } public void run() { stopTest(); } } private class RerunAction extends Action{ public RerunAction() { setText(JUnitMessages.getString("TestRunnerViewPart.rerunaction.label")); setToolTipText(JUnitMessages.getString("TestRunnerViewPart.rerunaction.tooltip")); setDisabledImageDescriptor(JUnitPlugin.getImageDescriptor("dlcl16/relaunch.gif")); setHoverImageDescriptor(JUnitPlugin.getImageDescriptor("clcl16/relaunch.gif")); setImageDescriptor(JUnitPlugin.getImageDescriptor("elcl16/relaunch.gif")); } public void run(){ rerunTestRun(); } } /** * Listen for for modifications to Java elements */ private class DirtyListener implements IElementChangedListener {
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
public void elementChanged(ElementChangedEvent event) { processDelta(event.getDelta()); } private boolean processDelta(IJavaElementDelta delta) { int kind= delta.getKind(); int details= delta.getFlags(); int type= delta.getElement().getElementType(); switch (type) { case IJavaElement.JAVA_MODEL: case IJavaElement.JAVA_PROJECT: case IJavaElement.PACKAGE_FRAGMENT_ROOT: case IJavaElement.PACKAGE_FRAGMENT: if (kind != IJavaElementDelta.CHANGED || details != IJavaElementDelta.F_CHILDREN) { codeHasChanged(); return false; } break; case IJavaElement.CLASS_FILE: return true; default: codeHasChanged(); return false; }
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
IJavaElementDelta[] affectedChildren= delta.getAffectedChildren(); if (affectedChildren == null) return true; for (int i= 0; i < affectedChildren.length; i++) { if (!processDelta(affectedChildren[i])) return false; } return true; } } /** * Stops the currently running test and shuts down the RemoteTestRunner */ public void stopTest() { if (fTestRunnerClient != null) fTestRunnerClient.stopTest(); } /** * Stops the currently running test and shuts down the RemoteTestRunner */ public void rerunTestRun() { if (fLastLaunch != null && fLastLaunch.getLaunchConfiguration() != null) { try { fLastLaunch.getLaunchConfiguration().launch(fLastLaunch.getLaunchMode(), null); } catch (CoreException e) { ErrorDialog.openError(getSite().getShell(), JUnitMessages.getString("TestRunnerViewPart.error.cannotrerun"), e.getMessage(), e.getStatus() );
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
} } } /* * @see ITestRunListener#testRunStarted(testCount) */ public void testRunStarted(final int testCount){ reset(testCount); fShowOnErrorOnly= JUnitPreferencePage.getShowOnErrorOnly(); fExecutedTests++; } /* * @see ITestRunListener#testRunEnded */ public void testRunEnded(long elapsedTime){ fExecutedTests--; String msg= JUnitMessages.getFormattedString("TestRunnerViewPart.message.finish", elapsedTimeAsString(elapsedTime)); postInfo(msg); postAsyncRunnable(new Runnable() { public void run() { if(isDisposed()) return; if (fFirstFailure != null) { fActiveRunView.setSelectedTest(fFirstFailure.fTestName); handleTestSelected(fFirstFailure.fTestName); } updateViewIcon(); if (fDirtyListener == null) { fDirtyListener= new DirtyListener(); JavaCore.addElementChangedListener(fDirtyListener);
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
} } }); } private void updateViewIcon() { if (fErrors+fFailures > 0) fViewImage= fTestRunFailIcon; else fViewImage= fTestRunOKIcon; firePropertyChange(IWorkbenchPart.PROP_TITLE); } private String elapsedTimeAsString(long runTime) { return NumberFormat.getInstance().format((double)runTime/1000); } /* * @see ITestRunListener#testRunStopped */ public void testRunStopped(final long elapsedTime) { String msg= JUnitMessages.getFormattedString("TestRunnerViewPart.message.stopped", elapsedTimeAsString(elapsedTime)); postInfo(msg); postAsyncRunnable(new Runnable() { public void run() { if(isDisposed()) return; resetViewIcon(); } }); } private void resetViewIcon() { fViewImage= fOriginalViewImage;
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
firePropertyChange(IWorkbenchPart.PROP_TITLE); } /* * @see ITestRunListener#testRunTerminated */ public void testRunTerminated() { String msg= JUnitMessages.getString("TestRunnerViewPart.message.terminated"); showMessage(msg); } private void showMessage(String msg) { showInformation(msg); postError(msg); } /* * @see ITestRunListener#testStarted */ public void testStarted(String testName) { if (!fShowOnErrorOnly && fExecutedTests == 1) postShowTestResultsView(); postInfo(JUnitMessages.getFormattedString("TestRunnerViewPart.message.started", testName)); TestRunInfo testInfo= getTestInfo(testName); if (testInfo == null) fTestInfos.put(testName, new TestRunInfo(testName)); } /* * @see ITestRunListener#testEnded */ public void testEnded(String testName){
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
postEndTest(testName); fExecutedTests++; } /* * @see ITestRunListener#testFailed */ public void testFailed(int status, String testName, String trace){ TestRunInfo testInfo= getTestInfo(testName); if (testInfo == null) { testInfo= new TestRunInfo(testName); fTestInfos.put(testName, testInfo); } testInfo.fTrace= trace; testInfo.fStatus= status; if (status == ITestRunListener.STATUS_ERROR) fErrors++; else fFailures++; if (fFirstFailure == null) fFirstFailure= testInfo; if (fShowOnErrorOnly && (fErrors + fFailures == 1)) postShowTestResultsView(); } /* * @see ITestRunListener#testReran */ public void testReran(String className, String testName, int status, String trace) { if (status == ITestRunListener.STATUS_ERROR) { String msg= JUnitMessages.getFormattedString("TestRunnerViewPart.message.error", new String[]{testName, className});
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
postError(msg); } else if (status == ITestRunListener.STATUS_FAILURE) { String msg= JUnitMessages.getFormattedString("TestRunnerViewPart.message.failure", new String[]{testName, className}); postError(msg); } else { String msg= JUnitMessages.getFormattedString("TestRunnerViewPart.message.success", new String[]{testName, className}); postInfo(msg); } String test= testName+"("+className+")"; TestRunInfo info= getTestInfo(test); updateTest(info, status); if (info.fTrace == null || !info.fTrace.equals(trace)) { info.fTrace= trace; showFailure(info.fTrace); } } private void updateTest(TestRunInfo info, final int status) { if (status == info.fStatus) return; if (info.fStatus == ITestRunListener.STATUS_OK) { if (status == ITestRunListener.STATUS_FAILURE) fFailures++; else if (status == ITestRunListener.STATUS_ERROR) fErrors++; } else if (info.fStatus == ITestRunListener.STATUS_ERROR) { if (status == ITestRunListener.STATUS_OK) fErrors--; else if (status == ITestRunListener.STATUS_FAILURE) { fErrors--; fFailures++;
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
} } else if (info.fStatus == ITestRunListener.STATUS_FAILURE) { if (status == ITestRunListener.STATUS_OK) fFailures--; else if (status == ITestRunListener.STATUS_ERROR) { fFailures--; fErrors++; } } info.fStatus= status; final TestRunInfo finalInfo= info; postAsyncRunnable(new Runnable() { public void run() { refreshCounters(); for (Enumeration e= fTestRunViews.elements(); e.hasMoreElements();) { ITestRunView v= (ITestRunView) e.nextElement(); v.testStatusChanged(finalInfo); } } }); } /* * @see ITestRunListener#testTreeEntry */ public void testTreeEntry(final String treeEntry){ postSyncRunnable(new Runnable() { public void run() { if(isDisposed()) return;
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
for (Enumeration e= fTestRunViews.elements(); e.hasMoreElements();) { ITestRunView v= (ITestRunView) e.nextElement(); v.newTreeEntry(treeEntry); } } }); } public void startTestRunListening(IType type, int port, ILaunch launch) { fTestType= type; fLaunchMode= launch.getLaunchMode(); aboutToLaunch(); if (fTestRunnerClient != null) { stopTest(); } fTestRunnerClient= new RemoteTestRunnerClient(); fTestRunnerClient.startListening(this, port); fLastLaunch= launch; String title= JUnitMessages.getFormattedString("TestRunnerViewPart.title", fTestType.getElementName()); setTitle(title); setTitleToolTip(fTestType.getFullyQualifiedName()); } private void aboutToLaunch() { String msg= JUnitMessages.getString("TestRunnerViewPart.message.launching"); showInformation(msg); postInfo(msg); fViewImage= fOriginalViewImage; firePropertyChange(IWorkbenchPart.PROP_TITLE); } public void rerunTest(String className, String testName) {
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
if (fTestRunnerClient != null && fTestRunnerClient.isRunning() && ILaunchManager.DEBUG_MODE.equals(fLaunchMode)) fTestRunnerClient.rerunTest(className, testName); else { MessageDialog.openInformation(getSite().getShell(), JUnitMessages.getString("TestRunnerViewPart.cannotrerun.title"), JUnitMessages.getString("TestRunnerViewPart.cannotrerurn.message") ); } } public synchronized void dispose(){ fIsDisposed= true; stopTest(); fProgressImages.dispose(); JUnitPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this); fTestRunOKIcon.dispose(); fTestRunFailIcon.dispose(); fStackViewIcon.dispose(); fTestRunOKDirtyIcon.dispose(); fTestRunFailDirtyIcon.dispose(); } private void start(final int total) { resetProgressBar(total); fCounterPanel.setTotal(total); fCounterPanel.setRunValue(0); } private void resetProgressBar(final int total) { fProgressBar.setMinimum(0); fProgressBar.setSelection(0); fProgressBar.setForeground(getDisplay().getSystemColor(SWT.COLOR_GREEN)); fProgressBar.setMaximum(total);
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
} private void postSyncRunnable(Runnable r) { if (!isDisposed()) getDisplay().syncExec(r); } private void postAsyncRunnable(Runnable r) { if (!isDisposed()) getDisplay().asyncExec(r); } private void aboutToStart() { postSyncRunnable(new Runnable() { public void run() { if (!isDisposed()) { for (Enumeration e= fTestRunViews.elements(); e.hasMoreElements();) { ITestRunView v= (ITestRunView) e.nextElement(); v.aboutToStart(); } } } }); } private void postEndTest(final String testName) { postSyncRunnable(new Runnable() { public void run() { if(isDisposed()) return; handleEndTest(); for (Enumeration e= fTestRunViews.elements(); e.hasMoreElements();) { ITestRunView v= (ITestRunView) e.nextElement(); v.endTest(testName);
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
} } }); } private void handleEndTest() { refreshCounters(); updateProgressColor(fFailures+fErrors); fProgressBar.setSelection(fProgressBar.getSelection() + 1); if (fShowOnErrorOnly) { Image progress= fProgressImages.getImage(fExecutedTests, fTestCount, fErrors, fFailures); if (progress != fViewImage) { fViewImage= progress; firePropertyChange(IWorkbenchPart.PROP_TITLE); } } } private void updateProgressColor(int failures) { if (failures > 0) fProgressBar.setForeground(getDisplay().getSystemColor(SWT.COLOR_RED)); else fProgressBar.setForeground(getDisplay().getSystemColor(SWT.COLOR_GREEN)); } private void refreshCounters() { fCounterPanel.setErrorValue(fErrors); fCounterPanel.setFailureValue(fFailures); fCounterPanel.setRunValue(fExecutedTests); updateProgressColor(fErrors + fFailures); } protected void postShowTestResultsView() { postAsyncRunnable(new Runnable() {
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
public void run() { if (isDisposed()) return; showTestResultsView(); } }); } public void showTestResultsView() { IWorkbenchWindow window= getSite().getWorkbenchWindow(); IWorkbenchPage page= window.getActivePage(); TestRunnerViewPart testRunner= null; if (page != null) { try { testRunner= (TestRunnerViewPart)page.findView(TestRunnerViewPart.NAME); if(testRunner == null) { IWorkbenchPart activePart= page.getActivePart(); testRunner= (TestRunnerViewPart)page.showView(TestRunnerViewPart.NAME); page.activate(activePart); } else { page.bringToTop(testRunner); } } catch (PartInitException pie) { JUnitPlugin.log(pie); } } } protected void postInfo(final String message) { postAsyncRunnable(new Runnable() {
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
public void run() { if (isDisposed()) return; getStatusLine().setErrorMessage(null); getStatusLine().setMessage(message); } }); } protected void postError(final String message) { postAsyncRunnable(new Runnable() { public void run() { if (isDisposed()) return; getStatusLine().setMessage(null); getStatusLine().setErrorMessage(message); } }); } protected void showInformation(final String info){ postSyncRunnable(new Runnable() { public void run() { if (!isDisposed()) fFailureView.setInformation(info); } }); } private CTabFolder createTestRunViews(Composite parent) { CTabFolder tabFolder= new CTabFolder(parent, SWT.TOP); GridData gridData= new GridData(); tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL));
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
ITestRunView failureRunView= new FailureRunView(tabFolder, this); ITestRunView testHierarchyRunView= new HierarchyRunView(tabFolder, this); fTestRunViews.addElement(failureRunView); fTestRunViews.addElement(testHierarchyRunView); tabFolder.setSelection(0); fActiveRunView= (ITestRunView)fTestRunViews.firstElement(); tabFolder.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { testViewChanged(event); } }); return tabFolder; } private void testViewChanged(SelectionEvent event) { for (Enumeration e= fTestRunViews.elements(); e.hasMoreElements();) { ITestRunView v= (ITestRunView) e.nextElement(); if (((CTabFolder) event.widget).getSelection().getText() == v.getName()){ v.setSelectedTest(fActiveRunView.getTestName()); fActiveRunView= v; fActiveRunView.activate(); } } } private SashForm createSashForm(Composite parent) { SashForm sashForm= new SashForm(parent, SWT.VERTICAL); ViewForm top= new ViewForm(sashForm, SWT.NONE); CTabFolder tabFolder= createTestRunViews(top);
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
tabFolder.setLayoutData(new TabFolderLayout()); top.setContent(tabFolder); ViewForm bottom= new ViewForm(sashForm, SWT.NONE); ToolBar failureToolBar= new ToolBar(bottom, SWT.FLAT | SWT.WRAP); bottom.setTopCenter(failureToolBar); fFailureView= new FailureTraceView(bottom, this); bottom.setContent(fFailureView.getComposite()); CLabel label= new CLabel(bottom, SWT.NONE); label.setText(JUnitMessages.getString("TestRunnerViewPart.label.failure")); label.setImage(fStackViewIcon); bottom.setTopLeft(label); Composite traceView= fFailureView.getComposite(); ToolBarManager failureToolBarmanager= new ToolBarManager(failureToolBar); failureToolBarmanager.add(new EnableStackFilterAction(fFailureView)); failureToolBarmanager.update(true); sashForm.setWeights(new int[]{50, 50}); return sashForm; } private void reset(final int testCount) { postAsyncRunnable(new Runnable() { public void run() { if (isDisposed()) return; fCounterPanel.reset(); fFailureView.clear(); clearStatus();
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
start(testCount); } }); fExecutedTests= 0; fFailures= 0; fErrors= 0; fTestCount= testCount; aboutToStart(); fTestInfos.clear(); fFirstFailure= null; } private void clearStatus() { getStatusLine().setMessage(null); getStatusLine().setErrorMessage(null); } public void setFocus() { if (fActiveRunView != null) fActiveRunView.setFocus(); } public void createPartControl(Composite parent) { GridLayout gridLayout= new GridLayout(); gridLayout.marginWidth= 0; parent.setLayout(gridLayout); IActionBars actionBars= getViewSite().getActionBars(); IToolBarManager toolBar= actionBars.getToolBarManager(); toolBar.add(new StopAction()); toolBar.add(new RerunAction()); actionBars.updateActionBars(); Composite counterPanel= createProgressCountPanel(parent);
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
counterPanel.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); SashForm sashForm= createSashForm(parent); sashForm.setLayoutData(new GridData(GridData.FILL_BOTH)); actionBars.setGlobalActionHandler( IWorkbenchActionConstants.COPY, new CopyTraceAction(fFailureView)); JUnitPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(this); fOriginalViewImage= getTitleImage(); fProgressImages= new ProgressImages(); } private IStatusLineManager getStatusLine() { IViewSite site= getViewSite(); IWorkbenchPage page= site.getPage(); IWorkbenchPart activePart= page.getActivePart(); if (activePart instanceof IViewPart) { IViewPart activeViewPart= (IViewPart)activePart; IViewSite activeViewSite= activeViewPart.getViewSite(); return activeViewSite.getActionBars().getStatusLineManager(); } if (activePart instanceof IEditorPart) { IEditorPart activeEditorPart= (IEditorPart)activePart; IEditorActionBarContributor contributor= activeEditorPart.getEditorSite().getActionBarContributor(); if (contributor instanceof EditorActionBarContributor) return ((EditorActionBarContributor) contributor).getActionBars().getStatusLineManager(); }
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
return getViewSite().getActionBars().getStatusLineManager(); } private Composite createProgressCountPanel(Composite parent) { Composite composite= new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout()); fProgressBar = new ProgressBar(composite, SWT.HORIZONTAL); fProgressBar.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); fCounterPanel = new CounterPanel(composite); fCounterPanel.setLayoutData( new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); return composite; } public TestRunInfo getTestInfo(String testName) { return (TestRunInfo) fTestInfos.get(testName); } public void handleTestSelected(String testName) { TestRunInfo testInfo= getTestInfo(testName); if (testInfo == null) { showFailure(""); } else { showFailure(testInfo.fTrace); } } private void showFailure(final String failure) { postSyncRunnable(new Runnable() { public void run() { if (!isDisposed()) fFailureView.showFailure(failure); }
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
}); } public IJavaProject getLaunchedProject() { return fTestType.getJavaProject(); } protected static Image createImage(String path) { try { ImageDescriptor id= ImageDescriptor.createFromURL(JUnitPlugin.makeIconFileURL(path)); return id.createImage(); } catch (MalformedURLException e) { } return null; } private boolean isDisposed() { return fIsDisposed || fCounterPanel.isDisposed(); } private Display getDisplay() { return fCounterPanel.getDisplay(); } /** * @see IWorkbenchPart#getTitleImage() */ public Image getTitleImage() { if (fOriginalViewImage == null) fOriginalViewImage= super.getTitleImage(); if (fViewImage == null) return super.getTitleImage(); return fViewImage;
17,915
Bug 17915 JUnit dirty indicator appears to early
opening a compilation unit in the editor marks the test result as dirty.
verified fixed
fa25600
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T12:12:15Z
2002-05-27T11:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/internal/junit/ui/TestRunnerViewPart.java
} public void propertyChange(PropertyChangeEvent event) { if (isDisposed()) return; if (event.getProperty() == JUnitPreferencePage.SHOW_ON_ERROR_ONLY) { if (!JUnitPreferencePage.getShowOnErrorOnly()) { fViewImage= fOriginalViewImage; firePropertyChange(IWorkbenchPart.PROP_TITLE); } } } void codeHasChanged() { postAsyncRunnable(new Runnable() { public void run() { if (isDisposed()) return; if (fDirtyListener != null) { JavaCore.removeElementChangedListener(fDirtyListener); fDirtyListener= null; } if (fViewImage == fTestRunOKIcon) fViewImage= fTestRunOKDirtyIcon; else if (fViewImage == fTestRunFailIcon) fViewImage= fTestRunFailDirtyIcon; firePropertyChange(IWorkbenchPart.PROP_TITLE); } }); } }
17,576
Bug 17576 JavaSearchPage.SearchPatternData must be a static class
F1 it's a non static class now, which leads to leaks: the static variable (!always a leak danger!) in JavaSearchPage contains a list of previous patterns, each holding an instance of JavaSearchPage (exactly because SearchPatternData is not static) static fields of type List + non static nested classes = trouble
verified fixed
d4c266d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T13:26:47Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
/* * (c) Copyright IBM Corp. 2000, 2002. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.search; import java.lang.reflect.InvocationTargetException; import java.io.BufferedReader; import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; import java.util.List;
17,576
Bug 17576 JavaSearchPage.SearchPatternData must be a static class
F1 it's a non static class now, which leads to leaks: the static variable (!always a leak danger!) in JavaSearchPage contains a list of previous patterns, each holding an instance of JavaSearchPage (exactly because SearchPatternData is not static) static fields of type List + non static nested classes = trouble
verified fixed
d4c266d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T13:26:47Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.dialogs.DialogPage; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.util.Assert; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkingSet; import org.eclipse.ui.PlatformUI;
17,576
Bug 17576 JavaSearchPage.SearchPatternData must be a static class
F1 it's a non static class now, which leads to leaks: the static variable (!always a leak danger!) in JavaSearchPage contains a list of previous patterns, each holding an instance of JavaSearchPage (exactly because SearchPatternData is not static) static fields of type List + non static nested classes = trouble
verified fixed
d4c266d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T13:26:47Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
import org.eclipse.ui.model.IWorkbenchAdapter; import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.search.ui.ISearchPage; import org.eclipse.search.ui.ISearchPageContainer; import org.eclipse.search.ui.ISearchResultViewEntry; import org.eclipse.search.ui.SearchUI; import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IField; import org.eclipse.jdt.core.IImportDeclaration; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.search.IJavaSearchConstants; import org.eclipse.jdt.core.search.IJavaSearchScope; import org.eclipse.jdt.core.search.SearchEngine; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.RowLayouter; public class JavaSearchPage extends DialogPage implements ISearchPage, IJavaSearchConstants { public static final String EXTENSION_POINT_ID= "org.eclipse.jdt.ui.JavaSearchPage"; private final static String PAGE_NAME= "JavaSearchPage"; private final static String STORE_CASE_SENSITIVE= PAGE_NAME + "CASE_SENSITIVE"; private static List fgPreviousSearchPatterns= new ArrayList(20);
17,576
Bug 17576 JavaSearchPage.SearchPatternData must be a static class
F1 it's a non static class now, which leads to leaks: the static variable (!always a leak danger!) in JavaSearchPage contains a list of previous patterns, each holding an instance of JavaSearchPage (exactly because SearchPatternData is not static) static fields of type List + non static nested classes = trouble
verified fixed
d4c266d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T13:26:47Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
private SearchPatternData fInitialData; private IStructuredSelection fStructuredSelection; private IJavaElement fJavaElement; private boolean fFirstTime= true; private IDialogSettings fDialogSettings; private boolean fIsCaseSensitive; private Combo fPattern; private ISearchPageContainer fContainer; private Button fCaseSensitive; private Button[] fSearchFor; private String[] fSearchForText= { SearchMessages.getString("SearchPage.searchFor.type"), SearchMessages.getString("SearchPage.searchFor.method"), SearchMessages.getString("SearchPage.searchFor.package"), SearchMessages.getString("SearchPage.searchFor.constructor"), SearchMessages.getString("SearchPage.searchFor.field")}; private Button[] fLimitTo; private String[] fLimitToText= { SearchMessages.getString("SearchPage.limitTo.declarations"), SearchMessages.getString("SearchPage.limitTo.implementors"), SearchMessages.getString("SearchPage.limitTo.references"), SearchMessages.getString("SearchPage.limitTo.allOccurrences"), SearchMessages.getString("SearchPage.limitTo.readReferences"), SearchMessages.getString("SearchPage.limitTo.writeReferences")}; private class SearchPatternData { int searchFor; int limitTo; String pattern;
17,576
Bug 17576 JavaSearchPage.SearchPatternData must be a static class
F1 it's a non static class now, which leads to leaks: the static variable (!always a leak danger!) in JavaSearchPage contains a list of previous patterns, each holding an instance of JavaSearchPage (exactly because SearchPatternData is not static) static fields of type List + non static nested classes = trouble
verified fixed
d4c266d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-05-27T13:26:47Z
2002-05-24T08:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
boolean isCaseSensitive; IJavaElement javaElement; int scope; IWorkingSet[] workingSets; public SearchPatternData(int s, int l, String p, IJavaElement element) { this(s, l, p, fIsCaseSensitive || element != null, element, ISearchPageContainer.WORKSPACE_SCOPE, null); } public SearchPatternData(int s, int l, String p, boolean i, IJavaElement element, int scope, IWorkingSet[] workingSets) { searchFor= s; limitTo= l; pattern= p; isCaseSensitive= i; javaElement= element; this.scope= scope; this.workingSets= workingSets; } } public boolean performAction() { SearchUI.activateSearchResultView(); SearchPatternData data= getPatternData(); IWorkspace workspace= JavaPlugin.getWorkspace(); IJavaSearchScope scope= null; String scopeDescription= ""; switch (getContainer().getSelectedScope()) { case ISearchPageContainer.WORKSPACE_SCOPE: