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
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
IJavaElement[] elements= new IJavaElement[] { root.getJavaProject() }; IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements); IType type= null; try { SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), getWizard().getContainer(), scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, null); dialog.setTitle(Messages.getString("NewTestClassWizPage.class_to_test.dialog.title")); dialog.setMessage(Messages.getString("NewTestClassWizPage.class_to_test.dialog.message")); dialog.open(); if (dialog.getReturnCode() != SelectionDialog.OK) return type; else { Object[] resultArray= dialog.getResult(); type= (IType) resultArray[0]; } } catch (JavaModelException e) { JUnitPlugin.log(e); } return type; } protected IStatus classToTestClassChanged() { fClassToTestButton.setEnabled(getPackageFragmentRoot() != null); IStatus status= validateClassToTest(); return status; } /** * Gets the content of the class to test text field. */ public String getClassToTestText() { return fClassToTestText.getText();
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
} public IType getClassToTest() { return fClassToTest; } /** * Sets the class to test name. * @param canBeModified Selects if the super class can be changed by the user */ public void setClassToTest(String name) { fClassToTestText.setText(name); } /* * @see TypePage#evalMethods */ protected void createTypeMembers(IType type, IImportsStructure imports, IProgressMonitor monitor) throws CoreException { fIndexOfFirstTestMethod= 0; createConstructor(type); if (fMethodStubsButtons.isSelected(0)) createMain(type); if (fMethodStubsButtons.isSelected(2)) { createSetUp(type, imports); } if (fMethodStubsButtons.isSelected(3)) { createTearDown(type, imports); } if (isNextPageValid()) {
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
createTestMethodStubs(type); } } protected void createConstructor(IType type) throws JavaModelException { String constr= "public "+getTypeName()+"(String name) {super(name);}\n\n"; type.createMethod(constr, null, false, null); fIndexOfFirstTestMethod++; } protected void createMain(IType type) throws JavaModelException { StringBuffer main= new StringBuffer("public static void main(String[] args) {"); if (fMethodStubsButtons.isSelected(1)) { main.append("junit."); switch (fMethodStubsButtons.getComboSelection()) { case 0: main.append("textui"); break; case 1: main.append("swingui"); break; case 2 : main.append("awtui"); break; default : main.append("textui"); break; } main.append(".TestRunner.run(" + getTypeName() + ".class);"); } main.append("}\n"); type.createMethod(main.toString(), null, false, null);
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
fIndexOfFirstTestMethod++; } protected void createSetUp(IType type, IImportsStructure imports) throws JavaModelException { ITypeHierarchy typeHierarchy= null; IType[] superTypes= null; String setUp; IMethod methodTemplate= null; if (type.exists()) { typeHierarchy= type.newSupertypeHierarchy(null); superTypes= typeHierarchy.getAllSuperclasses(type); for (int i= 0; i < superTypes.length; i++) { if (superTypes[i].exists()) { IMethod testMethod= superTypes[i].getMethod(SETUP, new String[] {}); if (testMethod.exists()) { methodTemplate= testMethod; break; } } } } if (methodTemplate != null) { CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(); GenStubSettings genStubSettings= new GenStubSettings(settings); genStubSettings.fCallSuper= true; genStubSettings.fMethodOverwrites= true; setUp= JUnitStubUtility.genStub(getTypeName(), methodTemplate, genStubSettings, imports); } else { setUp="/**\n * Sets up the fixture, for example, open a network connection.\n * This method is called before a test is executed.\n * @throws Exception\n */\n" + "protected void "+SETUP+"() throws Exception {}\n\n"; }
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
type.createMethod(setUp, null, false, null); fIndexOfFirstTestMethod++; } protected void createTearDown(IType type, IImportsStructure imports) throws JavaModelException { ITypeHierarchy typeHierarchy= null; IType[] superTypes= null; String tearDown; IMethod methodTemplate= null; if (type.exists()) { if (typeHierarchy == null) { typeHierarchy= type.newSupertypeHierarchy(null); superTypes= typeHierarchy.getAllSuperclasses(type); } for (int i= 0; i < superTypes.length; i++) { if (superTypes[i].exists()) { IMethod testM= superTypes[i].getMethod(TEARDOWN, new String[] {}); if (testM.exists()) { methodTemplate= testM; break; } } } } if (methodTemplate != null) { CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(); GenStubSettings genStubSettings= new GenStubSettings(settings); genStubSettings.fCallSuper= true; genStubSettings.fMethodOverwrites= true; tearDown= JUnitStubUtility.genStub(getTypeName(), methodTemplate, genStubSettings, imports);
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
} else { tearDown="/**\n * Tears down the fixture, for example, close a network connection.\n * This method is called after a test is executed.\n * @throws Exception\n */\n" + "protected void "+TEARDOWN+"() throws Exception {}\n\n"; } type.createMethod(tearDown, null, false, null); fIndexOfFirstTestMethod++; } protected void createTestMethodStubs(IType type) throws JavaModelException { IMethod[] methods= fPage2.getCheckedMethods(); if (methods.length > 0) { ArrayList allMethods= new ArrayList(); IMethod[] allMethodsArray= fPage2.getAllMethods(); for (int i= 0; i < allMethodsArray.length; i++) { allMethods.add(allMethodsArray[i]); } ArrayList overloadedMethods= new ArrayList(); for (int i= 0; i < allMethods.size(); i++) { IMethod current= (IMethod) allMethods.get(i); String currentName= current.getElementName(); boolean currentAdded= false; for (ListIterator iter= allMethods.listIterator(i+1); iter.hasNext(); ) { IMethod iterMethod= (IMethod) iter.next(); if (iterMethod.getElementName().equals(currentName)) { if (!currentAdded) { overloadedMethods.add(current); currentAdded= true; } overloadedMethods.add(iterMethod);
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
iter.remove(); } } } /* used when for example both sum and Sum methods are present. Then * sum -> testSum * Sum -> testSum1 */ ArrayList newMethodsNames= new ArrayList(); for (int i = 0; i < methods.length; i++) { String elementName= methods[i].getElementName(); StringBuffer methodName= new StringBuffer(NewTestCaseCreationWizardPage2.PREFIX+Character.toUpperCase(elementName.charAt(0))+elementName.substring(1)); StringBuffer newMethod= new StringBuffer(); if (overloadedMethods.contains(methods[i])) { IMethod method= methods[i]; newMethod.append("/*\n * Test for "+Signature.toString(method.getReturnType())+" "+method.getElementName()+"("); String[] paramTypes= method.getParameterTypes(); if (paramTypes.length > 0) { if (paramTypes.length > 1) { for (int j= 0; j < paramTypes.length-1; j++) { newMethod.append(Signature.toString(paramTypes[j])+", "); } } newMethod.append(Signature.toString(paramTypes[paramTypes.length-1])); } newMethod.append(")\n */\n"); String[] params= methods[i].getParameterTypes(); for (int j= 0; j < params.length; j++) {
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
String param= params[j]; int start= 0, end= param.length(); if (param.startsWith( (new Character(Signature.C_ARRAY)).toString() )) start= 1; if (param.endsWith((new Character(Signature.C_NAME_END)).toString() )) end--; if (param.startsWith((new Character(Signature.C_UNRESOLVED)).toString() ,start) || param.startsWith((new Character(Signature.C_RESOLVED)).toString() ,start)) start++; String paramName= param.substring(start, end); if (paramName.indexOf('.') != -1) { start += paramName.lastIndexOf('.')+1; } methodName.append(param.substring(start, end)); if (param.startsWith( (new Character(Signature.C_ARRAY)).toString() )) methodName.append("Array"); } } if (newMethodsNames.contains(methodName.toString())) methodName.append("1"); newMethodsNames.add(new String(methodName)); newMethod.append("public void "+methodName.toString()+"() {}\n\n"); type.createMethod(newMethod.toString(), null, false, null); }
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
} } protected static GridData gridDataForDefaultForTypeName(int span) { GridData gd= new GridData(); gd.horizontalSpan= span; return gd; } public static Control createEmptySpace(Composite parent, int span) { Label label= new Label(parent, SWT.LEFT); GridData gd= new GridData(); gd.horizontalAlignment= gd.BEGINNING; gd.grabExcessHorizontalSpace= false; gd.horizontalSpan= span; gd.horizontalIndent= 0; gd.widthHint= 0; gd.heightHint= 0; label.setLayoutData(gd); return label; } public void setVisible(boolean visible) { super.setVisible(visible); if (visible && fFirstTime) { handleFieldChanged(CLASS_TO_TEST); if (getClassToTestText().equals("")) setPageComplete(false); fFirstTime= false; } } public int getIndexOfFirstMethod() {
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
return fIndexOfFirstTestMethod; } /** * Creates a type using the current field values. */ public void createType(IProgressMonitor monitor) throws CoreException, InterruptedException { super.createType(monitor); if (fPage2.getCreateTasksButtonSelection()) { createTaskMarkers(); } } private void createTaskMarkers() throws CoreException { IType createdType= getCreatedType(); fTestMethods= createdType.getMethods(); ICompilationUnit cu= createdType.getCompilationUnit(); cu.save(null, false); IResource res= createdType.getCompilationUnit().getUnderlyingResource(); for (int i= getIndexOfFirstMethod(); i < fTestMethods.length; i++) { IMethod method= fTestMethods[i]; IMarker marker= res.createMarker("org.eclipse.jdt.junit.junit_task"); HashMap attributes= new HashMap(10); attributes.put(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_NORMAL)); attributes.put(IMarker.MESSAGE, Messages.getFormattedString("NewTestClassWizPage.marker.message",method.getElementName())); ISourceRange markerRange= method.getSourceRange(); attributes.put(IMarker.CHAR_START, new Integer(markerRange.getOffset())); attributes.put(IMarker.CHAR_END, new Integer(markerRange.getOffset()+markerRange.getLength())); marker.setAttributes(attributes); } }
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
private void validateSuperClass() { fMethodStubsButtons.setEnabled(2, true); fMethodStubsButtons.setEnabled(3, true); String superClassName= getSuperClass(); if (superClassName != null && !superClassName.equals("") && getPackageFragmentRoot() != null) { try { IType type= NewTestCaseCreationWizardPage.resolveClassNameToType(getPackageFragmentRoot().getJavaProject(), getPackageFragment(), superClassName); JUnitStatus status = new JUnitStatus(); if (type == null) { status.setError(Messages.getString("NewTestClassWizPage.error.superclass.not_exist")); fSuperClassStatus= status; } else { if (type.isInterface()) { status.setError(Messages.getString("NewTestClassWizPage.error.superclass.is_interface")); fSuperClassStatus= status; } if (!TestSearchEngine.isTestImplementor(type)) { status.setError(Messages.getFormattedString("NewTestClassWizPage.error.superclass.not_implementing_test_interface", JUnitPlugin.TEST_INTERFACE_NAME)); fSuperClassStatus= status; } else { IMethod setupMethod= type.getMethod(SETUP, new String[] {}); IMethod teardownMethod= type.getMethod(TEARDOWN, new String[] {}); if (setupMethod.exists()) fMethodStubsButtons.setEnabled(2, !Flags.isFinal(setupMethod.getFlags())); if (teardownMethod.exists()) fMethodStubsButtons.setEnabled(3, !Flags.isFinal(teardownMethod.getFlags())); } } } catch (JavaModelException e) { JUnitPlugin.log(e);
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
} } } protected void createTestClassControls(Composite composite, int nColumns) { fTestClassLabel= new Label(composite, SWT.LEFT | SWT.WRAP); fTestClassLabel.setFont(composite.getFont()); fTestClassLabel.setText(Messages.getString("NewTestClassWizPage.testcase.label")); GridData gd= new GridData(); gd.horizontalSpan= 1; fTestClassLabel.setLayoutData(gd); fTestClassText= new Text(composite, SWT.SINGLE | SWT.BORDER); fTestClassText.setEnabled(true); fTestClassText.setFont(composite.getFont()); fTestClassText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { handleFieldChanged(TEST_CLASS); } }); gd= new GridData(); gd.horizontalAlignment= gd.FILL; gd.grabExcessHorizontalSpace= true; gd.horizontalSpan= nColumns - 2; fTestClassText.setLayoutData(gd); Label space= new Label(composite, SWT.LEFT); space.setText(" "); gd= new GridData(); gd.horizontalSpan= 1; space.setLayoutData(gd);
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
} /** * Gets the type name. */ public String getTypeName() { return (fTestClassText==null)?fTestClassTextInitialValue:fTestClassText.getText(); } /** * Sets the type name. */ public void setTypeName(String name, boolean canBeModified) { if (fTestClassText == null) { fTestClassTextInitialValue= name; } else { fTestClassText.setText(name); fTestClassText.setEnabled(canBeModified); } } /** * 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 testClassChanged() { JUnitStatus status= new JUnitStatus(); String typeName= getTypeName(); if (typeName.length() == 0) {
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
status.setError(Messages.getString("NewTestClassWizPage.error.testcase.name_empty")); return status; } if (typeName.indexOf('.') != -1) { status.setError(Messages.getString("NewTestClassWizPage.error.testcase.name_qualified")); return status; } IStatus val= JavaConventions.validateJavaTypeName(typeName); if (val.getSeverity() == IStatus.ERROR) { status.setError(Messages.getString("NewTestClassWizPage.error.testcase.name_not_valid")+val.getMessage()); return status; } else if (val.getSeverity() == IStatus.WARNING) { status.setWarning(Messages.getString("NewTestClassWizPage.error.testcase.name_discouraged")+val.getMessage()); } IPackageFragment pack= getPackageFragment(); if (pack != null) { ICompilationUnit cu= pack.getCompilationUnit(typeName + ".java"); if (cu.exists()) { status.setError(Messages.getString("NewTestClassWizPage.error.testcase.already_exists")); return status; } } return status; } /** * @see WizardPage#getNextPage */ public boolean canFlipToNextPage() {
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
return isPageComplete() && getNextPage() != null && isNextPageValid(); } protected boolean isNextPageValid() { return !getClassToTestText().equals(""); } protected JUnitStatus validateClassToTest() { IPackageFragmentRoot root= getPackageFragmentRoot(); IPackageFragment pack= getPackageFragment(); String classToTestName= fClassToTestText.getText(); JUnitStatus status= new JUnitStatus(); fClassToTest= null; if (classToTestName.length() == 0) { return status; } IStatus val= JavaConventions.validateJavaTypeName(classToTestName); if (!val.isOK()) { status.setError(Messages.getString("NewTestClassWizPage.error.class_to_test.not_valid")); return status; } if (root != null) { try { IType type= NewTestCaseCreationWizardPage.resolveClassNameToType(root.getJavaProject(), pack, classToTestName); if (type == null) { status.setError(Messages.getString("NewTestClassWizPage.error.class_to_test.not_exist")); return status; } else {
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (type.isInterface()) { status.setWarning(Messages.getFormattedString("NewTestClassWizPage.warning.class_to_test.is_interface",classToTestName)); } if (pack != null && !JavaModelUtil.isVisible(type, pack)) { status.setWarning(Messages.getFormattedString("NewTestClassWizPage.warning.class_to_test.interface_not_visible",classToTestName)); } } fClassToTest= type; } catch (JavaModelException e) { status.setError(Messages.getString("NewTestClassWizPage.error.class_to_test.not_valid")); } } else { status.setError(""); } return status; } static public IType resolveClassNameToType(IJavaProject jproject, IPackageFragment pack, String classToTestName) throws JavaModelException { IType type= null; if (type == null && pack != null) { String packName= pack.getElementName(); if (!pack.isDefaultPackage()) { type= JavaModelUtil.findType(jproject, packName, classToTestName); } if (type == null && !"java.lang".equals(packName)) { type= JavaModelUtil.findType(jproject, "java.lang", classToTestName); } }
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (type == null) { type= JavaModelUtil.findType(jproject, classToTestName); } return type; } /** * Finds the most severe status from a array of stati. * An error is more severe than a warning, and a warning is more severe * than ok. */ public static IStatus getMostSevere(IStatus[] status) { IStatus max= null; for (int i= 0; i < status.length; i++) { IStatus curr= status[i]; if (curr.matches(IStatus.ERROR)) { return curr; } if (max == null || curr.getSeverity() > max.getSeverity()) { max= curr; } } return max; } /** * Sets the focus on the type name. */ protected void setFocus() { fTestClassText.setFocus(); }
12,195
Bug 12195 TestCase creation wizard: no progress when pressing super button
There is no progress shown in the wizard when pressing the browse button for selecting the super class. This is not consistent with the New Class wizard.
resolved fixed
1fdab7d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T08:11:30Z
2002-03-24T22:46:40Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
/** * Use the dialog store to restore widget values to the values that they held * last time this wizard was used to completion */ private void restoreWidgetValues() { IDialogSettings settings= getDialogSettings(); if (settings != null) { boolean generateMain= settings.getBoolean(STORE_GENERATE_MAIN); fMethodStubsButtons.setSelection(0, generateMain); fMethodStubsButtons.setEnabled(1, generateMain); fMethodStubsButtons.setSelection(1,settings.getBoolean(STORE_USE_TESTRUNNER)); try { fMethodStubsButtons.setComboSelection(settings.getInt(STORE_TESTRUNNER_TYPE)); } catch(NumberFormatException e) {} } } /** * Since Finish was pressed, write widget values to the dialog store so that they * will persist into the next invocation of this wizard page */ void saveWidgetValues() { IDialogSettings settings= getDialogSettings(); if (settings != null) { settings.put(STORE_GENERATE_MAIN, fMethodStubsButtons.isSelected(0)); settings.put(STORE_USE_TESTRUNNER, fMethodStubsButtons.isSelected(1)); settings.put(STORE_TESTRUNNER_TYPE, fMethodStubsButtons.getComboSelection()); } } }
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.jarpackager; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import java.util.jar.Manifest; import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IncrementalProjectBuilder;
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubProgressMonitor; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.ModalContext; import org.eclipse.jface.util.Assert; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IFileEditorInput; import org.xml.sax.SAXException; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaStatusConstants; import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; /** * Operation for exporting a resource and its children to a new JAR file. */ public class JarFileExportOperation implements IRunnableWithProgress { private JarWriter fJarWriter;
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
private JarPackage fJarPackage; private IFile[] fDescriptionFiles; private Shell fParentShell; private Map fJavaNameToClassFilesMap; private IContainer fClassFilesMapContainer; private MultiStatus fProblems; /** * Creates an instance of this class. * * @param jarPackage the JAR package specification * @param parent the parent for the dialog, * or <code>null</code> if no dialog should be presented */ public JarFileExportOperation(JarPackage jarPackage, Shell parent) { this(parent); fJarPackage= jarPackage; } /** * Creates an instance of this class. * * @param descriptions an array with JAR package descriptions * @param parent the parent for the dialog, * or <code>null</code> if no dialog should be presented */ public JarFileExportOperation(IFile[] descriptions, Shell parent) { this(parent); fDescriptionFiles= descriptions; } /**
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
* Adds a new warning to the list with the passed information. * Normally the export operation continues after a warning. * @param message the message * @param exception the throwable that caused the warning, or <code>null</code> */ private JarFileExportOperation(Shell parent) { fParentShell= parent; fProblems= new MultiStatus(JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, JarPackagerMessages.getString("JarFileExportOperation.exportFinishedWithWarnings"), null); } protected void addWarning(String message, Throwable error) { if (fJarPackage == null || fJarPackage.logWarnings()) fProblems.add(new Status(IStatus.WARNING, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, message, error)); } /** * Adds a new error to the list with the passed information. * Normally an error terminates the export operation. * @param message the message * @param exception the throwable that caused the error, or <code>null</code> */ protected void addError(String message, Throwable error) { if (fJarPackage == null || fJarPackage.logErrors()) fProblems.add(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, message, error)); } /** * Answers the number of file resources specified by the JAR package. * * @return int */ protected int countSelectedElements() { int count= 0;
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
Iterator iter= fJarPackage.getSelectedElements().iterator(); while (iter.hasNext()) { Object element= iter.next(); IResource resource= null; if (element instanceof IJavaElement) { IJavaElement je= (IJavaElement)element; try { resource= je.getUnderlyingResource(); } catch (JavaModelException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.underlyingResourceNotFound", je.getElementName()), ex); return count; } } else resource= (IResource)element; if (resource.getType() == IResource.FILE) count++; else count += getTotalChildCount((IContainer)resource); } return count; } private int getTotalChildCount(IContainer container) { IResource[] members; try { members= container.members(); } catch (CoreException ex) { return 0; }
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
int count= 0; for (int i= 0; i < members.length; i++) { if (members[i].getType() == IResource.FILE) count++; else count += getTotalChildCount((IContainer)members[i]); } return count; } /** * Exports the passed resource to the JAR file * * @param element the resource or JavaElement to export */ protected void exportElement(Object element, IProgressMonitor progressMonitor) throws InterruptedException { int leadSegmentsToRemove= 1; IPackageFragmentRoot pkgRoot= null; boolean isInJavaProject= false; IResource resource= null; IJavaProject jProject= null; if (element instanceof IJavaElement) { isInJavaProject= true; IJavaElement je= (IJavaElement)element; try { resource= je.getUnderlyingResource(); } catch (JavaModelException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.underlyingResourceNotFound", je.getElementName()), ex); return; } jProject= je.getJavaProject();
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
pkgRoot= JavaModelUtil.getPackageFragmentRoot(je); } else resource= (IResource)element; if (!resource.isAccessible()) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.resourceNotFound", resource.getFullPath()), null); return; } if (resource.getType() == IResource.FILE) { if (!resource.isLocal(IResource.DEPTH_ZERO)) try { resource.setLocal(true , IResource.DEPTH_ZERO, progressMonitor); } catch (CoreException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.resourceNotLocal", resource.getFullPath()), ex); return; } if (!isInJavaProject) { try { isInJavaProject= resource.getProject().hasNature(JavaCore.NATURE_ID); } catch (CoreException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.projectNatureNotDeterminable", resource.getFullPath()), ex); return; } if (isInJavaProject) { jProject= JavaCore.create(resource.getProject()); try { IPackageFragment pkgFragment= jProject.findPackageFragment(resource.getFullPath().removeLastSegments(1)); if (pkgFragment != null) pkgRoot= JavaModelUtil.getPackageFragmentRoot(pkgFragment);
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
else pkgRoot= jProject.findPackageFragmentRoot(resource.getFullPath().removeLastSegments(1)); } catch (JavaModelException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.javaPackageNotDeterminable", resource.getFullPath()), ex); return; } } } if (pkgRoot != null) { leadSegmentsToRemove= pkgRoot.getPath().segmentCount(); if (fJarPackage.useSourceFolderHierarchy()&& !pkgRoot.getElementName().equals(pkgRoot.DEFAULT_PACKAGEROOT_PATH)) leadSegmentsToRemove--; } IPath destinationPath= resource.getFullPath().removeFirstSegments(leadSegmentsToRemove); boolean isInOutputFolder= false; if (isInJavaProject) { try { isInOutputFolder= jProject.getOutputLocation().isPrefixOf(resource.getFullPath()); } catch (JavaModelException ex) { isInOutputFolder= false; } } exportClassFiles(progressMonitor, pkgRoot, resource, jProject, destinationPath); exportResource(progressMonitor, pkgRoot, isInJavaProject, resource, destinationPath, isInOutputFolder); progressMonitor.worked(1); ModalContext.checkCanceled(progressMonitor);
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} else if (element instanceof IPackageFragment) exportPackageFragment(progressMonitor, (IPackageFragment)element); else exportContainer(progressMonitor, resource); } private void exportPackageFragment(IProgressMonitor progressMonitor, IPackageFragment pkgFragment) throws java.lang.InterruptedException { Object[] children; try { children= pkgFragment.getChildren(); for (int i= 0; i < children.length; i++) exportElement(children[i], progressMonitor); children= pkgFragment.getNonJavaResources(); for (int i= 0; i < children.length; i++) exportElement(children[i], progressMonitor); } catch (CoreException e) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringExport", pkgFragment.toString()), e); } } private void exportContainer(IProgressMonitor progressMonitor, IResource resource) throws java.lang.InterruptedException { IResource[] children= null; try { children= ((IContainer) resource).members(); } catch (CoreException e) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringExport", resource.getFullPath()), e); } for (int i= 0; i < children.length; i++) exportElement(children[i], progressMonitor); }
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
private void exportResource(IProgressMonitor progressMonitor, IPackageFragmentRoot pkgRoot, boolean isInJavaProject, IResource resource, IPath destinationPath, boolean isInOutputFolder) { boolean isNonJavaResource= !isInJavaProject || pkgRoot == null; boolean isInClassFolder= false; try { isInClassFolder= pkgRoot != null && !pkgRoot.isArchive() && pkgRoot.getKind() == pkgRoot.K_BINARY; } catch (JavaModelException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.cantGetRootKind", resource.getFullPath()), ex); } if ((fJarPackage.areClassFilesExported() && ((isNonJavaResource || (pkgRoot != null && !isJavaFile(resource) && !isClassFile(resource))) || isInClassFolder && isClassFile(resource))) || (fJarPackage.areJavaFilesExported() && (isNonJavaResource || (pkgRoot != null && !isClassFile(resource))))) { try { progressMonitor.subTask(JarPackagerMessages.getFormattedString("JarFileExportOperation.exporting", destinationPath.toString())); fJarWriter.write((IFile) resource, destinationPath); } catch (IOException ex) { String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringExport", resource.getFullPath()); addWarning(message , ex); } catch (CoreException ex) { String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.coreErrorDuringExport", resource.getFullPath()); addWarning(message, ex); } } } private void exportClassFiles(IProgressMonitor progressMonitor, IPackageFragmentRoot pkgRoot, IResource resource, IJavaProject jProject, IPath destinationPath) { if (fJarPackage.areClassFilesExported() && isJavaFile(resource) && pkgRoot != null) {
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
try { Iterator iter= filesOnClasspath((IFile)resource, destinationPath, jProject, progressMonitor); IPath baseDestinationPath= destinationPath.removeLastSegments(1); while (iter.hasNext()) { IFile file= (IFile)iter.next(); if (!resource.isLocal(IResource.DEPTH_ZERO)) file.setLocal(true , IResource.DEPTH_ZERO, progressMonitor); IPath classFilePath= baseDestinationPath.append(file.getName()); progressMonitor.subTask(JarPackagerMessages.getFormattedString("JarFileExportOperation.exporting", classFilePath.toString())); fJarWriter.write(file, classFilePath); } } catch (IOException ex) { String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringExport", resource.getFullPath()); addWarning(message , ex); } catch (CoreException ex) { String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.coreErrorDuringExport", resource.getFullPath()); addWarning(message, ex); } } } /** * Exports the resources as specified by the JAR package. */ protected void exportSelectedElements(IProgressMonitor progressMonitor) throws InterruptedException { Iterator iter= fJarPackage.getSelectedElements().iterator();
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
while (iter.hasNext()) exportElement(iter.next(), progressMonitor); } /** * Returns an iterator on a list with files that correspond to the * passed file and that are on the classpath of its project. * * @param file the file for which to find the corresponding classpath resources * @param pathInJar the path that the file has in the JAR (i.e. project and source folder segments removed) * @param javaProject the javaProject that contains the file * @return the iterator over the corresponding classpath files for the given file */ protected Iterator filesOnClasspath(IFile file, IPath pathInJar, IJavaProject javaProject, IProgressMonitor progressMonitor) throws CoreException { IPath outputPath= javaProject.getOutputLocation(); IContainer outputContainer; if (javaProject.getProject().getFullPath().equals(outputPath)) outputContainer= javaProject.getProject(); else { outputContainer= createFolderHandle(outputPath); if (outputContainer == null || !outputContainer.isAccessible()) { String msg= JarPackagerMessages.getString("JarFileExportOperation.outputContainerNotAccessible"); throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null)); } } if (isJavaFile(file)) { boolean hasErrors= fJarPackage.hasCompileErrors(file); boolean hasWarnings= fJarPackage.hasCompileWarnings(file); boolean canBeExported= canBeExported(hasErrors, hasWarnings); if (!canBeExported)
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
return Collections.EMPTY_LIST.iterator(); reportPossibleCompileProblems(file, hasErrors, hasWarnings, canBeExported); IContainer classContainer= outputContainer; if (pathInJar.segmentCount() > 1) classContainer= outputContainer.getFolder(pathInJar.removeLastSegments(1)); if (fClassFilesMapContainer == null || !fClassFilesMapContainer.equals(classContainer)) { fJavaNameToClassFilesMap= buildJavaToClassMap(classContainer); fClassFilesMapContainer= classContainer; } ArrayList classFiles= (ArrayList)fJavaNameToClassFilesMap.get(file.getName()); if (classFiles == null || classFiles.isEmpty()) { String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.classFileOnClasspathNotAccessible", file.getFullPath()); throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null)); } return classFiles.iterator(); } else { List binaryFiles= new ArrayList(1); IFile cpFile= outputContainer.getFile(pathInJar); if (cpFile.isAccessible()) { if (!cpFile.isLocal(IResource.DEPTH_ZERO)) cpFile.setLocal(true , IResource.DEPTH_ZERO, progressMonitor); binaryFiles.add(cpFile); } else { String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.resourceOnCasspathNotAccessible", cpFile.getFullPath()); throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null)); } return binaryFiles.iterator();
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} } /** * Answers whether the given resource is a Java file. * The resource must be a file whose file name ends with ".java". * * @return a <code>true<code> if the given resource is a Java file */ boolean isJavaFile(IResource file) { return file != null && file.getType() == IFile.FILE && file.getFileExtension() != null && file.getFileExtension().equalsIgnoreCase("java"); } /** * Answers whether the given resource is a class file. * The resource must be a file whose file name ends with ".class". * * @return a <code>true<code> if the given resource is a class file */ boolean isClassFile(IResource file) { return file != null && file.getType() == IFile.FILE && file.getFileExtension() != null && file.getFileExtension().equalsIgnoreCase("class"); } /* * Builds and returns a map that has the class files * for each java file in a given directory */
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
private Map buildJavaToClassMap(IContainer container) throws CoreException { if (container == null || !container.isAccessible()) return new HashMap(0); /* * XXX: Bug 6584: Need a way to get class files for a java file (or CU) */ org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader cfReader; IResource[] members= container.members(); Map map= new HashMap(members.length); for (int i= 0; i < members.length; i++) { if (isClassFile(members[i])) { IFile classFile= (IFile)members[i]; try { cfReader= org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.read(classFile.getLocation().toFile()); } catch (org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.invalidClassFileFormat", classFile.getLocation().toFile()), ex); continue; } catch (IOException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringClassFileLookup", classFile.getLocation().toFile()), ex); continue; } if (cfReader != null) { if (cfReader.sourceFileName() == null) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.classFileWithoutSourceFileAttribute", classFile.getLocation().toFile()), null); continue; } String javaName= new String(cfReader.sourceFileName()); Object classFiles= map.get(javaName); if (classFiles == null) { classFiles= new ArrayList(3);
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
map.put(javaName, classFiles); } ((ArrayList)classFiles).add(classFile); } } } return map; } /** * Creates a file resource handle for the file with the given workspace path. * This method does not create the file resource; this is the responsibility * of <code>createFile</code>. * * @param filePath the path of the file resource to create a handle for * @return the new file resource handle * @see #createFile */ protected IFile createFileHandle(IPath filePath) { if (filePath.isValidPath(filePath.toString()) && filePath.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFile(filePath); else return null; } /** * Creates a folder resource handle for the folder with the given workspace path. * * @param folderPath the path of the folder to create a handle for * @return the new folder resource handle */ protected IFolder createFolderHandle(IPath folderPath) {
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
if (folderPath.isValidPath(folderPath.toString()) && folderPath.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFolder(folderPath); else return null; } /** * Returns the status of this operation. * If there were any errors, the result is a status object containing * individual status objects for each error. * If there were no errors, the result is a status object with error code <code>OK</code>. * * @return the status of this operation */ public IStatus getStatus() { if (fProblems.getSeverity() == IStatus.ERROR) { String message= null; if (fDescriptionFiles != null && fDescriptionFiles.length > 1) message= JarPackagerMessages.getString("JarFileExportOperation.creationOfSomeJARsFailed"); else message= JarPackagerMessages.getString("JarFileExportOperation.jarCreationFailed"); return new MultiStatus(JavaPlugin.getPluginId(), 0, fProblems.getChildren(), message, null); } return fProblems; } /** * Answer a boolean indicating whether the passed child is a descendant * of one or more members of the passed resources collection * * @param resources a List contain potential parents
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
* @param child the resource to test * @return a <code>boolean</code> indicating if the child is a descendant */ protected boolean isDescendant(List resources, IResource child) { if (child.getType() == IResource.PROJECT) return false; IResource parent= child.getParent(); if (resources.contains(parent)) return true; return isDescendant(resources, parent); } protected boolean canBeExported(boolean hasErrors, boolean hasWarnings) throws CoreException { return (!hasErrors && !hasWarnings) || (hasErrors && fJarPackage.exportErrors()) || (hasWarnings && fJarPackage.exportWarnings()); } protected void reportPossibleCompileProblems(IFile file, boolean hasErrors, boolean hasWarnings, boolean canBeExported) { if (hasErrors) { if (canBeExported) addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.exportedWithCompileErrors", file.getFullPath()), null); else addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.notExportedDueToCompileErrors", file.getFullPath()), null); } if (hasWarnings) { if (canBeExported) addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.exportedWithCompileWarnings", file.getFullPath()), null); else addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.notExportedDueToCompileWarnings", file.getFullPath()), null); } }
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
/** * Exports the resources as specified by the JAR package. * * @param progressMonitor the progress monitor that displays the progress * @see #getStatus() */ public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException { if (fJarPackage != null) singleRun(progressMonitor); else { int jarCount= fDescriptionFiles.length; progressMonitor.beginTask("", jarCount); try { for (int i= 0; i < jarCount; i++) { SubProgressMonitor subProgressMonitor= new SubProgressMonitor(progressMonitor, 1); fJarPackage= readJarPackage(fDescriptionFiles[i]); if (fJarPackage != null) singleRun(subProgressMonitor); } } finally { progressMonitor.done(); } } } public void singleRun(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException { try { if (!preconditionsOK()) throw new InvocationTargetException(null, JarPackagerMessages.getString("JarFileExportOperation.jarCreationFailedSeeDetails")); int totalWork= countSelectedElements(); if (!isAutoBuilding() && fJarPackage.isBuildingIfNeeded()) {
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
int subMonitorTicks= totalWork/10; totalWork += subMonitorTicks; progressMonitor.beginTask("", totalWork); SubProgressMonitor subProgressMonitor= new SubProgressMonitor(progressMonitor, subMonitorTicks, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK); buildProjects(subProgressMonitor); } else progressMonitor.beginTask("", totalWork); fJarWriter= new JarWriter(fJarPackage, fParentShell); exportSelectedElements(progressMonitor); if (getStatus().getSeverity() != IStatus.ERROR) { progressMonitor.subTask(JarPackagerMessages.getString("JarFileExportOperation.savingFiles")); saveFiles(); } } catch (IOException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCreateJarFle", ex.getMessage()); addError(message, ex); throw new InvocationTargetException(ex, message); } catch (CoreException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCreateJarFileDueToInvalidManifest", ex.getMessage()); addError(message, ex); throw new InvocationTargetException(ex, message); } finally { try { if (fJarWriter != null) fJarWriter.close(); } catch (IOException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCloseJarFile", ex.getMessage()); addError(message, ex); throw new InvocationTargetException(ex, message);
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} progressMonitor.done(); } } protected boolean preconditionsOK() { if (!fJarPackage.areClassFilesExported() && !fJarPackage.areJavaFilesExported()) { addError(JarPackagerMessages.getString("JarFileExportOperation.noExportTypeChosen"), null); return false; } if (fJarPackage.getSelectedElements() == null || fJarPackage.getSelectedElements().size() == 0) { addError(JarPackagerMessages.getString("JarFileExportOperation.noResourcesSelected"), null); return false; } if (fJarPackage.getJarLocation() == null) { addError(JarPackagerMessages.getString("JarFileExportOperation.invalidJarLocation"), null); return false; } if (!fJarPackage.doesManifestExist()) { addError(JarPackagerMessages.getString("JarFileExportOperation.manifestDoesNotExist"), null); return false; } if (!fJarPackage.isMainClassValid(new BusyIndicatorRunnableContext())) { addError(JarPackagerMessages.getString("JarFileExportOperation.invalidMainClass"), null); return false; } IEditorPart[] dirtyEditors= JavaPlugin.getDirtyEditors(); if (dirtyEditors.length > 0) { List unsavedFiles= new ArrayList(dirtyEditors.length); List selection= fJarPackage.getSelectedResources();
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
for (int i= 0; i < dirtyEditors.length; i++) { if (dirtyEditors[i].getEditorInput() instanceof IFileEditorInput) { IFile dirtyFile= ((IFileEditorInput)dirtyEditors[i].getEditorInput()).getFile(); if (selection.contains(dirtyFile)) { unsavedFiles.add(dirtyFile); addError(JarPackagerMessages.getFormattedString("JarFileExportOperation.fileUnsaved", dirtyFile.getFullPath()), null); } } } if (!unsavedFiles.isEmpty()) return false; } return true; } protected void saveFiles() { if (fJarPackage.isManifestSaved()) { try { saveManifest(); } catch (CoreException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingManifest"), ex); } catch (IOException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingManifest"), ex); } } if (fJarPackage.isDescriptionSaved()) { try { saveDescription();
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} catch (CoreException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingDescription"), ex); } catch (IOException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingDescription"), ex); } } } protected void saveDescription() throws CoreException, IOException { if (fJarPackage.isManifestReused()) fJarPackage.setGenerateManifest(false); ByteArrayOutputStream objectStreamOutput= new ByteArrayOutputStream(); JarPackageWriter objectStream= new JarPackageWriter(objectStreamOutput); ByteArrayInputStream fileInput= null; try { objectStream.writeXML(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); if (fJarPackage.getDescriptionFile().isAccessible()) { if (fJarPackage.canOverwriteDescription(fParentShell)) fJarPackage.getDescriptionFile().setContents(fileInput, true, true, null); } else { fJarPackage.getDescriptionFile().create(fileInput, true, null); } } finally { if (fileInput != null) fileInput.close(); if (objectStream != null) objectStream.close(); }
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} protected void saveManifest() throws CoreException, IOException { ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream(); ByteArrayInputStream fileInput= null; try { Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage); manifest.write(manifestOutput); fileInput= new ByteArrayInputStream(manifestOutput.toByteArray()); if (fJarPackage.getManifestFile().isAccessible()) { if (fJarPackage.canOverwriteManifest(fParentShell)) fJarPackage.getManifestFile().setContents(fileInput, true, true, null); } else { fJarPackage.getManifestFile().create(fileInput, true, null); } } finally { if (manifestOutput != null) manifestOutput.close(); if (fileInput != null) fileInput.close(); } } /** * Reads the JAR package spec from file. */ protected JarPackage readJarPackage(IFile description) { Assert.isLegal(description.isAccessible()); Assert.isNotNull(description.getFileExtension()); Assert.isLegal(description.getFileExtension().equals(JarPackage.DESCRIPTION_EXTENSION)); JarPackage jarPackage= null;
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
JarPackageReader reader= null; try { reader= new JarPackageReader(description.getContents()); jarPackage= reader.readXML(); jarPackage.setSaveManifest(false); jarPackage.setSaveDescription(false); } catch (CoreException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorReadingJarPackageFromDescription"), ex); } catch (IOException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.errorReadingFile", description.getFullPath(), ex.getMessage()); addError(message, null); } catch (SAXException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.badXmlFormat", description.getFullPath(), ex.getMessage()); addError(message, null); } finally { if ((jarPackage == null || jarPackage.logWarnings()) && reader != null) fProblems.addAll(reader.getWarnings()); try { if (reader != null) reader.close(); } catch (IOException ex) { addError(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorClosingJarPackageDescriptionReader", description.getFullPath()), ex); } } return jarPackage; }
6,125
Bug 6125 JAR packager reports open files very late
1. edit in a file, don't save 2. open the JAR packager on it's project 3. enter all path, destination, name of jar packager description, etc 4. press finish: 'JAR creation failed: Unsaved Editors' 5. To save, I have to quit the wizard, save, open the wizard again and then enter all fields again - I should be allowed to create a JAR with unsaved editors - If not, there should be a dialog to allow saving
resolved fixed
715af9d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T15:17:40Z
2001-11-20T18:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
private boolean isAutoBuilding() { return ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding(); } private void buildProjects(IProgressMonitor progressMonitor) { Set builtProjects= new HashSet(10); Iterator iter= fJarPackage.getSelectedElementsClosure(); while (iter.hasNext()) { IProject project= null; Object element= iter.next(); if (element instanceof IResource) project= ((IResource)element).getProject(); else if (element instanceof IJavaElement) project= ((IJavaElement)element).getJavaProject().getProject(); if (project != null && !builtProjects.contains(project)) { try { project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, progressMonitor); } catch (CoreException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringProjectBuild", project.getFullPath()); addError(message, ex); } finally { builtProjects.add(project); } } } } }
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
package org.eclipse.jdt.junit.wizards; import java.awt.Stroke; import java.util.ArrayList; import java.util.HashMap; import java.util.ListIterator; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.jdt.core.Flags; import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IMethod; 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.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.codemanipulation.IImportsStructure; import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
import org.eclipse.jdt.internal.junit.ui.JUnitPlugin; import org.eclipse.jdt.internal.junit.util.JUnitStatus; import org.eclipse.jdt.internal.junit.util.JUnitStubUtility; import org.eclipse.jdt.internal.junit.util.LayoutUtil; import org.eclipse.jdt.internal.junit.util.TestSearchEngine; import org.eclipse.jdt.internal.junit.util.JUnitStubUtility.GenStubSettings; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import org.eclipse.jdt.internal.ui.util.SWTUtil; import org.eclipse.jdt.ui.IJavaElementSearchConstants; import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.ui.wizards.NewTypeWizardPage; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.dialogs.SelectionDialog; /** * The first page of the TestCase creation wizard. */ public class NewTestCaseCreationWizardPage extends NewTypeWizardPage {
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
protected final static String PAGE_NAME= "NewTestCaseCreationWizardPage"; protected final static String CLASS_TO_TEST= PAGE_NAME + ".classtotest"; protected final static String TEST_CLASS= PAGE_NAME + ".testclass"; protected final static String TEST_SUFFIX= "Test"; protected final static String SETUP= "setUp"; protected final static String TEARDOWN= "tearDown"; protected final static String STORE_GENERATE_MAIN= PAGE_NAME + ".GENERATE_MAIN"; protected final static String STORE_USE_TESTRUNNER= PAGE_NAME + ".USE_TESTRUNNER"; protected final static String STORE_TESTRUNNER_TYPE= PAGE_NAME + ".TESTRUNNER_TYPE"; private String fDefaultClassToTest; private NewTestCaseCreationWizardPage2 fPage2; private SelectionButtonGroup fMethodStubsButtons; private IType fClassToTest; protected IStatus fClassToTestStatus; protected IStatus fTestClassStatus; private int fIndexOfFirstTestMethod; private Label fClassToTestLabel; private Text fClassToTestText; private Button fClassToTestButton; private Label fTestClassLabel; private Text fTestClassText;
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
private String fTestClassTextInitialValue; private IMethod[] fTestMethods; private IType fCreatedType; private boolean fFirstTime; public NewTestCaseCreationWizardPage() { super(true, PAGE_NAME); fFirstTime= true; fTestClassTextInitialValue= ""; setTitle(Messages.getString("NewTestClassWizPage.title")); setDescription(Messages.getString("NewTestClassWizPage.description")); String[] buttonNames= new String[] { "public static void main(Strin&g[] args)", Messages.getString("NewTestClassWizPage.methodStub.testRunner"), Messages.getString("NewTestClassWizPage.methodStub.setUp"), Messages.getString("NewTestClassWizPage.methodStub.tearDown") }; fMethodStubsButtons= new SelectionButtonGroup(SWT.CHECK, buttonNames, 1); fMethodStubsButtons.setLabelText(Messages.getString("NewTestClassWizPage.method.Stub.label")); fMethodStubsButtons.setSelectionGroupListener(new SelectionButtonGroup.SelectionButtonGroupListener() { public void groupChanged(SelectionButtonGroup field) { field.setEnabled(1, field.isSelected(0)); } }); fClassToTestStatus= new JUnitStatus(); fTestClassStatus= new JUnitStatus();
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
fDefaultClassToTest= ""; } /** * Should be called from the wizard with the input element. */ public void init(IStructuredSelection selection, NewTestCaseCreationWizardPage2 page2) { fPage2= page2; IJavaElement element= getInitialJavaElement(selection); initContainerPage(element); initTypePage(element); doStatusUpdate(); if (element != null) { IType classToTest= null; IPackageFragment pack= (IPackageFragment) JavaModelUtil.findElementOfKind(element, IJavaElement.PACKAGE_FRAGMENT); IType typeInCompUnit= (IType) JavaModelUtil.findElementOfKind(element, IJavaElement.TYPE); if (typeInCompUnit != null) { if (typeInCompUnit.getCompilationUnit() != null) { classToTest= typeInCompUnit; } } else { ICompilationUnit cu= (ICompilationUnit) JavaModelUtil.findElementOfKind(element, IJavaElement.COMPILATION_UNIT); if (cu != null) classToTest= JavaModelUtil.findPrimaryType(cu); else { if (element instanceof IClassFile) { try { IClassFile cf= (IClassFile) element;
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (cf.isStructureKnown()) classToTest= cf.getType(); } catch(JavaModelException e) { JUnitPlugin.log(e); } } } } if (classToTest != null) { try { if (!TestSearchEngine.isTestImplementor(classToTest)) { fDefaultClassToTest= classToTest.getFullyQualifiedName(); } } catch (JavaModelException e) { JUnitPlugin.log(e); } } } fMethodStubsButtons.setSelection(0, false); fMethodStubsButtons.setSelection(1, false); fMethodStubsButtons.setEnabled(1, false); fMethodStubsButtons.setSelection(2, false); fMethodStubsButtons.setSelection(3, false); } /** * @see NewContainerWizardPage#handleFieldChanged */ protected void handleFieldChanged(String fieldName) { super.handleFieldChanged(fieldName);
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (fieldName.equals(CLASS_TO_TEST)) { fClassToTestStatus= classToTestClassChanged(); updateDefaultName(); } else if (fieldName.equals(SUPER)) { validateSuperClass(); } else if (fieldName.equals(TEST_CLASS)) { fTestClassStatus= testClassChanged(); } else if (fieldName.equals(PACKAGE) || fieldName.equals(CONTAINER)) { if (fieldName.equals(PACKAGE)) fPackageStatus= packageChanged(); if (!fFirstTime) { validateSuperClass(); fClassToTestStatus= classToTestClassChanged(); fTestClassStatus= testClassChanged(); } } doStatusUpdate(); } private void doStatusUpdate() { IStatus[] status= new IStatus[] { fContainerStatus, fPackageStatus, fTestClassStatus, fClassToTestStatus, fModifierStatus, fSuperClassStatus };
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
updateStatus(status); } protected void updateDefaultName() { String s= fClassToTestText.getText(); if (s.lastIndexOf('.') > -1) s= s.substring(s.lastIndexOf('.') + 1); if (s.length() > 0) setTypeName(s + TEST_SUFFIX, true); } /* * @see IDialogPage#createControl(Composite) */ public void createControl(Composite parent) { initializeDialogUnits(parent); Composite composite= new Composite(parent, SWT.NONE); int nColumns= 4; GridLayout layout= new GridLayout(); layout.numColumns= nColumns; composite.setLayout(layout); createContainerControls(composite, nColumns); createPackageControls(composite, nColumns); createSeparator(composite, nColumns); createTestClassControls(composite, nColumns); createClassToTestControls(composite, nColumns); createSuperClassControls(composite, nColumns);
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
createMethodStubSelectionControls(composite, nColumns); setSuperClass(JUnitPlugin.TEST_SUPERCLASS_NAME, true); setControl(composite); fClassToTestText.setText(fDefaultClassToTest); restoreWidgetValues(); setFocus(); } protected void createMethodStubSelectionControls(Composite composite, int nColumns) { LayoutUtil.setHorizontalSpan(fMethodStubsButtons.getLabelControl(composite), nColumns); LayoutUtil.createEmptySpace(composite,1); LayoutUtil.setHorizontalSpan(fMethodStubsButtons.getSelectionButtonsGroup(composite), nColumns - 1); } protected void createClassToTestControls(Composite composite, int nColumns) { fClassToTestLabel= new Label(composite, SWT.LEFT | SWT.WRAP); fClassToTestLabel.setFont(composite.getFont()); fClassToTestLabel.setText(Messages.getString("NewTestClassWizPage.class_to_test.label")); GridData gd= new GridData(); gd.horizontalSpan= 1; fClassToTestLabel.setLayoutData(gd); fClassToTestText= new Text(composite, SWT.SINGLE | SWT.BORDER); fClassToTestText.setEnabled(true); fClassToTestText.setFont(composite.getFont()); fClassToTestText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { handleFieldChanged(CLASS_TO_TEST); } });
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
gd= new GridData(); gd.horizontalAlignment= gd.FILL; gd.grabExcessHorizontalSpace= true; gd.horizontalSpan= nColumns - 2; fClassToTestText.setLayoutData(gd); fClassToTestButton= new Button(composite, SWT.PUSH); fClassToTestButton.setText(Messages.getString("NewTestClassWizPage.class_to_test.browse")); fClassToTestButton.setEnabled(true); fClassToTestButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { classToTestButtonPressed(); } public void widgetSelected(SelectionEvent e) { classToTestButtonPressed(); } }); gd= new GridData(); gd.horizontalAlignment= gd.FILL; gd.grabExcessHorizontalSpace= false; gd.horizontalSpan= 1; gd.heightHint = SWTUtil.getButtonHeigthHint(fClassToTestButton); gd.widthHint = SWTUtil.getButtonWidthHint(fClassToTestButton); fClassToTestButton.setLayoutData(gd); } private void classToTestButtonPressed() { IType type= chooseClassToTestType(); if (type != null) { fClassToTestText.setText(JavaModelUtil.getFullyQualifiedName(type)); handleFieldChanged(CLASS_TO_TEST);
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
} } private IType chooseClassToTestType() { IPackageFragmentRoot root= getPackageFragmentRoot(); if (root == null) return null; IJavaElement[] elements= new IJavaElement[] { root.getJavaProject() }; IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements); IType type= null; try { SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), getWizard().getContainer(), scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, null); dialog.setTitle(Messages.getString("NewTestClassWizPage.class_to_test.dialog.title")); dialog.setMessage(Messages.getString("NewTestClassWizPage.class_to_test.dialog.message")); dialog.open(); if (dialog.getReturnCode() != SelectionDialog.OK) return type; else { Object[] resultArray= dialog.getResult(); type= (IType) resultArray[0]; } } catch (JavaModelException e) { JUnitPlugin.log(e); } return type; } protected IStatus classToTestClassChanged() { fClassToTestButton.setEnabled(getPackageFragmentRoot() != null); IStatus status= validateClassToTest(); return status;
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
} /** * Gets the content of the class to test text field. */ public String getClassToTestText() { return fClassToTestText.getText(); } public IType getClassToTest() { return fClassToTest; } /** * Sets the class to test name. */ public void setClassToTest(String name) { fClassToTestText.setText(name); } /* * @see TypePage#evalMethods */ protected void createTypeMembers(IType type, IImportsStructure imports, IProgressMonitor monitor) throws CoreException { fIndexOfFirstTestMethod= 0; createConstructor(type); if (fMethodStubsButtons.isSelected(0)) createMain(type); if (fMethodStubsButtons.isSelected(2)) { createSetUp(type, imports); }
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (fMethodStubsButtons.isSelected(3)) { createTearDown(type, imports); } if (isNextPageValid()) { createTestMethodStubs(type); } } protected void createConstructor(IType type) throws JavaModelException { String constr= "public "+getTypeName()+"(String name) {super(name);}\n\n"; type.createMethod(constr, null, false, null); fIndexOfFirstTestMethod++; } protected void createMain(IType type) throws JavaModelException { StringBuffer main= new StringBuffer("public static void main(String[] args) {"); if (fMethodStubsButtons.isSelected(1)) { main.append("junit."); switch (fMethodStubsButtons.getComboSelection()) { case 0: main.append("textui"); break; case 1: main.append("swingui"); break; case 2 : main.append("awtui"); break; default : main.append("textui"); break;
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
} main.append(".TestRunner.run(" + getTypeName() + ".class);"); } main.append("}\n"); type.createMethod(main.toString(), null, false, null); fIndexOfFirstTestMethod++; } protected void createSetUp(IType type, IImportsStructure imports) throws JavaModelException { ITypeHierarchy typeHierarchy= null; IType[] superTypes= null; String setUp; IMethod methodTemplate= null; if (type.exists()) { typeHierarchy= type.newSupertypeHierarchy(null); superTypes= typeHierarchy.getAllSuperclasses(type); for (int i= 0; i < superTypes.length; i++) { if (superTypes[i].exists()) { IMethod testMethod= superTypes[i].getMethod(SETUP, new String[] {}); if (testMethod.exists()) { methodTemplate= testMethod; break; } } } } if (methodTemplate != null) { CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(); GenStubSettings genStubSettings= new GenStubSettings(settings); genStubSettings.fCallSuper= true; genStubSettings.fMethodOverwrites= true;
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
setUp= JUnitStubUtility.genStub(getTypeName(), methodTemplate, genStubSettings, imports); } else { setUp="/**\n * Sets up the fixture, for example, open a network connection.\n * This method is called before a test is executed.\n * @throws Exception\n */\n" + "protected void "+SETUP+"() throws Exception {}\n\n"; } type.createMethod(setUp, null, false, null); fIndexOfFirstTestMethod++; } protected void createTearDown(IType type, IImportsStructure imports) throws JavaModelException { ITypeHierarchy typeHierarchy= null; IType[] superTypes= null; String tearDown; IMethod methodTemplate= null; if (type.exists()) { if (typeHierarchy == null) { typeHierarchy= type.newSupertypeHierarchy(null); superTypes= typeHierarchy.getAllSuperclasses(type); } for (int i= 0; i < superTypes.length; i++) { if (superTypes[i].exists()) { IMethod testM= superTypes[i].getMethod(TEARDOWN, new String[] {}); if (testM.exists()) { methodTemplate= testM; break; } } } } if (methodTemplate != null) {
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(); GenStubSettings genStubSettings= new GenStubSettings(settings); genStubSettings.fCallSuper= true; genStubSettings.fMethodOverwrites= true; tearDown= JUnitStubUtility.genStub(getTypeName(), methodTemplate, genStubSettings, imports); } else { tearDown="/**\n * Tears down the fixture, for example, close a network connection.\n * This method is called after a test is executed.\n * @throws Exception\n */\n" + "protected void "+TEARDOWN+"() throws Exception {}\n\n"; } type.createMethod(tearDown, null, false, null); fIndexOfFirstTestMethod++; } protected void createTestMethodStubs(IType type) throws JavaModelException { IMethod[] methods= fPage2.getCheckedMethods(); if (methods.length > 0) { ArrayList allMethods= new ArrayList(); IMethod[] allMethodsArray= fPage2.getAllMethods(); for (int i= 0; i < allMethodsArray.length; i++) { allMethods.add(allMethodsArray[i]); } ArrayList overloadedMethods= new ArrayList(); for (int i= 0; i < allMethods.size(); i++) { IMethod current= (IMethod) allMethods.get(i); String currentName= current.getElementName(); boolean currentAdded= false; for (ListIterator iter= allMethods.listIterator(i+1); iter.hasNext(); ) { IMethod iterMethod= (IMethod) iter.next(); if (iterMethod.getElementName().equals(currentName)) {
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (!currentAdded) { overloadedMethods.add(current); currentAdded= true; } overloadedMethods.add(iterMethod); iter.remove(); } } } /* used when for example both sum and Sum methods are present. Then * sum -> testSum * Sum -> testSum1 */ ArrayList newMethodsNames= new ArrayList(); for (int i = 0; i < methods.length; i++) { String elementName= methods[i].getElementName(); StringBuffer methodName= new StringBuffer(NewTestCaseCreationWizardPage2.PREFIX+Character.toUpperCase(elementName.charAt(0))+elementName.substring(1)); StringBuffer newMethod= new StringBuffer(); if (overloadedMethods.contains(methods[i])) { IMethod method= methods[i]; newMethod.append("/*\n * Test for "+Signature.toString(method.getReturnType())+" "+method.getElementName()+"("); String[] paramTypes= method.getParameterTypes(); if (paramTypes.length > 0) { if (paramTypes.length > 1) { for (int j= 0; j < paramTypes.length-1; j++) { newMethod.append(Signature.toString(paramTypes[j])+", "); } }
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
newMethod.append(Signature.toString(paramTypes[paramTypes.length-1])); } newMethod.append(")\n */\n"); String[] params= methods[i].getParameterTypes(); for (int j= 0; j < params.length; j++) { String param= params[j]; int start= 0, end= param.length(); if (param.startsWith( (new Character(Signature.C_ARRAY)).toString() )) start= 1; if (param.endsWith((new Character(Signature.C_NAME_END)).toString() )) end--; if (param.startsWith((new Character(Signature.C_UNRESOLVED)).toString() ,start) || param.startsWith((new Character(Signature.C_RESOLVED)).toString() ,start)) start++; String paramName= param.substring(start, end); if (paramName.indexOf('.') != -1) { start += paramName.lastIndexOf('.')+1; } methodName.append(param.substring(start, end)); if (param.startsWith( (new Character(Signature.C_ARRAY)).toString() )) methodName.append("Array"); } } if (newMethodsNames.contains(methodName.toString()))
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
methodName.append("1"); newMethodsNames.add(new String(methodName)); newMethod.append("public void "+methodName.toString()+"() {}\n\n"); type.createMethod(newMethod.toString(), null, false, null); } } } public void setVisible(boolean visible) { super.setVisible(visible); if (visible && fFirstTime) { handleFieldChanged(CLASS_TO_TEST); if (getClassToTestText().equals("")) setPageComplete(false); fFirstTime= false; } } public int getIndexOfFirstMethod() { return fIndexOfFirstTestMethod; } /** * Creates a type using the current field values. */ public void createType(IProgressMonitor monitor) throws CoreException, InterruptedException { super.createType(monitor); if (fPage2.getCreateTasksButtonSelection()) { createTaskMarkers(); } } private void createTaskMarkers() throws CoreException {
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
IType createdType= getCreatedType(); fTestMethods= createdType.getMethods(); ICompilationUnit cu= createdType.getCompilationUnit(); cu.save(null, false); IResource res= createdType.getCompilationUnit().getUnderlyingResource(); for (int i= getIndexOfFirstMethod(); i < fTestMethods.length; i++) { IMethod method= fTestMethods[i]; IMarker marker= res.createMarker("org.eclipse.jdt.junit.junit_task"); HashMap attributes= new HashMap(10); attributes.put(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_NORMAL)); attributes.put(IMarker.MESSAGE, Messages.getFormattedString("NewTestClassWizPage.marker.message",method.getElementName())); ISourceRange markerRange= method.getSourceRange(); attributes.put(IMarker.CHAR_START, new Integer(markerRange.getOffset())); attributes.put(IMarker.CHAR_END, new Integer(markerRange.getOffset()+markerRange.getLength())); marker.setAttributes(attributes); } } private void validateSuperClass() { fMethodStubsButtons.setEnabled(2, true); fMethodStubsButtons.setEnabled(3, true); String superClassName= getSuperClass(); if (superClassName != null && !superClassName.equals("") && getPackageFragmentRoot() != null) { try { IType type= NewTestCaseCreationWizardPage.resolveClassNameToType(getPackageFragmentRoot().getJavaProject(), getPackageFragment(), superClassName); JUnitStatus status = new JUnitStatus(); if (type == null) { status.setError(Messages.getString("NewTestClassWizPage.error.superclass.not_exist")); fSuperClassStatus= status; } else {
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (type.isInterface()) { status.setError(Messages.getString("NewTestClassWizPage.error.superclass.is_interface")); fSuperClassStatus= status; } if (!TestSearchEngine.isTestImplementor(type)) { status.setError(Messages.getFormattedString("NewTestClassWizPage.error.superclass.not_implementing_test_interface", JUnitPlugin.TEST_INTERFACE_NAME)); fSuperClassStatus= status; } else { IMethod setupMethod= type.getMethod(SETUP, new String[] {}); IMethod teardownMethod= type.getMethod(TEARDOWN, new String[] {}); if (setupMethod.exists()) fMethodStubsButtons.setEnabled(2, !Flags.isFinal(setupMethod.getFlags())); if (teardownMethod.exists()) fMethodStubsButtons.setEnabled(3, !Flags.isFinal(teardownMethod.getFlags())); } } } catch (JavaModelException e) { JUnitPlugin.log(e); } } } protected void createTestClassControls(Composite composite, int nColumns) { fTestClassLabel= new Label(composite, SWT.LEFT | SWT.WRAP); fTestClassLabel.setFont(composite.getFont()); fTestClassLabel.setText(Messages.getString("NewTestClassWizPage.testcase.label")); GridData gd= new GridData(); gd.horizontalSpan= 1; fTestClassLabel.setLayoutData(gd); fTestClassText= new Text(composite, SWT.SINGLE | SWT.BORDER);
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
fTestClassText.setEnabled(true); fTestClassText.setFont(composite.getFont()); fTestClassText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { handleFieldChanged(TEST_CLASS); } }); gd= new GridData(); gd.horizontalAlignment= gd.FILL; gd.grabExcessHorizontalSpace= true; gd.horizontalSpan= nColumns - 2; fTestClassText.setLayoutData(gd); Label space= new Label(composite, SWT.LEFT); space.setText(" "); gd= new GridData(); gd.horizontalSpan= 1; space.setLayoutData(gd); } /** * Gets the type name. */ public String getTypeName() { return (fTestClassText==null)?fTestClassTextInitialValue:fTestClassText.getText(); } /** * Sets the type name. */ public void setTypeName(String name, boolean canBeModified) {
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (fTestClassText == null) { fTestClassTextInitialValue= name; } else { fTestClassText.setText(name); fTestClassText.setEnabled(canBeModified); } } /** * 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 testClassChanged() { JUnitStatus status= new JUnitStatus(); String typeName= getTypeName(); if (typeName.length() == 0) { status.setError(Messages.getString("NewTestClassWizPage.error.testcase.name_empty")); return status; } if (typeName.indexOf('.') != -1) { status.setError(Messages.getString("NewTestClassWizPage.error.testcase.name_qualified")); return status; } IStatus val= JavaConventions.validateJavaTypeName(typeName); if (val.getSeverity() == IStatus.ERROR) { status.setError(Messages.getString("NewTestClassWizPage.error.testcase.name_not_valid")+val.getMessage()); return status; } else if (val.getSeverity() == IStatus.WARNING) {
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
status.setWarning(Messages.getString("NewTestClassWizPage.error.testcase.name_discouraged")+val.getMessage()); } IPackageFragment pack= getPackageFragment(); if (pack != null) { ICompilationUnit cu= pack.getCompilationUnit(typeName + ".java"); if (cu.exists()) { status.setError(Messages.getString("NewTestClassWizPage.error.testcase.already_exists")); return status; } } return status; } /** * @see IWizardPage#canFlipToNextPage */ public boolean canFlipToNextPage() { return isPageComplete() && getNextPage() != null && isNextPageValid(); } protected boolean isNextPageValid() { return !getClassToTestText().equals(""); } protected JUnitStatus validateClassToTest() { IPackageFragmentRoot root= getPackageFragmentRoot(); IPackageFragment pack= getPackageFragment(); String classToTestName= fClassToTestText.getText(); JUnitStatus status= new JUnitStatus(); fClassToTest= null;
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (classToTestName.length() == 0) { return status; } IStatus val= JavaConventions.validateJavaTypeName(classToTestName); if (val.getSeverity() == IStatus.ERROR) { status.setError(Messages.getString("NewTestClassWizPage.error.class_to_test.not_valid")); return status; } if (root != null) { try { IType type= NewTestCaseCreationWizardPage.resolveClassNameToType(root.getJavaProject(), pack, classToTestName); if (type == null) { status.setError(Messages.getString("NewTestClassWizPage.error.class_to_test.not_exist")); return status; } else { if (type.isInterface()) { status.setWarning(Messages.getFormattedString("NewTestClassWizPage.warning.class_to_test.is_interface",classToTestName)); } if (pack != null && !JavaModelUtil.isVisible(type, pack)) { status.setWarning(Messages.getFormattedString("NewTestClassWizPage.warning.class_to_test.not_visible", new String[] {(type.isInterface())?Messages.getString("Interface"):Messages.getString("Class") , classToTestName})); } } fClassToTest= type; } catch (JavaModelException e) { status.setError(Messages.getString("NewTestClassWizPage.error.class_to_test.not_valid")); } } else {
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
status.setError(""); } return status; } static public IType resolveClassNameToType(IJavaProject jproject, IPackageFragment pack, String classToTestName) throws JavaModelException { IType type= null; if (type == null && pack != null) { String packName= pack.getElementName(); if (!pack.isDefaultPackage()) { type= JavaModelUtil.findType(jproject, packName, classToTestName); } if (type == null && !"java.lang".equals(packName)) { type= JavaModelUtil.findType(jproject, "java.lang", classToTestName); } } if (type == null) { type= JavaModelUtil.findType(jproject, classToTestName); } return type; } /** * Sets the focus on the type name. */ protected void setFocus() { fTestClassText.setFocus(); }
11,851
Bug 11851 generated new TestCase differes form generated new class
It would be nice if the generation of a new test case would do the same as generation of a new class. The thing which I noticed: new Class wizards adds javadoc while new Test Case wizard does not. /** * Constructor for AA. * @param name */ public AA(String name) { super(name); }
resolved fixed
8834612
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:06:08Z
2002-03-20T13:13:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
/** * Use the dialog store to restore widget values to the values that they held * last time this wizard was used to completion */ private void restoreWidgetValues() { IDialogSettings settings= getDialogSettings(); if (settings != null) { boolean generateMain= settings.getBoolean(STORE_GENERATE_MAIN); fMethodStubsButtons.setSelection(0, generateMain); fMethodStubsButtons.setEnabled(1, generateMain); fMethodStubsButtons.setSelection(1,settings.getBoolean(STORE_USE_TESTRUNNER)); try { fMethodStubsButtons.setComboSelection(settings.getInt(STORE_TESTRUNNER_TYPE)); } catch(NumberFormatException e) {} } } /** * Since Finish was pressed, write widget values to the dialog store so that they * will persist into the next invocation of this wizard page */ void saveWidgetValues() { IDialogSettings settings= getDialogSettings(); if (settings != null) { settings.put(STORE_GENERATE_MAIN, fMethodStubsButtons.isSelected(0)); settings.put(STORE_USE_TESTRUNNER, fMethodStubsButtons.isSelected(1)); settings.put(STORE_TESTRUNNER_TYPE, fMethodStubsButtons.getComboSelection()); } } }
11,773
Bug 11773 java browsing: sorter for Members view
i'd like to be able to sort and filters things in package and type views (sorting more important)
resolved fixed
7d2c273
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:09:27Z
2002-03-20T10:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.browsing; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.StructuredViewer; import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IImportContainer; import org.eclipse.jdt.core.IImportDeclaration; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.viewsupport.MemberFilterActionGroup; import org.eclipse.jdt.internal.ui.viewsupport.ProblemTreeViewer; import org.eclipse.jdt.internal.ui.viewsupport.StandardJavaUILabelProvider; public class MembersView extends JavaBrowsingPart {
11,773
Bug 11773 java browsing: sorter for Members view
i'd like to be able to sort and filters things in package and type views (sorting more important)
resolved fixed
7d2c273
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:09:27Z
2002-03-20T10:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java
private MemberFilterActionGroup fMemberFilterActionGroup; /** * Creates and returns the label provider for this part. * * @return the label provider * @see ILabelProvider */ protected ILabelProvider createLabelProvider() { return new StandardJavaUILabelProvider( StandardJavaUILabelProvider.DEFAULT_TEXTFLAGS, StandardJavaUILabelProvider.DEFAULT_IMAGEFLAGS, StandardJavaUILabelProvider.getAdornmentProviders(true, null) ); } /** * Returns the context ID for the Help system * * @return the string used as ID for the Help context
11,773
Bug 11773 java browsing: sorter for Members view
i'd like to be able to sort and filters things in package and type views (sorting more important)
resolved fixed
7d2c273
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:09:27Z
2002-03-20T10:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java
*/ protected String getHelpContextId() { return IJavaHelpContextIds.MEMBERS_VIEW; } /** * Creates the the viewer of this part. * * @param parent the parent for the viewer */ protected StructuredViewer createViewer(Composite parent) { ProblemTreeViewer viewer= new ProblemTreeViewer(parent, SWT.MULTI); fMemberFilterActionGroup= new MemberFilterActionGroup(viewer, JavaPlugin.ID_PACKAGES_VIEW); return viewer; } /** * Adds filters the viewer of this part. */ protected void addFilters() { } protected void fillToolBar(IToolBarManager tbm) { fMemberFilterActionGroup.contributeToToolBar(tbm); } /** * Answers if the given <code>element</code> is a valid * input for this part. * * @param element the object to test * @return <true> if the given element is a valid input */
11,773
Bug 11773 java browsing: sorter for Members view
i'd like to be able to sort and filters things in package and type views (sorting more important)
resolved fixed
7d2c273
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:09:27Z
2002-03-20T10:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java
protected boolean isValidInput(Object element) { if (element instanceof IType) { IType type= (IType)element; return type.isBinary() || type.getDeclaringType() == null; } return false; } /** * Answers if the given <code>element</code> is a valid * element for this part. * * @param element the object to test * @return <true> if the given element is a valid element */ protected boolean isValidElement(Object element) { if (element instanceof IMember) return super.isValidElement(((IMember)element).getDeclaringType()); else if (element instanceof IImportContainer || element instanceof IImportDeclaration) { IJavaElement parent= ((IJavaElement)element).getParent(); if (parent.getElementType() == IJavaElement.CLASS_FILE) { IType type; try { type= ((IClassFile)parent).getType(); } catch (JavaModelException ex) { return false; } return isValidElement(type); } else if (parent.getElementType() == IJavaElement.COMPILATION_UNIT) {
11,773
Bug 11773 java browsing: sorter for Members view
i'd like to be able to sort and filters things in package and type views (sorting more important)
resolved fixed
7d2c273
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:09:27Z
2002-03-20T10:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java
IType[] types; try { types= ((ICompilationUnit)parent).getAllTypes(); } catch (JavaModelException ex) { return false; } for (int i= 0; i < types.length; i++) { boolean result= isValidElement(types[i]); if (result) return true; } } } return false; } /** * Finds the element which has to be selected in this part. * * @param je the Java element which has the focus */ protected IJavaElement findElementToSelect(IJavaElement je) { if (je == null) return null; switch (je.getElementType()) { case IJavaElement.METHOD: case IJavaElement.FIELD: case IJavaElement.TYPE: case IJavaElement.PACKAGE_DECLARATION: case IJavaElement.IMPORT_CONTAINER: case IJavaElement.IMPORT_DECLARATION:
11,773
Bug 11773 java browsing: sorter for Members view
i'd like to be able to sort and filters things in package and type views (sorting more important)
resolved fixed
7d2c273
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:09:27Z
2002-03-20T10:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java
je= getSuitableJavaElement(je); if (je != null) return je; default: return null; } } /** * Finds the closest Java element which can be used as input for * this part and has the given Java element as child * * @param je the Java element for which to search the closest input * @return the closest Java element used as input for this part */ protected IJavaElement findInputForJavaElement(IJavaElement je) { if (je == null || !je.exists()) return null; switch (je.getElementType()) { case IJavaElement.TYPE: IType type= ((IType)je).getDeclaringType(); if (type == null) return je; else return findInputForJavaElement(type); case IJavaElement.COMPILATION_UNIT: return getTypeForCU((ICompilationUnit)je); case IJavaElement.CLASS_FILE: try { return findInputForJavaElement(((IClassFile)je).getType());
11,773
Bug 11773 java browsing: sorter for Members view
i'd like to be able to sort and filters things in package and type views (sorting more important)
resolved fixed
7d2c273
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-26T16:09:27Z
2002-03-20T10:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/MembersView.java
} catch (JavaModelException ex) { return null; } case IJavaElement.IMPORT_DECLARATION: return findInputForJavaElement(je.getParent()); case IJavaElement.PACKAGE_DECLARATION: case IJavaElement.IMPORT_CONTAINER: IJavaElement parent= je.getParent(); if (parent instanceof ICompilationUnit) { IType[] types; try { types= ((ICompilationUnit)parent).getAllTypes(); } catch (JavaModelException ex) { return null; } if (types.length > 0) return types[0]; else return null; } else if (parent instanceof IClassFile) return findInputForJavaElement(parent); default: if (je instanceof IMember) return findInputForJavaElement(((IMember)je).getDeclaringType()); } return null; } }
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
package org.eclipse.jdt.junit.wizards; import java.awt.Stroke; import java.util.ArrayList; import java.util.HashMap; import java.util.ListIterator; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.jdt.core.Flags; import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IMethod; 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.internal.corext.codemanipulation.CodeGenerationSettings; import org.eclipse.jdt.internal.corext.codemanipulation.IImportsStructure; import org.eclipse.jdt.internal.corext.util.JavaModelUtil;
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
import org.eclipse.jdt.internal.junit.ui.JUnitPlugin; import org.eclipse.jdt.internal.junit.util.JUnitStatus; import org.eclipse.jdt.internal.junit.util.JUnitStubUtility; import org.eclipse.jdt.internal.junit.util.LayoutUtil; import org.eclipse.jdt.internal.junit.util.TestSearchEngine; import org.eclipse.jdt.internal.junit.util.JUnitStubUtility.GenStubSettings; import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings; import org.eclipse.jdt.internal.ui.util.SWTUtil; import org.eclipse.jdt.ui.IJavaElementSearchConstants; import org.eclipse.jdt.ui.JavaUI; import org.eclipse.jdt.ui.wizards.NewTypeWizardPage; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.dialogs.SelectionDialog; /** * The first page of the TestCase creation wizard. */ public class NewTestCaseCreationWizardPage extends NewTypeWizardPage {
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
protected final static String PAGE_NAME= "NewTestCaseCreationWizardPage"; protected final static String CLASS_TO_TEST= PAGE_NAME + ".classtotest"; protected final static String TEST_CLASS= PAGE_NAME + ".testclass"; protected final static String TEST_SUFFIX= "Test"; protected final static String SETUP= "setUp"; protected final static String TEARDOWN= "tearDown"; protected final static String STORE_GENERATE_MAIN= PAGE_NAME + ".GENERATE_MAIN"; protected final static String STORE_USE_TESTRUNNER= PAGE_NAME + ".USE_TESTRUNNER"; protected final static String STORE_TESTRUNNER_TYPE= PAGE_NAME + ".TESTRUNNER_TYPE"; private String fDefaultClassToTest;
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
private NewTestCaseCreationWizardPage2 fPage2; private SelectionButtonGroup fMethodStubsButtons; private IType fClassToTest; protected IStatus fClassToTestStatus; protected IStatus fTestClassStatus; private int fIndexOfFirstTestMethod; private Label fClassToTestLabel; private Text fClassToTestText; private Button fClassToTestButton; private Label fTestClassLabel; private Text fTestClassText; private String fTestClassTextInitialValue; private IMethod[] fTestMethods; private IType fCreatedType; private boolean fFirstTime; public NewTestCaseCreationWizardPage() { super(true, PAGE_NAME); fFirstTime= true; fTestClassTextInitialValue= ""; setTitle(Messages.getString("NewTestClassWizPage.title")); setDescription(Messages.getString("NewTestClassWizPage.description")); String[] buttonNames= new String[] { "public static void main(Strin&g[] args)", Messages.getString("NewTestClassWizPage.methodStub.testRunner"), Messages.getString("NewTestClassWizPage.methodStub.setUp"), Messages.getString("NewTestClassWizPage.methodStub.tearDown")
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
}; fMethodStubsButtons= new SelectionButtonGroup(SWT.CHECK, buttonNames, 1); fMethodStubsButtons.setLabelText(Messages.getString("NewTestClassWizPage.method.Stub.label")); fMethodStubsButtons.setSelectionGroupListener(new SelectionButtonGroup.SelectionButtonGroupListener() { public void groupChanged(SelectionButtonGroup field) { field.setEnabled(1, field.isSelected(0)); } }); fClassToTestStatus= new JUnitStatus(); fTestClassStatus= new JUnitStatus(); fDefaultClassToTest= ""; } /** * Should be called from the wizard with the input element. */ public void init(IStructuredSelection selection, NewTestCaseCreationWizardPage2 page2) { fPage2= page2; IJavaElement element= getInitialJavaElement(selection); initContainerPage(element); initTypePage(element); doStatusUpdate(); if (element != null) { IType classToTest= null; IPackageFragment pack= (IPackageFragment) JavaModelUtil.findElementOfKind(element, IJavaElement.PACKAGE_FRAGMENT); IType typeInCompUnit= (IType) JavaModelUtil.findElementOfKind(element, IJavaElement.TYPE);
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (typeInCompUnit != null) { if (typeInCompUnit.getCompilationUnit() != null) { classToTest= typeInCompUnit; } } else { ICompilationUnit cu= (ICompilationUnit) JavaModelUtil.findElementOfKind(element, IJavaElement.COMPILATION_UNIT); if (cu != null) classToTest= JavaModelUtil.findPrimaryType(cu); else { if (element instanceof IClassFile) { try { IClassFile cf= (IClassFile) element; if (cf.isStructureKnown()) classToTest= cf.getType(); } catch(JavaModelException e) { JUnitPlugin.log(e); } } } } if (classToTest != null) { try { if (!TestSearchEngine.isTestImplementor(classToTest)) { fDefaultClassToTest= classToTest.getFullyQualifiedName(); } } catch (JavaModelException e) { JUnitPlugin.log(e); } } }
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
fMethodStubsButtons.setSelection(0, false); fMethodStubsButtons.setSelection(1, false); fMethodStubsButtons.setEnabled(1, false); fMethodStubsButtons.setSelection(2, false); fMethodStubsButtons.setSelection(3, false); } /** * @see NewContainerWizardPage#handleFieldChanged */ protected void handleFieldChanged(String fieldName) { super.handleFieldChanged(fieldName); if (fieldName.equals(CLASS_TO_TEST)) { fClassToTestStatus= classToTestClassChanged(); updateDefaultName(); } else if (fieldName.equals(SUPER)) { validateSuperClass(); } else if (fieldName.equals(TEST_CLASS)) { fTestClassStatus= testClassChanged(); } else if (fieldName.equals(PACKAGE) || fieldName.equals(CONTAINER)) { if (fieldName.equals(PACKAGE)) fPackageStatus= packageChanged(); if (!fFirstTime) { validateSuperClass(); fClassToTestStatus= classToTestClassChanged(); fTestClassStatus= testClassChanged(); } } doStatusUpdate(); }
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
private void doStatusUpdate() { IStatus[] status= new IStatus[] { fContainerStatus, fPackageStatus, fTestClassStatus, fClassToTestStatus, fModifierStatus, fSuperClassStatus }; updateStatus(status); } protected void updateDefaultName() { String s= fClassToTestText.getText(); if (s.lastIndexOf('.') > -1) s= s.substring(s.lastIndexOf('.') + 1); if (s.length() > 0) setTypeName(s + TEST_SUFFIX, true); } /* * @see IDialogPage#createControl(Composite) */ public void createControl(Composite parent) { initializeDialogUnits(parent); Composite composite= new Composite(parent, SWT.NONE);
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
int nColumns= 4; GridLayout layout= new GridLayout(); layout.numColumns= nColumns; composite.setLayout(layout); createContainerControls(composite, nColumns); createPackageControls(composite, nColumns); createSeparator(composite, nColumns); createTestClassControls(composite, nColumns); createClassToTestControls(composite, nColumns); createSuperClassControls(composite, nColumns); createMethodStubSelectionControls(composite, nColumns); setSuperClass(JUnitPlugin.TEST_SUPERCLASS_NAME, true); setControl(composite); fClassToTestText.setText(fDefaultClassToTest); restoreWidgetValues(); } protected void createMethodStubSelectionControls(Composite composite, int nColumns) { LayoutUtil.setHorizontalSpan(fMethodStubsButtons.getLabelControl(composite), nColumns); LayoutUtil.createEmptySpace(composite,1); LayoutUtil.setHorizontalSpan(fMethodStubsButtons.getSelectionButtonsGroup(composite), nColumns - 1); } protected void createClassToTestControls(Composite composite, int nColumns) { fClassToTestLabel= new Label(composite, SWT.LEFT | SWT.WRAP); fClassToTestLabel.setFont(composite.getFont()); fClassToTestLabel.setText(Messages.getString("NewTestClassWizPage.class_to_test.label"));
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
GridData gd= new GridData(); gd.horizontalSpan= 1; fClassToTestLabel.setLayoutData(gd); fClassToTestText= new Text(composite, SWT.SINGLE | SWT.BORDER); fClassToTestText.setEnabled(true); fClassToTestText.setFont(composite.getFont()); fClassToTestText.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { handleFieldChanged(CLASS_TO_TEST); } }); gd= new GridData(); gd.horizontalAlignment= gd.FILL; gd.grabExcessHorizontalSpace= true; gd.horizontalSpan= nColumns - 2; fClassToTestText.setLayoutData(gd); fClassToTestButton= new Button(composite, SWT.PUSH); fClassToTestButton.setText(Messages.getString("NewTestClassWizPage.class_to_test.browse")); fClassToTestButton.setEnabled(true); fClassToTestButton.addSelectionListener(new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { classToTestButtonPressed(); } public void widgetSelected(SelectionEvent e) { classToTestButtonPressed(); } }); gd= new GridData(); gd.horizontalAlignment= gd.FILL;
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
gd.grabExcessHorizontalSpace= false; gd.horizontalSpan= 1; gd.heightHint = SWTUtil.getButtonHeigthHint(fClassToTestButton); gd.widthHint = SWTUtil.getButtonWidthHint(fClassToTestButton); fClassToTestButton.setLayoutData(gd); } private void classToTestButtonPressed() { IType type= chooseClassToTestType(); if (type != null) { fClassToTestText.setText(JavaModelUtil.getFullyQualifiedName(type)); handleFieldChanged(CLASS_TO_TEST); } } private IType chooseClassToTestType() { IPackageFragmentRoot root= getPackageFragmentRoot(); if (root == null) return null; IJavaElement[] elements= new IJavaElement[] { root.getJavaProject() }; IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements); IType type= null; try { SelectionDialog dialog= JavaUI.createTypeDialog(getShell(), getWizard().getContainer(), scope, IJavaElementSearchConstants.CONSIDER_CLASSES, false, null); dialog.setTitle(Messages.getString("NewTestClassWizPage.class_to_test.dialog.title")); dialog.setMessage(Messages.getString("NewTestClassWizPage.class_to_test.dialog.message")); dialog.open(); if (dialog.getReturnCode() != SelectionDialog.OK) return type; else { Object[] resultArray= dialog.getResult();
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
type= (IType) resultArray[0]; } } catch (JavaModelException e) { JUnitPlugin.log(e); } return type; } protected IStatus classToTestClassChanged() { fClassToTestButton.setEnabled(getPackageFragmentRoot() != null); IStatus status= validateClassToTest(); return status; } /** * Gets the content of the class to test text field. */ public String getClassToTestText() { return fClassToTestText.getText(); } public IType getClassToTest() { return fClassToTest; } /** * Sets the class to test name. */ public void setClassToTest(String name) { fClassToTestText.setText(name); } /* * @see TypePage#evalMethods
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
*/ protected void createTypeMembers(IType type, IImportsStructure imports, IProgressMonitor monitor) throws CoreException { fIndexOfFirstTestMethod= 0; createConstructor(type, imports); if (fMethodStubsButtons.isSelected(0)) createMain(type); if (fMethodStubsButtons.isSelected(2)) { createSetUp(type, imports); } if (fMethodStubsButtons.isSelected(3)) { createTearDown(type, imports); } if (isNextPageValid()) { createTestMethodStubs(type); } } protected void createConstructor(IType type, IImportsStructure imports) throws JavaModelException { ITypeHierarchy typeHierarchy= null; IType[] superTypes= null; String constr= ""; IMethod methodTemplate= null; if (type.exists()) { typeHierarchy= type.newSupertypeHierarchy(null); superTypes= typeHierarchy.getAllSuperclasses(type); for (int i= 0; i < superTypes.length; i++) { if (superTypes[i].exists()) { IMethod constrMethod= superTypes[i].getMethod(superTypes[i].getElementName(), new String[] {"Ljava.lang.String;"});
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (constrMethod.exists() && constrMethod.isConstructor()) { methodTemplate= constrMethod; break; } } } } CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(); if (methodTemplate != null) { GenStubSettings genStubSettings= new GenStubSettings(settings); genStubSettings.fCallSuper= true; genStubSettings.fMethodOverwrites= true; constr= JUnitStubUtility.genStub(getTypeName(), methodTemplate, genStubSettings, imports); } else { StringBuffer field= new StringBuffer(); if (settings.createComments) field.append("/**\n * The name of the test case.\n */\n"); field.append("private String fName;\n\n"); type.createField(field.toString(), null, true, null); if (settings.createComments) constr="/**\n * Constructs a test case with the given name.\n */\n"; constr += "public "+getTypeName()+"(String name) {\nfName= name;\n}\n\n"; } type.createMethod(constr, null, true, null); fIndexOfFirstTestMethod++; } protected void createMain(IType type) throws JavaModelException { StringBuffer main= new StringBuffer("public static void main(String[] args) {"); if (fMethodStubsButtons.isSelected(1)) { main.append("junit.");
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
switch (fMethodStubsButtons.getComboSelection()) { case 0: main.append("textui"); break; case 1: main.append("swingui"); break; case 2 : main.append("awtui"); break; default : main.append("textui"); break; } main.append(".TestRunner.run(" + getTypeName() + ".class);"); } main.append("}\n\n"); type.createMethod(main.toString(), null, false, null); fIndexOfFirstTestMethod++; } protected void createSetUp(IType type, IImportsStructure imports) throws JavaModelException { ITypeHierarchy typeHierarchy= null; IType[] superTypes= null; String setUp= ""; IMethod methodTemplate= null; if (type.exists()) { typeHierarchy= type.newSupertypeHierarchy(null); superTypes= typeHierarchy.getAllSuperclasses(type); for (int i= 0; i < superTypes.length; i++) { if (superTypes[i].exists()) {
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
IMethod testMethod= superTypes[i].getMethod(SETUP, new String[] {}); if (testMethod.exists()) { methodTemplate= testMethod; break; } } } } CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(); if (methodTemplate != null) { GenStubSettings genStubSettings= new GenStubSettings(settings); genStubSettings.fCallSuper= true; genStubSettings.fMethodOverwrites= true; setUp= JUnitStubUtility.genStub(getTypeName(), methodTemplate, genStubSettings, imports); } else { if (settings.createComments) setUp= "/**\n * Sets up the fixture, for example, open a network connection.\n * This method is called before a test is executed.\n * @throws Exception\n */\n"; setUp+= "protected void "+SETUP+"() throws Exception {}\n\n"; } type.createMethod(setUp, null, false, null); fIndexOfFirstTestMethod++; } protected void createTearDown(IType type, IImportsStructure imports) throws JavaModelException { ITypeHierarchy typeHierarchy= null; IType[] superTypes= null; String tearDown= ""; IMethod methodTemplate= null; if (type.exists()) { if (typeHierarchy == null) {
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
typeHierarchy= type.newSupertypeHierarchy(null); superTypes= typeHierarchy.getAllSuperclasses(type); } for (int i= 0; i < superTypes.length; i++) { if (superTypes[i].exists()) { IMethod testM= superTypes[i].getMethod(TEARDOWN, new String[] {}); if (testM.exists()) { methodTemplate= testM; break; } } } } CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings(); if (methodTemplate != null) { GenStubSettings genStubSettings= new GenStubSettings(settings); genStubSettings.fCallSuper= true; genStubSettings.fMethodOverwrites= true; tearDown= JUnitStubUtility.genStub(getTypeName(), methodTemplate, genStubSettings, imports); } else { if (settings.createComments) tearDown="/**\n * Tears down the fixture, for example, close a network connection.\n * This method is called after a test is executed.\n * @throws Exception\n */\n"; tearDown+= "protected void "+TEARDOWN+"() throws Exception {}\n\n"; } type.createMethod(tearDown, null, false, null); fIndexOfFirstTestMethod++; } protected void createTestMethodStubs(IType type) throws JavaModelException { IMethod[] methods= fPage2.getCheckedMethods(); if (methods.length > 0) {
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
ArrayList allMethods= new ArrayList(); IMethod[] allMethodsArray= fPage2.getAllMethods(); for (int i= 0; i < allMethodsArray.length; i++) { allMethods.add(allMethodsArray[i]); } ArrayList overloadedMethods= new ArrayList(); for (int i= 0; i < allMethods.size(); i++) { IMethod current= (IMethod) allMethods.get(i); String currentName= current.getElementName(); boolean currentAdded= false; for (ListIterator iter= allMethods.listIterator(i+1); iter.hasNext(); ) { IMethod iterMethod= (IMethod) iter.next(); if (iterMethod.getElementName().equals(currentName)) { if (!currentAdded) { overloadedMethods.add(current); currentAdded= true; } overloadedMethods.add(iterMethod); iter.remove(); } } } /* used when for example both sum and Sum methods are present. Then * sum -> testSum * Sum -> testSum1 */ ArrayList newMethodsNames= new ArrayList();
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
for (int i = 0; i < methods.length; i++) { String elementName= methods[i].getElementName(); StringBuffer methodName= new StringBuffer(NewTestCaseCreationWizardPage2.PREFIX+Character.toUpperCase(elementName.charAt(0))+elementName.substring(1)); StringBuffer newMethod= new StringBuffer(); if (overloadedMethods.contains(methods[i])) { IMethod method= methods[i]; newMethod.append("/*\n * Test for "+Signature.toString(method.getReturnType())+" "+method.getElementName()+"("); String[] paramTypes= method.getParameterTypes(); if (paramTypes.length > 0) { if (paramTypes.length > 1) { for (int j= 0; j < paramTypes.length-1; j++) { newMethod.append(Signature.toString(paramTypes[j])+", "); } } newMethod.append(Signature.toString(paramTypes[paramTypes.length-1])); } newMethod.append(")\n */\n"); String[] params= methods[i].getParameterTypes(); for (int j= 0; j < params.length; j++) { String param= params[j]; int start= 0, end= param.length(); if (param.startsWith( (new Character(Signature.C_ARRAY)).toString() )) start= 1; if (param.endsWith((new Character(Signature.C_NAME_END)).toString() )) end--;
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
if (param.startsWith((new Character(Signature.C_UNRESOLVED)).toString() ,start) || param.startsWith((new Character(Signature.C_RESOLVED)).toString() ,start)) start++; String paramName= param.substring(start, end); if (paramName.indexOf('.') != -1) { start += paramName.lastIndexOf('.')+1; } methodName.append(param.substring(start, end)); if (param.startsWith( (new Character(Signature.C_ARRAY)).toString() )) methodName.append("Array"); } } /* Should I for examples have methods * void foo(java.lang.StringBuffer sb) {} * void foo(mypackage1.StringBuffer sb) {} * void foo(mypackage2.StringBuffer sb) {} * I will get in the test class: * testFooStringBuffer() * testFooStringBuffer1() * testFooStringBuffer2() */ if (newMethodsNames.contains(methodName.toString())) { int suffix= 1; while (newMethodsNames.contains(methodName.toString() + Integer.toString(suffix))) suffix++; methodName.append(Integer.toString(suffix)); } newMethodsNames.add(new String(methodName)); newMethod.append("public void "+methodName.toString()+"() {}\n\n");
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
type.createMethod(newMethod.toString(), null, false, null); } } } public void setVisible(boolean visible) { super.setVisible(visible); if (visible && fFirstTime) { handleFieldChanged(CLASS_TO_TEST); if (getClassToTestText().equals("")) setPageComplete(false); fFirstTime= false; } if (visible) setFocus(); } public int getIndexOfFirstMethod() { return fIndexOfFirstTestMethod; } /** * Creates a type using the current field values. */ public void createType(IProgressMonitor monitor) throws CoreException, InterruptedException { super.createType(monitor); if (fPage2.getCreateTasksButtonSelection()) { createTaskMarkers(); } } private void createTaskMarkers() throws CoreException { IType createdType= getCreatedType();
11,689
Bug 11689 NPE creating a test case in empty workbench
If you create a project and then a JUnit TestCase when there are no other classes in the image you will get a NullPointerException when you select the browse button on the Test Class entry. STEPS 1) Create a ConfigurableProject 2) Create a JUnit Test class. In the creation dialog select the 3rd browse button. Walkback: java.lang.NullPointerException at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.chooseClassToTestTyp e(NewTestCaseCreationWizardPage.java:318) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.classToTestButtonPre ssed(NewTestCaseCreationWizardPage.java:293) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage.access$0 (NewTestCaseCreationWizardPage.java:292) at org.eclipse.jdt.junit.wizards.NewTestCaseCreationWizardPage$3.widgetSelected (NewTestCaseCreationWizardPage.java:279) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:74) at org.eclipse.jface.action.Action.runWithEvent(Action.java:473) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:361) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:352) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:47) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:698) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:196) at org.eclipse.core.launcher.Main.run(Main.java:555) at org.eclipse.core.launcher.Main.main(Main.java:396)
resolved fixed
4f1a191
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-03-27T10:34:12Z
2002-03-19T20:33:20Z
org.eclipse.jdt.junit/src/org/eclipse/jdt/junit/wizards/NewTestCaseCreationWizardPage.java
fTestMethods= createdType.getMethods(); ICompilationUnit cu= createdType.getCompilationUnit(); cu.save(null, false); IResource res= createdType.getCompilationUnit().getUnderlyingResource(); for (int i= getIndexOfFirstMethod(); i < fTestMethods.length; i++) { IMethod method= fTestMethods[i]; IMarker marker= res.createMarker("org.eclipse.jdt.junit.junit_task"); HashMap attributes= new HashMap(10); attributes.put(IMarker.PRIORITY, new Integer(IMarker.PRIORITY_NORMAL)); attributes.put(IMarker.MESSAGE, Messages.getFormattedString("NewTestClassWizPage.marker.message",method.getElementName())); ISourceRange markerRange= method.getSourceRange(); attributes.put(IMarker.CHAR_START, new Integer(markerRange.getOffset())); attributes.put(IMarker.CHAR_END, new Integer(markerRange.getOffset()+markerRange.getLength())); marker.setAttributes(attributes); } } private void validateSuperClass() { fMethodStubsButtons.setEnabled(2, true); fMethodStubsButtons.setEnabled(3, true); String superClassName= getSuperClass(); if (superClassName != null && !superClassName.equals("") && getPackageFragmentRoot() != null) { try { IType type= NewTestCaseCreationWizardPage.resolveClassNameToType(getPackageFragmentRoot().getJavaProject(), getPackageFragment(), superClassName); JUnitStatus status = new JUnitStatus(); if (type == null) { status.setError(Messages.getString("NewTestClassWizPage.error.superclass.not_exist")); fSuperClassStatus= status; } else { if (type.isInterface()) {