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
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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) { /* * Can't fully build the map because one or more * class file does not contain the name of its * source file. */ addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.classFileWithoutSourceFileAttribute", classFile.getLocation().toFile()), null); return null; }
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
String javaName= new String(cfReader.sourceFileName()); Object classFiles= map.get(javaName); if (classFiles == null) { classFiles= new ArrayList(3); 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. *
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
* @param folderPath the path of the folder to create a handle for * @return the new folder resource handle */ protected IFolder createFolderHandle(IPath folderPath) { if (folderPath.isValidPath(folderPath.toString()) && folderPath.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFolder(folderPath); else return null; } /** * Returns the status of this operation. * The result is a status object containing individual * status objects. * * @return the status of this operation */ public IStatus getStatus() { String message= null; switch (fStatus.getSeverity()) { case IStatus.OK: message= ""; break; case IStatus.INFO: message= JarPackagerMessages.getString("JarFileExportOperation.exportFinishedWithInfo"); break; case IStatus.WARNING: message= JarPackagerMessages.getString("JarFileExportOperation.exportFinishedWithWarnings"); break; case IStatus.ERROR: if (fJarPackages.length > 1)
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
message= JarPackagerMessages.getString("JarFileExportOperation.creationOfSomeJARsFailed"); else message= JarPackagerMessages.getString("JarFileExportOperation.jarCreationFailed"); break; default: message= ""; break; } fStatus.setMessage(message); return fStatus; } /** * 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 * @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)
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|| (hasErrors && fJarPackage.areErrorsExported()) || (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); } } /** * 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 { int count= fJarPackages.length; progressMonitor.beginTask("", count); try { for (int i= 0; i < count; i++) { SubProgressMonitor subProgressMonitor= new SubProgressMonitor(progressMonitor, 1); fJarPackage= fJarPackages[i];
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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()) { 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= fJarPackage.createJarWriter(fParentShell); exportSelectedElements(progressMonitor); if (getStatus().getSeverity() != IStatus.ERROR) { progressMonitor.subTask(JarPackagerMessages.getString("JarFileExportOperation.savingFiles")); saveFiles(); } } catch (CoreException ex) { addToStatus(ex); } finally {
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
try { if (fJarWriter != null) fJarWriter.close(); } catch (CoreException ex) { addToStatus(ex); } progressMonitor.done(); } } protected boolean preconditionsOK() { if (!fJarPackage.areClassFilesExported() && !fJarPackage.areJavaFilesExported()) { addError(JarPackagerMessages.getString("JarFileExportOperation.noExportTypeChosen"), null); return false; } if (fJarPackage.getElements() == null || fJarPackage.getElements().length == 0) { addError(JarPackagerMessages.getString("JarFileExportOperation.noResourcesSelected"), null); return false; } if (fJarPackage.getJarLocation() == null) { addError(JarPackagerMessages.getString("JarFileExportOperation.invalidJarLocation"), null); return false; } if (!fJarPackage.isManifestAccessible()) { addError(JarPackagerMessages.getString("JarFileExportOperation.manifestDoesNotExist"), null); return false; } if (!fJarPackage.isMainClassValid(new BusyIndicatorRunnableContext())) { addError(JarPackagerMessages.getString("JarFileExportOperation.invalidMainClass"), null); return false;
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} IFile[] unsavedFiles= getUnsavedFiles(); if (unsavedFiles.length > 0) return saveModifiedResourcesIfUserConfirms(unsavedFiles); return true; } /** * Returns the files which are not saved and which are * part of the files being exported. * * @return an array of unsaved files */ private IFile[] getUnsavedFiles() { IEditorPart[] dirtyEditors= JavaPlugin.getDirtyEditors(); Set unsavedFiles= new HashSet(dirtyEditors.length); if (dirtyEditors.length > 0) { List selection= JarPackagerUtil.asResources(fJarPackage.getElements()); 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); } } } } return (IFile[])unsavedFiles.toArray(new IFile[unsavedFiles.size()]); } /**
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
* Asks the user to confirm to save the modified resources. * * @return true if user pressed OK. */ private boolean confirmSaveModifiedResources(IFile[] dirtyFiles) { if (dirtyFiles == null || dirtyFiles.length == 0) return true; Display display= fParentShell.getDisplay(); if (display == null || display.isDisposed()) return false; final ConfirmSaveModifiedResourcesDialog dlg= new ConfirmSaveModifiedResourcesDialog(fParentShell, dirtyFiles); final int[] intResult= new int[1]; Runnable runnable= new Runnable() { public void run() { intResult[0]= dlg.open(); } }; display.syncExec(runnable); return intResult[0] == IDialogConstants.OK_ID; } /** * Asks to confirm to save the modified resources * and save them if OK is pressed. * * @return true if user pressed OK and save was successful. */ private boolean saveModifiedResourcesIfUserConfirms(IFile[] dirtyFiles) { if (confirmSaveModifiedResources(dirtyFiles))
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
return saveModifiedResources(dirtyFiles); for (int i= 0; i < dirtyFiles.length; i++) addError(JarPackagerMessages.getFormattedString("JarFileExportOperation.fileUnsaved", dirtyFiles[i].getFullPath()), null); return false; } /** * Save all of the editors in the workbench. * * @return true if successful. */ private boolean saveModifiedResources(final IFile[] dirtyFiles) { Display display= fParentShell.getDisplay(); if (display == null || display.isDisposed()) return false; final boolean[] retVal= new boolean[1]; Runnable runnable= new Runnable() { public void run() { IWorkspace workspace= ResourcesPlugin.getWorkspace(); IWorkspaceDescription description= workspace.getDescription(); boolean autoBuild= description.isAutoBuilding(); description.setAutoBuilding(false); try { workspace.setDescription(description); try { new ProgressMonitorDialog(fParentShell).run(false, false, createSaveModifiedResourcesRunnable(dirtyFiles)); retVal[0]= true;
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} finally { description.setAutoBuilding(autoBuild); workspace.setDescription(description); } } catch (InvocationTargetException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingModifiedResources"), ex); JavaPlugin.log(ex); retVal[0]= false; } catch (InterruptedException ex) { Assert.isTrue(false); retVal[0]= false; } catch (CoreException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingModifiedResources"), ex); JavaPlugin.log(ex); retVal[0]= false; } } }; display.syncExec(runnable); return retVal[0]; } private IRunnableWithProgress createSaveModifiedResourcesRunnable(final IFile[] dirtyFiles) { return new IRunnableWithProgress() { public void run(final IProgressMonitor pm) { IEditorPart[] editorsToSave= JavaPlugin.getDirtyEditors(); pm.beginTask(JarPackagerMessages.getString("JarFileExportOperation.savingModifiedResources"), editorsToSave.length); try { List dirtyFilesList= Arrays.asList(dirtyFiles); for (int i= 0; i < editorsToSave.length; i++) {
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
if (editorsToSave[i].getEditorInput() instanceof IFileEditorInput) { IFile dirtyFile= ((IFileEditorInput)editorsToSave[i].getEditorInput()).getFile(); if (dirtyFilesList.contains((dirtyFile))) editorsToSave[i].doSave(new SubProgressMonitor(pm, 1)); } pm.worked(1); } } finally { pm.done(); } } }; } protected void saveFiles() { if (fJarPackage.isManifestGenerated() && 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(); } catch (CoreException ex) {
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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(); IJarDescriptionWriter writer= fJarPackage.createJarDescriptionWriter(objectStreamOutput); ByteArrayInputStream fileInput= null; try { writer.write(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); IFile descriptionFile= fJarPackage.getDescriptionFile(); if (descriptionFile.isAccessible() && (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, descriptionFile.getFullPath().toString()))) descriptionFile.setContents(fileInput, true, true, null); else { descriptionFile.create(fileInput, true, null); } } finally { if (fileInput != null) fileInput.close(); if (writer != null) writer.close(); } } protected void saveManifest() throws CoreException, IOException {
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream(); ByteArrayInputStream fileInput= null; try { Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage); manifest.write(manifestOutput); fileInput= new ByteArrayInputStream(manifestOutput.toByteArray()); IFile manifestFile= fJarPackage.getManifestFile(); if (manifestFile.isAccessible() && (fJarPackage.allowOverwrite() || JarPackagerUtil.askForOverwritePermission(fParentShell, manifestFile.getFullPath().toString()))) manifestFile.setContents(fileInput, true, true, null); else { manifestFile.create(fileInput, true, null); } } finally { if (manifestOutput != null) manifestOutput.close(); if (fileInput != null) fileInput.close(); } } private boolean isAutoBuilding() { return ResourcesPlugin.getWorkspace().getDescription().isAutoBuilding(); } private boolean isCompilerGeneratingSourceFileAttribute() { Object value= JavaCore.getOptions().get(COMPILER_SOURCE_FILE_ATTR); if (value instanceof String) return "generate".equalsIgnoreCase((String)value); else return true; }
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
private void buildProjects(IProgressMonitor progressMonitor) { Set builtProjects= new HashSet(10); Object[] elements= fJarPackage.getElements(); for (int i= 0; i < elements.length; i++) { IProject project= null; Object element= elements[i]; 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); } } } } /** * Tells whether the given resource (or its children) have compile errors. * The method acts on the current build state and does not recompile. * * @param resource the resource to check for errors * @return <code>true</code> if the resource (and its children) are error free * @throws import org.eclipse.core.runtime.CoreException if there's a marker problem
14,236
Bug 14236 Unable to log info messages during jar packaging
Using the 04/18 Integration build, I still can't get an info message into the status maintained by JarFileExportOperation. In my JarWriter implementation, the close() method is throwing a CoreException which contains a status whose severity is set to IStatus.INFO. However, note that JarFileExportOperation.addToStatus() only accepts ERROR and WARNING (and only when they are being logged respectively which they are for my package data).
resolved fixed
202c3f9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:07:06Z
2002-04-19T15:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
*/ private boolean hasCompileErrors(IResource resource) throws CoreException { IMarker[] problemMarkers= resource.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE); for (int i= 0; i < problemMarkers.length; i++) { if (problemMarkers[i].getAttribute(IMarker.SEVERITY, -1) == IMarker.SEVERITY_ERROR) return true; } return false; } /** * Tells whether the given resource (or its children) have compile errors. * The method acts on the current build state and does not recompile. * * @param resource the resource to check for errors * @return <code>true</code> if the resource (and its children) are error free * @throws import org.eclipse.core.runtime.CoreException if there's a marker problem */ private boolean hasCompileWarnings(IResource resource) throws CoreException { IMarker[] problemMarkers= resource.findMarkers(IJavaModelMarker.JAVA_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE); for (int i= 0; i < problemMarkers.length; i++) { if (problemMarkers[i].getAttribute(IMarker.SEVERITY, -1) == IMarker.SEVERITY_WARNING) return true; } return false; } private boolean mustUseSourceFolderHierarchy() { return fJarPackage.useSourceFolderHierarchy() && fJarPackage.areJavaFilesExported() && !fJarPackage.areClassFilesExported(); } }
14,093
Bug 14093 exception in search results view
M5 sorry, no steps my search results view stopped working (would display no entries) then i found this in the log java.lang.NullPointerException at org.eclipse.jdt.internal.ui.search.GroupByKeyComputer.getJavaElement (GroupByKeyComputer.java:56) at org.eclipse.jdt.internal.ui.search.GroupByKeyComputer.computeGroupByKey (GroupByKeyComputer.java:28) at org.eclipse.search.internal.ui.SearchManager.handleAddMatch (SearchManager.java:375) at org.eclipse.search.internal.ui.SearchManager.handleSearchMarkerChanged (SearchManager.java:359) at org.eclipse.search.internal.ui.SearchManager.handleSearchMarkersChanged (SearchManager.java:348) at org.eclipse.search.internal.ui.SearchManager.access$2 (SearchManager.java:337) at org.eclipse.search.internal.ui.SearchManager$7.run (SearchManager.java:472) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java (Compiled Code)) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java (Compiled Code)) at org.eclipse.swt.widgets.Display.syncExec(Display.java(Compiled Code)) at org.eclipse.search.internal.ui.SearchManager.resourceChanged (SearchManager.java:482) at org.eclipse.core.internal.events.NotificationManager$1.run (NotificationManager.java(Compiled Code)) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java(Compiled Code)) at org.eclipse.core.runtime.Platform.run(Platform.java(Compiled Code)) at org.eclipse.core.internal.events.NotificationManager.notify (NotificationManager.java(Compiled Code)) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges (NotificationManager.java:62) at org.eclipse.core.internal.resources.Workspace.broadcastChanges (Workspace.java:134) at org.eclipse.core.internal.resources.Workspace.endOperation (Workspace.java(Compiled Code)) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1348) at org.eclipse.ui.actions.WorkspaceModifyOperation.run (WorkspaceModifyOperation.java:78) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.executeChange (PerformChangeOperation.java:143) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.run (PerformChangeOperation.java:132) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:296) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:249) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:713) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish (RefactoringWizard.java:330) at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.performFinish (PreviewWizardPage.java:310) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish (RefactoringWizard.java:461) at org.eclipse.jface.wizard.WizardDialog.finishPressed (WizardDialog.java:570) at org.eclipse.jface.wizard.WizardDialog.buttonPressed (WizardDialog.java:311) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:356) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java (Compiled Code)) 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.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate (RefactoringStarter.java:78) at org.eclipse.jdt.internal.ui.refactoring.RefactoringSupportFactory$RenameSupport. rename(RefactoringSupportFactory.java:73) at org.eclipse.jdt.internal.ui.reorg.RenameAction.run (RenameAction.java:37) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) 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:819) 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:190) at org.eclipse.core.launcher.Main.run(Main.java:549) at org.eclipse.core.launcher.Main.main(Main.java:390)
resolved fixed
c59926d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:10:29Z
2002-04-18T11:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/GroupByKeyComputer.java
/* * (c) Copyright IBM Corp. 2000, 2002. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.search; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.search.ui.IGroupByKeyComputer; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; public class GroupByKeyComputer implements IGroupByKeyComputer { IJavaElement fLastJavaElement= null;; String fLastHandle= null;; public Object computeGroupByKey(IMarker marker) { if (marker == null) return null; IJavaElement jElement= getJavaElement(marker); if (jElement != null && jElement.exists()) {
14,093
Bug 14093 exception in search results view
M5 sorry, no steps my search results view stopped working (would display no entries) then i found this in the log java.lang.NullPointerException at org.eclipse.jdt.internal.ui.search.GroupByKeyComputer.getJavaElement (GroupByKeyComputer.java:56) at org.eclipse.jdt.internal.ui.search.GroupByKeyComputer.computeGroupByKey (GroupByKeyComputer.java:28) at org.eclipse.search.internal.ui.SearchManager.handleAddMatch (SearchManager.java:375) at org.eclipse.search.internal.ui.SearchManager.handleSearchMarkerChanged (SearchManager.java:359) at org.eclipse.search.internal.ui.SearchManager.handleSearchMarkersChanged (SearchManager.java:348) at org.eclipse.search.internal.ui.SearchManager.access$2 (SearchManager.java:337) at org.eclipse.search.internal.ui.SearchManager$7.run (SearchManager.java:472) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java (Compiled Code)) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java (Compiled Code)) at org.eclipse.swt.widgets.Display.syncExec(Display.java(Compiled Code)) at org.eclipse.search.internal.ui.SearchManager.resourceChanged (SearchManager.java:482) at org.eclipse.core.internal.events.NotificationManager$1.run (NotificationManager.java(Compiled Code)) at org.eclipse.core.internal.runtime.InternalPlatform.run (InternalPlatform.java(Compiled Code)) at org.eclipse.core.runtime.Platform.run(Platform.java(Compiled Code)) at org.eclipse.core.internal.events.NotificationManager.notify (NotificationManager.java(Compiled Code)) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges (NotificationManager.java:62) at org.eclipse.core.internal.resources.Workspace.broadcastChanges (Workspace.java:134) at org.eclipse.core.internal.resources.Workspace.endOperation (Workspace.java(Compiled Code)) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1348) at org.eclipse.ui.actions.WorkspaceModifyOperation.run (WorkspaceModifyOperation.java:78) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.executeChange (PerformChangeOperation.java:143) at org.eclipse.jdt.internal.ui.refactoring.PerformChangeOperation.run (PerformChangeOperation.java:132) at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:296) at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:249) at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:713) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish (RefactoringWizard.java:330) at org.eclipse.jdt.internal.ui.refactoring.PreviewWizardPage.performFinish (PreviewWizardPage.java:310) at org.eclipse.jdt.internal.ui.refactoring.RefactoringWizard.performFinish (RefactoringWizard.java:461) at org.eclipse.jface.wizard.WizardDialog.finishPressed (WizardDialog.java:570) at org.eclipse.jface.wizard.WizardDialog.buttonPressed (WizardDialog.java:311) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:356) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java (Compiled Code)) 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.jdt.internal.ui.refactoring.actions.RefactoringStarter.activate (RefactoringStarter.java:78) at org.eclipse.jdt.internal.ui.refactoring.RefactoringSupportFactory$RenameSupport. rename(RefactoringSupportFactory.java:73) at org.eclipse.jdt.internal.ui.reorg.RenameAction.run (RenameAction.java:37) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) 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:819) 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:190) at org.eclipse.core.launcher.Main.run(Main.java:549) at org.eclipse.core.launcher.Main.main(Main.java:390)
resolved fixed
c59926d
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-19T16:10:29Z
2002-04-18T11:40:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/GroupByKeyComputer.java
return fLastHandle; } return null; } private String getJavaElementHandleId(IMarker marker) { try { return (String)marker.getAttribute(IJavaSearchUIConstants.ATT_JE_HANDLE_ID); } catch (CoreException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.markerAttributeAccess.title"), SearchMessages.getString("Search.Error.markerAttributeAccess.message")); return null; } } private IJavaElement getJavaElement(IMarker marker) { String handle= getJavaElementHandleId(marker); if (handle == null) { fLastHandle= null; fLastJavaElement= null; return null; } if (!handle.equals(fLastHandle)) { fLastJavaElement= SearchUtil.getJavaElement(marker); fLastHandle= fLastJavaElement.getHandleIdentifier(); } return fLastJavaElement; } }
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
/* * (c) Copyright IBM Corp. 2000, 2002. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.search; import java.io.BufferedReader; import java.io.IOException;
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
import java.io.StringReader; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IAdaptable; import org.eclipse.swt.SWT; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.dialogs.DialogPage; import org.eclipse.jface.dialogs.IDialogSettings; import org.eclipse.jface.text.ITextSelection; import org.eclipse.jface.util.Assert; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.ui.IEditorPart;
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkingSet; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.model.IWorkbenchAdapter; import org.eclipse.search.ui.ISearchPage; import org.eclipse.search.ui.ISearchPageContainer; import org.eclipse.search.ui.ISearchResultViewEntry; import org.eclipse.search.ui.SearchUI; import org.eclipse.jdt.core.IClassFile; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IField; import org.eclipse.jdt.core.IImportDeclaration; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IMethod; import org.eclipse.jdt.core.IType; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.core.search.IJavaSearchConstants; import org.eclipse.jdt.core.search.IJavaSearchScope; import org.eclipse.jdt.core.search.SearchEngine; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.actions.SelectionConverter; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.RowLayouter; public class JavaSearchPage extends DialogPage implements ISearchPage, IJavaSearchConstants {
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
public static final String EXTENSION_POINT_ID= "org.eclipse.jdt.ui.JavaSearchPage"; private final static String PAGE_NAME= "JavaSearchPage"; private final static String STORE_CASE_SENSITIVE= PAGE_NAME + "CASE_SENSITIVE"; private static List fgPreviousSearchPatterns= new ArrayList(20); private SearchPatternData fInitialData; private IStructuredSelection fStructuredSelection; private IJavaElement fJavaElement; private boolean fFirstTime= true; private IDialogSettings fDialogSettings; private boolean fIsCaseSensitive; private Combo fPattern; private ISearchPageContainer fContainer; private Button fCaseSensitive; private Button[] fSearchFor; private String[] fSearchForText= { SearchMessages.getString("SearchPage.searchFor.type"), SearchMessages.getString("SearchPage.searchFor.method"), SearchMessages.getString("SearchPage.searchFor.package"), SearchMessages.getString("SearchPage.searchFor.constructor"), SearchMessages.getString("SearchPage.searchFor.field")}; private Button[] fLimitTo; private String[] fLimitToText= { SearchMessages.getString("SearchPage.limitTo.declarations"), SearchMessages.getString("SearchPage.limitTo.implementors"), SearchMessages.getString("SearchPage.limitTo.references"), SearchMessages.getString("SearchPage.limitTo.allOccurrences"),
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
SearchMessages.getString("SearchPage.limitTo.readReferences"), SearchMessages.getString("SearchPage.limitTo.writeReferences")}; private class SearchPatternData { int searchFor; int limitTo; String pattern; boolean isCaseSensitive; IJavaElement javaElement; int scope; IWorkingSet[] workingSets; public SearchPatternData(int s, int l, String p, IJavaElement element) { this(s, l, p, fIsCaseSensitive || element != null, element, ISearchPageContainer.WORKSPACE_SCOPE, null); } public SearchPatternData(int s, int l, String p, boolean i, IJavaElement element, int scope, IWorkingSet[] workingSets) { searchFor= s; limitTo= l; pattern= p; isCaseSensitive= i; javaElement= element; this.scope= scope; this.workingSets= workingSets; } } public boolean performAction() { SearchUI.activateSearchResultView(); SearchPatternData data= getPatternData();
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
IWorkspace workspace= JavaPlugin.getWorkspace(); IJavaSearchScope scope= null; String scopeDescription= ""; switch (getContainer().getSelectedScope()) { case ISearchPageContainer.WORKSPACE_SCOPE: scopeDescription= SearchMessages.getString("WorkspaceScope"); scope= SearchEngine.createWorkspaceScope(); break; case ISearchPageContainer.SELECTION_SCOPE: scopeDescription= SearchMessages.getString("SelectionScope"); scope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(fStructuredSelection); break; case ISearchPageContainer.WORKING_SET_SCOPE: IWorkingSet[] workingSets= getContainer().getSelectedWorkingSets(); if (workingSets == null || workingSets.length < 1) return false; scopeDescription= SearchMessages.getFormattedString("WorkingSetScope", SearchUtil.toString(workingSets)); scope= JavaSearchScopeFactory.getInstance().createJavaSearchScope(getContainer().getSelectedWorkingSets()); ElementSearchAction.updateLRUWorkingSets(getContainer().getSelectedWorkingSets()); } JavaSearchResultCollector collector= new JavaSearchResultCollector(); JavaSearchOperation op= null; if (data.javaElement != null && getPattern().equals(fInitialData.pattern)) op= new JavaSearchOperation(workspace, data.javaElement, data.limitTo, scope, scopeDescription, collector); else { data.javaElement= null; op= new JavaSearchOperation(workspace, data.pattern, data.isCaseSensitive, data.searchFor, data.limitTo, scope, scopeDescription, collector);
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
} Shell shell= getControl().getShell(); try { getContainer().getRunnableContext().run(true, true, op); } catch (InvocationTargetException ex) { ExceptionHandler.handle(ex, shell, SearchMessages.getString("Search.Error.search.title"), SearchMessages.getString("Search.Error.search.message")); return false; } catch (InterruptedException ex) { return false; } return true; } private int getLimitTo() { for (int i= 0; i < fLimitTo.length; i++) { if (fLimitTo[i].getSelection()) return i; } return -1; } private void setLimitTo(int searchFor) { fLimitTo[DECLARATIONS].setEnabled(true); fLimitTo[IMPLEMENTORS].setEnabled(false); fLimitTo[REFERENCES].setEnabled(true); fLimitTo[ALL_OCCURRENCES].setEnabled(true); fLimitTo[READ_ACCESSES].setEnabled(false); fLimitTo[WRITE_ACCESSES].setEnabled(false); if (!(searchFor == TYPE || searchFor == INTERFACE) && fLimitTo[IMPLEMENTORS].getSelection()) { fLimitTo[IMPLEMENTORS].setSelection(false);
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
fLimitTo[REFERENCES].setSelection(true); } if (!(searchFor == FIELD) && (getLimitTo() == READ_ACCESSES || getLimitTo() == WRITE_ACCESSES)) { fLimitTo[getLimitTo()].setSelection(false); fLimitTo[REFERENCES].setSelection(true); } switch (searchFor) { case TYPE | INTERFACE: fLimitTo[IMPLEMENTORS].setEnabled(true); case FIELD: fLimitTo[READ_ACCESSES].setEnabled(true); fLimitTo[WRITE_ACCESSES].setEnabled(true); break; default : break; } } private String[] getPreviousSearchPatterns() { int patternCount= fgPreviousSearchPatterns.size(); String [] patterns= new String[patternCount]; for (int i= 0; i < patternCount; i++) patterns[i]= ((SearchPatternData) fgPreviousSearchPatterns.get(patternCount - 1 - i)).pattern; return patterns; } private int getSearchFor() { for (int i= 0; i < fSearchFor.length; i++) { if (fSearchFor[i].getSelection()) return i;
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
} Assert.isTrue(false, "shouldNeverHappen"); return -1; } private String getPattern() { return fPattern.getText(); } /** * Return search pattern data and update previous searches. * An existing entry will be updated. */ private SearchPatternData getPatternData() { String pattern= getPattern(); SearchPatternData match= null; int i= 0; int size= fgPreviousSearchPatterns.size(); while (match == null && i < size) { match= (SearchPatternData) fgPreviousSearchPatterns.get(i); i++; if (!pattern.equals(match.pattern)) match= null; }; if (match == null) { match= new SearchPatternData( getSearchFor(), getLimitTo(), pattern, fCaseSensitive.getSelection(), fJavaElement,
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
getContainer().getSelectedScope(), getContainer().getSelectedWorkingSets()); fgPreviousSearchPatterns.add(match); } else { match.searchFor= getSearchFor(); match.limitTo= getLimitTo(); match.isCaseSensitive= fCaseSensitive.getSelection(); match.javaElement= fJavaElement; match.scope= getContainer().getSelectedScope(); match.workingSets= getContainer().getSelectedWorkingSets(); }; return match; } /* * Implements method from IDialogPage */ public void setVisible(boolean visible) { if (visible && fPattern != null) { if (fFirstTime) { fFirstTime= false; fPattern.setItems(getPreviousSearchPatterns()); initSelections(); } fPattern.setFocus(); getContainer().setPerformActionEnabled(fPattern.getText().length() > 0 && getContainer().hasValidScope()); } super.setVisible(visible); }
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
public boolean isValid() { return true; } /** * Creates the page's content. */ public void createControl(Composite parent) { readConfiguration(); GridData gd; Composite result= new Composite(parent, SWT.NONE); GridLayout layout= new GridLayout(); layout.numColumns= 2; layout.makeColumnsEqualWidth= true; layout.horizontalSpacing= 10; result.setLayout(layout); RowLayouter layouter= new RowLayouter(layout.numColumns); gd= new GridData(); gd.horizontalAlignment= gd.FILL; layouter.setDefaultGridData(gd, 0); layouter.setDefaultGridData(gd, 1); layouter.setDefaultSpan(); layouter.perform(createExpression(result)); layouter.perform(createSearchFor(result), createLimitTo(result), -1); SelectionAdapter javaElementInitializer= new SelectionAdapter() { public void widgetSelected(SelectionEvent event) {
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
if (getSearchFor() == fInitialData.searchFor) fJavaElement= fInitialData.javaElement; else fJavaElement= null; setLimitTo(getSearchFor()); updateCaseSensitiveCheckbox(); } }; fSearchFor[TYPE].addSelectionListener(javaElementInitializer); fSearchFor[METHOD].addSelectionListener(javaElementInitializer); fSearchFor[FIELD].addSelectionListener(javaElementInitializer); fSearchFor[CONSTRUCTOR].addSelectionListener(javaElementInitializer); fSearchFor[PACKAGE].addSelectionListener(javaElementInitializer); setControl(result); WorkbenchHelp.setHelp(result, IJavaHelpContextIds.JAVA_SEARCH_PAGE); } private Control createExpression(Composite parent) { Group result= new Group(parent, SWT.NONE); result.setText(SearchMessages.getString("SearchPage.expression.label")); GridLayout layout= new GridLayout(); layout.numColumns= 2; result.setLayout(layout); fPattern= new Combo(result, SWT.SINGLE | SWT.BORDER); fPattern.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { handlePatternSelected(); }
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
}); fPattern.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent e) { getContainer().setPerformActionEnabled(getPattern().length() > 0 && getContainer().hasValidScope()); updateCaseSensitiveCheckbox(); } }); GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.widthHint= convertWidthInCharsToPixels(30); gd.horizontalSpan= 2; fPattern.setLayoutData(gd); Label label= new Label(result, SWT.LEFT); label.setText(SearchMessages.getString("SearchPage.expression.pattern")); fCaseSensitive= new Button(result, SWT.CHECK); fCaseSensitive.setText(SearchMessages.getString("SearchPage.expression.caseSensitive")); gd= new GridData(); gd.horizontalAlignment= gd.END; fCaseSensitive.setLayoutData(gd); fCaseSensitive.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { fIsCaseSensitive= fCaseSensitive.getSelection(); writeConfiguration(); } }); return result; } private void updateCaseSensitiveCheckbox() {
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
if (fInitialData != null && getPattern().equals(fInitialData.pattern) && fJavaElement != null) { fCaseSensitive.setEnabled(false); fCaseSensitive.setSelection(true); } else { fCaseSensitive.setEnabled(true); fCaseSensitive.setSelection(fIsCaseSensitive); } } private void handlePatternSelected() { if (fPattern.getSelectionIndex() < 0) return; int index= fgPreviousSearchPatterns.size() - 1 - fPattern.getSelectionIndex(); fInitialData= (SearchPatternData) fgPreviousSearchPatterns.get(index); for (int i= 0; i < fSearchFor.length; i++) fSearchFor[i].setSelection(false); for (int i= 0; i < fLimitTo.length; i++) fLimitTo[i].setSelection(false); fSearchFor[fInitialData.searchFor].setSelection(true); setLimitTo(fInitialData.searchFor); fLimitTo[fInitialData.limitTo].setSelection(true); fPattern.setText(fInitialData.pattern); fIsCaseSensitive= fInitialData.isCaseSensitive; fJavaElement= fInitialData.javaElement; fCaseSensitive.setEnabled(fJavaElement == null); fCaseSensitive.setSelection(fInitialData.isCaseSensitive); if (fInitialData.workingSets != null) getContainer().setSelectedWorkingSets(fInitialData.workingSets); else getContainer().setSelectedScope(fInitialData.scope);
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
} private Control createSearchFor(Composite parent) { Group result= new Group(parent, SWT.NONE); result.setText(SearchMessages.getString("SearchPage.searchFor.label")); GridLayout layout= new GridLayout(); layout.numColumns= 3; result.setLayout(layout); result.setLayoutData(new GridData(GridData.FILL_VERTICAL)); fSearchFor= new Button[fSearchForText.length]; for (int i= 0; i < fSearchForText.length; i++) { Button button= new Button(result, SWT.RADIO); button.setText(fSearchForText[i]); fSearchFor[i]= button; } return result; } private Control createLimitTo(Composite parent) { Group result= new Group(parent, SWT.NONE); result.setText(SearchMessages.getString("SearchPage.limitTo.label")); GridLayout layout= new GridLayout(); layout.numColumns= 2; result.setLayout(layout); fLimitTo= new Button[fLimitToText.length]; for (int i= 0; i < fLimitToText.length; i++) { Button button= new Button(result, SWT.RADIO); button.setText(fLimitToText[i]); fLimitTo[i]= button; }
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
return result; } private void initSelections() { fStructuredSelection= asStructuredSelection(); fInitialData= tryStructuredSelection(fStructuredSelection); if (fInitialData == null) fInitialData= trySimpleTextSelection(getContainer().getSelection()); if (fInitialData == null) fInitialData= getDefaultInitValues(); fJavaElement= fInitialData.javaElement; fCaseSensitive.setSelection(fInitialData.isCaseSensitive); fCaseSensitive.setEnabled(fInitialData.javaElement == null); fSearchFor[fInitialData.searchFor].setSelection(true); setLimitTo(fInitialData.searchFor); fLimitTo[fInitialData.limitTo].setSelection(true); fPattern.setText(fInitialData.pattern); } private SearchPatternData tryStructuredSelection(IStructuredSelection selection) { if (selection == null) return null; Object o= selection.getFirstElement(); if (o instanceof IJavaElement) { return determineInitValuesFrom((IJavaElement)o); } else if (o instanceof ISearchResultViewEntry) { IJavaElement element= SearchUtil.getJavaElement(((ISearchResultViewEntry)o).getSelectedMarker()); return determineInitValuesFrom(element); } else if (o instanceof IAdaptable) { IJavaElement element= (IJavaElement)((IAdaptable)o).getAdapter(IJavaElement.class); if (element != null) {
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
return determineInitValuesFrom(element); } else { IWorkbenchAdapter adapter= (IWorkbenchAdapter)((IAdaptable)o).getAdapter(IWorkbenchAdapter.class); if (adapter != null) return new SearchPatternData(TYPE, REFERENCES, adapter.getLabel(o), null); } } return null; } private IJavaElement getJavaElement(IMarker marker) { try { return JavaCore.create((String)marker.getAttribute(IJavaSearchUIConstants.ATT_JE_HANDLE_ID)); } catch (CoreException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createJavaElement.title"), SearchMessages.getString("Search.Error.createJavaElement.message")); return null; } } private SearchPatternData determineInitValuesFrom(IJavaElement element) { if (element == null) return null; int searchFor= UNKNOWN; int limitTo= UNKNOWN; String pattern= null; switch (element.getElementType()) { case IJavaElement.PACKAGE_FRAGMENT: searchFor= PACKAGE; limitTo= REFERENCES; pattern= element.getElementName(); break;
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
case IJavaElement.PACKAGE_FRAGMENT_ROOT: searchFor= PACKAGE; limitTo= REFERENCES; pattern= element.getElementName(); break; case IJavaElement.PACKAGE_DECLARATION: searchFor= PACKAGE; limitTo= REFERENCES; pattern= element.getElementName(); break; case IJavaElement.IMPORT_DECLARATION: pattern= element.getElementName(); IImportDeclaration declaration= (IImportDeclaration)element; if (declaration.isOnDemand()) { searchFor= PACKAGE; int index= pattern.lastIndexOf('.'); pattern= pattern.substring(0, index); } else { searchFor= TYPE; } limitTo= DECLARATIONS; break; case IJavaElement.TYPE: searchFor= TYPE; limitTo= REFERENCES; pattern= JavaModelUtil.getFullyQualifiedName((IType)element); break; case IJavaElement.COMPILATION_UNIT: ICompilationUnit cu= (ICompilationUnit)element; String mainTypeName= element.getElementName().substring(0, element.getElementName().indexOf("."));
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
IType mainType= cu.getType(mainTypeName); mainTypeName= JavaModelUtil.getTypeQualifiedName(mainType); try { mainType= JavaModelUtil.findTypeInCompilationUnit(cu, mainTypeName); if (mainType == null) { IType[] types= cu.getTypes(); if (types.length > 0) mainType= types[0]; else break; } } catch (JavaModelException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); break; } searchFor= TYPE; element= mainType; limitTo= REFERENCES; pattern= JavaModelUtil.getFullyQualifiedName((IType)mainType); break; case IJavaElement.CLASS_FILE: IClassFile cf= (IClassFile)element; try { mainType= cf.getType(); } catch (JavaModelException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); break; } if (mainType == null)
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
break; element= mainType; searchFor= TYPE; limitTo= REFERENCES; pattern= JavaModelUtil.getFullyQualifiedName(mainType); break; case IJavaElement.FIELD: searchFor= FIELD; limitTo= REFERENCES; IType type= ((IField)element).getDeclaringType(); StringBuffer buffer= new StringBuffer(); buffer.append(JavaModelUtil.getFullyQualifiedName(type)); buffer.append('.'); buffer.append(element.getElementName()); pattern= buffer.toString(); break; case IJavaElement.METHOD: searchFor= METHOD; try { IMethod method= (IMethod)element; if (method.isConstructor()) searchFor= CONSTRUCTOR; } catch (JavaModelException ex) { ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.javaElementAccess.title"), SearchMessages.getString("Search.Error.javaElementAccess.message")); break; } limitTo= REFERENCES; pattern= PrettySignature.getMethodSignature((IMethod)element); break; }
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
if (searchFor != UNKNOWN && limitTo != UNKNOWN && pattern != null) return new SearchPatternData(searchFor, limitTo, pattern, element); return null; } private SearchPatternData trySimpleTextSelection(ISelection selection) { SearchPatternData result= null; if (selection instanceof ITextSelection) { BufferedReader reader= new BufferedReader(new StringReader(((ITextSelection)selection).getText())); String text; try { text= reader.readLine(); if (text == null) text= ""; } catch (IOException ex) { text= ""; } result= new SearchPatternData(TYPE, REFERENCES, text, null); } return result; } private SearchPatternData getDefaultInitValues() { return new SearchPatternData(TYPE, REFERENCES, "", null); } /* * Implements method from ISearchPage */ public void setContainer(ISearchPageContainer container) {
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
fContainer= container; } /** * Returns the search page's container. */ private ISearchPageContainer getContainer() { return fContainer; } /** * Returns the structured selection from the selection. */ private IStructuredSelection asStructuredSelection() { IWorkbenchWindow wbWindow= PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (wbWindow != null) { IWorkbenchPage page= wbWindow.getActivePage(); if (page != null) { IWorkbenchPart part= page.getActivePart(); if (part != null) try { return SelectionConverter.getStructuredSelection(part); } catch (JavaModelException ex) { } } } return StructuredSelection.EMPTY; }
14,281
Bug 14281 Java search page layout of Limit To
The Limit To box should be top aligned with the Search For box
resolved fixed
77e6484
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T08:34:51Z
2002-04-20T16:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
/** * Returns the page settings for this Java search page. * * @return the page settings to be used */ private IDialogSettings getDialogSettings() { IDialogSettings settings= JavaPlugin.getDefault().getDialogSettings(); fDialogSettings= settings.getSection(PAGE_NAME); if (fDialogSettings == null) fDialogSettings= settings.addNewSection(PAGE_NAME); return fDialogSettings; } /** * Initializes itself from the stored page settings. */ private void readConfiguration() { IDialogSettings s= getDialogSettings(); fIsCaseSensitive= s.getBoolean(STORE_CASE_SENSITIVE); } /** * Stores it current configuration in the dialog store. */ private void writeConfiguration() { IDialogSettings s= getDialogSettings(); s.put(STORE_CASE_SENSITIVE, fIsCaseSensitive); } }
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.preferences; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Arrays; import java.util.Hashtable; import org.eclipse.core.resources.IncrementalProjectBuilder; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.layout.GridData;
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.TabFolder; import org.eclipse.swt.widgets.TabItem; import org.eclipse.swt.widgets.Widget; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaPluginImages; import org.eclipse.jdt.internal.ui.JavaUIMessages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.dialogs.StatusUtil; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.util.TabFolderLayout; /* * The page for setting the compiler options. */ public class CompilerPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
private static final String PREF_LOCAL_VARIABLE_ATTR= "org.eclipse.jdt.core.compiler.debug.localVariable"; private static final String PREF_LINE_NUMBER_ATTR= "org.eclipse.jdt.core.compiler.debug.lineNumber"; private static final String PREF_SOURCE_FILE_ATTR= "org.eclipse.jdt.core.compiler.debug.sourceFile"; private static final String PREF_CODEGEN_UNUSED_LOCAL= "org.eclipse.jdt.core.compiler.codegen.unusedLocal"; private static final String PREF_CODEGEN_TARGET_PLATFORM= "org.eclipse.jdt.core.compiler.codegen.targetPlatform"; private static final String PREF_PB_UNREACHABLE_CODE= "org.eclipse.jdt.core.compiler.problem.unreachableCode"; private static final String PREF_PB_INVALID_IMPORT= "org.eclipse.jdt.core.compiler.problem.invalidImport"; private static final String PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD= "org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod"; private static final String PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME= "org.eclipse.jdt.core.compiler.problem.methodWithConstructorName"; private static final String PREF_PB_DEPRECATION= "org.eclipse.jdt.core.compiler.problem.deprecation"; private static final String PREF_PB_HIDDEN_CATCH_BLOCK= "org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock"; private static final String PREF_PB_UNUSED_LOCAL= "org.eclipse.jdt.core.compiler.problem.unusedLocal"; private static final String PREF_PB_UNUSED_PARAMETER= "org.eclipse.jdt.core.compiler.problem.unusedParameter"; private static final String PREF_PB_SYNTHETIC_ACCESS_EMULATION= "org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation"; private static final String PREF_PB_NON_EXTERNALIZED_STRINGS= "org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral"; private static final String PREF_PB_ASSERT_AS_IDENTIFIER= "org.eclipse.jdt.core.compiler.problem.assertIdentifier";
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
private static final String PREF_SOURCE_COMPATIBILITY= "org.eclipse.jdt.core.compiler.source"; private static final String PREF_COMPLIANCE= "org.eclipse.jdt.core.compiler.compliance"; private static final String INTR_DEFAULT_COMPLIANCE= "internal.default.compliance"; private static final String GENERATE= "generate"; private static final String DO_NOT_GENERATE= "do not generate"; private static final String PRESERVE= "preserve"; private static final String OPTIMIZE_OUT= "optimize out"; private static final String VERSION_1_1= "1.1"; private static final String VERSION_1_2= "1.2"; private static final String VERSION_1_3= "1.3"; private static final String VERSION_1_4= "1.4"; private static final String ERROR= "error"; private static final String WARNING= "warning"; private static final String IGNORE= "ignore"; private static final String DEFAULT= "default"; private static final String USER= "user"; private static String[] getAllKeys() { return new String[] { PREF_LOCAL_VARIABLE_ATTR, PREF_LINE_NUMBER_ATTR, PREF_SOURCE_FILE_ATTR, PREF_CODEGEN_UNUSED_LOCAL, PREF_CODEGEN_TARGET_PLATFORM, PREF_PB_UNREACHABLE_CODE, PREF_PB_INVALID_IMPORT, PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD, PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, PREF_PB_DEPRECATION, PREF_PB_HIDDEN_CATCH_BLOCK, PREF_PB_UNUSED_LOCAL, PREF_PB_UNUSED_PARAMETER, PREF_PB_SYNTHETIC_ACCESS_EMULATION, PREF_PB_NON_EXTERNALIZED_STRINGS, PREF_PB_ASSERT_AS_IDENTIFIER, PREF_SOURCE_COMPATIBILITY, PREF_COMPLIANCE }; }
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
/** * Initializes the current options (read from preference store) */ public static void initDefaults(IPreferenceStore store) { Hashtable hashtable= JavaCore.getDefaultOptions(); Hashtable currOptions= JavaCore.getOptions(); String[] allKeys= getAllKeys(); for (int i= 0; i < allKeys.length; i++) { String key= allKeys[i]; String defValue= (String) hashtable.get(key); if (defValue != null) { store.setDefault(key, defValue); } else { JavaPlugin.logErrorMessage("CompilerPreferencePage: value is null: " + key); } String val= store.getString(key); if (val != null) { currOptions.put(key, val); } } JavaCore.setOptions(currOptions); } private static class ControlData { private String fKey; private String[] fValues; public ControlData(String key, String[] values) { fKey= key; fValues= values;
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
} public String getKey() { return fKey; } public String getValue(boolean selection) { int index= selection ? 0 : 1; return fValues[index]; } public String getValue(int index) { return fValues[index]; } public int getSelection(String value) { for (int i= 0; i < fValues.length; i++) { if (value.equals(fValues[i])) { return i; } } throw new IllegalArgumentException(); } } private Hashtable fWorkingValues; private ArrayList fCheckBoxes; private ArrayList fComboBoxes; private SelectionListener fSelectionListener;
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
private ArrayList fComplianceControls; public CompilerPreferencePage() { setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore()); setDescription(JavaUIMessages.getString("CompilerPreferencePage.description")); fWorkingValues= JavaCore.getOptions(); fWorkingValues.put(INTR_DEFAULT_COMPLIANCE, getCurrentCompliance()); fCheckBoxes= new ArrayList(); fComboBoxes= new ArrayList(); fComplianceControls= new ArrayList(); fSelectionListener= new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) {} public void widgetSelected(SelectionEvent e) { controlChanged(e.widget); } }; } /** * @see IWorkbenchPreferencePage#init() */ public void init(IWorkbench workbench) { } /** * @see PreferencePage#createControl(Composite)
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
*/ public void createControl(Composite parent) { super.createControl(parent); WorkbenchHelp.setHelp(getControl(), IJavaHelpContextIds.COMPILER_PREFERENCE_PAGE); } /** * @see PreferencePage#createContents(Composite) */ protected Control createContents(Composite parent) { TabFolder folder= new TabFolder(parent, SWT.NONE); folder.setLayout(new TabFolderLayout()); folder.setLayoutData(new GridData(GridData.FILL_BOTH)); Composite warningsComposite= createWarningsTabContent(folder); Composite codeGenComposite= createCodeGenTabContent(folder); Composite complianceComposite= createComplianceTabContent(folder); TabItem item= new TabItem(folder, SWT.NONE); item.setText(JavaUIMessages.getString("CompilerPreferencePage.warnings.tabtitle")); item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_REFACTORING_WARNING)); item.setControl(warningsComposite); item= new TabItem(folder, SWT.NONE); item.setText(JavaUIMessages.getString("CompilerPreferencePage.generation.tabtitle")); item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_CFILE)); item.setControl(codeGenComposite); item= new TabItem(folder, SWT.NONE); item.setText(JavaUIMessages.getString("CompilerPreferencePage.compliance.tabtitle")); item.setImage(JavaPluginImages.get(JavaPluginImages.IMG_OBJS_LIBRARY)); item.setControl(complianceComposite);
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
validateSettings(null, null); return folder; } private Composite createWarningsTabContent(Composite folder) { String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE }; String[] errorWarningIgnoreLabels= new String[] { JavaUIMessages.getString("CompilerPreferencePage.error"), JavaUIMessages.getString("CompilerPreferencePage.warning"), JavaUIMessages.getString("CompilerPreferencePage.ignore") }; GridLayout layout= new GridLayout(); layout.numColumns= 2; Composite warningsComposite= new Composite(folder, SWT.NULL); warningsComposite.setLayout(layout); Label description= new Label(warningsComposite, SWT.WRAP); description.setText(JavaUIMessages.getString("CompilerPreferencePage.warnings.description")); GridData gd= new GridData(); gd.horizontalSpan= 2; gd.widthHint= convertWidthInCharsToPixels(60); description.setLayoutData(gd); String label= JavaUIMessages.getString("CompilerPreferencePage.pb_unreachable_code.label"); addComboBox(warningsComposite, label, PREF_PB_UNREACHABLE_CODE, errorWarningIgnore, errorWarningIgnoreLabels, 0); label= JavaUIMessages.getString("CompilerPreferencePage.pb_invalid_import.label"); addComboBox(warningsComposite, label, PREF_PB_INVALID_IMPORT, errorWarningIgnore, errorWarningIgnoreLabels, 0); label= JavaUIMessages.getString("CompilerPreferencePage.pb_overriding_pkg_dflt.label");
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
addComboBox(warningsComposite, label, PREF_PB_OVERRIDING_PACKAGE_DEFAULT_METHOD, errorWarningIgnore, errorWarningIgnoreLabels, 0); label= JavaUIMessages.getString("CompilerPreferencePage.pb_method_naming.label"); addComboBox(warningsComposite, label, PREF_PB_METHOD_WITH_CONSTRUCTOR_NAME, errorWarningIgnore, errorWarningIgnoreLabels, 0); label= JavaUIMessages.getString("CompilerPreferencePage.pb_deprecation.label"); addComboBox(warningsComposite, label, PREF_PB_DEPRECATION, errorWarningIgnore, errorWarningIgnoreLabels, 0); label= JavaUIMessages.getString("CompilerPreferencePage.pb_hidden_catchblock.label"); addComboBox(warningsComposite, label, PREF_PB_HIDDEN_CATCH_BLOCK, errorWarningIgnore, errorWarningIgnoreLabels, 0); label= JavaUIMessages.getString("CompilerPreferencePage.pb_unused_local.label"); addComboBox(warningsComposite, label, PREF_PB_UNUSED_LOCAL, errorWarningIgnore, errorWarningIgnoreLabels, 0); label= JavaUIMessages.getString("CompilerPreferencePage.pb_unused_parameter.label"); addComboBox(warningsComposite, label, PREF_PB_UNUSED_PARAMETER, errorWarningIgnore, errorWarningIgnoreLabels, 0); label= JavaUIMessages.getString("CompilerPreferencePage.pb_synth_access_emul.label"); addComboBox(warningsComposite, label, PREF_PB_SYNTHETIC_ACCESS_EMULATION, errorWarningIgnore, errorWarningIgnoreLabels, 0); label= JavaUIMessages.getString("CompilerPreferencePage.pb_non_externalized_strings.label"); addComboBox(warningsComposite, label, PREF_PB_NON_EXTERNALIZED_STRINGS, errorWarningIgnore, errorWarningIgnoreLabels, 0); return warningsComposite; } private Composite createCodeGenTabContent(Composite folder) { String[] generateValues= new String[] { GENERATE, DO_NOT_GENERATE }; GridLayout layout= new GridLayout(); layout.numColumns= 2; Composite codeGenComposite= new Composite(folder, SWT.NULL); codeGenComposite.setLayout(layout); String label= JavaUIMessages.getString("CompilerPreferencePage.variable_attr.label");
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
addCheckBox(codeGenComposite, label, PREF_LOCAL_VARIABLE_ATTR, generateValues, 0); label= JavaUIMessages.getString("CompilerPreferencePage.line_number_attr.label"); addCheckBox(codeGenComposite, label, PREF_LINE_NUMBER_ATTR, generateValues, 0); label= JavaUIMessages.getString("CompilerPreferencePage.source_file_attr.label"); addCheckBox(codeGenComposite, label, PREF_SOURCE_FILE_ATTR, generateValues, 0); label= JavaUIMessages.getString("CompilerPreferencePage.codegen_unused_local.label"); addCheckBox(codeGenComposite, label, PREF_CODEGEN_UNUSED_LOCAL, new String[] { PRESERVE, OPTIMIZE_OUT }, 0); return codeGenComposite; } private Composite createComplianceTabContent(Composite folder) { GridLayout layout= new GridLayout(); layout.numColumns= 2; Composite complianceComposite= new Composite(folder, SWT.NULL); complianceComposite.setLayout(layout); String[] values34= new String[] { VERSION_1_3, VERSION_1_4 }; String[] values34Labels= new String[] { JavaUIMessages.getString("CompilerPreferencePage.version13"), JavaUIMessages.getString("CompilerPreferencePage.version14") }; String label= JavaUIMessages.getString("CompilerPreferencePage.compiler_compliance.label"); addComboBox(complianceComposite, label, PREF_COMPLIANCE, values34, values34Labels, 0); label= JavaUIMessages.getString("CompilerPreferencePage.default_settings.label"); addCheckBox(complianceComposite, label, INTR_DEFAULT_COMPLIANCE, new String[] { DEFAULT, USER }, 0); int indent= convertWidthInCharsToPixels(2); Control[] otherChildren= complianceComposite.getChildren();
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
String[] values14= new String[] { VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4 }; String[] values14Labels= new String[] { JavaUIMessages.getString("CompilerPreferencePage.version11"), JavaUIMessages.getString("CompilerPreferencePage.version12"), JavaUIMessages.getString("CompilerPreferencePage.version13"), JavaUIMessages.getString("CompilerPreferencePage.version14") }; label= JavaUIMessages.getString("CompilerPreferencePage.codegen_targetplatform.label"); addComboBox(complianceComposite, label, PREF_CODEGEN_TARGET_PLATFORM, values14, values14Labels, indent); label= JavaUIMessages.getString("CompilerPreferencePage.source_compatibility.label"); addComboBox(complianceComposite, label, PREF_SOURCE_COMPATIBILITY, values34, values34Labels, indent); String[] errorWarningIgnore= new String[] { ERROR, WARNING, IGNORE }; String[] errorWarningIgnoreLabels= new String[] { JavaUIMessages.getString("CompilerPreferencePage.error"), JavaUIMessages.getString("CompilerPreferencePage.warning"), JavaUIMessages.getString("CompilerPreferencePage.ignore") }; label= JavaUIMessages.getString("CompilerPreferencePage.pb_assert_as_identifier.label"); addComboBox(complianceComposite, label, PREF_PB_ASSERT_AS_IDENTIFIER, errorWarningIgnore, errorWarningIgnoreLabels, indent); Control[] allChildren= complianceComposite.getChildren(); fComplianceControls.addAll(Arrays.asList(allChildren)); fComplianceControls.removeAll(Arrays.asList(otherChildren)); return complianceComposite; } private void addCheckBox(Composite parent, String label, String key, String[] values, int indent) { ControlData data= new ControlData(key, values);
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= 2; gd.horizontalIndent= indent; Button checkBox= new Button(parent, SWT.CHECK); checkBox.setText(label); checkBox.setData(data); checkBox.setLayoutData(gd); checkBox.addSelectionListener(fSelectionListener); String currValue= (String)fWorkingValues.get(key); checkBox.setSelection(data.getSelection(currValue) == 0); fCheckBoxes.add(checkBox); } private void addComboBox(Composite parent, String label, String key, String[] values, String[] valueLabels, int indent) { ControlData data= new ControlData(key, values); GridData gd= new GridData(GridData.FILL_HORIZONTAL); gd.horizontalIndent= indent; Label labelControl= new Label(parent, SWT.NONE); labelControl.setText(label); labelControl.setLayoutData(gd); Combo comboBox= new Combo(parent, SWT.READ_ONLY); comboBox.setItems(valueLabels); comboBox.setData(data);
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); comboBox.addSelectionListener(fSelectionListener); String currValue= (String)fWorkingValues.get(key); comboBox.select(data.getSelection(currValue)); fComboBoxes.add(comboBox); } private void controlChanged(Widget widget) { ControlData data= (ControlData) widget.getData(); String newValue= null; if (widget instanceof Button) { newValue= data.getValue(((Button)widget).getSelection()); } else if (widget instanceof Combo) { newValue= data.getValue(((Combo)widget).getSelectionIndex()); } else { return; } fWorkingValues.put(data.getKey(), newValue); validateSettings(data.getKey(), newValue); } private boolean checkValue(String key, String value) { return value.equals(fWorkingValues.get(key)); } /* (non-javadoc) * Update fields and validate. * @param changedKey Key that changed, or null, if all changed. */
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
private void validateSettings(String changedKey, String newValue) { if (changedKey != null) { if (INTR_DEFAULT_COMPLIANCE.equals(changedKey)) { updateComplianceEnableState(); if (DEFAULT.equals(newValue)) { updateComplianceDefaultSettings(); } } else if (PREF_COMPLIANCE.equals(changedKey)) { if (checkValue(INTR_DEFAULT_COMPLIANCE, DEFAULT)) { updateComplianceDefaultSettings(); } } else if (!PREF_SOURCE_COMPATIBILITY.equals(changedKey) && !PREF_CODEGEN_TARGET_PLATFORM.equals(changedKey) && !PREF_PB_ASSERT_AS_IDENTIFIER.equals(changedKey)) { return; } } else { updateComplianceEnableState(); } updateStatus(getValidation()); } private IStatus getValidation() { StatusInfo status= new StatusInfo(); if (checkValue(PREF_COMPLIANCE, VERSION_1_3)) { if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) { status.setError(JavaUIMessages.getString("CompilerPreferencePage.cpl13src14.error")); return status; } else if (checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4)) { status.setError(JavaUIMessages.getString("CompilerPreferencePage.cpl13trg14.error"));
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
return status; } } if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) { if (!checkValue(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR)) { status.setError(JavaUIMessages.getString("CompilerPreferencePage.src14asrterr.error")); return status; } } if (checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4)) { if (!checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4)) { status.setError(JavaUIMessages.getString("CompilerPreferencePage.src14tgt14.error")); return status; } } return status; } /* * Update the compliance controls' enable state */ private void updateComplianceEnableState() { boolean enabled= checkValue(INTR_DEFAULT_COMPLIANCE, USER); for (int i= fComplianceControls.size() - 1; i >= 0; i--) { Control curr= (Control) fComplianceControls.get(i); curr.setEnabled(enabled); } } /* * Set the default compliance values derived from the chosen level */
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
private void updateComplianceDefaultSettings() { Object complianceLevel= fWorkingValues.get(PREF_COMPLIANCE); if (VERSION_1_3.equals(complianceLevel)) { fWorkingValues.put(PREF_PB_ASSERT_AS_IDENTIFIER, IGNORE); fWorkingValues.put(PREF_SOURCE_COMPATIBILITY, VERSION_1_3); fWorkingValues.put(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_1); } else if (VERSION_1_4.equals(complianceLevel)) { fWorkingValues.put(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR); fWorkingValues.put(PREF_SOURCE_COMPATIBILITY, VERSION_1_4); fWorkingValues.put(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4); } updateControls(); } /* * Evaluate if the current compliance setting correspond to a default setting */ private String getCurrentCompliance() { Object complianceLevel= fWorkingValues.get(PREF_COMPLIANCE); if ((VERSION_1_3.equals(complianceLevel) && checkValue(PREF_PB_ASSERT_AS_IDENTIFIER, IGNORE) && checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_3) && checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_1)) || (VERSION_1_4.equals(complianceLevel) && checkValue(PREF_PB_ASSERT_AS_IDENTIFIER, ERROR) && checkValue(PREF_SOURCE_COMPATIBILITY, VERSION_1_4) && checkValue(PREF_CODEGEN_TARGET_PLATFORM, VERSION_1_4))) { return DEFAULT; } return USER;
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
} /* * @see IPreferencePage#performOk() */ public boolean performOk() { String[] allKeys= getAllKeys(); Hashtable actualOptions= JavaCore.getOptions(); IPreferenceStore store= getPreferenceStore(); boolean hasChanges= false; for (int i= 0; i < allKeys.length; i++) { String key= allKeys[i]; String val= (String) fWorkingValues.get(key); String oldVal= (String) actualOptions.get(key); hasChanges= hasChanges | !val.equals(oldVal); actualOptions.put(key, val); store.setValue(key, val); } JavaCore.setOptions(actualOptions); if (hasChanges) { String title= JavaUIMessages.getString("CompilerPreferencePage.needsbuild.title"); String message= JavaUIMessages.getString("CompilerPreferencePage.needsbuild.message"); if (MessageDialog.openQuestion(getShell(), title, message)) { doFullBuild(); } }
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
return super.performOk(); } private void doFullBuild() { ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell()); try { dialog.run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException { try { JavaPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } }); } catch (InterruptedException e) { } catch (InvocationTargetException e) { String title= JavaUIMessages.getString("CompilerPreferencePage.builderror.title"); String message= JavaUIMessages.getString("CompilerPreferencePage.builderror.message"); ExceptionHandler.handle(e, getShell(), title, message); } } /* * @see PreferencePage#performDefaults() */ protected void performDefaults() { fWorkingValues= JavaCore.getDefaultOptions(); fWorkingValues.put(INTR_DEFAULT_COMPLIANCE, getCurrentCompliance());
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/CompilerPreferencePage.java
updateControls(); validateSettings(null, null); super.performDefaults(); } private void updateControls() { for (int i= fCheckBoxes.size() - 1; i >= 0; i--) { Button curr= (Button) fCheckBoxes.get(i); ControlData data= (ControlData) curr.getData(); String currValue= (String) fWorkingValues.get(data.getKey()); curr.setSelection(data.getSelection(currValue) == 0); } for (int i= fComboBoxes.size() - 1; i >= 0; i--) { Combo curr= (Combo) fComboBoxes.get(i); ControlData data= (ControlData) curr.getData(); String currValue= (String) fWorkingValues.get(data.getKey()); curr.select(data.getSelection(currValue)); } } private void updateStatus(IStatus status) { setValid(!status.matches(IStatus.ERROR)); StatusUtil.applyToStatusLine(this, status); } }
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaBuilderPreferencePage.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.preferences; import java.lang.reflect.InvocationTargetException; import java.util.Hashtable; import java.util.StringTokenizer; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.IncrementalProjectBuilder; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.PreferencePage; import org.eclipse.ui.IWorkbench;
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaBuilderPreferencePage.java
import org.eclipse.ui.IWorkbenchPreferencePage; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaUIMessages; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.dialogs.StatusUtil; import org.eclipse.jdt.internal.ui.util.ExceptionHandler; import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener; import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField; public class JavaBuilderPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { private StringDialogField fResourceFilterField; private StatusInfo fResourceFilterStatus; private Hashtable fWorkingValues; private static final String PREF_RESOURCE_FILTER= "org.eclipse.jdt.core.builder.resourceCopyExclusionFilter"; private static String[] getAllKeys() { return new String[] { PREF_RESOURCE_FILTER }; } public JavaBuilderPreferencePage() { setPreferenceStore(JavaPlugin.getDefault().getPreferenceStore()); setDescription(JavaUIMessages.getString("JavaBuilderPreferencePage.description")); fWorkingValues= JavaCore.getOptions(); IDialogFieldListener listener= new IDialogFieldListener() { public void dialogFieldChanged(DialogField field) {
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaBuilderPreferencePage.java
doValidation(); } }; fResourceFilterField= new StringDialogField(); fResourceFilterField.setDialogFieldListener(listener); fResourceFilterField.setLabelText(JavaUIMessages.getString("JavaBuilderPreferencePage.filter.label")); updateControls(); } /* * @see PreferencePage#createContents(Composite) */ protected Control createContents(Composite parent) { initializeDialogUnits(parent); GridLayout layout= new GridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; layout.numColumns= 2; Composite composite= new Composite(parent, SWT.NONE); composite.setLayout(layout); DialogField resourceFilterLabel= new DialogField(); resourceFilterLabel.setLabelText(JavaUIMessages.getString("JavaBuilderPreferencePage.filter.description")); resourceFilterLabel.doFillIntoGrid(composite, 2); LayoutUtil.setWidthHint(resourceFilterLabel.getLabelControl(null), convertWidthInCharsToPixels(80)); fResourceFilterField.doFillIntoGrid(composite, 2); LayoutUtil.setHorizontalGrabbing(fResourceFilterField.getTextControl(null)); LayoutUtil.setWidthHint(fResourceFilterField.getTextControl(null), convertWidthInCharsToPixels(50));
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaBuilderPreferencePage.java
return composite; } /** * Initializes the current options (read from preference store) */ public static void initDefaults(IPreferenceStore store) { Hashtable hashtable= JavaCore.getDefaultOptions(); Hashtable currOptions= JavaCore.getOptions(); String[] allKeys= getAllKeys(); for (int i= 0; i < allKeys.length; i++) { String key= allKeys[i]; String defValue= (String) hashtable.get(key); if (defValue != null) { store.setDefault(key, defValue); } else { JavaPlugin.logErrorMessage("JavaBuilderPreferencePage: value is null: " + key); } String val= store.getString(key); if (val != null) { currOptions.put(key, val); } } JavaCore.setOptions(currOptions); } /* * @see IWorkbenchPreferencePage#init(IWorkbench) */
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaBuilderPreferencePage.java
public void init(IWorkbench workbench) { } /* * @see IPreferencePage#performOk() */ public boolean performOk() { String[] allKeys= getAllKeys(); Hashtable actualOptions= JavaCore.getOptions(); IPreferenceStore store= getPreferenceStore(); boolean hasChanges= false; for (int i= 0; i < allKeys.length; i++) { String key= allKeys[i]; String val= (String) fWorkingValues.get(key); String oldVal= (String) actualOptions.get(key); hasChanges= hasChanges | !val.equals(oldVal); actualOptions.put(key, val); store.setValue(key, val); } JavaCore.setOptions(actualOptions); if (hasChanges) { String title= JavaUIMessages.getString("JavaBuilderPreferencePage.needsbuild.title"); String message= JavaUIMessages.getString("JavaBuilderPreferencePage.needsbuild.message"); if (MessageDialog.openQuestion(getShell(), title, message)) { doFullBuild(); } }
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaBuilderPreferencePage.java
return super.performOk(); } private void doValidation() { IStatus status= validateResourceFilters(); updateStatus(status); } private String[] getFilters(String text) { StringTokenizer tok= new StringTokenizer(text, ","); int nTokens= tok.countTokens(); String[] res= new String[nTokens]; for (int i= 0; i < res.length; i++) { res[i]= tok.nextToken().trim(); } return res; } private IStatus validateResourceFilters() { IWorkspace workspace= ResourcesPlugin.getWorkspace(); String text= fResourceFilterField.getText(); String[] filters= getFilters(text); for (int i= 0; i < filters.length; i++) { String fileName= filters[i].replace('*', 'x'); IStatus status= workspace.validateName(fileName, IResource.FILE); if (status.matches(IStatus.ERROR)) { String message= JavaUIMessages.getFormattedString("JavaBuilderPreferencePage.filter.invalidsegment.error", status.getMessage()); return new StatusInfo(IStatus.ERROR, message); }
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaBuilderPreferencePage.java
} StringBuffer buf= new StringBuffer(); for (int i= 0; i < filters.length; i++) { if (i > 0) { buf.append(','); } buf.append(filters[i]); } fWorkingValues.put(PREF_RESOURCE_FILTER, buf.toString()); return new StatusInfo(); } private void updateStatus(IStatus status) { setValid(!status.matches(IStatus.ERROR)); StatusUtil.applyToStatusLine(this, status); } private void doFullBuild() { ProgressMonitorDialog dialog= new ProgressMonitorDialog(getShell()); try { dialog.run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException { try { JavaPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } }); } catch (InterruptedException e) {
11,673
Bug 11673 ESC does not cancel Apply when changing compiler options
build 20020319 Workbench->Preferences->Java->Compiler 1) Start with the default settings 2) Change "Unused local variables" to "Warning" 3) Hit Apply button 4) Dialog shows up asking if user wants a full rebuild 5) Hit Cancel to exit yes/no dialog 6) Hit cancel to exit preferences 7) Go back to the same preferences page 8) "Unused local variables" was set to "Warning" The expected behaviour was to cancel the dialog (none of the options) and cancel the preferences without modifying anything. It seems that ESC is the same as hitting NO in that dialog.
resolved fixed
e34c5fc
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T09:40:25Z
2002-03-19T20:33:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/JavaBuilderPreferencePage.java
} catch (InvocationTargetException e) { String title= JavaUIMessages.getString("JavaBuilderPreferencePage.builderror.title"); String message= JavaUIMessages.getString("JavaBuilderPreferencePage.builderror.message"); ExceptionHandler.handle(e, getShell(), title, message); } } /* * @see PreferencePage#performDefaults() */ protected void performDefaults() { fWorkingValues= JavaCore.getDefaultOptions(); updateControls(); doValidation(); super.performDefaults(); } private void updateControls() { String[] filters= getFilters((String) fWorkingValues.get(PREF_RESOURCE_FILTER)); StringBuffer buf= new StringBuffer(); for (int i= 0; i < filters.length; i++) { if (i > 0) { buf.append(", "); } buf.append(filters[i]); } fResourceFilterField.setText(buf.toString()); } }
13,242
Bug 13242 quick fix: method name not offered
void d(){ class D{ void fs(){ dsss(); //error }; } } d is not offered as a fix
resolved fixed
119bb95
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:13:35Z
2002-04-10T12:00:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NameMatcher.java
/******************************************************************************* * Copyright (c) 2000, 2002 International Business Machines Corp. and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Common Public License v0.5 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/cpl-v05.html * * Contributors: * IBM Corporation - initial API and implementation ******************************************************************************/ package org.eclipse.jdt.internal.ui.text.correction; public class NameMatcher { /**
13,242
Bug 13242 quick fix: method name not offered
void d(){ class D{ void fs(){ dsss(); //error }; } } d is not offered as a fix
resolved fixed
119bb95
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:13:35Z
2002-04-10T12:00:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NameMatcher.java
* Returns a similarity value of the two names. * The range of is from 0 to 256. no similarity is negative */ public static boolean isSimilarName(String name1, String name2) { return getSimilarity(name1, name2) >= 0; } /** * Returns a similarity value of the two names. * The range of is from 0 to 256. no similarity is negative */ public static int getSimilarity(String name1, String name2) { if (name1.length() > name2.length()) { String tmp= name1; name1= name2; name2= tmp; } int name1len= name1.length(); int name2len= name2.length(); int nMatched= 0; int i= 0; while (i < name1len && isSimilarChar(name1.charAt(i), name2.charAt(i))) { i++; nMatched++; } int k= name1len; int diff= name2len - name1len;
13,242
Bug 13242 quick fix: method name not offered
void d(){ class D{ void fs(){ dsss(); //error }; } } d is not offered as a fix
resolved fixed
119bb95
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:13:35Z
2002-04-10T12:00:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NameMatcher.java
while (k > i && isSimilarChar(name1.charAt(k - 1), name2.charAt(k + diff - 1))) { k--; nMatched++; } if (name2len - nMatched > nMatched) { return -1; } int tolerance= name1len / 4 + 1; return (tolerance - (k - i)) * 256 / tolerance; } private static boolean isSimilarChar(char ch1, char ch2) { return Character.toLowerCase(ch1) == Character.toLowerCase(ch2); } private static void test(String name1, String name2) { int sim= getSimilarity(name1, name2); System.out.println(name1 + " - " + name2 + " : " + sim); } public static void main(String[] arguments) { test("runner", "gunner"); test("rundner", "gunner"); test("rundner", "rund"); test("test", "rund"); } }
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
/* * (c) Copyright IBM Corp. 2000, 2002. * 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.Arrays; 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;
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.IWorkspaceDescription; import org.eclipse.core.resources.IncrementalProjectBuilder; 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.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.dialogs.ProgressMonitorDialog; 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.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaModelMarker; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IPackageFragment;
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.ui.jarpackager.IJarDescriptionWriter; import org.eclipse.jdt.ui.jarpackager.IJarExportRunnable; import org.eclipse.jdt.ui.jarpackager.JarPackageData; import org.eclipse.jdt.ui.jarpackager.JarWriter; 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 IJarExportRunnable { private static class MessageMultiStatus extends MultiStatus { MessageMultiStatus(String pluginId, int code, String message, Throwable exception) { super(pluginId, code, message, exception); } /* * allows to change the message */ protected void setMessage(String message) { super.setMessage(message); } } private static final String COMPILER_SOURCE_FILE_ATTR = "org.eclipse.jdt.core.compiler.debug.sourceFile"; private JarWriter fJarWriter; private JarPackageData fJarPackage; private JarPackageData[] fJarPackages;
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
private Shell fParentShell; private Map fJavaNameToClassFilesMap; private IContainer fClassFilesMapContainer; private Set fExportedClassContainers; private MessageMultiStatus fStatus; /** * 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(JarPackageData jarPackage, Shell parent) { this(new JarPackageData[] {jarPackage}, parent); } /** * Creates an instance of this class. * * @param jarPackages an array with JAR package data objects * @param parent the parent for the dialog, * or <code>null</code> if no dialog should be presented */ public JarFileExportOperation(JarPackageData[] jarPackages, Shell parent) { this(parent); fJarPackages= jarPackages; } private JarFileExportOperation(Shell parent) { fParentShell= parent; fStatus= new MessageMultiStatus(JavaPlugin.getPluginId(), IStatus.OK, "", null);
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} protected void addToStatus(CoreException ex) { IStatus status= ex.getStatus(); int severity= status.getSeverity(); if (fJarPackage == null || severity == IStatus.INFO || (severity == IStatus.ERROR && fJarPackage.logErrors()) || (severity == IStatus.WARNING && fJarPackage.logWarnings())) { String message= ex.getLocalizedMessage(); if (message == null || message.length() < 1) { message= JarPackagerMessages.getString("JarFileExportOperation.coreErrorDuringExport"); status= new Status(status.getSeverity(), status.getPlugin(), status.getCode(), message, ex); } fStatus.add(status); } } /** * 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> */ protected void addWarning(String message, Throwable error) { if (fJarPackage == null || fJarPackage.logWarnings()) fStatus.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> */
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
protected void addError(String message, Throwable error) { if (fJarPackage == null || fJarPackage.logErrors()) fStatus.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; int n= fJarPackage.getElements().length; for (int i= 0; i < n; i++) { Object element= fJarPackage.getElements()[i]; 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);
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} return count; } private int getTotalChildCount(IContainer container) { IResource[] members; try { members= container.members(); } catch (CoreException ex) { return 0; } 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;
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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(); 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 {
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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); else pkgRoot= findPackageFragmentRoot(jProject, resource.getFullPath().removeLastSegments(1)); } catch (JavaModelException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.javaPackageNotDeterminable", resource.getFullPath()), ex); return; } } } if (pkgRoot != null) { leadSegmentsToRemove= pkgRoot.getPath().segmentCount(); if (mustUseSourceFolderHierarchy() && !pkgRoot.getElementName().equals(pkgRoot.DEFAULT_PACKAGEROOT_PATH)) leadSegmentsToRemove--; } IPath destinationPath= resource.getFullPath().removeFirstSegments(leadSegmentsToRemove); boolean isInOutputFolder= false; if (isInJavaProject) {
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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); } else if (element instanceof IPackageFragment) exportPackageFragment(progressMonitor, (IPackageFragment)element); else exportContainer(progressMonitor, (IContainer)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); } }
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
private void exportContainer(IProgressMonitor progressMonitor, IContainer container) throws java.lang.InterruptedException { if (container.getType() == IResource.FOLDER && isOutputFolder((IFolder)container)) return; IResource[] children= null; try { children= container.members(); } catch (CoreException e) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringExport", container.getFullPath()), e); } for (int i= 0; i < children.length; i++) exportElement(children[i], progressMonitor); } private IPackageFragmentRoot findPackageFragmentRoot(IJavaProject jProject, IPath path) throws JavaModelException { if (jProject == null || path == null || path.segmentCount() <= 0) return null; IPackageFragmentRoot pkgRoot= jProject.findPackageFragmentRoot(path); if (pkgRoot != null) return pkgRoot; else return findPackageFragmentRoot(jProject, path.removeLastSegments(1)); } 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);
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} 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 (CoreException ex) { addToStatus(ex); } } } private boolean isOutputFolder(IFolder folder) { try { IJavaProject javaProject= JavaCore.create(folder.getProject()); IPath outputFolderPath= javaProject.getOutputLocation(); return folder.getFullPath().equals(outputFolderPath); } catch (JavaModelException ex) { return false; } } private void exportClassFiles(IProgressMonitor progressMonitor, IPackageFragmentRoot pkgRoot, IResource resource, IJavaProject jProject, IPath destinationPath) { if (fJarPackage.areClassFilesExported() && isJavaFile(resource) && pkgRoot != null) { try { Iterator iter= filesOnClasspath((IFile)resource, destinationPath, jProject, progressMonitor); IPath baseDestinationPath= destinationPath.removeLastSegments(1); while (iter.hasNext()) { IFile file= (IFile)iter.next();
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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 (CoreException ex) { addToStatus(ex); } } } /** * Exports the resources as specified by the JAR package. */ protected void exportSelectedElements(IProgressMonitor progressMonitor) throws InterruptedException { fExportedClassContainers= new HashSet(10); int n= fJarPackage.getElements().length; for (int i= 0; i < n; i++) exportElement(fJarPackage.getElements()[i], 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 {
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
IFile[] classFiles= fJarPackage.findClassfilesFor(file); if (classFiles != null) return Arrays.asList(classFiles).iterator(); if (!isJavaFile(file)) return Collections.EMPTY_LIST.iterator(); 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)); } } boolean hasErrors= hasCompileErrors(file); boolean hasWarnings= hasCompileWarnings(file); boolean canBeExported= canBeExported(hasErrors, hasWarnings); if (!canBeExported) return Collections.EMPTY_LIST.iterator(); reportPossibleCompileProblems(file, hasErrors, hasWarnings, canBeExported); IContainer classContainer= outputContainer; if (pathInJar.segmentCount() > 1) classContainer= outputContainer.getFolder(pathInJar.removeLastSegments(1)); if (fExportedClassContainers.contains(classContainer))
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
return Collections.EMPTY_LIST.iterator(); if (fClassFilesMapContainer == null || !fClassFilesMapContainer.equals(classContainer)) { fJavaNameToClassFilesMap= buildJavaToClassMap(classContainer); if (fJavaNameToClassFilesMap == null) { String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.missingSourceFileAttributeExportedAll", classContainer.getLocation().toFile()); addWarning(msg, null); fExportedClassContainers.add(classContainer); return getClassesIn(classContainer); } fClassFilesMapContainer= classContainer; } ArrayList classFileList= (ArrayList)fJavaNameToClassFilesMap.get(file.getName()); if (classFileList == null || classFileList.isEmpty()) { String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.classFileOnClasspathNotAccessible", file.getFullPath()); throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null)); } return classFileList.iterator(); } private Iterator getClassesIn(IContainer classContainer) throws CoreException { IResource[] resources= classContainer.members(); List files= new ArrayList(resources.length); for (int i= 0; i < resources.length; i++) if (resources[i].getType() == IResource.FILE && isClassFile(resources[i])) files.add(resources[i]); return files.iterator(); } /** * Answers whether the given resource is a Java file.
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
* 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 */ private Map buildJavaToClassMap(IContainer container) throws CoreException { if (!isCompilerGeneratingSourceFileAttribute()) return null;
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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) { /* * Can't fully build the map because one or more * class file does not contain the name of its * source file. */ addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.classFileWithoutSourceFileAttribute", classFile.getLocation().toFile()), null); return null; }
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
String javaName= new String(cfReader.sourceFileName()); Object classFiles= map.get(javaName); if (classFiles == null) { classFiles= new ArrayList(3); 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. *
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
* @param folderPath the path of the folder to create a handle for * @return the new folder resource handle */ protected IFolder createFolderHandle(IPath folderPath) { if (folderPath.isValidPath(folderPath.toString()) && folderPath.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFolder(folderPath); else return null; } /** * Returns the status of this operation. * The result is a status object containing individual * status objects. * * @return the status of this operation */ public IStatus getStatus() { String message= null; switch (fStatus.getSeverity()) { case IStatus.OK: message= ""; break; case IStatus.INFO: message= JarPackagerMessages.getString("JarFileExportOperation.exportFinishedWithInfo"); break; case IStatus.WARNING: message= JarPackagerMessages.getString("JarFileExportOperation.exportFinishedWithWarnings"); break; case IStatus.ERROR: if (fJarPackages.length > 1)
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
message= JarPackagerMessages.getString("JarFileExportOperation.creationOfSomeJARsFailed"); else message= JarPackagerMessages.getString("JarFileExportOperation.jarCreationFailed"); break; default: message= ""; break; } fStatus.setMessage(message); return fStatus; } /** * 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 * @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)
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|| (hasErrors && fJarPackage.areErrorsExported()) || (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); } } /** * 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 { int count= fJarPackages.length; progressMonitor.beginTask("", count); try { for (int i= 0; i < count; i++) { SubProgressMonitor subProgressMonitor= new SubProgressMonitor(progressMonitor, 1); fJarPackage= fJarPackages[i];
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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()) { 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= fJarPackage.createJarWriter(fParentShell); exportSelectedElements(progressMonitor); if (getStatus().getSeverity() != IStatus.ERROR) { progressMonitor.subTask(JarPackagerMessages.getString("JarFileExportOperation.savingFiles")); saveFiles(); } } catch (CoreException ex) { addToStatus(ex); } finally {
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
try { if (fJarWriter != null) fJarWriter.close(); } catch (CoreException ex) { addToStatus(ex); } progressMonitor.done(); } } protected boolean preconditionsOK() { if (!fJarPackage.areClassFilesExported() && !fJarPackage.areJavaFilesExported()) { addError(JarPackagerMessages.getString("JarFileExportOperation.noExportTypeChosen"), null); return false; } if (fJarPackage.getElements() == null || fJarPackage.getElements().length == 0) { addError(JarPackagerMessages.getString("JarFileExportOperation.noResourcesSelected"), null); return false; } if (fJarPackage.getJarLocation() == null) { addError(JarPackagerMessages.getString("JarFileExportOperation.invalidJarLocation"), null); return false; } if (!fJarPackage.isManifestAccessible()) { addError(JarPackagerMessages.getString("JarFileExportOperation.manifestDoesNotExist"), null); return false; } if (!fJarPackage.isMainClassValid(new BusyIndicatorRunnableContext())) { addError(JarPackagerMessages.getString("JarFileExportOperation.invalidMainClass"), null); return false;
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} IFile[] unsavedFiles= getUnsavedFiles(); if (unsavedFiles.length > 0) return saveModifiedResourcesIfUserConfirms(unsavedFiles); return true; } /** * Returns the files which are not saved and which are * part of the files being exported. * * @return an array of unsaved files */ private IFile[] getUnsavedFiles() { IEditorPart[] dirtyEditors= JavaPlugin.getDirtyEditors(); Set unsavedFiles= new HashSet(dirtyEditors.length); if (dirtyEditors.length > 0) { List selection= JarPackagerUtil.asResources(fJarPackage.getElements()); 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); } } } } return (IFile[])unsavedFiles.toArray(new IFile[unsavedFiles.size()]); } /**
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
* Asks the user to confirm to save the modified resources. * * @return true if user pressed OK. */ private boolean confirmSaveModifiedResources(IFile[] dirtyFiles) { if (dirtyFiles == null || dirtyFiles.length == 0) return true; Display display= fParentShell.getDisplay(); if (display == null || display.isDisposed()) return false; final ConfirmSaveModifiedResourcesDialog dlg= new ConfirmSaveModifiedResourcesDialog(fParentShell, dirtyFiles); final int[] intResult= new int[1]; Runnable runnable= new Runnable() { public void run() { intResult[0]= dlg.open(); } }; display.syncExec(runnable); return intResult[0] == IDialogConstants.OK_ID; } /** * Asks to confirm to save the modified resources * and save them if OK is pressed. * * @return true if user pressed OK and save was successful. */ private boolean saveModifiedResourcesIfUserConfirms(IFile[] dirtyFiles) { if (confirmSaveModifiedResources(dirtyFiles))
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
return saveModifiedResources(dirtyFiles); for (int i= 0; i < dirtyFiles.length; i++) addError(JarPackagerMessages.getFormattedString("JarFileExportOperation.fileUnsaved", dirtyFiles[i].getFullPath()), null); return false; } /** * Save all of the editors in the workbench. * * @return true if successful. */ private boolean saveModifiedResources(final IFile[] dirtyFiles) { Display display= fParentShell.getDisplay(); if (display == null || display.isDisposed()) return false; final boolean[] retVal= new boolean[1]; Runnable runnable= new Runnable() { public void run() { IWorkspace workspace= ResourcesPlugin.getWorkspace(); IWorkspaceDescription description= workspace.getDescription(); boolean autoBuild= description.isAutoBuilding(); description.setAutoBuilding(false); try { workspace.setDescription(description); try { new ProgressMonitorDialog(fParentShell).run(false, false, createSaveModifiedResourcesRunnable(dirtyFiles)); retVal[0]= true;
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} finally { description.setAutoBuilding(autoBuild); workspace.setDescription(description); } } catch (InvocationTargetException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingModifiedResources"), ex); JavaPlugin.log(ex); retVal[0]= false; } catch (InterruptedException ex) { Assert.isTrue(false); retVal[0]= false; } catch (CoreException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingModifiedResources"), ex); JavaPlugin.log(ex); retVal[0]= false; } } }; display.syncExec(runnable); return retVal[0]; } private IRunnableWithProgress createSaveModifiedResourcesRunnable(final IFile[] dirtyFiles) { return new IRunnableWithProgress() { public void run(final IProgressMonitor pm) { IEditorPart[] editorsToSave= JavaPlugin.getDirtyEditors(); pm.beginTask(JarPackagerMessages.getString("JarFileExportOperation.savingModifiedResources"), editorsToSave.length); try { List dirtyFilesList= Arrays.asList(dirtyFiles); for (int i= 0; i < editorsToSave.length; i++) {
13,269
Bug 13269 Incorrect operation order in jarpackager
null
resolved fixed
7a8abf9
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2002-04-22T10:26:34Z
2002-04-10T14:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
if (editorsToSave[i].getEditorInput() instanceof IFileEditorInput) { IFile dirtyFile= ((IFileEditorInput)editorsToSave[i].getEditorInput()).getFile(); if (dirtyFilesList.contains((dirtyFile))) editorsToSave[i].doSave(new SubProgressMonitor(pm, 1)); } pm.worked(1); } } finally { pm.done(); } } }; } protected void saveFiles() { if (fJarPackage.isManifestGenerated() && 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(); } catch (CoreException ex) {