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
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
public void widgetDefaultSelected(SelectionEvent e) { } public void widgetSelected(SelectionEvent e) { handleListSelection(); } }); colorButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { } public void widgetSelected(SelectionEvent e) { int i= fList.getSelectionIndex(); String key= fListModel[i][1]; PreferenceConverter.setValue(fOverlayStore, key, fColorEditor.getColorValue()); } }); fBoldCheckBox.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { } public void widgetSelected(SelectionEvent e) { int i= fList.getSelectionIndex(); String key= fListModel[i][1]; fOverlayStore.setValue(key + "_bold", fBoldCheckBox.getSelection()); } });
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
return colorComposite; } private Control createPreviewer(Composite parent) { fJavaTextTools= new JavaTextTools(fOverlayStore); fPreviewViewer= new SourceViewer(parent, null, SWT.V_SCROLL | SWT.H_SCROLL); fPreviewViewer.configure(new JavaSourceViewerConfiguration(fJavaTextTools, null)); fPreviewViewer.getTextWidget().setFont(JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT)); fPreviewViewer.setEditable(false); String content= loadPreviewContentFromFile("ColorSettingPreviewCode.txt"); IDocument document= new Document(content); IDocumentPartitioner partitioner= fJavaTextTools.createDocumentPartitioner(); partitioner.connect(document); document.setDocumentPartitioner(partitioner); fPreviewViewer.setDocument(document); fOverlayStore.addPropertyChangeListener(new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { fPreviewViewer.invalidateTextPresentation(); } }); return fPreviewViewer.getControl(); } private Control createBehaviorPage(Composite parent) {
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
Composite behaviorComposite= new Composite(parent, SWT.NULL); GridLayout layout= new GridLayout(); layout.numColumns= 2; behaviorComposite.setLayout(layout); String label= "Highlight matching brackets"; addCheckBox(behaviorComposite, label, CompilationUnitEditor.MATCHING_BRACKETS, 0); label= "Matching brackets highlight color:"; addColorButton(behaviorComposite, label, CompilationUnitEditor.MATCHING_BRACKETS_COLOR, 0); label= "Text font:"; addTextFontEditor(behaviorComposite, label, AbstractTextEditor.PREFERENCE_FONT); label= "&Displayed tab width:"; addTextField(behaviorComposite, label, JavaSourceViewerConfiguration.PREFERENCE_TAB_WIDTH, 2, 0); return behaviorComposite; } private Control createContentAssistPage(Composite parent) { Composite contentAssistComposite= new Composite(parent, SWT.NULL); GridLayout layout= new GridLayout(); layout.numColumns= 2; contentAssistComposite.setLayout(layout); String label= "Insert &single proposals automatically"; addCheckBox(contentAssistComposite, label, ContentAssistPreference.AUTOINSERT, 0); label= "Show only proposals visible in the invocation &context"; addCheckBox(contentAssistComposite, label, ContentAssistPreference.SHOW_VISIBLE_PROPOSALS, 0);
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
label= "Present proposals in &alphabetical order"; addCheckBox(contentAssistComposite, label, ContentAssistPreference.ORDER_PROPOSALS, 0); label= "&Enable auto activation"; addCheckBox(contentAssistComposite, label, ContentAssistPreference.AUTOACTIVATION, 0); label= "Automatically add &import instead of qualified name"; addCheckBox(contentAssistComposite, label, ContentAssistPreference.ADD_IMPORT, 0); label= "Auto activation &delay:"; addTextField(contentAssistComposite, label, ContentAssistPreference.AUTOACTIVATION_DELAY, 4, 0); label= "Auto activation &triggers for Java:"; addTextField(contentAssistComposite, label, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_JAVA, 25, 0); label= "Auto activation tri&ggers for JavaDoc:"; addTextField(contentAssistComposite, label, ContentAssistPreference.AUTOACTIVATION_TRIGGERS_JAVADOC, 25, 0); label= "&Background for completion proposals:"; addColorButton(contentAssistComposite, label, ContentAssistPreference.PROPOSALS_BACKGROUND, 0); label= "&Foreground for completion proposals:"; addColorButton(contentAssistComposite, label, ContentAssistPreference.PROPOSALS_FOREGROUND, 0); label= "B&ackground for method parameters:"; addColorButton(contentAssistComposite, label, ContentAssistPreference.PARAMETERS_BACKGROUND, 0); label= "F&oreground for method parameters:"; addColorButton(contentAssistComposite, label, ContentAssistPreference.PARAMETERS_FOREGROUND, 0); return contentAssistComposite;
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
} /* * @see PreferencePage#createContents(Composite) */ protected Control createContents(Composite parent) { fOverlayStore.load(); fOverlayStore.start(); TabFolder folder= new TabFolder(parent, SWT.NONE); folder.setLayout(new TabFolderLayout()); folder.setLayoutData(new GridData(GridData.FILL_BOTH)); TabItem item= new TabItem(folder, SWT.NONE); item.setText("&General"); item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CFILE)); item.setControl(createBehaviorPage(folder)); item= new TabItem(folder, SWT.NONE); item.setText("&Colors"); item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CFILE)); item.setControl(createColorPage(folder)); item= new TabItem(folder, SWT.NONE); item.setText("Code &Assist"); item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CFILE)); item.setControl(createContentAssistPage(folder)); initialize();
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
return folder; } private void initialize() { fFontEditor.setPreferenceStore(getPreferenceStore()); fFontEditor.setPreferencePage(this); fFontEditor.load(); initializeFields(); for (int i= 0; i < fListModel.length; i++) fList.add(fListModel[i][0]); fList.getDisplay().asyncExec(new Runnable() { public void run() { fList.select(0); handleListSelection(); } }); } private void initializeFields() { Iterator e= fColorButtons.keySet().iterator(); while (e.hasNext()) { ColorEditor c= (ColorEditor) e.next(); String key= (String) fColorButtons.get(c); RGB rgb= PreferenceConverter.getColor(fOverlayStore, key); c.setColorValue(rgb);
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
} e= fCheckBoxes.keySet().iterator(); while (e.hasNext()) { Button b= (Button) e.next(); String key= (String) fCheckBoxes.get(b); b.setSelection(fOverlayStore.getBoolean(key)); } e= fTextFields.keySet().iterator(); while (e.hasNext()) { Text t= (Text) e.next(); String key= (String) fTextFields.get(t); t.setText(fOverlayStore.getString(key)); } } /* * @see PreferencePage#performOk() */ public boolean performOk() { fFontEditor.store(); fOverlayStore.propagate(); return true; } /* * @see PreferencePage#performDefaults() */ protected void performDefaults() {
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
fFontEditor.loadDefault(); fOverlayStore.loadDefaults(); initializeFields(); handleListSelection(); super.performDefaults(); fPreviewViewer.invalidateTextPresentation(); } /* * @see DialogPage#dispose() */ public void dispose() { if (fJavaTextTools != null) { fJavaTextTools= null; } fFontEditor.setPreferencePage(null); fFontEditor.setPreferenceStore(null); if (fOverlayStore != null) { fOverlayStore.stop(); fOverlayStore= null; } super.dispose();
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
} private void addColorButton(Composite parent, String label, String key, int indentation) { Label labelControl= new Label(parent, SWT.NONE); labelControl.setText(label); GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalIndent= indentation; labelControl.setLayoutData(gd); ColorEditor editor= new ColorEditor(parent); Button button= editor.getButton(); button.setData(editor); gd= new GridData(); gd.horizontalAlignment= GridData.END; button.setLayoutData(gd); button.addSelectionListener(fColorButtonListener); fColorButtons.put(editor, key); } private void addCheckBox(Composite parent, String label, String key, int indentation) { Button checkBox= new Button(parent, SWT.CHECK); checkBox.setText(label); GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalIndent= indentation; gd.horizontalSpan= 2;
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
checkBox.setLayoutData(gd); checkBox.addSelectionListener(fCheckBoxListener); fCheckBoxes.put(checkBox, key); } private void addTextField(Composite parent, String label, String key, int textLimit, int indentation) { Label labelControl= new Label(parent, SWT.NONE); labelControl.setText(label); GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalIndent= indentation; labelControl.setLayoutData(gd); Text textControl= new Text(parent, SWT.BORDER | SWT.SINGLE); gd= new GridData(GridData.FILL_HORIZONTAL); gd.widthHint= convertWidthInCharsToPixels(textLimit + 1); gd.horizontalAlignment= GridData.END; textControl.setLayoutData(gd); textControl.setTextLimit(textLimit); textControl.addModifyListener(fTextFieldListener); fTextFields.put(textControl, key); } private void addTextFontEditor(Composite parent, String label, String key) { Composite editorComposite= new Composite(parent, SWT.NULL); GridLayout layout= new GridLayout(); layout.numColumns= 3;
6,146
Bug 6146 Java Editor Preference Page is missing most of the mnemonics
summary says it all.
resolved fixed
0322ef0
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T12:20:26Z
2001-11-21T08:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaEditorPreferencePage.java
editorComposite.setLayout(layout); fFontEditor= new WorkbenchChainedTextFontFieldEditor(key, label, editorComposite); GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan= 2; editorComposite.setLayoutData(gd); } private String loadPreviewContentFromFile(String filename) { String line; String separator= System.getProperty("line.separator"); StringBuffer buffer= new StringBuffer(512); BufferedReader reader= null; try { reader= new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(filename))); while ((line= reader.readLine()) != null) { buffer.append(line); buffer.append(separator); } } catch (IOException io) { JavaPlugin.log(io); } finally { if (reader != null) { try { reader.close(); } catch (IOException e) {} } } return buffer.toString(); } }
7,947
Bug 7947 JDIDebugModel still using types for breakpoints
This should be changed to just check on a type name. The current implementation is doing an equality check on a type and a type name.
verified fixed
efe3021
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T19:01:27Z
2002-01-21T16:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/BreakpointRulerAction.java
package org.eclipse.jdt.internal.ui.javaeditor; /* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource;
7,947
Bug 7947 JDIDebugModel still using types for breakpoints
This should be changed to just check on a type name. The current implementation is doing an equality check on a type and a type name.
verified fixed
efe3021
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T19:01:27Z
2002-01-21T16:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/BreakpointRulerAction.java
import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.IBreakpointManager; import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.debug.core.IJavaBreakpoint; import org.eclipse.jdt.debug.core.IJavaLineBreakpoint; import org.eclipse.jdt.debug.core.JDIDebugModel; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.source.IVerticalRuler; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.MarkerRulerAction; /** * */ public class BreakpointRulerAction extends MarkerRulerAction {
7,947
Bug 7947 JDIDebugModel still using types for breakpoints
This should be changed to just check on a type name. The current implementation is doing an equality check on a type and a type name.
verified fixed
efe3021
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T19:01:27Z
2002-01-21T16:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/BreakpointRulerAction.java
public BreakpointRulerAction(IVerticalRuler ruler, ITextEditor editor) { super(JavaEditorMessages.getResourceBundle(), "ManageBreakpoints.", ruler, editor, IBreakpoint.BREAKPOINT_MARKER, false); } /** * Checks whether the element the breakpoint refers to is shown in this editor */ protected boolean breakpointElementInEditor(IBreakpointManager manager, IMarker marker) { return true; } /** * @see MarkerRulerAction#getMarkers */ protected List getMarkers() { List breakpoints= new ArrayList(); IResource resource= getResource(); IDocument document= getDocument(); AbstractMarkerAnnotationModel model= getAnnotationModel();
7,947
Bug 7947 JDIDebugModel still using types for breakpoints
This should be changed to just check on a type name. The current implementation is doing an equality check on a type and a type name.
verified fixed
efe3021
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T19:01:27Z
2002-01-21T16:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/BreakpointRulerAction.java
if (model != null) { try { IMarker[] markers= null; if (resource instanceof IFile) markers= resource.findMarkers(IBreakpoint.BREAKPOINT_MARKER, true, IResource.DEPTH_INFINITE); else { IWorkspaceRoot root= JavaPlugin.getWorkspace().getRoot(); markers= root.findMarkers(IBreakpoint.BREAKPOINT_MARKER, true, IResource.DEPTH_INFINITE); } if (markers != null) { IBreakpointManager breakpointManager= DebugPlugin.getDefault().getBreakpointManager(); for (int i= 0; i < markers.length; i++) { IBreakpoint breakpoint= breakpointManager.getBreakpoint(markers[i]); if (breakpoint != null && breakpointManager.isRegistered(breakpoint) && breakpointElementInEditor(breakpointManager, markers[i]) && includesRulerLine(model.getMarkerPosition(markers[i]), document)) breakpoints.add(markers[i]); } } } catch (CoreException x) { JavaPlugin.logErrorStatus(JavaEditorMessages.getString("ManageBreakpoints.error.retrieving.message"), x.getStatus()); } } return breakpoints; } /**
7,947
Bug 7947 JDIDebugModel still using types for breakpoints
This should be changed to just check on a type name. The current implementation is doing an equality check on a type and a type name.
verified fixed
efe3021
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T19:01:27Z
2002-01-21T16:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/BreakpointRulerAction.java
* @see MarkerRulerAction#addMarker */ protected void addMarker() { IEditorInput editorInput= getTextEditor().getEditorInput(); IDocument document= getDocument(); int rulerLine= getVerticalRuler().getLineOfLastMouseButtonActivity(); try { BreakpointLocationVerifier bv = new BreakpointLocationVerifier(); int lineNumber = bv.getValidBreakpointLocation(document, rulerLine); if (lineNumber > 0) { IRegion line= document.getLineInformation(lineNumber - 1); IType type = null; if (editorInput instanceof IClassFileEditorInput) { IClassFileEditorInput input= (IClassFileEditorInput) editorInput; type = input.getClassFile().getType(); } else if (editorInput instanceof IFileEditorInput) { IFileEditorInput input= (IFileEditorInput) editorInput; ICompilationUnit cu = (ICompilationUnit) JavaCore.create(input.getFile()); IJavaElement e = cu.getElementAt(line.getOffset()); if (e instanceof IType) type = (IType)e; else if (e != null && e instanceof IMember) { type = ((IMember)e).getDeclaringType(); } }
7,947
Bug 7947 JDIDebugModel still using types for breakpoints
This should be changed to just check on a type name. The current implementation is doing an equality check on a type and a type name.
verified fixed
efe3021
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T19:01:27Z
2002-01-21T16:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/BreakpointRulerAction.java
if (type != null) { if (!JDIDebugModel.lineBreakpointExists(type, lineNumber)) { Map attributes = new HashMap(10); JavaCore.addJavaElementMarkerAttributes(attributes, type); attributes.put("org.eclipse.jdt.debug.ui.JAVA_ELEMENT_HANDLE_ID", type.getHandleIdentifier()); IJavaLineBreakpoint bp = JDIDebugModel.createLineBreakpoint(getBreakpointResource(type), type.getFullyQualifiedName(), lineNumber, line.getOffset(), line.getOffset() + line.getLength(), 0, true, attributes); } } } } catch (DebugException e) { Shell shell= getTextEditor().getSite().getShell(); ErrorDialog.openError(shell, JavaEditorMessages.getString("ManageBreakpoints.error.adding.title1"), JavaEditorMessages.getString("ManageBreakpoints.error.adding.message1"), e.getStatus()); } catch (CoreException e) { Shell shell= getTextEditor().getSite().getShell(); ErrorDialog.openError(shell, JavaEditorMessages.getString("ManageBreakpoints.error.adding.title2"), JavaEditorMessages.getString("ManageBreakpoints.error.adding.message2"), e.getStatus()); } catch (BadLocationException e) { Shell shell= getTextEditor().getSite().getShell(); ErrorDialog.openError(shell, JavaEditorMessages.getString("ManageBreakpoints.error.adding.title3"), JavaEditorMessages.getString("ManageBreakpoints.error.adding.message3"), null); } } /** * @see MarkerRulerAction#removeMarkers */ protected void removeMarkers(List markers) { IBreakpointManager breakpointManager= DebugPlugin.getDefault().getBreakpointManager(); try { Iterator e= markers.iterator(); while (e.hasNext()) {
7,947
Bug 7947 JDIDebugModel still using types for breakpoints
This should be changed to just check on a type name. The current implementation is doing an equality check on a type and a type name.
verified fixed
efe3021
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-21T19:01:27Z
2002-01-21T16:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/BreakpointRulerAction.java
IBreakpoint breakpoint= breakpointManager.getBreakpoint((IMarker) e.next()); breakpointManager.removeBreakpoint(breakpoint, true); } } catch (CoreException e) { Shell shell= getTextEditor().getSite().getShell(); ErrorDialog.openError(shell, JavaEditorMessages.getString("ManageBreakpoints.error.removing.title1"), JavaEditorMessages.getString("ManageBreakpoints.error.removing.message1"), e.getStatus()); } } /** * Returns the resource on which a breakpoint marker should * be created for the given member. The resource returned is the * associated file, or project in the case of a class file in * a jar. * * @param member member in which a breakpoint is being created * @return resource the resource on which a breakpoint marker * should be created * @exception CoreException if an exception occurrs accessing the * underlying resource or Java model elements */ public IResource getBreakpointResource(IMember member) throws CoreException { IResource res = member.getUnderlyingResource(); if (res == null) { res = member.getJavaProject().getProject(); } return res; } }
7,892
Bug 7892 extract method: incorrect on nested loops (compile errors)
public class A{ void f(){ for (int i = 0; i < 10; i++) { /*[*/for (int j = 0; j < 10; j++) { }/*]*/ } } } the new method is: protected int dd() { /*[*/for (int j = 0; j < 10; j++) { } return j; } which results in a compile error
verified fixed
03bf976
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T11:24:23Z
2002-01-18T18:53:20Z
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/A.java
class A { public void foo() { int i= 0; } }
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.reorg; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.action.Action; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress;
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.Viewer; import org.eclipse.ui.IEditorInput; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IFileEditorInput; import org.eclipse.ui.dialogs.ListSelectionDialog; import org.eclipse.jdt.core.IJavaElement; 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.JavaElementContentProvider; import org.eclipse.jdt.ui.JavaElementLabelProvider; import org.eclipse.jdt.internal.corext.refactoring.Assert; import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgRefactoring; import org.eclipse.jdt.internal.corext.refactoring.reorg.ReorgUtils; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIException; import org.eclipse.jdt.internal.ui.actions.StructuredSelectionProvider; import org.eclipse.jdt.internal.ui.dialogs.ElementTreeSelectionDialog; import org.eclipse.jdt.internal.ui.dialogs.ISelectionValidator; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.packageview.PackageFilter; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementSorter; import org.eclipse.jdt.internal.ui.viewsupport.ListContentProvider; abstract class ReorgDestinationAction extends ReorgAction {
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
public ReorgDestinationAction(String name, ISelectionProvider provider) { super(name, provider); } public ReorgDestinationAction(String name, StructuredSelectionProvider provider) { super(name, provider); } /* * @see Action#run() */ public void run() { List elements= getStructuredSelection().toList(); if (!ensureSaved(elements, getActionName())) return; ReorgRefactoring refactoring= createRefactoring(elements); setUnsavedFileList(refactoring, elements); Object destination= selectDestination(refactoring); if (destination == null) return; try{ String duplicate= getDuplicatedElementName(elements); if (duplicate != null){ String message= "Two or more elements named " + duplicate + " are selected."; MessageDialog.openInformation(JavaPlugin.getActiveWorkbenchShell().getShell(), "Duplicate Element Name", message); return; }
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
refactoring.setDestination(destination); Set excluded= getExcluded(refactoring); if (excluded == null) return; if (excluded.size() == elements.size()) return; refactoring.setExcludedElements(excluded); if (! isOkToProceed(refactoring)) return; doReorg(refactoring); } catch (JavaModelException e){ ExceptionHandler.handle(e, "Exception", "Unexpected exception occurred. See log for details."); } } /** * returns null if no 2 elements have the same name */ private static String getDuplicatedElementName(List elements){ String[] names= getElementNames(elements); if (names.length == 0) return null; Arrays.sort(names); String last= names[0]; for (int i= 1; i < names.length; i++){ if (last.equals(names[i])) return last;
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
last= names[i]; } return null; } abstract String getActionName(); abstract String getDestinationDialogMessage(); abstract ReorgRefactoring createRefactoring(List elements); Set getExcluded(ReorgRefactoring refactoring) throws JavaModelException{ return new HashSet(0); } protected boolean isOkToProceed(ReorgRefactoring refactoring) throws JavaModelException{ return true; } void doReorg(ReorgRefactoring refactoring) throws JavaModelException{ MultiStatus status= perform(refactoring); if (status.isOK()) return; ExceptionHandler.handle(new JavaUIException(status), ReorgMessages.getString("copyAction.exception.title"), ReorgMessages.getString("copyAction.exception.label")); } private static boolean ensureSaved(List elements, String actionName) {
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
List unsavedEditors= new ArrayList(); List unsavedElements= new ArrayList(); collectUnsavedEditors(elements, unsavedEditors, unsavedElements); if (unsavedEditors.isEmpty()) return true; ListSelectionDialog dialog = createUnsavedEditorDialog(unsavedElements); if (dialog.open() != dialog.OK) return false; IRunnableWithProgress r= createSaveEditorOperation(dialog.getResult(), elements, unsavedEditors); try { new ProgressMonitorDialog(JavaPlugin.getActiveWorkbenchShell()).run(false, false, r); } catch (InvocationTargetException e) { ExceptionHandler.handle(e, actionName, ReorgMessages.getString("ReorgAction.exception.saving")); return false; } catch (InterruptedException e) { } return true; } private static void setUnsavedFileList(ReorgRefactoring refactoring, List elements){ List unsavedEditors= new ArrayList(0); collectUnsavedEditors(elements, unsavedEditors, new ArrayList(0)); refactoring.setUnsavedFiles(getFiles(unsavedEditors)); } private static IFile[] getFiles(List editorParts){ List result= new ArrayList(editorParts.size());
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
for (Iterator iter= editorParts.iterator(); iter.hasNext(); ){ IEditorPart each= (IEditorPart)iter.next(); IEditorInput input= each.getEditorInput(); if (input instanceof IFileEditorInput) result.add(((IFileEditorInput)input).getFile()); } return (IFile[]) result.toArray(new IFile[result.size()]); } private static IRunnableWithProgress createSaveEditorOperation(final Object[] elementsToSave, final List elements, final List unsavedEditors) { return new IRunnableWithProgress() { public void run(IProgressMonitor pm) { pm.beginTask(ReorgMessages.getString("ReorgAction.task.saving"), elementsToSave.length); for (int i= 0; i < elementsToSave.length; i++) { IEditorPart editor= (IEditorPart)unsavedEditors.get(elements.indexOf(elementsToSave[i])); editor.doSave(new SubProgressMonitor(pm, 1)); } pm.done(); } }; } private static ListSelectionDialog createUnsavedEditorDialog(List unsavedElements) { int labelFlags= JavaElementLabelProvider.SHOW_DEFAULT | JavaElementLabelProvider.SHOW_POST_QUALIFIED; Shell parent= JavaPlugin.getActiveWorkbenchShell(); String msg= ReorgMessages.getString("ReorgAction.checkSaveTargets"); ListSelectionDialog dialog= new ListSelectionDialog(parent, unsavedElements, new ListContentProvider(), new JavaElementLabelProvider(labelFlags), msg); dialog.setInitialSelections(unsavedElements.toArray()); return dialog; }
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
private static void collectUnsavedEditors(List elements, List unsavedEditors, List unsavedElements) { IEditorPart[] editors= JavaPlugin.getDirtyEditors(); for (int i= 0; i < editors.length; i++) { for (Iterator iter= elements.iterator(); iter.hasNext(); ){ Object element= iter.next(); if (EditorUtility.isEditorInput(element, editors[i])) { unsavedEditors.add(editors[i]); unsavedElements.add(element); } } } } private static String[] getElementNames(List elements){ String[] result= new String[elements.size()]; int i= 0; for (Iterator iter= elements.iterator(); iter.hasNext(); ){ result[i]= ReorgUtils.getName(iter.next()); i++; } return result; } protected Object selectDestination(ReorgRefactoring refactoring) { JavaElementContentProvider cp= new JavaElementContentProvider() { public boolean hasChildren(Object element) { return !(element instanceof IPackageFragment) && super.hasChildren(element); }
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
}; ElementTreeSelectionDialog dialog= createDestinationSelectionDialog(JavaPlugin.getActiveWorkbenchShell(), new DestinationRenderer(JavaElementLabelProvider.SHOW_SMALL_ICONS ), cp, refactoring); dialog.setTitle(getActionName()); dialog.setValidator(new ReorgSelectionValidator(refactoring)); dialog.addFilter(new ContainerFilter(refactoring)); dialog.setSorter(new JavaElementSorter()); dialog.setMessage(getDestinationDialogMessage()); dialog.setSize(60, 18); dialog.setInput(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot())); dialog.setInitialSelection(computeCommonParent(refactoring.getElementsToReorg())); if (dialog.open() != dialog.CANCEL) return dialog.getFirstResult(); return null; } ElementTreeSelectionDialog createDestinationSelectionDialog(Shell parent, ILabelProvider labelProvider, JavaElementContentProvider cp, ReorgRefactoring refactoring){ return new ElementTreeSelectionDialog(parent, labelProvider, cp); } private static Object computeCommonParent(List elements){ if (elements.isEmpty()) return null; Object parent= elements.get(0); for (Iterator iter= elements.iterator(); iter.hasNext(); ){ parent= computeCommonParent(parent, iter.next()); }
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
IResource parentRes= getResource(parent); IJavaElement parentElement= JavaCore.create(parentRes); if (parentElement != null) return parentElement; return getResource(parent); } private static Object computeCommonParent(Object e1, Object e2){ IResource r1= getResource(e1); IResource r2= getResource(e2); if (r1 == null && r2 == null) return null; if (r1 == null) return r2.getParent(); if (r2 == null) return r1.getParent(); if (r1.equals(r2)) return r1.getParent(); if (r1.getFullPath().isPrefixOf(r2.getFullPath())) return r1; if (r2.getFullPath().isPrefixOf(r1.getFullPath())) return r2; IPath p1= r1.getParent().getFullPath(); IPath p2= r2.getParent().getFullPath(); IPath commonPath= new Path(""); int segCount= Math.min(p1.segmentCount(), p2.segmentCount()); for (int i= 0; i < segCount; i++){
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
if (p1.segment(i).equals(p2.segment(i))) commonPath= commonPath.append(p1.segment(i)); else break; } return ResourcesPlugin.getWorkspace().getRoot().findMember(commonPath); } private static IResource getResource(Object o) { try{ if (o instanceof IResource) return (IResource)o; else if (o instanceof IJavaElement) return ((IJavaElement)o).getCorrespondingResource(); else return null; } catch (JavaModelException e){ JavaPlugin.log(e); return null; } } /* non java-doc * @see IRefactoringAction#canOperateOn(IStructuredSelection) */ public boolean canOperateOn(IStructuredSelection selection) { return canActivate(createRefactoring(selection.toList())); } private static class ContainerFilter extends PackageFilter {
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
private ReorgRefactoring fRefactoring; ContainerFilter(ReorgRefactoring refactoring) { Assert.isNotNull(refactoring); fRefactoring= refactoring; } public boolean select(Viewer viewer, Object parent, Object o) { if (fRefactoring.getElementsToReorg().contains(o)) return false; return fRefactoring.canBeAncestor(o); } } private static class DestinationRenderer extends JavaElementLabelProvider {
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
public DestinationRenderer(int flags) { super(flags); } public String getText(Object element) { try { if (element instanceof IPackageFragmentRoot) { IPackageFragmentRoot root= (IPackageFragmentRoot)element; if (root.getUnderlyingResource() instanceof IProject) return ReorgMessages.getString("DestinationRenderer.packages"); } } catch (JavaModelException e) { ExceptionHandler.handle(e, "Exception", "Unexpected exception occurred. See log for details."); } return super.getText(element); } } private static class ReorgSelectionValidator implements ISelectionValidator {
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgDestinationAction.java
private ReorgRefactoring fRefactoring; public ReorgSelectionValidator(ReorgRefactoring refactoring) { Assert.isNotNull(refactoring); fRefactoring= refactoring; } public IStatus validate(Object[] selection) { if (selection.length != 1) return new StatusInfo(IStatus.ERROR, ""); try{ if (fRefactoring.isValidDestination(selection[0])) return new StatusInfo(); return new StatusInfo(IStatus.ERROR, ""); } catch (JavaModelException e){ ExceptionHandler.handle(e, "Exception", "Unexpected exception occurred. See log for details."); return new StatusInfo(IStatus.ERROR, ""); } } } }
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgExceptionHandler.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.reorg; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.jdt.internal.corext.refactoring.base.ChangeContext; import org.eclipse.jdt.internal.corext.refactoring.base.IChange; import org.eclipse.jdt.internal.corext.refactoring.base.IChangeExceptionHandler; import org.eclipse.jdt.internal.ui.JavaPlugin; /** * Class used to handle exceptions occurring during reorg actions. */ class ReorgExceptionHandler implements IChangeExceptionHandler{
7,873
Bug 7873 Bogus error messages
1. Create a Project Test with a folder "COM". 2. Create a Project Test2 with a folder "com". 3. Select "COM" from Step 1, copy it to Test2. You get an error dialog: An error occurred while copying resources. Reason: Status <==== bogus, what does "Status" mean? 4. Same thing happens if you try to a folder with the same name AND the error dialog has the incorrect action information (the dialog is titled "Copy" instead of "Move" and its error message says error "copying", not "moving").
verified fixed
86083cf
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T12:49:52Z
2002-01-17T23:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/reorg/ReorgExceptionHandler.java
private MultiStatus fStatus; ReorgExceptionHandler() { String id = JavaPlugin.getDefault().getDescriptor().getUniqueIdentifier(); fStatus = new MultiStatus(id, IStatus.OK, "Status", null); } public void handle(ChangeContext context, IChange change, Exception e) { if (e instanceof RuntimeException) throw (RuntimeException) e; if (e instanceof CoreException) fStatus.merge(((CoreException) e).getStatus()); } MultiStatus getStatus(){ return fStatus; } }
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractMethodWorkSpace/ExtractMethodTests/A.java
class A { public void foo() { { int i= 0; i--; i++; } } }
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
/* * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ package org.eclipse.jdt.ui.tests.core; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; import org.eclipse.jdt.internal.corext.textmanipulation.MoveTextEdit; import org.eclipse.jdt.internal.corext.textmanipulation.SimpleTextEdit; import org.eclipse.jdt.internal.corext.textmanipulation.SwapTextEdit; import org.eclipse.jdt.internal.corext.textmanipulation.TextBuffer; import org.eclipse.jdt.internal.corext.textmanipulation.TextBufferEditor; import org.eclipse.jdt.internal.corext.textmanipulation.TextRange; import org.eclipse.jdt.internal.corext.textmanipulation.UndoMemento; import org.eclipse.jdt.testplugin.TestPluginLauncher; public class TextBufferTest extends TestCase { private static final Class THIS= TextBufferTest.class; private TextBuffer fBuffer; private TextBufferEditor fEditor; public TextBufferTest(String name) { super(name); } public static void main(String[] args) { TestPluginLauncher.run(TestPluginLauncher.getLocationFromProperties(), THIS, args); } public static Test suite() {
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
TestSuite result= new TestSuite(THIS); if (false) { result.addTestSuite(THIS); result.addTestSuite(THIS); result.addTestSuite(THIS); result.addTestSuite(THIS); result.addTestSuite(THIS); result.addTestSuite(THIS); } return result; } protected void setUp() throws Exception { fBuffer= TextBuffer.create("0123456789"); fEditor= new TextBufferEditor(fBuffer); } protected void tearDown() throws Exception { fEditor= null; } public void testOverlap1() throws Exception { fEditor.add(SimpleTextEdit.createReplace(0, 2, "01")); fEditor.add(SimpleTextEdit.createReplace(1, 2, "12")); assertTrue(!fEditor.canPerformEdits()); } public void testOverlap2() throws Exception {
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
fEditor.add(SimpleTextEdit.createReplace(0, 2, "01")); fEditor.add(SimpleTextEdit.createReplace(0, 1, "0")); assertTrue(!fEditor.canPerformEdits()); } public void testOverlap3() throws Exception { fEditor.add(SimpleTextEdit.createReplace(0, 2, "01")); fEditor.add(SimpleTextEdit.createReplace(1, 1, "1")); assertTrue(!fEditor.canPerformEdits()); } public void testOverlap4() throws Exception { fEditor.add(SimpleTextEdit.createReplace(0, 3, "012")); fEditor.add(SimpleTextEdit.createReplace(1, 1, "1")); assertTrue(!fEditor.canPerformEdits()); } public void testOverlap5() throws Exception { fEditor.add(SimpleTextEdit.createReplace(0, 3, "012")); fEditor.add(SimpleTextEdit.createInsert(1, "xx")); assertTrue(!fEditor.canPerformEdits()); } public void testOverlap6() throws Exception { fEditor.add(SimpleTextEdit.createReplace(0, 3, "012")); fEditor.add(SimpleTextEdit.createInsert(2, "xx"));
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
assertTrue(!fEditor.canPerformEdits()); } public void testOverlap7() throws Exception { boolean catched= false; try { new MoveTextEdit(2,5,3); } catch (Exception e) { catched= true; } assertTrue(catched); } public void testOverlap8() throws Exception { boolean catched= false; try { new MoveTextEdit(2,5,6); } catch (Exception e) { catched= true; } assertTrue(catched); } public void testOverlap9() throws Exception { MoveTextEdit e1= new MoveTextEdit(3, 1, 7); MoveTextEdit e2= new MoveTextEdit(2, 3, 8); fEditor.add(e1); fEditor.add(e2); assertTrue(!fEditor.canPerformEdits()); }
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
public void testInsert1() throws Exception { SimpleTextEdit e1= SimpleTextEdit.createInsert(2, "yy"); SimpleTextEdit e2= SimpleTextEdit.createReplace(2, 3, "3456"); fEditor.add(e1); fEditor.add(e2); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assert(e1.getTextRange(), 2, 2); assert(e2.getTextRange(), 4, 4); assertEquals("Buffer content", "01yy345656789", fBuffer.getContent()); doUndo(undo); assert(e1.getTextRange(), 2, 0); assert(e2.getTextRange(), 2, 3); } public void testInsert2() throws Exception { SimpleTextEdit e1= SimpleTextEdit.createInsert(2, "yy"); SimpleTextEdit e2= SimpleTextEdit.createInsert(2, "xx"); fEditor.add(e1); fEditor.add(e2); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assert(e1.getTextRange(), 2, 2); assert(e2.getTextRange(), 4, 2); assertEquals("Buffer content", "01yyxx23456789", fBuffer.getContent()); doUndo(undo); assert(e1.getTextRange(), 2, 0);
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
assert(e2.getTextRange(), 2, 0); } public void testInsert3() throws Exception { SimpleTextEdit e1= SimpleTextEdit.createReplace(0, 2, "011"); SimpleTextEdit e2= SimpleTextEdit.createInsert(2, "xx"); SimpleTextEdit e3= SimpleTextEdit.createReplace(2, 2, "2"); fEditor.add(e1); fEditor.add(e2); fEditor.add(e3); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assert(e1.getTextRange(), 0, 3); assert(e2.getTextRange(), 3, 2); assert(e3.getTextRange(), 5, 1); assertEquals("Buffer content", "011xx2456789", fBuffer.getContent()); doUndo(undo); assert(e1.getTextRange(), 0, 2); assert(e2.getTextRange(), 2, 0); assert(e3.getTextRange(), 2, 2); } public void testInsert4() throws Exception { SimpleTextEdit e1= SimpleTextEdit.createInsert(0, "xx"); fEditor.add(e1); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer length", 12, fBuffer.getLength()); assert(e1.getTextRange(), 0, 2);
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
assertEquals("Buffer content", "xx0123456789", fBuffer.getContent()); doUndo(undo); assert(e1.getTextRange(), 0, 0); } public void testInsert5() throws Exception { SimpleTextEdit e1= SimpleTextEdit.createInsert(10, "xx"); fEditor.add(e1); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer length", 12, fBuffer.getLength()); assert(e1.getTextRange(), 10, 2); assertEquals("Buffer content", "0123456789xx", fBuffer.getContent()); doUndo(undo); assert(e1.getTextRange(), 10, 0); } public void testDelete1() throws Exception { SimpleTextEdit e1= SimpleTextEdit.createDelete(3, 1); fEditor.add(e1); assertTrue("Can perform edits", fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assert(e1.getTextRange(), 3, 0); assertEquals("Buffer content", "012456789", fBuffer.getContent()); doUndo(undo); assert(e1.getTextRange(), 3, 1); } public void testDelete2() throws Exception { SimpleTextEdit e1= SimpleTextEdit.createDelete(4, 1);
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
SimpleTextEdit e2= SimpleTextEdit.createDelete(3, 1); SimpleTextEdit e3= SimpleTextEdit.createDelete(5, 1); fEditor.add(e1); fEditor.add(e2); fEditor.add(e3); assertTrue("Can perform edits", fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assert(e1.getTextRange(), 3, 0); assert(e2.getTextRange(), 3, 0); assert(e3.getTextRange(), 3, 0); assertEquals("Buffer content", "0126789", fBuffer.getContent()); doUndo(undo); assert(e1.getTextRange(), 4, 1); assert(e2.getTextRange(), 3, 1); assert(e3.getTextRange(), 5, 1); } public void testDelete3() throws Exception { SimpleTextEdit e1= SimpleTextEdit.createInsert(3, "x"); SimpleTextEdit e2= SimpleTextEdit.createDelete(3, 1); fEditor.add(e1); fEditor.add(e2); assertTrue("Can perform edits", fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assert(e1.getTextRange(), 3, 1); assert(e2.getTextRange(), 4, 0); assertEquals("Buffer content", "012x456789", fBuffer.getContent()); doUndo(undo); assert(e1.getTextRange(), 3, 0); assert(e2.getTextRange(), 3, 1);
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
} public void testMove1() throws Exception { MoveTextEdit e1= new MoveTextEdit(2, 2, 5); fEditor.add(e1); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer content", "0142356789", fBuffer.getContent()); assert(e1.getTargetRange(), 3, 2); assert(e1.getSourceRange(), 2, 0); doUndo(undo); assert(e1.getSourceRange(), 2, 2); assert(e1.getTargetRange(), 5, 0); } public void testMove2() throws Exception { MoveTextEdit e1= new MoveTextEdit(5, 2, 2); fEditor.add(e1); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer content", "0156234789", fBuffer.getContent()); assert(e1.getTargetRange(), 2, 2); assert(e1.getSourceRange(), 7, 0); doUndo(undo); assert(e1.getSourceRange(), 5, 2); assert(e1.getTargetRange(), 2, 0); } public void testMove3() throws Exception { MoveTextEdit e1= new MoveTextEdit(2, 2, 7); SimpleTextEdit e2= SimpleTextEdit.createReplace(4, 1, "x");
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
fEditor.add(e1); fEditor.add(e2); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer content", "01x5623789", fBuffer.getContent()); assert(e1.getTargetRange(), 5, 2); assert(e1.getSourceRange(), 2, 0); assert(e2.getTextRange(), 2, 1); doUndo(undo); assert(e1.getSourceRange(), 2, 2); assert(e1.getTargetRange(), 7, 0); assert(e2.getTextRange(), 4, 1); } public void testMove4() throws Exception { MoveTextEdit e1= new MoveTextEdit(7, 2, 2); SimpleTextEdit e2= SimpleTextEdit.createReplace(5, 1, "x"); fEditor.add(e2); fEditor.add(e1); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer content", "0178234x69", fBuffer.getContent()); assert(e1.getTargetRange(), 2, 2); assert(e1.getSourceRange(), 9, 0); assert(e2.getTextRange(), 7, 1); doUndo(undo); assert(e1.getSourceRange(), 7, 2); assert(e1.getTargetRange(), 2, 0); assert(e2.getTextRange(), 5, 1); }
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
public void testMove5() throws Exception { MoveTextEdit e1= new MoveTextEdit(2, 1, 3); SimpleTextEdit e2= SimpleTextEdit.createReplace(2,1,"x"); fEditor.add(e1); fEditor.add(e2); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assert(e1.getTargetRange(), 2, 1); assert(e1.getSourceRange(), 3, 0); assert(e2.getTextRange(), 2, 1); assertEquals("Buffer content", "01x3456789", fBuffer.getContent()); doUndo(undo); assert(e1.getSourceRange(), 2, 1); assert(e1.getTargetRange(), 3, 0); assert(e2.getTextRange(), 2, 1); } public void testMove6() throws Exception { MoveTextEdit e1= new MoveTextEdit(2, 1, 2); SimpleTextEdit e2= SimpleTextEdit.createReplace(2,1,"x"); fEditor.add(e1); fEditor.add(e2); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assert(e1.getTargetRange(), 2, 1); assert(e1.getSourceRange(), 3, 0); assert(e2.getTextRange(), 2, 1);
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
assertEquals("Buffer content", "01x3456789", fBuffer.getContent()); doUndo(undo); assert(e1.getSourceRange(), 2, 1); assert(e1.getTargetRange(), 3, 0); assert(e2.getTextRange(), 2, 1); } public void testMove7() throws Exception { MoveTextEdit e1= new MoveTextEdit(2, 3, 7); SimpleTextEdit e2= SimpleTextEdit.createReplace(3, 1, "x"); fEditor.add(e1); fEditor.add(e2); assertTrue(fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer content", "01562x4789", fBuffer.getContent()); assert(e1.getTargetRange(), 4, 3); assert(e1.getSourceRange(), 2, 0); assert(e2.getTextRange(), 5, 1); doUndo(undo); assert(e1.getSourceRange(), 2, 3); assert(e1.getTargetRange(), 7, 0); assert(e2.getTextRange(), 3, 1); } public void testMove8() throws Exception { MoveTextEdit e1= new MoveTextEdit(5, 3, 1); SimpleTextEdit e2= SimpleTextEdit.createReplace(6, 1, "x"); fEditor.add(e2); fEditor.add(e1); assertTrue(fEditor.canPerformEdits());
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer content", "05x7123489", fBuffer.getContent()); assert(e1.getTargetRange(), 1, 3); assert(e1.getSourceRange(), 8, 0); assert(e2.getTextRange(), 2, 1); doUndo(undo); assert(e1.getSourceRange(), 5, 3); assert(e1.getTargetRange(), 1, 0); assert(e2.getTextRange(), 6, 1); } public void testMove9() throws Exception { MoveTextEdit e1= new MoveTextEdit(1, 1, 3); MoveTextEdit e2= new MoveTextEdit(1, 3, 5); fEditor.add(e1); fEditor.add(e2); assertTrue("Can perform edits", fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assert(e1.getTargetRange(), 3, 1); assert(e1.getSourceRange(), 2, 0); assert(e2.getTargetRange(), 2, 3); assert(e2.getSourceRange(), 1, 0); assertEquals("Buffer content", "0421356789", fBuffer.getContent()); doUndo(undo); assert(e1.getSourceRange(), 1, 1); assert(e1.getTargetRange(), 3, 0); assert(e2.getSourceRange(), 1, 3); assert(e2.getTargetRange(), 5, 0); }
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
public void testMove10() throws Exception { MoveTextEdit e1= new MoveTextEdit(2, 2, 8); MoveTextEdit e2= new MoveTextEdit(5, 2, 1); fEditor.add(e1); fEditor.add(e2); assertTrue("Can perform edits", fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer content", "0561472389", fBuffer.getContent()); doUndo(undo); } public void testSwap1() throws Exception { SwapTextEdit e1= new SwapTextEdit(1, 1, 3, 1); fEditor.add(e1); assertTrue("Can perform edits", fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer content", "0321456789", fBuffer.getContent()); doUndo(undo); } public void testSwap2() throws Exception { SwapTextEdit e1= new SwapTextEdit(1, 1, 3, 1); SwapTextEdit e2= new SwapTextEdit(5, 1, 7, 1); fEditor.add(e1); fEditor.add(e2); assertTrue("Can perform edits", fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer content", "0321476589", fBuffer.getContent()); doUndo(undo); }
7,985
Bug 7985 extract method: cannot extract (entire) try/catch block
public class A{ String f(int y, int z, boolean ff){ /*[*/try{ } catch (Exception e){ }/*]*/ return null; } void f(){} } cannot extract the selected fragment
verified fixed
b4bbfa8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T14:23:50Z
2002-01-22T11:46:40Z
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/TextBufferTest.java
public void testSwap3() throws Exception { SwapTextEdit e1= new SwapTextEdit(1, 1, 3, 1); SwapTextEdit e2= new SwapTextEdit(5, 1, 7, 1); SwapTextEdit e3= new SwapTextEdit(1, 3, 5, 3); fEditor.add(e1); fEditor.add(e2); fEditor.add(e3); assertTrue("Can perform edits", fEditor.canPerformEdits()); UndoMemento undo= fEditor.performEdits(null); assertEquals("Buffer content", "0765432189", fBuffer.getContent()); doUndo(undo); } private void doUndo(UndoMemento undo) throws Exception { fEditor.add(undo); fEditor.performEdits(null); assertBufferContent(); } private void assert(TextRange r, int offset, int length) { assertEquals("Offset", offset, r.getOffset()); assertEquals("Length", length, r.getLength()); } private void assertBufferContent() { assertEquals("Buffer content restored", "0123456789", fBuffer.getContent()); } }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.wizards; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control;
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jdt.core.Flags; import org.eclipse.jdt.core.IBuffer; 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.ISourceRange; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.ITypeHierarchy; import org.eclipse.jdt.core.JavaConventions; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.Signature; import org.eclipse.jdt.core.search.IJavaSearchScope; import org.eclipse.jdt.core.search.SearchEngine; import org.eclipse.jdt.ui.IJavaElementSearchConstants; import org.eclipse.jdt.ui.JavaElementLabelProvider; import org.eclipse.jdt.internal.compiler.env.IConstants; import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.codemanipulation.IImportsStructure; import org.eclipse.jdt.internal.corext.codemanipulation.ImportsStructure; import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.dialogs.ElementListSelectionDialog; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.dialogs.TypeSelectionDialog;
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility; import org.eclipse.jdt.internal.ui.preferences.CodeGenerationPreferencePage; import org.eclipse.jdt.internal.ui.preferences.ImportOrganizePreferencePage; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import org.eclipse.jdt.internal.ui.text.template.Template; import org.eclipse.jdt.internal.ui.text.template.Templates; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IStringButtonAdapter; import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogFieldGroup; import org.eclipse.jdt.internal.ui.wizards.dialogfields.Separator; import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonStatusDialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField; import org.eclipse.jdt.internal.ui.wizards.swt.MGridData; import org.eclipse.jdt.internal.ui.wizards.swt.MGridLayout; /** * <code>TypePage</code> contains controls and validation routines for a 'New Type WizardPage' * Implementors decide which components to add and to enable. Implementors can also * customize the validation code. * <code>TypePage</code> is intended to serve as base class of all wizards that create types. * Applets, Servlets, Classes, Interfaces... * See <code>NewClassCreationWizardPage</code> or <code>NewInterfaceCreationWizardPage</code> for an * example usage of TypePage. */ public abstract class TypePage extends ContainerPage {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
private final static String PAGE_NAME= "TypePage"; protected final static String PACKAGE= PAGE_NAME + ".package"; protected final static String ENCLOSING= PAGE_NAME + ".enclosing"; protected final static String ENCLOSINGSELECTION= ENCLOSING + ".selection"; protected final static String TYPENAME= PAGE_NAME + ".typename"; protected final static String SUPER= PAGE_NAME + ".superclass"; protected final static String INTERFACES= PAGE_NAME + ".interfaces"; protected final static String MODIFIERS= PAGE_NAME + ".modifiers"; protected final static String METHODS= PAGE_NAME + ".methods"; private class InterfacesListLabelProvider extends LabelProvider {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
private Image fInterfaceImage; public InterfacesListLabelProvider() { super(); fInterfaceImage= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_INTERFACE); } public Image getImage(Object element) { return fInterfaceImage; } } private StringButtonStatusDialogField fPackageDialogField; private SelectionButtonDialogField fEnclosingTypeSelection; private StringButtonDialogField fEnclosingTypeDialogField; private boolean fCanModifyPackage; private boolean fCanModifyEnclosingType; private IPackageFragment fCurrPackage; private IType fCurrEnclosingType; private StringDialogField fTypeNameDialogField; private StringButtonDialogField fSuperClassDialogField; private ListDialogField fSuperInterfacesDialogField;
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
private IType fSuperClass; private SelectionButtonDialogFieldGroup fAccMdfButtons; private SelectionButtonDialogFieldGroup fOtherMdfButtons; private IType fCreatedType; protected IStatus fEnclosingTypeStatus; protected IStatus fPackageStatus; protected IStatus fTypeNameStatus; protected IStatus fSuperClassStatus; protected IStatus fModifierStatus; protected IStatus fSuperInterfacesStatus; private boolean fIsClass; private int fStaticMdfIndex; private final int PUBLIC_INDEX= 0, DEFAULT_INDEX= 1, PRIVATE_INDEX= 2, PROTECTED_INDEX= 3; private final int ABSTRACT_INDEX= 0, FINAL_INDEX= 1; public TypePage(boolean isClass, String pageName, IWorkspaceRoot root) { super(pageName, root); fCreatedType= null; fIsClass= isClass; TypeFieldsAdapter adapter= new TypeFieldsAdapter(); fPackageDialogField= new StringButtonStatusDialogField(adapter); fPackageDialogField.setDialogFieldListener(adapter);
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
fPackageDialogField.setLabelText(NewWizardMessages.getString("TypePage.package.label")); fPackageDialogField.setButtonLabel(NewWizardMessages.getString("TypePage.package.button")); fPackageDialogField.setStatusWidthHint(NewWizardMessages.getString("TypePage.default")); fEnclosingTypeSelection= new SelectionButtonDialogField(SWT.CHECK); fEnclosingTypeSelection.setDialogFieldListener(adapter); fEnclosingTypeSelection.setLabelText(NewWizardMessages.getString("TypePage.enclosing.selection.label")); fEnclosingTypeDialogField= new StringButtonDialogField(adapter); fEnclosingTypeDialogField.setDialogFieldListener(adapter); fEnclosingTypeDialogField.setButtonLabel(NewWizardMessages.getString("TypePage.enclosing.button")); fTypeNameDialogField= new StringDialogField(); fTypeNameDialogField.setDialogFieldListener(adapter); fTypeNameDialogField.setLabelText(NewWizardMessages.getString("TypePage.typename.label")); fSuperClassDialogField= new StringButtonDialogField(adapter); fSuperClassDialogField.setDialogFieldListener(adapter); fSuperClassDialogField.setLabelText(NewWizardMessages.getString("TypePage.superclass.label")); fSuperClassDialogField.setButtonLabel(NewWizardMessages.getString("TypePage.superclass.button")); String[] addButtons= new String[] { NewWizardMessages.getString("TypePage.interfaces.add"), null, NewWizardMessages.getString("TypePage.interfaces.remove") }; fSuperInterfacesDialogField= new ListDialogField(adapter, addButtons, new InterfacesListLabelProvider()); fSuperInterfacesDialogField.setDialogFieldListener(adapter); String interfaceLabel= fIsClass ? NewWizardMessages.getString("TypePage.interfaces.class.label") : NewWizardMessages.getString("TypePage.interfaces.ifc.label"); fSuperInterfacesDialogField.setLabelText(interfaceLabel);
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
fSuperInterfacesDialogField.setRemoveButtonIndex(2); String[] buttonNames1= new String[] { NewWizardMessages.getString("TypePage.modifiers.public"), NewWizardMessages.getString("TypePage.modifiers.default"), NewWizardMessages.getString("TypePage.modifiers.private"), NewWizardMessages.getString("TypePage.modifiers.protected") }; fAccMdfButtons= new SelectionButtonDialogFieldGroup(SWT.RADIO, buttonNames1, 4); fAccMdfButtons.setDialogFieldListener(adapter); fAccMdfButtons.setLabelText(NewWizardMessages.getString("TypePage.modifiers.acc.label")); fAccMdfButtons.setSelection(0, true); String[] buttonNames2; if (fIsClass) { buttonNames2= new String[] { NewWizardMessages.getString("TypePage.modifiers.abstract"), NewWizardMessages.getString("TypePage.modifiers.final"), NewWizardMessages.getString("TypePage.modifiers.static") }; fStaticMdfIndex= 2; } else { buttonNames2= new String[] { NewWizardMessages.getString("TypePage.modifiers.static") }; fStaticMdfIndex= 0; } fOtherMdfButtons= new SelectionButtonDialogFieldGroup(SWT.CHECK, buttonNames2, 4); fOtherMdfButtons.setDialogFieldListener(adapter);
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
fAccMdfButtons.enableSelectionButton(PRIVATE_INDEX, false); fAccMdfButtons.enableSelectionButton(PROTECTED_INDEX, false); fOtherMdfButtons.enableSelectionButton(fStaticMdfIndex, false); fPackageStatus= new StatusInfo(); fEnclosingTypeStatus= new StatusInfo(); fCanModifyPackage= true; fCanModifyEnclosingType= true; updateEnableState(); fTypeNameStatus= new StatusInfo(); fSuperClassStatus= new StatusInfo(); fSuperInterfacesStatus= new StatusInfo(); fModifierStatus= new StatusInfo(); } /** * Initializes all fields provided by the type page with a given * Java element as selection. * @param elem The initial selection of this page or null if no * selection was available */ protected void initTypePage(IJavaElement elem) { String initSuperclass= "java.lang.Object"; ArrayList initSuperinterfaces= new ArrayList(5); IPackageFragment pack= null; IType enclosingType= null; if (elem != null) {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
pack= (IPackageFragment) JavaModelUtil.findElementOfKind(elem, IJavaElement.PACKAGE_FRAGMENT); IType typeInCU= (IType) JavaModelUtil.findElementOfKind(elem, IJavaElement.TYPE); if (typeInCU != null) { if (typeInCU.getCompilationUnit() != null) { enclosingType= typeInCU; } } else { ICompilationUnit cu= (ICompilationUnit) JavaModelUtil.findElementOfKind(elem, IJavaElement.COMPILATION_UNIT); if (cu != null) { enclosingType= JavaModelUtil.findPrimaryType(cu); } } try { IType type= null; if (elem.getElementType() == IJavaElement.TYPE) { type= (IType)elem; if (type.exists()) { String superName= JavaModelUtil.getFullyQualifiedName(type); if (type.isInterface()) { initSuperinterfaces.add(superName); } else { initSuperclass= superName; } } } } catch (JavaModelException e) { JavaPlugin.log(e.getStatus()); }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
} setPackageFragment(pack, true); setEnclosingType(enclosingType, true); setEnclosingTypeSelection(false, true); setTypeName("", true); setSuperClass(initSuperclass, true); setSuperInterfaces(initSuperinterfaces, true); } /** * Creates a separator line. * @param composite The parent composite * @param nColumns Number of columns to span */ protected void createSeparator(Composite composite, int nColumns) { (new Separator(SWT.SEPARATOR | SWT.HORIZONTAL)).doFillIntoGrid(composite, nColumns, convertHeightInCharsToPixels(1)); } /** * Creates the controls for the package name field. * @param composite The parent composite * @param nColumns Number of columns to span */ protected void createPackageControls(Composite composite, int nColumns) { fPackageDialogField.doFillIntoGrid(composite, 4); LayoutUtil.setWidthHint(fPackageDialogField.getTextControl(null), getMaxFieldWidth()); } /**
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
* Creates the controls for the enclosing type name field. * @param composite The parent composite * @param nColumns Number of columns to span */ protected void createEnclosingTypeControls(Composite composite, int nColumns) { Composite tabGroup= new Composite(composite, SWT.NONE); MGridLayout layout= new MGridLayout(); layout.marginWidth= 0; layout.marginHeight= 0; tabGroup.setLayout(layout); fEnclosingTypeSelection.doFillIntoGrid(tabGroup, 1); Control c= fEnclosingTypeDialogField.getTextControl(composite); MGridData gd= new MGridData(MGridData.FILL_HORIZONTAL); gd.widthHint= getMaxFieldWidth(); gd.horizontalSpan= 2; c.setLayoutData(gd); c= fEnclosingTypeDialogField.getChangeControl(composite); c.setLayoutData(new MGridData(MGridData.HORIZONTAL_ALIGN_FILL)); } /** * Creates the controls for the type name field. * @param composite The parent composite * @param nColumns Number of columns to span */ protected void createTypeNameControls(Composite composite, int nColumns) { fTypeNameDialogField.doFillIntoGrid(composite, nColumns - 1); DialogField.createEmptySpace(composite);
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
LayoutUtil.setWidthHint(fTypeNameDialogField.getTextControl(null), getMaxFieldWidth()); } /** * Creates the controls for the modifiers radio/ceckbox buttons. * @param composite The parent composite * @param nColumns Number of columns to span */ protected void createModifierControls(Composite composite, int nColumns) { LayoutUtil.setHorizontalSpan(fAccMdfButtons.getLabelControl(composite), 1); Control control= fAccMdfButtons.getSelectionButtonsGroup(composite); MGridData gd= new MGridData(MGridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= nColumns - 2; control.setLayoutData(gd); DialogField.createEmptySpace(composite); DialogField.createEmptySpace(composite); control= fOtherMdfButtons.getSelectionButtonsGroup(composite); gd= new MGridData(MGridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= nColumns - 2; control.setLayoutData(gd); DialogField.createEmptySpace(composite); } /** * Creates the controls for the superclass name field. * @param composite The parent composite * @param nColumns Number of columns to span */
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
protected void createSuperClassControls(Composite composite, int nColumns) { fSuperClassDialogField.doFillIntoGrid(composite, nColumns); LayoutUtil.setWidthHint(fSuperClassDialogField.getTextControl(null), getMaxFieldWidth()); } /** * Creates the controls for the superclass name field. * @param composite The parent composite * @param nColumns Number of columns to span */ protected void createSuperInterfacesControls(Composite composite, int nColumns) { fSuperInterfacesDialogField.doFillIntoGrid(composite, nColumns); MGridData gd= (MGridData)fSuperInterfacesDialogField.getListControl(null).getLayoutData(); if (fIsClass) { gd.heightHint= convertHeightInCharsToPixels(3); } else { gd.heightHint= convertHeightInCharsToPixels(6); } gd.grabExcessVerticalSpace= false; gd.widthHint= getMaxFieldWidth(); } /** * Sets the focus on the container if empty, elso on type name. */ protected void setFocus() { fTypeNameDialogField.setFocus(); } private class TypeFieldsAdapter implements IStringButtonAdapter, IDialogFieldListener, IListAdapter {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
public void changeControlPressed(DialogField field) { typePageChangeControlPressed(field); }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
public void customButtonPressed(DialogField field, int index) { typePageCustomButtonPressed(field, index); } public void selectionChanged(DialogField field) {} public void dialogFieldChanged(DialogField field) { typePageDialogFieldChanged(field); } } private void typePageChangeControlPressed(DialogField field) { if (field == fPackageDialogField) { IPackageFragment pack= choosePackage(); if (pack != null) { fPackageDialogField.setText(pack.getElementName()); } } else if (field == fEnclosingTypeDialogField) { IType type= chooseEnclosingType(); if (type != null) { fEnclosingTypeDialogField.setText(JavaModelUtil.getFullyQualifiedName(type)); } } else if (field == fSuperClassDialogField) { IType type= chooseSuperType(); if (type != null) { fSuperClassDialogField.setText(JavaModelUtil.getFullyQualifiedName(type)); }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
} } private void typePageCustomButtonPressed(DialogField field, int index) { if (field == fSuperInterfacesDialogField) { chooseSuperInterfaces(); } } /* * A field on the type has changed. The fields' status and all dependend * status are updated. */ private void typePageDialogFieldChanged(DialogField field) { String fieldName= null; if (field == fPackageDialogField) { fPackageStatus= packageChanged(); updatePackageStatusLabel(); fTypeNameStatus= typeNameChanged(); fSuperClassStatus= superClassChanged(); fieldName= PACKAGE; } else if (field == fEnclosingTypeDialogField) { fEnclosingTypeStatus= enclosingTypeChanged(); fTypeNameStatus= typeNameChanged(); fSuperClassStatus= superClassChanged(); fieldName= ENCLOSING; } else if (field == fEnclosingTypeSelection) { updateEnableState(); boolean isEnclosedType= isEnclosingTypeSelected(); if (!isEnclosedType) {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
if (fAccMdfButtons.isSelected(PRIVATE_INDEX) || fAccMdfButtons.isSelected(PROTECTED_INDEX)) { fAccMdfButtons.setSelection(PRIVATE_INDEX, false); fAccMdfButtons.setSelection(PROTECTED_INDEX, false); fAccMdfButtons.setSelection(PUBLIC_INDEX, true); } if (fOtherMdfButtons.isSelected(fStaticMdfIndex)) { fOtherMdfButtons.setSelection(fStaticMdfIndex, false); } } fAccMdfButtons.enableSelectionButton(PRIVATE_INDEX, isEnclosedType && fIsClass); fAccMdfButtons.enableSelectionButton(PROTECTED_INDEX, isEnclosedType && fIsClass); fOtherMdfButtons.enableSelectionButton(fStaticMdfIndex, isEnclosedType); fTypeNameStatus= typeNameChanged(); fSuperClassStatus= superClassChanged(); fieldName= ENCLOSINGSELECTION; } else if (field == fTypeNameDialogField) { fTypeNameStatus= typeNameChanged(); fieldName= TYPENAME; } else if (field == fSuperClassDialogField) { fSuperClassStatus= superClassChanged(); fieldName= SUPER; } else if (field == fSuperInterfacesDialogField) { fSuperInterfacesStatus= superInterfacesChanged(); fieldName= INTERFACES; } else if (field == fOtherMdfButtons) { fModifierStatus= modifiersChanged(); fieldName= MODIFIERS; } else { fieldName= METHODS; }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
handleFieldChanged(fieldName); } /** * Called whenever a content of a field has changed. * Implementors of TypePage can hook in. * @see ContainerPage#handleFieldChanged */ protected void handleFieldChanged(String fieldName) { super.handleFieldChanged(fieldName); if (fieldName == CONTAINER) { fPackageStatus= packageChanged(); fEnclosingTypeStatus= enclosingTypeChanged(); fTypeNameStatus= typeNameChanged(); fSuperClassStatus= superClassChanged(); fSuperInterfacesStatus= superInterfacesChanged(); } } /** * Gets the text of package field. */ public String getPackageText() { return fPackageDialogField.getText();
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
} /** * Gets the text of enclosing type field. */ public String getEnclosingTypeText() { return fEnclosingTypeDialogField.getText(); } /** * Returns the package fragment corresponding to the current input. * @return Returns <code>null</code> if the input could not be resolved. */ public IPackageFragment getPackageFragment() { if (!isEnclosingTypeSelected()) { return fCurrPackage; } else { if (fCurrEnclosingType != null) { return fCurrEnclosingType.getPackageFragment(); } } return null; } /** * Sets the package fragment. * This will update model and the text of the control. * @param canBeModified Selects if the package fragment can be changed by the user */ public void setPackageFragment(IPackageFragment pack, boolean canBeModified) {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
fCurrPackage= pack; fCanModifyPackage= canBeModified; String str= (pack == null) ? "" : pack.getElementName(); fPackageDialogField.setText(str); updateEnableState(); } /** * Returns the encloding type corresponding to the current input. * @return Returns <code>null</code> if enclosing type is not selected or the input could not * be resolved. */ public IType getEnclosingType() { if (isEnclosingTypeSelected()) { return fCurrEnclosingType; } return null; } /** * Sets the package fragment. * This will update model and the text of the control. * @param canBeModified Selects if the enclosing type can be changed by the user */ public void setEnclosingType(IType type, boolean canBeModified) { fCurrEnclosingType= type; fCanModifyEnclosingType= canBeModified; String str= (type == null) ? "" : JavaModelUtil.getFullyQualifiedName(type); fEnclosingTypeDialogField.setText(str); updateEnableState(); }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
/** * Returns <code>true</code> if the enclosing type selection check box is enabled. */ public boolean isEnclosingTypeSelected() { return fEnclosingTypeSelection.isSelected(); } /** * Sets the enclosing type selection checkbox. * @param canBeModified Selects if the enclosing type selection can be changed by the user */ public void setEnclosingTypeSelection(boolean isSelected, boolean canBeModified) { fEnclosingTypeSelection.setSelection(isSelected); fEnclosingTypeSelection.setEnabled(canBeModified); updateEnableState(); } /** * Gets the type name. */ public String getTypeName() { return fTypeNameDialogField.getText(); } /** * Sets the type name. * @param canBeModified Selects if the type name can be changed by the user */ public void setTypeName(String name, boolean canBeModified) { fTypeNameDialogField.setText(name); fTypeNameDialogField.setEnabled(canBeModified); }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
/** * Gets the selected modifiers. * @see Flags */ public int getModifiers() { int mdf= 0; if (fAccMdfButtons.isSelected(PUBLIC_INDEX)) { mdf+= IConstants.AccPublic; } else if (fAccMdfButtons.isSelected(PRIVATE_INDEX)) { mdf+= IConstants.AccPrivate; } else if (fAccMdfButtons.isSelected(PROTECTED_INDEX)) { mdf+= IConstants.AccProtected; } if (fOtherMdfButtons.isSelected(ABSTRACT_INDEX) && (fStaticMdfIndex != 0)) { mdf+= IConstants.AccAbstract; } if (fOtherMdfButtons.isSelected(FINAL_INDEX)) { mdf+= IConstants.AccFinal; } if (fOtherMdfButtons.isSelected(fStaticMdfIndex)) { mdf+= IConstants.AccStatic; } return mdf; } /** * Sets the modifiers. * @param canBeModified Selects if the modifiers can be changed by the user * @see IConstants */
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
public void setModifiers(int modifiers, boolean canBeModified) { if (Flags.isPublic(modifiers)) { fAccMdfButtons.setSelection(PUBLIC_INDEX, true); } else if (Flags.isPrivate(modifiers)) { fAccMdfButtons.setSelection(PRIVATE_INDEX, true); } else if (Flags.isProtected(modifiers)) { fAccMdfButtons.setSelection(PROTECTED_INDEX, true); } else { fAccMdfButtons.setSelection(DEFAULT_INDEX, true); } if (Flags.isAbstract(modifiers)) { fOtherMdfButtons.setSelection(ABSTRACT_INDEX, true); } if (Flags.isFinal(modifiers)) { fOtherMdfButtons.setSelection(FINAL_INDEX, true); } if (Flags.isStatic(modifiers)) { fOtherMdfButtons.setSelection(fStaticMdfIndex, true); } fAccMdfButtons.setEnabled(canBeModified); fOtherMdfButtons.setEnabled(canBeModified); } /** * Gets the content of the super class text field. */ public String getSuperClass() { return fSuperClassDialogField.getText(); }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
/** * Sets the super class name. * @param canBeModified Selects if the super class can be changed by the user */ public void setSuperClass(String name, boolean canBeModified) { fSuperClassDialogField.setText(name); fSuperClassDialogField.setEnabled(canBeModified); } /** * Gets the currently chosen super interfaces. * @return returns a list of String */ public List getSuperInterfaces() { return fSuperInterfacesDialogField.getElements(); } /** * Sets the super interfaces. * @param interfacesNames a list of String */ public void setSuperInterfaces(List interfacesNames, boolean canBeModified) { fSuperInterfacesDialogField.setElements(interfacesNames); fSuperInterfacesDialogField.setEnabled(canBeModified); } /** * Called when the package field has changed. * The method validates the package name and returns the status of the validation
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
* This also updates the package fragment model. * Can be extended to add more validation */ protected IStatus packageChanged() { StatusInfo status= new StatusInfo(); fPackageDialogField.enableButton(getPackageFragmentRoot() != null); String packName= getPackageText(); if (packName.length() > 0) { IStatus val= JavaConventions.validatePackageName(packName); if (val.getSeverity() == IStatus.ERROR) { status.setError(NewWizardMessages.getFormattedString("TypePage.error.InvalidPackageName", val.getMessage())); return status; } else if (val.getSeverity() == IStatus.WARNING) { status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.DiscouragedPackageName", val.getMessage())); } } IPackageFragmentRoot root= getPackageFragmentRoot(); if (root != null) { IPackageFragment pack= root.getPackageFragment(packName); try { IPath rootPath= root.getPath(); IPath outputPath= root.getJavaProject().getOutputLocation(); if (rootPath.isPrefixOf(outputPath) && !rootPath.equals(outputPath)) { IPath packagePath= pack.getUnderlyingResource().getFullPath(); if (outputPath.isPrefixOf(packagePath)) {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
status.setError(NewWizardMessages.getString("TypePage.error.ClashOutputLocation")); return status; } } } catch (JavaModelException e) { JavaPlugin.log(e.getStatus()); } fCurrPackage= pack; } else { status.setError(""); } return status; } /* * Updates the 'default' label next to the package field. */ private void updatePackageStatusLabel() { String packName= fPackageDialogField.getText(); if (packName.length() == 0) { fPackageDialogField.setStatus(NewWizardMessages.getString("TypePage.default")); } else { fPackageDialogField.setStatus(""); } } /* * Updates the enable state of buttons related to the enclosing type selection checkbox.
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
*/ private void updateEnableState() { boolean enclosing= isEnclosingTypeSelected(); fPackageDialogField.setEnabled(fCanModifyPackage && !enclosing); fEnclosingTypeDialogField.setEnabled(fCanModifyEnclosingType && enclosing); } /** * Called when the enclosing type name has changed. * The method validates the enclosing type and returns the status of the validation * This also updates the enclosing type model. * Can be extended to add more validation */ protected IStatus enclosingTypeChanged() { StatusInfo status= new StatusInfo(); fCurrEnclosingType= null; IPackageFragmentRoot root= getPackageFragmentRoot(); fEnclosingTypeDialogField.enableButton(root != null); if (root == null) { status.setError(""); return status; } String enclName= getEnclosingTypeText(); if (enclName.length() == 0) { status.setError(NewWizardMessages.getString("TypePage.error.EnclosingTypeEnterName")); return status; } try {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
IType type= JavaModelUtil.findType(root.getJavaProject(), enclName); if (type == null) { status.setError(NewWizardMessages.getString("TypePage.error.EnclosingTypeNotExists")); return status; } if (type.getCompilationUnit() == null) { status.setError(NewWizardMessages.getString("TypePage.error.EnclosingNotInCU")); return status; } fCurrEnclosingType= type; return status; } catch (JavaModelException e) { status.setError(NewWizardMessages.getString("TypePage.error.EnclosingTypeNotExists")); JavaPlugin.log(e.getStatus()); return status; } } /** * Called when the type name has changed. * The method validates the type name and returns the status of the validation. * Can be extended to add more validation */ protected IStatus typeNameChanged() { StatusInfo status= new StatusInfo(); String typeName= getTypeName(); if (typeName.length() == 0) { status.setError(NewWizardMessages.getString("TypePage.error.EnterTypeName")); return status;
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
} if (typeName.indexOf('.') != -1) { status.setError(NewWizardMessages.getString("TypePage.error.QualifiedName")); return status; } IStatus val= JavaConventions.validateJavaTypeName(typeName); if (val.getSeverity() == IStatus.ERROR) { status.setError(NewWizardMessages.getFormattedString("TypePage.error.InvalidTypeName", val.getMessage())); return status; } else if (val.getSeverity() == IStatus.WARNING) { status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.TypeNameDiscouraged", val.getMessage())); } if (!isEnclosingTypeSelected()) { IPackageFragment pack= getPackageFragment(); if (pack != null) { ICompilationUnit cu= pack.getCompilationUnit(typeName + ".java"); if (cu.exists()) { status.setError(NewWizardMessages.getString("TypePage.error.TypeNameExists")); return status; } } } else { IType type= getEnclosingType(); if (type != null) { IType member= type.getType(typeName); if (member.exists()) { status.setError(NewWizardMessages.getString("TypePage.error.TypeNameExists")); return status;
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
} } } return status; } /** * Called when the superclass name has changed. * The method validates the superclass name and returns the status of the validation. * Can be extended to add more validation */ protected IStatus superClassChanged() { StatusInfo status= new StatusInfo(); IPackageFragmentRoot root= getPackageFragmentRoot(); fSuperClassDialogField.enableButton(root != null); fSuperClass= null; String sclassName= getSuperClass(); if (sclassName.length() == 0) { return status; } IStatus val= JavaConventions.validateJavaTypeName(sclassName); if (!val.isOK()) { status.setError(NewWizardMessages.getString("TypePage.error.InvalidSuperClassName")); return status; } if (root != null) {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
try { IType type= resolveSuperTypeName(root.getJavaProject(), sclassName); if (type == null) { status.setWarning(NewWizardMessages.getString("TypePage.warning.SuperClassNotExists")); return status; } else { if (type.isInterface()) { status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.SuperClassIsNotClass", sclassName)); return status; } int flags= type.getFlags(); if (Flags.isFinal(flags)) { status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.SuperClassIsFinal", sclassName)); return status; } else if (!JavaModelUtil.isVisible(type, getPackageFragment())) { status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.SuperClassIsNotVisible", sclassName)); return status; } } fSuperClass= type; } catch (JavaModelException e) { status.setError(NewWizardMessages.getString("TypePage.error.InvalidSuperClassName")); JavaPlugin.log(e.getStatus()); } } else { status.setError(""); } return status; }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
private IType resolveSuperTypeName(IJavaProject jproject, String sclassName) throws JavaModelException { IType type= null; if (isEnclosingTypeSelected()) { IType enclosingType= getEnclosingType(); if (enclosingType != null) { String[][] res= enclosingType.resolveType(sclassName); if (res != null && res.length > 0) { type= JavaModelUtil.findType(jproject, res[0][0], res[0][1]); } } } else { IPackageFragment currPack= getPackageFragment(); if (type == null && currPack != null) { String packName= currPack.getElementName(); if (!currPack.isDefaultPackage()) { type= JavaModelUtil.findType(jproject, packName, sclassName); } if (type == null && !"java.lang".equals(packName)) { type= JavaModelUtil.findType(jproject, "java.lang", sclassName); } } if (type == null) { type= JavaModelUtil.findType(jproject, sclassName); } }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
return type; } /** * Called when the list of super interface has changed. * The method validates the superinterfaces and returns the status of the validation. * Can be extended to add more validation. */ protected IStatus superInterfacesChanged() { StatusInfo status= new StatusInfo(); IPackageFragmentRoot root= getPackageFragmentRoot(); fSuperInterfacesDialogField.enableButton(0, root != null); if (root != null) { List elements= fSuperInterfacesDialogField.getElements(); int nElements= elements.size(); for (int i= 0; i < nElements; i++) { String intfname= (String)elements.get(i); try { IType type= JavaModelUtil.findType(root.getJavaProject(), intfname); if (type == null) { status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.InterfaceNotExists", intfname)); return status; } else { if (type.isClass()) { status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.InterfaceIsNotInterface", intfname)); return status; } if (!JavaModelUtil.isVisible(type, getPackageFragment())) {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
status.setWarning(NewWizardMessages.getFormattedString("TypePage.warning.InterfaceIsNotVisible", intfname)); return status; } } } catch (JavaModelException e) { JavaPlugin.log(e.getStatus()); } } } return status; } /** * Called when the modifiers have changed. * The method validates the modifiers and returns the status of the validation. * Can be extended to add more validation. */ protected IStatus modifiersChanged() { StatusInfo status= new StatusInfo(); int modifiers= getModifiers(); if (Flags.isFinal(modifiers) && Flags.isAbstract(modifiers)) { status.setError(NewWizardMessages.getString("TypePage.error.ModifiersFinalAndAbstract")); } return status; } private IPackageFragment choosePackage() {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
IPackageFragmentRoot froot= getPackageFragmentRoot(); IJavaElement[] packages= null; try { if (froot != null) { packages= froot.getChildren(); } } catch (JavaModelException e) { JavaPlugin.log(e); } if (packages == null) { packages= new IJavaElement[0]; } ElementListSelectionDialog dialog= new ElementListSelectionDialog(getShell(), new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT)); dialog.setIgnoreCase(false); dialog.setTitle(NewWizardMessages.getString("TypePage.ChoosePackageDialog.title")); dialog.setMessage(NewWizardMessages.getString("TypePage.ChoosePackageDialog.description")); dialog.setEmptyListMessage(NewWizardMessages.getString("TypePage.ChoosePackageDialog.empty")); dialog.setElements(packages); if (fCurrPackage != null) { dialog.setInitialSelections(new Object[] { fCurrPackage }); } if (dialog.open() == dialog.OK) { return (IPackageFragment) dialog.getFirstResult(); } return null; } private IType chooseEnclosingType() { IPackageFragmentRoot root= getPackageFragmentRoot();
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
if (root == null) { return null; } ArrayList elementsInScope= new ArrayList(); try { IPackageFragmentRoot[] pfrs= root.getJavaProject().getPackageFragmentRoots(); for (int i= 0; i < pfrs.length; i++) { if (pfrs[i].getKind() == IPackageFragmentRoot.K_SOURCE) { elementsInScope.add(pfrs[i]); } } } catch (JavaModelException e) { JavaPlugin.log(e); } IJavaElement[] elements= (IJavaElement[]) elementsInScope.toArray(new IJavaElement[elementsInScope.size()]); IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements); TypeSelectionDialog dialog= new TypeSelectionDialog(getShell(), getWizard().getContainer(), scope, IJavaElementSearchConstants.CONSIDER_TYPES); dialog.setTitle(NewWizardMessages.getString("TypePage.ChooseEnclosingTypeDialog.title")); dialog.setMessage(NewWizardMessages.getString("TypePage.ChooseEnclosingTypeDialog.description")); if (fCurrEnclosingType != null) { dialog.setInitialSelections(new Object[] { fCurrEnclosingType }); dialog.setFilter(fCurrEnclosingType.getElementName().substring(0, 1)); } if (dialog.open() == dialog.OK) { return (IType) dialog.getFirstResult(); }
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
return null; } private IType chooseSuperType() { IPackageFragmentRoot root= getPackageFragmentRoot(); if (root == null) { return null; } IJavaElement[] elements= new IJavaElement[] { root.getJavaProject() }; IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements); TypeSelectionDialog dialog= new TypeSelectionDialog(getShell(), getWizard().getContainer(), scope, IJavaElementSearchConstants.CONSIDER_CLASSES); dialog.setTitle(NewWizardMessages.getString("TypePage.SuperClassDialog.title")); dialog.setMessage(NewWizardMessages.getString("TypePage.SuperClassDialog.message")); if (fSuperClass != null) { dialog.setFilter(fSuperClass.getElementName()); } if (dialog.open() == dialog.OK) { return (IType) dialog.getFirstResult(); } return null; } private void chooseSuperInterfaces() { IPackageFragmentRoot root= getPackageFragmentRoot(); if (root == null) { return; } IJavaProject project= root.getJavaProject(); SuperInterfaceSelectionDialog dialog= new SuperInterfaceSelectionDialog(getShell(), getWizard().getContainer(), fSuperInterfacesDialogField, project); dialog.setTitle(NewWizardMessages.getString("TypePage.InterfacesDialog.title"));
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
dialog.setMessage(NewWizardMessages.getString("TypePage.InterfacesDialog.message")); dialog.open(); return; } /** * Creates a type using the current field values. */ public void createType(IProgressMonitor monitor) throws CoreException, InterruptedException { monitor.beginTask(NewWizardMessages.getString("TypePage.operationdesc"), 10); IPackageFragmentRoot root= getPackageFragmentRoot(); IPackageFragment pack= getPackageFragment(); if (pack == null) { pack= root.getPackageFragment(""); } if (!pack.exists()) { String packName= pack.getElementName(); pack= root.createPackageFragment(packName, true, null); } monitor.worked(1); String clName= fTypeNameDialogField.getText(); boolean isInnerClass= isEnclosingTypeSelected();
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
IType createdType; ImportsStructure imports; int indent= 0; String[] prefOrder= ImportOrganizePreferencePage.getImportOrderPreference(); int threshold= ImportOrganizePreferencePage.getImportNumberThreshold(); String lineDelimiter= null; if (!isInnerClass) { ICompilationUnit parentCU= pack.getCompilationUnit(clName + ".java"); imports= new ImportsStructure(parentCU, prefOrder, threshold, false); lineDelimiter= StubUtility.getLineDelimiterUsed(parentCU); String content= createTypeBody(imports, lineDelimiter); createdType= parentCU.createType(content, null, false, new SubProgressMonitor(monitor, 5)); String fileComment= getFileComment(); if (fileComment != null) { parentCU.getBuffer().replace(0, 0, fileComment + lineDelimiter); } } else { IType enclosingType= getEnclosingType(); IType workingCopy= (IType) EditorUtility.getWorkingCopy(enclosingType); if (workingCopy != null) { enclosingType= workingCopy; } ICompilationUnit parentCU= enclosingType.getCompilationUnit();
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
imports= new ImportsStructure(parentCU, prefOrder, threshold, true); lineDelimiter= StubUtility.getLineDelimiterUsed(enclosingType); String content= createTypeBody(imports, lineDelimiter); IJavaElement[] elems= enclosingType.getChildren(); IJavaElement sibling= elems.length > 0 ? elems[0] : null; createdType= enclosingType.createType(content, sibling, false, new SubProgressMonitor(monitor, 1)); indent= StubUtility.getIndentUsed(enclosingType) + 1; } imports.create(!isInnerClass, new SubProgressMonitor(monitor, 1)); String[] methods= evalMethods(createdType, imports, new SubProgressMonitor(monitor, 1)); if (methods.length > 0) { for (int i= 0; i < methods.length; i++) { createdType.createMethod(methods[i], null, false, null); } imports.create(!isInnerClass, null); } monitor.worked(1); ICompilationUnit cu= createdType.getCompilationUnit(); ISourceRange range; if (isInnerClass) { synchronized(cu) { cu.reconcile();
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
} range= createdType.getSourceRange(); } else { range= cu.getSourceRange(); } IBuffer buf= cu.getBuffer(); String originalContent= buf.getText(range.getOffset(), range.getLength()); String formattedContent= StubUtility.codeFormat(originalContent, indent, lineDelimiter); buf.replace(range.getOffset(), range.getLength(), formattedContent); if (!isInnerClass) { buf.save(new SubProgressMonitor(monitor, 1), false); } else { monitor.worked(1); } fCreatedType= createdType; monitor.done(); } /** * Returns the created type. Only valid after createType has been invoked */ public IType getCreatedType() { return fCreatedType; } private void writeSuperClass(StringBuffer buf, IImportsStructure imports) { String typename= getSuperClass(); if (fIsClass && typename.length() > 0 && !"java.lang.Object".equals(typename)) {
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
buf.append(" extends "); buf.append(Signature.getSimpleName(typename)); if (fSuperClass != null) { imports.addImport(JavaModelUtil.getFullyQualifiedName(fSuperClass)); } else { imports.addImport(typename); } } } private void writeSuperInterfaces(StringBuffer buf, IImportsStructure imports) { List interfaces= getSuperInterfaces(); int last= interfaces.size() - 1; if (last >= 0) { if (fIsClass) { buf.append(" implements "); } else { buf.append(" extends "); } for (int i= 0; i <= last; i++) { String typename= (String) interfaces.get(i); imports.addImport(typename); buf.append(Signature.getSimpleName(typename)); if (i < last) { buf.append(", "); } } } } /*
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
* Called from createType to construct the source for this type */ private String createTypeBody(IImportsStructure imports, String lineDelimiter) { StringBuffer buf= new StringBuffer(); String typeComment= getTypeComment(); if (typeComment != null) { buf.append(typeComment); buf.append(lineDelimiter); } int modifiers= getModifiers(); buf.append(Flags.toString(modifiers)); if (modifiers != 0) { buf.append(' '); } buf.append(fIsClass ? "class " : "interface "); buf.append(getTypeName()); writeSuperClass(buf, imports); writeSuperInterfaces(buf, imports); buf.append(" {"); buf.append(lineDelimiter); buf.append(lineDelimiter); buf.append('}'); buf.append(lineDelimiter); return buf.toString(); } /** * Called from createType to allow adding methods for the newly created type * Returns array of sources of the methods that have to be added * @param parent The type where the methods will be added to
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
*/ protected String[] evalMethods(IType parent, IImportsStructure imports, IProgressMonitor monitor) throws CoreException { return new String[0]; } /** * Called from createType to get a file comment. By default the content of template * 'filecomment' is taken. * Returns source or null, if no file comment should be added */ protected String getFileComment() { if (CodeGenerationPreferencePage.doFileComments()) { return getTemplate("filecomment"); } return null; } /** * Called from createType to get a type comment. * Returns source or null, if no type comment should be added */ protected String getTypeComment() { if (CodeGenerationPreferencePage.doCreateComments()) { return getTemplate("typecomment"); } return null; } protected String getTemplate(String name) { Template[] templates= Templates.getInstance().getTemplates();
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
for (int i= 0; i < templates.length; i++) { if (name.equals(templates[i].getName())) { return templates[i].getPattern(); } } return null; } /** * Creates the bodies of all unimplemented methods or/and all constructors * Can be used by implementors of TypePage to add method stub checkboxes */ protected String[] constructInheritedMethods(IType type, boolean doConstructors, boolean doUnimplementedMethods, IImportsStructure imports, IProgressMonitor monitor) throws CoreException { List newMethods= new ArrayList(); ITypeHierarchy hierarchy= type.newSupertypeHierarchy(monitor); CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(); if (doConstructors) { IType superclass= hierarchy.getSuperclass(type); if (superclass != null) { String[] constructors= StubUtility.evalConstructors(type, superclass, settings, imports); if (constructors != null) { for (int i= 0; i < constructors.length; i++) { newMethods.add(constructors[i]); } } } } if (doUnimplementedMethods) { String[] unimplemented= StubUtility.evalUnimplementedMethods(type, hierarchy, false, settings, null, imports);
7,966
Bug 7966 Class Creation Dialog generates syntax error
Build 20020115 If you create a class that will require import statements due to the interfaces it implements or the class it extends they will be created within the comment for the class. Here is an example of the comment of the generated class /* import org.eclipse.core.resources.IResourceChangeListener; import org.eclipse.jface.viewers.ITreeContentProvider; * (c) Copyright 2001 MyCorporation. * All Rights Reserved. */ Steps 1) Select the class creation dialog 2) Enter a class name 3) Choose an interface to have it inherit from 4) Hit OK - you will get an error from Eclipse 5) The class will be created - look at its definition
verified fixed
5071337
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:48:23Z
2002-01-21T21:53:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/TypePage.java
if (unimplemented != null) { for (int i= 0; i < unimplemented.length; i++) { newMethods.add(unimplemented[i]); } } } return (String[]) newMethods.toArray(new String[newMethods.size()]); } /** * @see NewElementWizardPage#getRunnable */ public IRunnableWithProgress getRunnable() { return new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { if (monitor == null) { monitor= new NullProgressMonitor(); } createType(monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } }; } }
7,834
Bug 7834 Methods-override dialog should present methods sorted (abc..)
Imagine a class extending JPanel. I want to override setBackgroundColor(Color c). I don't know where in the class-hierarchy the method is declared, so i've to search more or less to all entries in the tree, eye-scanning setBa.. . It's not so easy, as there are quite a few methods. So it would be nice to sort the method names in alphabeticall order, and really great would be a method searching. Could the code assist used for that?
verified fixed
66fae4e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:54:46Z
2002-01-17T15:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OverrideMethodQuery.java
package org.eclipse.jdt.internal.ui.actions; import java.util.ArrayList; import java.util.HashSet; import org.eclipse.core.runtime.IStatus; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerSorter; import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.ITypeHierarchy; import org.eclipse.jdt.ui.JavaElementLabelProvider; import org.eclipse.jdt.internal.corext.codemanipulation.IOverrideMethodQuery; import org.eclipse.jdt.internal.ui.JavaUIMessages; import org.eclipse.jdt.internal.ui.dialogs.CheckedTreeSelectionDialog; import org.eclipse.jdt.internal.ui.dialogs.ISelectionValidator; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; public class OverrideMethodQuery implements IOverrideMethodQuery { private static class OverrideMethodContentProvider implements ITreeContentProvider {
7,834
Bug 7834 Methods-override dialog should present methods sorted (abc..)
Imagine a class extending JPanel. I want to override setBackgroundColor(Color c). I don't know where in the class-hierarchy the method is declared, so i've to search more or less to all entries in the tree, eye-scanning setBa.. . It's not so easy, as there are quite a few methods. So it would be nice to sort the method names in alphabeticall order, and really great would be a method searching. Could the code assist used for that?
verified fixed
66fae4e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-01-22T16:54:46Z
2002-01-17T15:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/actions/OverrideMethodQuery.java
private Object[] fTypes; private IMethod[] fMethods; private final Object[] fEmpty= new Object[0]; /** * Constructor for OverrideMethodContentProvider. */ public OverrideMethodContentProvider(IMethod[] methods, Object[] types) { fMethods= methods; fTypes= types; } /* * @see ITreeContentProvider#getChildren(Object) */ public Object[] getChildren(Object parentElement) { if (parentElement instanceof IType) { ArrayList result= new ArrayList(fMethods.length); for (int i= 0; i < fMethods.length; i++) { if (fMethods[i].getDeclaringType().equals(parentElement)) { result.add(fMethods[i]); } } return result.toArray(); } return fEmpty; } /* * @see ITreeContentProvider#getParent(Object) */ public Object getParent(Object element) {