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
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
fDestinationNamesCombo.setLayoutData(data); fDestinationBrowseButton= new Button(destinationSelectionGroup, SWT.PUSH); fDestinationBrowseButton.setText(JarPackagerMessages.getString("JarPackageWizardPage.browseButton.text")); fDestinationBrowseButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); SWTUtil.setButtonDimensionHint(fDestinationBrowseButton); fDestinationBrowseButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { handleDestinationBrowseButtonPressed(); } }); } /** * Open an appropriate destination browser so that the user can specify a source * to import from */ protected void handleDescriptionFileBrowseButtonPressed() { SaveAsDialog dialog= new SaveAsDialog(getContainer().getShell()); dialog.create(); dialog.getShell().setText(JarPackagerMessages.getString("JarPackageWizardPage.saveAsDialog.title")); dialog.setMessage(JarPackagerMessages.getString("JarPackageWizardPage.saveAsDialog.message")); dialog.setOriginalFile(createFileHandle(fJarPackage.getDescriptionLocation())); if (dialog.open() == dialog.OK) { IPath path= dialog.getResult(); path= path.removeFileExtension().addFileExtension(JarPackage.DESCRIPTION_EXTENSION); fDescriptionFileText.setText(path.toString()); } } /** * Open an appropriate destination browser so that the user can specify a source
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
* to import from */ protected void handleDestinationBrowseButtonPressed() { FileDialog dialog= new FileDialog(getContainer().getShell(), SWT.SAVE); dialog.setFilterExtensions(new String[] {"*.jar"}); String currentSourceString= getDestinationValue(); int lastSeparatorIndex= currentSourceString.lastIndexOf(File.separator); if (lastSeparatorIndex != -1) { dialog.setFilterPath(currentSourceString.substring(0, lastSeparatorIndex)); dialog.setFileName(currentSourceString.substring(lastSeparatorIndex + 1, currentSourceString.length())); } else dialog.setFileName(currentSourceString); String selectedFileName= dialog.open(); if (selectedFileName != null) { IPath path= getPathFromString(selectedFileName); if (path.lastSegment().equals(getOutputSuffix())) selectedFileName= ""; fDestinationNamesCombo.setText(selectedFileName); } } /** * Returns the resource for the specified path. * * @param path the path for which the resource should be returned * @return the resource specified by the path or <code>null</code> */ protected IResource findResource(IPath path) { IWorkspace workspace= JavaPlugin.getWorkspace(); IStatus result= workspace.validatePath(
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
path.toString(), IResource.ROOT | IResource.PROJECT | IResource.FOLDER | IResource.FILE); if (result.isOK() && workspace.getRoot().exists(path)) return workspace.getRoot().findMember(path); return null; } /** * Creates the checkbox tree and list for selecting resources. * * @param parent the parent control */ protected void createInputGroup(Composite parent) { int labelFlags= JavaElementLabelProvider.SHOW_BASICS | JavaElementLabelProvider.SHOW_OVERLAY_ICONS | JavaElementLabelProvider.SHOW_SMALL_ICONS; ITreeContentProvider treeContentProvider= new JavaElementContentProvider() { public boolean hasChildren(Object element) { return !(element instanceof IPackageFragment) && super.hasChildren(element); } }; fInputGroup= new CheckboxTreeAndListGroup( parent, JavaCore.create(JavaPlugin.getDefault().getWorkspace().getRoot()), treeContentProvider, new JavaElementLabelProvider(labelFlags), new BaseJavaElementContentProvider(), new JavaElementLabelProvider(labelFlags), SWT.NONE,
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
SIZING_SELECTION_WIDGET_WIDTH, SIZING_SELECTION_WIDGET_HEIGHT); fInputGroup.addTreeFilter(new EmptyInnerPackageFilter()); fInputGroup.addTreeFilter(new ContainerFilter(ContainerFilter.FILTER_NON_CONTAINERS)); fInputGroup.addTreeFilter(new LibraryFilter()); fInputGroup.addListFilter(new ContainerFilter(ContainerFilter.FILTER_CONTAINERS)); fInputGroup.getTree().addListener(SWT.MouseUp, this); fInputGroup.getTable().addListener(SWT.MouseUp, this); } /** * Creates the export type controls. * * @param parent the parent control */ protected void createExportTypeGroup(Composite parent) { Composite optionsGroup= new Composite(parent, SWT.NONE); GridLayout optionsLayout= new GridLayout(); optionsLayout.marginHeight= 0; optionsGroup.setLayout(optionsLayout); fExportClassFilesCheckbox= new Button(optionsGroup, SWT.CHECK | SWT.LEFT); fExportClassFilesCheckbox.setText(JarPackagerMessages.getString("JarPackageWizardPage.exportClassFiles.text")); fExportClassFilesCheckbox.addListener(SWT.Selection, this); fExportJavaFilesCheckbox= new Button(optionsGroup, SWT.CHECK | SWT.LEFT); fExportJavaFilesCheckbox.setText(JarPackagerMessages.getString("JarPackageWizardPage.exportJavaFiles.text")); fExportJavaFilesCheckbox.addListener(SWT.Selection, this); } /** * Updates the enablements of this page's controls. Subclasses may extend. */ protected void updateWidgetEnablements() {
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
} /* * Overrides method from IJarPackageWizardPage */ public boolean isPageComplete() { setErrorMessage(null); return super.determinePageCompletion(); } /* * Implements method from Listener */ public void handleEvent(Event e) { if (getControl() == null) return; update(); } protected void update() { updateModel(); updateWidgetEnablements(); updatePageCompletion(); } /* * Overrides method from WizardDataTransferPage */ protected boolean validateDestinationGroup() { if (fDestinationNamesCombo.getText().length() == 0) { return false; }
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
if (fJarPackage.getJarLocation().toString().endsWith("/")) { setErrorMessage(JarPackagerMessages.getString("JarPackageWizardPage.error.exportDestinationMustNotBeDirectory")); fDestinationNamesCombo.setFocus(); return false; } return ensureTargetFileIsValid(fJarPackage.getJarLocation().toFile()); } /* * Overrides method from WizardDataTransferPage */ protected boolean validateOptionsGroup() { return true; } /* * Overrides method from WizardDataTransferPage */ protected boolean validateSourceGroup() { if (!fExportClassFilesCheckbox.getSelection() && !fExportJavaFilesCheckbox.getSelection()) { setErrorMessage(JarPackagerMessages.getString("JarPackageWizardPage.error.noExportTypeChecked")); return false; } if (getSelectedResources().size() == 0) return false; if (fExportClassFilesCheckbox.getSelection() || !fExportJavaFilesCheckbox.getSelection()) return true; Iterator iter= getSelectedResourcesIterator();
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
while (iter.hasNext()) { if (!(iter.next() instanceof IClassFile)) return true; } return false; } /* * Overwrides method from WizardExportPage */ protected IPath getResourcePath() { return getPathFromText(fSourceNameField); } /** * 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 ResourcesPlugin.getWorkspace().getRoot().getFile(filePath); else return null; } /** * Set the current input focus to self's destination entry field */
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
protected void giveFocusToDestination() { fDestinationNamesCombo.setFocus(); } /* * Overrides method from WizardExportResourcePage */ protected void setupBasedOnInitialSelections() { Iterator enum= fInitialSelection.iterator(); while (enum.hasNext()) { Object selectedElement= enum.next(); if (selectedElement instanceof ICompilationUnit || selectedElement instanceof IClassFile || selectedElement instanceof IFile) fInputGroup.initialCheckListItem(selectedElement); else fInputGroup.initialCheckTreeItem(selectedElement); } } /* * Implements method from IJarPackageWizardPage. */ public void finish() { saveWidgetValues(); } /* * Method declared on IWizardPage. */ public void setPreviousPage(IWizardPage page) { super.setPreviousPage(page); if (getControl() != null) updatePageCompletion(); }
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
void setSelectedElementsWithoutContainedChildren() { Set closure= removeContainedChildren(fInputGroup.getWhiteCheckedTreeItems()); closure.addAll(getExportedNonContainers()); fJarPackage.setSelectedElementsClosure(closure); } private Set removeContainedChildren(Set elements) { Set newList= new HashSet(elements.size()); Set javaElementResources= getCorrespondingContainers(elements); Iterator iter= elements.iterator(); boolean removedOne= false; while (iter.hasNext()) { Object element= iter.next(); Object parent; if (element instanceof IResource) parent= ((IResource)element).getParent(); else if (element instanceof IJavaElement) { parent= ((IJavaElement)element).getParent(); if (parent instanceof IPackageFragmentRoot) { IPackageFragmentRoot pkgRoot= (IPackageFragmentRoot)parent; try { if (pkgRoot.getCorrespondingResource() instanceof IProject) parent= pkgRoot.getJavaProject(); } catch (JavaModelException ex) { } } } else { newList.add(element);
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
continue; } if (element instanceof IJavaModel || ((!(parent instanceof IJavaModel)) && (elements.contains(parent) || javaElementResources.contains(parent)))) removedOne= true; else newList.add(element); } if (removedOne) return removeContainedChildren(newList); else return newList; } private Set getExportedNonContainers() { Set whiteCheckedTreeItems= fInputGroup.getWhiteCheckedTreeItems(); Set exportedNonContainers= new HashSet(whiteCheckedTreeItems.size()); Set javaElementResources= getCorrespondingContainers(whiteCheckedTreeItems); Iterator iter= fInputGroup.getAllCheckedListItems(); while (iter.hasNext()) { Object element= iter.next(); Object parent= null; if (element instanceof IResource) parent= ((IResource)element).getParent(); else if (element instanceof IJavaElement) parent= ((IJavaElement)element).getParent(); if (!whiteCheckedTreeItems.contains(parent) && !javaElementResources.contains(parent)) exportedNonContainers.add(element); } return exportedNonContainers; } /*
5,571
Bug 5571 JAR Packager: Reveal first checked project
If the list of projects in the JAR Packager is long it is possible that the shown projects are not checked even though there are checked projects (due to current selection). ==> reveal the first checked project.
closed fixed
9cf7888
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:03:04Z
2001-11-06T15:20:00Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackageWizardPage.java
* Create a list with the folders / projects that correspond * to the Java elements (Java project, package, package root) */ private Set getCorrespondingContainers(Set elements) { Set javaElementResources= new HashSet(elements.size()); Iterator iter= elements.iterator(); while (iter.hasNext()) { Object element= iter.next(); if (element instanceof IJavaElement) { IJavaElement je= (IJavaElement)element; int type= je.getElementType(); if (type == IJavaElement.JAVA_PROJECT || type == IJavaElement.PACKAGE_FRAGMENT || type == IJavaElement.PACKAGE_FRAGMENT_ROOT) { if (!(type == IJavaElement.PACKAGE_FRAGMENT && ((IPackageFragment)element).isDefaultPackage())) { Object resource; try { resource= je.getCorrespondingResource(); } catch (JavaModelException ex) { resource= null; } if (resource != null) javaElementResources.add(resource); } } } } return javaElementResources; } }
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.jarpackager; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.jar.Manifest; import org.eclipse.core.resources.IContainer;
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IResource; 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.swt.widgets.Shell; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.ModalContext; import org.eclipse.jface.util.Assert; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IFileEditorInput; import org.xml.sax.SAXException; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaStatusConstants; import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; /** * Operation for exporting a resource and its children to a new JAR file. */ public class JarFileExportOperation implements IRunnableWithProgress {
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
private JarWriter fJarWriter; private JarPackage fJarPackage; private IFile[] fDescriptionFiles; private Shell fParentShell; private Map fJavaNameToClassFilesMap; private IContainer fClassFilesMapContainer; private MultiStatus fProblems; /** * Creates an instance of this class. * * @param jarPackage the JAR package specification * @param parent the parent for the dialog, * or <code>null</code> if no dialog should be presented */ public JarFileExportOperation(JarPackage jarPackage, Shell parent) { this(parent); fJarPackage= jarPackage;
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} /** * Creates an instance of this class. * * @param descriptions an array with JAR package descriptions * @param parent the parent for the dialog, * or <code>null</code> if no dialog should be presented */ public JarFileExportOperation(IFile[] descriptions, Shell parent) { this(parent); fDescriptionFiles= descriptions; } /** * Adds a new warning to the list with the passed information. * Normally the export operation continues after a warning. * @param message the message * @param exception the throwable that caused the warning, or <code>null</code> */ private JarFileExportOperation(Shell parent) { fParentShell= parent; fProblems= new MultiStatus(JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, JarPackagerMessages.getString("JarFileExportOperation.exportFinishedWithWarnings"), null); } protected void addWarning(String message, Throwable error) { if (fJarPackage == null || fJarPackage.logWarnings()) fProblems.add(new Status(IStatus.WARNING, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, message, error)); } /** * Adds a new error to the list with the passed information. * Normally an error terminates the export operation. * @param message the message
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
* @param exception the throwable that caused the error, or <code>null</code> */ protected void addError(String message, Throwable error) { if (fJarPackage == null || fJarPackage.logErrors()) fProblems.add(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, message, error)); } /** * Answers the number of file resources specified by the JAR package. * * @return int */ protected int countSelectedElements() { return fJarPackage.getSelectedElements().size(); } /** * Exports the passed resource to the JAR file * * @param element the resource or JavaElement to export */ protected void exportElement(Object element, IProgressMonitor progressMonitor) throws InterruptedException { int leadSegmentsToRemove= 1; IPackageFragmentRoot pkgRoot= null; boolean isInJavaProject= false; IResource resource= null; IJavaProject jProject= null; if (element instanceof IJavaElement) { isInJavaProject= true; IJavaElement je= (IJavaElement)element; try { resource= je.getUnderlyingResource();
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} 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 { isInJavaProject= resource.getProject().hasNature(JavaCore.NATURE_ID); } catch (CoreException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.projectNatureNotDeterminable", resource.getFullPath()), ex); return; } if (isInJavaProject) {
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
jProject= JavaCore.create(resource.getProject()); try { IPackageFragment pkgFragment= jProject.findPackageFragment(resource.getFullPath().removeLastSegments(1)); if (pkgFragment != null) pkgRoot= JavaModelUtil.getPackageFragmentRoot(pkgFragment); else pkgRoot= jProject.findPackageFragmentRoot(resource.getFullPath().uptoSegment(2)); } catch (JavaModelException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.javaPackageNotDeterminable", resource.getFullPath()), ex); return; } } } if (pkgRoot != null) { leadSegmentsToRemove= pkgRoot.getPath().segmentCount(); if (fJarPackage.useSourceFolderHierarchy()&& !pkgRoot.getElementName().equals(pkgRoot.DEFAULT_PACKAGEROOT_PATH)) leadSegmentsToRemove--; } IPath destinationPath= resource.getFullPath().removeFirstSegments(leadSegmentsToRemove); progressMonitor.subTask(destinationPath.toString()); boolean isInOutputFolder= false; if (isInJavaProject) { try { isInOutputFolder= jProject.getOutputLocation().isPrefixOf(resource.getFullPath()); } catch (JavaModelException ex) { isInOutputFolder= false; }
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} exportClassFiles(progressMonitor, pkgRoot, resource, jProject, destinationPath); exportResourceFiles(pkgRoot, isInJavaProject, resource, destinationPath, isInOutputFolder); progressMonitor.worked(1); ModalContext.checkCanceled(progressMonitor); } else exportContainer(progressMonitor, resource); } private void exportContainer(IProgressMonitor progressMonitor, IResource resource) throws java.lang.InterruptedException { IResource[] children= null; try { children= ((IContainer) resource).members(); } catch (CoreException e) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringExport", resource.getFullPath()), e); } for (int i= 0; i < children.length; i++) exportElement(children[i], progressMonitor); } private void exportResourceFiles(IPackageFragmentRoot pkgRoot, boolean isInJavaProject, IResource resource, IPath destinationPath, boolean isInOutputFolder) { boolean isNonJavaResource= !isInJavaProject || (pkgRoot == null && !isInOutputFolder); boolean isInClassFolder= false; try { isInClassFolder= pkgRoot != null && !pkgRoot.isArchive() && pkgRoot.getKind() == pkgRoot.K_BINARY; } catch (JavaModelException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.cantGetRootKind", resource.getFullPath()), ex); } if ((fJarPackage.areClassFilesExported() && ((isNonJavaResource || (pkgRoot != null && !isJavaFile(resource) && !isClassFile(resource)))
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
|| isInClassFolder && isClassFile(resource))) || (fJarPackage.areJavaFilesExported() && (isNonJavaResource || (pkgRoot != null && !isClassFile(resource))))) { try { fJarWriter.write((IFile) resource, destinationPath); } catch (IOException ex) { String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringExport", resource.getFullPath()); addWarning(message , ex); } catch (CoreException ex) { String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.coreErrorDuringExport", resource.getFullPath()); addWarning(message, ex); } } } private void exportClassFiles(IProgressMonitor progressMonitor, IPackageFragmentRoot pkgRoot, IResource resource, IJavaProject jProject, IPath destinationPath) { if (fJarPackage.areClassFilesExported() && isJavaFile(resource) && pkgRoot != null) { try { Iterator iter= filesOnClasspath((IFile)resource, destinationPath, jProject, progressMonitor); IPath baseDestinationPath= destinationPath.removeLastSegments(1); while (iter.hasNext()) { IFile file= (IFile)iter.next(); if (!resource.isLocal(IResource.DEPTH_ZERO)) file.setLocal(true , IResource.DEPTH_ZERO, progressMonitor); fJarWriter.write(file, baseDestinationPath.append(file.getName())); } } catch (IOException ex) {
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringExport", resource.getFullPath()); addWarning(message , ex); } catch (CoreException ex) { String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.coreErrorDuringExport", resource.getFullPath()); addWarning(message, ex); } } } /** * Exports the resources as specified by the JAR package. */ protected void exportSelectedElements(IProgressMonitor progressMonitor) throws InterruptedException { Iterator iter= fJarPackage.getSelectedElements().iterator(); while (iter.hasNext()) exportElement(iter.next(), progressMonitor); } /** * Returns an iterator on a list with files that correspond to the * passed file and that are on the classpath of its project. * * @param file the file for which to find the corresponding classpath resources * @param pathInJar the path that the file has in the JAR (i.e. project and source folder segments removed) * @param javaProject the javaProject that contains the file * @return the iterator over the corresponding classpath files for the given file */ protected Iterator filesOnClasspath(IFile file, IPath pathInJar, IJavaProject javaProject, IProgressMonitor progressMonitor) throws CoreException {
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
IPath outputPath= javaProject.getOutputLocation(); IContainer outputContainer; if (javaProject.getProject().getFullPath().equals(outputPath)) outputContainer= javaProject.getProject(); else { outputContainer= createFolderHandle(outputPath); if (outputContainer == null || !outputContainer.isAccessible()) { String msg= JarPackagerMessages.getString("JarFileExportOperation.outputContainerNotAccessible"); throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null)); } } if (isJavaFile(file)) { boolean hasErrors= fJarPackage.hasCompileErrors(file); boolean hasWarnings= fJarPackage.hasCompileWarnings(file); boolean canBeExported= canBeExported(hasErrors, hasWarnings); reportPossibleCompileProblems(file, hasErrors, hasWarnings, canBeExported); if (!canBeExported) return Collections.EMPTY_LIST.iterator(); IContainer classContainer= outputContainer; if (pathInJar.segmentCount() > 1) classContainer= outputContainer.getFolder(pathInJar.removeLastSegments(1)); if (fClassFilesMapContainer == null || !fClassFilesMapContainer.equals(classContainer)) { fJavaNameToClassFilesMap= buildJavaToClassMap(classContainer); fClassFilesMapContainer= classContainer; } ArrayList classFiles= (ArrayList)fJavaNameToClassFilesMap.get(file.getName()); if (classFiles == null || classFiles.isEmpty()) { String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.classFileOnClasspathNotAccessible", file.getFullPath()); throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null));
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} return classFiles.iterator(); } else { List binaryFiles= new ArrayList(1); IFile cpFile= outputContainer.getFile(pathInJar); if (cpFile.isAccessible()) { if (!cpFile.isLocal(IResource.DEPTH_ZERO)) cpFile.setLocal(true , IResource.DEPTH_ZERO, progressMonitor); binaryFiles.add(cpFile); } else { String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.resourceOnCasspathNotAccessible", cpFile.getFullPath()); throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null)); } return binaryFiles.iterator(); } } /** * Answers whether the given resource is a Java file. * The resource must be a file whose file name ends with ".java". * * @return a <code>true<code> if the given resource is a Java file */ boolean isJavaFile(IResource file) { return file != null && file.getType() == IFile.FILE && file.getFileExtension() != null && file.getFileExtension().equalsIgnoreCase("java");
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.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 (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 {
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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) { 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 */
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
protected IFile createFileHandle(IPath filePath) { if (filePath.isValidPath(filePath.toString()) && filePath.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFile(filePath); else return null; } /** * Creates a folder resource handle for the folder with the given workspace path. * * @param folderPath the path of the folder to create a handle for * @return the new folder resource handle */ protected IFolder createFolderHandle(IPath folderPath) { if (folderPath.isValidPath(folderPath.toString()) && folderPath.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFolder(folderPath); else return null; } /** * Returns the status of this operation. * If there were any errors, the result is a status object containing * individual status objects for each error. * If there were no errors, the result is a status object with error code <code>OK</code>. * * @return the status of this operation */ public IStatus getStatus() { if (fProblems.getSeverity() == IStatus.ERROR) { String message= null; if (fDescriptionFiles != null && fDescriptionFiles.length > 1)
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06: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"); return new MultiStatus(JavaPlugin.getPluginId(), 0, fProblems.getChildren(), message, null); } return fProblems; } /** * Answer a boolean indicating whether the passed child is a descendant * of one or more members of the passed resources collection * * @param resources a List contain potential parents * @param child the resource to test * @return a <code>boolean</code> indicating if the child is a descendant */ protected boolean isDescendant(List resources, IResource child) { if (child.getType() == IResource.PROJECT) return false; IResource parent= child.getParent(); if (resources.contains(parent)) return true; return isDescendant(resources, parent); } protected boolean canBeExported(boolean hasErrors, boolean hasWarnings) throws CoreException { return (!hasErrors && !hasWarnings) || (hasErrors && fJarPackage.exportErrors()) || (hasWarnings && fJarPackage.exportWarnings()); } protected void reportPossibleCompileProblems(IFile file, boolean hasErrors, boolean hasWarnings, boolean canBeExported) {
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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 { if (fJarPackage != null) singleRun(progressMonitor); else { int jarCount= fDescriptionFiles.length; for (int i= 0; i < jarCount; i++) { fJarPackage= readJarPackage(fDescriptionFiles[i]); if (fJarPackage != null) singleRun(progressMonitor); } }
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} public void singleRun(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException { int totalWork= countSelectedElements(); progressMonitor.beginTask(JarPackagerMessages.getString("JarFileExportOperation.exporting"), totalWork); try { if (!preconditionsOK()) throw new InvocationTargetException(null, JarPackagerMessages.getString("JarFileExportOperation.jarCreationFailedSeeDetails")); fJarWriter= new JarWriter(fJarPackage, fParentShell); exportSelectedElements(progressMonitor); if (getStatus().getSeverity() != IStatus.ERROR) { progressMonitor.subTask(JarPackagerMessages.getString("JarFileExportOperation.savingFiles")); saveFiles(); } } catch (IOException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCreateJarFle", ex.getMessage()); addError(message, ex); throw new InvocationTargetException(ex, message); } catch (CoreException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCreateJarFileDueToInvalidManifest", ex.getMessage()); addError(message, ex); throw new InvocationTargetException(ex, message); } finally { try { if (fJarWriter != null) fJarWriter.close(); } catch (IOException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCloseJarFile", ex.getMessage()); addError(message, ex); throw new InvocationTargetException(ex, message); }
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
progressMonitor.done(); } } protected boolean preconditionsOK() { if (!fJarPackage.areClassFilesExported() && !fJarPackage.areJavaFilesExported()) { addError(JarPackagerMessages.getString("JarFileExportOperation.noExportTypeChosen"), null); return false; } if (fJarPackage.getSelectedElements() == null || fJarPackage.getSelectedElements().size() == 0) { addError(JarPackagerMessages.getString("JarFileExportOperation.noResourcesSelected"), null); return false; } if (fJarPackage.getJarLocation() == null) { addError(JarPackagerMessages.getString("JarFileExportOperation.invalidJarLocation"), null); return false; } if (!fJarPackage.doesManifestExist()) { addError(JarPackagerMessages.getString("JarFileExportOperation.manifestDoesNotExist"), null); return false; } if (!fJarPackage.isMainClassValid(new BusyIndicatorRunnableContext())) { addError(JarPackagerMessages.getString("JarFileExportOperation.invalidMainClass"), null); return false; } IEditorPart[] dirtyEditors= JavaPlugin.getDirtyEditors(); if (dirtyEditors.length > 0) { List unsavedFiles= new ArrayList(dirtyEditors.length); List selection= fJarPackage.getSelectedResources(); for (int i= 0; i < dirtyEditors.length; i++) {
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
if (dirtyEditors[i].getEditorInput() instanceof IFileEditorInput) { IFile dirtyFile= ((IFileEditorInput)dirtyEditors[i].getEditorInput()).getFile(); if (selection.contains(dirtyFile)) { unsavedFiles.add(dirtyFile); addError(JarPackagerMessages.getFormattedString("JarFileExportOperation.fileUnsaved", dirtyFile.getFullPath()), null); } } } if (!unsavedFiles.isEmpty()) return false; } return true; } protected void saveFiles() { if (fJarPackage.isManifestSaved()) { try { saveManifest(); } catch (CoreException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingManifest"), ex); } catch (IOException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingManifest"), ex); } } if (fJarPackage.isDescriptionSaved()) { try { saveDescription(); } catch (CoreException ex) {
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06: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(); JarPackageWriter objectStream= new JarPackageWriter(objectStreamOutput); ByteArrayInputStream fileInput= null; try { objectStream.writeXML(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); if (fJarPackage.getDescriptionFile().isAccessible()) { if (fJarPackage.canOverwriteDescription(fParentShell)) fJarPackage.getDescriptionFile().setContents(fileInput, true, true, null); } else { fJarPackage.getDescriptionFile().create(fileInput, true, null); } } finally { if (fileInput != null) fileInput.close(); if (objectStream != null) objectStream.close(); } }
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
protected void saveManifest() throws CoreException, IOException { ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream(); ByteArrayInputStream fileInput= null; try { Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage); manifest.write(manifestOutput); fileInput= new ByteArrayInputStream(manifestOutput.toByteArray()); if (fJarPackage.getManifestFile().isAccessible()) { if (fJarPackage.canOverwriteManifest(fParentShell)) fJarPackage.getManifestFile().setContents(fileInput, true, true, null); } else { fJarPackage.getManifestFile().create(fileInput, true, null); } } finally { if (manifestOutput != null) manifestOutput.close(); if (fileInput != null) fileInput.close(); } } /** * Reads the JAR package spec from file. */ protected JarPackage readJarPackage(IFile description) { Assert.isLegal(description.isAccessible()); Assert.isNotNull(description.getFileExtension()); Assert.isLegal(description.getFileExtension().equals(JarPackage.DESCRIPTION_EXTENSION)); JarPackage jarPackage= null; JarPackageReader reader= null;
6,478
Bug 6478 Jar packager progress messages misleading
When exporting classes to a JAR file, the progress message says things like: "Exporting org.eclipse.foo.MyFile.java" This is misleading, because it looks like it's adding .java files to the zip, but it's actually adding class files. I actually canceled the export and went to check the jar file when I saw these messages. I suggest just trimming the .java suffix: "Exporting org.eclipse.foo.MyFile"
verified fixed
d551209
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T15:20:18Z
2001-11-30T17:06:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
try { reader= new JarPackageReader(description.getContents()); jarPackage= reader.readXML(); jarPackage.setSaveManifest(false); jarPackage.setSaveDescription(false); } catch (CoreException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorReadingJarPackageFromDescription"), ex); } catch (IOException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.errorReadingFile", description.getFullPath(), ex.getMessage()); addError(message, null); } catch (SAXException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.badXmlFormat", description.getFullPath(), ex.getMessage()); addError(message, null); } finally { if ((jarPackage == null || jarPackage.logWarnings()) && reader != null) fProblems.addAll(reader.getWarnings()); try { if (reader != null) reader.close(); } catch (IOException ex) { addError(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorClosingJarPackageDescriptionReader", description.getFullPath()), ex); } } return jarPackage; } }
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.jarpackager; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.jar.Manifest; import org.eclipse.core.resources.IContainer;
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IResource; 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.swt.widgets.Shell; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.ModalContext; import org.eclipse.jface.util.Assert; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IFileEditorInput; import org.xml.sax.SAXException; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.corext.util.JavaModelUtil; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.JavaStatusConstants; import org.eclipse.jdt.internal.ui.util.BusyIndicatorRunnableContext; /** * Operation for exporting a resource and its children to a new JAR file. */ public class JarFileExportOperation implements IRunnableWithProgress {
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
private JarWriter fJarWriter; private JarPackage fJarPackage; private IFile[] fDescriptionFiles; private Shell fParentShell; private Map fJavaNameToClassFilesMap; private IContainer fClassFilesMapContainer; private MultiStatus fProblems; /** * Creates an instance of this class. * * @param jarPackage the JAR package specification * @param parent the parent for the dialog, * or <code>null</code> if no dialog should be presented */ public JarFileExportOperation(JarPackage jarPackage, Shell parent) { this(parent); fJarPackage= jarPackage; } /**
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
* Creates an instance of this class. * * @param descriptions an array with JAR package descriptions * @param parent the parent for the dialog, * or <code>null</code> if no dialog should be presented */ public JarFileExportOperation(IFile[] descriptions, Shell parent) { this(parent); fDescriptionFiles= descriptions; } /** * Adds a new warning to the list with the passed information. * Normally the export operation continues after a warning. * @param message the message * @param exception the throwable that caused the warning, or <code>null</code> */ private JarFileExportOperation(Shell parent) { fParentShell= parent; fProblems= new MultiStatus(JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, JarPackagerMessages.getString("JarFileExportOperation.exportFinishedWithWarnings"), null); } protected void addWarning(String message, Throwable error) { if (fJarPackage == null || fJarPackage.logWarnings()) fProblems.add(new Status(IStatus.WARNING, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, message, error)); } /** * Adds a new error to the list with the passed information. * Normally an error terminates the export operation. * @param message the message * @param exception the throwable that caused the error, or <code>null</code> */
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16: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()) fProblems.add(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, message, error)); } /** * Answers the number of file resources specified by the JAR package. * * @return int */ protected int countSelectedElements() { return fJarPackage.getSelectedElements().size(); } /** * Exports the passed resource to the JAR file * * @param element the resource or JavaElement to export */ protected void exportElement(Object element, IProgressMonitor progressMonitor) throws InterruptedException { int leadSegmentsToRemove= 1; IPackageFragmentRoot pkgRoot= null; boolean isInJavaProject= false; IResource resource= null; IJavaProject jProject= null; if (element instanceof IJavaElement) { isInJavaProject= true; IJavaElement je= (IJavaElement)element; try { resource= je.getUnderlyingResource(); } catch (JavaModelException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.underlyingResourceNotFound", je.getElementName()), ex);
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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 { 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 {
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
IPackageFragment pkgFragment= jProject.findPackageFragment(resource.getFullPath().removeLastSegments(1)); if (pkgFragment != null) pkgRoot= JavaModelUtil.getPackageFragmentRoot(pkgFragment); else pkgRoot= jProject.findPackageFragmentRoot(resource.getFullPath().uptoSegment(2)); } catch (JavaModelException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.javaPackageNotDeterminable", resource.getFullPath()), ex); return; } } } if (pkgRoot != null) { leadSegmentsToRemove= pkgRoot.getPath().segmentCount(); if (fJarPackage.useSourceFolderHierarchy()&& !pkgRoot.getElementName().equals(pkgRoot.DEFAULT_PACKAGEROOT_PATH)) leadSegmentsToRemove--; } IPath destinationPath= resource.getFullPath().removeFirstSegments(leadSegmentsToRemove); boolean isInOutputFolder= false; if (isInJavaProject) { try { isInOutputFolder= jProject.getOutputLocation().isPrefixOf(resource.getFullPath()); } catch (JavaModelException ex) { isInOutputFolder= false; } } exportClassFiles(progressMonitor, pkgRoot, resource, jProject, destinationPath);
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
exportResourceFiles(progressMonitor, pkgRoot, isInJavaProject, resource, destinationPath, isInOutputFolder); progressMonitor.worked(1); ModalContext.checkCanceled(progressMonitor); } else exportContainer(progressMonitor, resource); } private void exportContainer(IProgressMonitor progressMonitor, IResource resource) throws java.lang.InterruptedException { IResource[] children= null; try { children= ((IContainer) resource).members(); } catch (CoreException e) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorDuringExport", resource.getFullPath()), e); } for (int i= 0; i < children.length; i++) exportElement(children[i], progressMonitor); } private void exportResourceFiles(IProgressMonitor progressMonitor, IPackageFragmentRoot pkgRoot, boolean isInJavaProject, IResource resource, IPath destinationPath, boolean isInOutputFolder) { boolean isNonJavaResource= !isInJavaProject || (pkgRoot == null && !isInOutputFolder); boolean isInClassFolder= false; try { isInClassFolder= pkgRoot != null && !pkgRoot.isArchive() && pkgRoot.getKind() == pkgRoot.K_BINARY; } catch (JavaModelException ex) { addWarning(JarPackagerMessages.getFormattedString("JarFileExportOperation.cantGetRootKind", resource.getFullPath()), ex); } if ((fJarPackage.areClassFilesExported() && ((isNonJavaResource || (pkgRoot != null && !isJavaFile(resource) && !isClassFile(resource))) || isInClassFolder && isClassFile(resource))) || (fJarPackage.areJavaFilesExported() && (isNonJavaResource || (pkgRoot != null && !isClassFile(resource))))) { try {
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
progressMonitor.subTask(destinationPath.toString()); fJarWriter.write((IFile) resource, destinationPath); } catch (IOException ex) { String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringExport", resource.getFullPath()); addWarning(message , ex); } catch (CoreException ex) { String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.coreErrorDuringExport", resource.getFullPath()); addWarning(message, ex); } } } private void exportClassFiles(IProgressMonitor progressMonitor, IPackageFragmentRoot pkgRoot, IResource resource, IJavaProject jProject, IPath destinationPath) { if (fJarPackage.areClassFilesExported() && isJavaFile(resource) && pkgRoot != null) { try { Iterator iter= filesOnClasspath((IFile)resource, destinationPath, jProject, progressMonitor); IPath baseDestinationPath= destinationPath.removeLastSegments(1); while (iter.hasNext()) { IFile file= (IFile)iter.next(); if (!resource.isLocal(IResource.DEPTH_ZERO)) file.setLocal(true , IResource.DEPTH_ZERO, progressMonitor); IPath classFilePath= baseDestinationPath.append(file.getName()); progressMonitor.subTask(classFilePath.toString()); fJarWriter.write(file, classFilePath); } } catch (IOException ex) {
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.ioErrorDuringExport", resource.getFullPath()); addWarning(message , ex); } catch (CoreException ex) { String message= ex.getMessage(); if (message == null) message= JarPackagerMessages.getFormattedString("JarFileExportOperation.coreErrorDuringExport", resource.getFullPath()); addWarning(message, ex); } } } /** * Exports the resources as specified by the JAR package. */ protected void exportSelectedElements(IProgressMonitor progressMonitor) throws InterruptedException { Iterator iter= fJarPackage.getSelectedElements().iterator(); while (iter.hasNext()) exportElement(iter.next(), progressMonitor); } /** * Returns an iterator on a list with files that correspond to the * passed file and that are on the classpath of its project. * * @param file the file for which to find the corresponding classpath resources * @param pathInJar the path that the file has in the JAR (i.e. project and source folder segments removed) * @param javaProject the javaProject that contains the file * @return the iterator over the corresponding classpath files for the given file */ protected Iterator filesOnClasspath(IFile file, IPath pathInJar, IJavaProject javaProject, IProgressMonitor progressMonitor) throws CoreException {
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
IPath outputPath= javaProject.getOutputLocation(); IContainer outputContainer; if (javaProject.getProject().getFullPath().equals(outputPath)) outputContainer= javaProject.getProject(); else { outputContainer= createFolderHandle(outputPath); if (outputContainer == null || !outputContainer.isAccessible()) { String msg= JarPackagerMessages.getString("JarFileExportOperation.outputContainerNotAccessible"); throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null)); } } if (isJavaFile(file)) { boolean hasErrors= fJarPackage.hasCompileErrors(file); boolean hasWarnings= fJarPackage.hasCompileWarnings(file); boolean canBeExported= canBeExported(hasErrors, hasWarnings); reportPossibleCompileProblems(file, hasErrors, hasWarnings, canBeExported); if (!canBeExported) return Collections.EMPTY_LIST.iterator(); IContainer classContainer= outputContainer; if (pathInJar.segmentCount() > 1) classContainer= outputContainer.getFolder(pathInJar.removeLastSegments(1)); if (fClassFilesMapContainer == null || !fClassFilesMapContainer.equals(classContainer)) { fJavaNameToClassFilesMap= buildJavaToClassMap(classContainer); fClassFilesMapContainer= classContainer; } ArrayList classFiles= (ArrayList)fJavaNameToClassFilesMap.get(file.getName()); if (classFiles == null || classFiles.isEmpty()) { String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.classFileOnClasspathNotAccessible", file.getFullPath()); throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null));
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} return classFiles.iterator(); } else { List binaryFiles= new ArrayList(1); IFile cpFile= outputContainer.getFile(pathInJar); if (cpFile.isAccessible()) { if (!cpFile.isLocal(IResource.DEPTH_ZERO)) cpFile.setLocal(true , IResource.DEPTH_ZERO, progressMonitor); binaryFiles.add(cpFile); } else { String msg= JarPackagerMessages.getFormattedString("JarFileExportOperation.resourceOnCasspathNotAccessible", cpFile.getFullPath()); throw new CoreException(new Status(IStatus.ERROR, JavaPlugin.getPluginId(), JavaStatusConstants.INTERNAL_ERROR, msg, null)); } return binaryFiles.iterator(); } } /** * Answers whether the given resource is a Java file. * The resource must be a file whose file name ends with ".java". * * @return a <code>true<code> if the given resource is a Java file */ boolean isJavaFile(IResource file) { return file != null && file.getType() == IFile.FILE && file.getFileExtension() != null && file.getFileExtension().equalsIgnoreCase("java");
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.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 (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 {
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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) { 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 */
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
protected IFile createFileHandle(IPath filePath) { if (filePath.isValidPath(filePath.toString()) && filePath.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFile(filePath); else return null; } /** * Creates a folder resource handle for the folder with the given workspace path. * * @param folderPath the path of the folder to create a handle for * @return the new folder resource handle */ protected IFolder createFolderHandle(IPath folderPath) { if (folderPath.isValidPath(folderPath.toString()) && folderPath.segmentCount() >= 2) return JavaPlugin.getWorkspace().getRoot().getFolder(folderPath); else return null; } /** * Returns the status of this operation. * If there were any errors, the result is a status object containing * individual status objects for each error. * If there were no errors, the result is a status object with error code <code>OK</code>. * * @return the status of this operation */ public IStatus getStatus() { if (fProblems.getSeverity() == IStatus.ERROR) { String message= null; if (fDescriptionFiles != null && fDescriptionFiles.length > 1)
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16: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"); return new MultiStatus(JavaPlugin.getPluginId(), 0, fProblems.getChildren(), message, null); } return fProblems; } /** * Answer a boolean indicating whether the passed child is a descendant * of one or more members of the passed resources collection * * @param resources a List contain potential parents * @param child the resource to test * @return a <code>boolean</code> indicating if the child is a descendant */ protected boolean isDescendant(List resources, IResource child) { if (child.getType() == IResource.PROJECT) return false; IResource parent= child.getParent(); if (resources.contains(parent)) return true; return isDescendant(resources, parent); } protected boolean canBeExported(boolean hasErrors, boolean hasWarnings) throws CoreException { return (!hasErrors && !hasWarnings) || (hasErrors && fJarPackage.exportErrors()) || (hasWarnings && fJarPackage.exportWarnings()); } protected void reportPossibleCompileProblems(IFile file, boolean hasErrors, boolean hasWarnings, boolean canBeExported) {
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
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 { if (fJarPackage != null) singleRun(progressMonitor); else { int jarCount= fDescriptionFiles.length; for (int i= 0; i < jarCount; i++) { fJarPackage= readJarPackage(fDescriptionFiles[i]); if (fJarPackage != null) singleRun(progressMonitor); } }
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
} public void singleRun(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException { int totalWork= countSelectedElements(); progressMonitor.beginTask(JarPackagerMessages.getString("JarFileExportOperation.exporting"), totalWork); try { if (!preconditionsOK()) throw new InvocationTargetException(null, JarPackagerMessages.getString("JarFileExportOperation.jarCreationFailedSeeDetails")); fJarWriter= new JarWriter(fJarPackage, fParentShell); exportSelectedElements(progressMonitor); if (getStatus().getSeverity() != IStatus.ERROR) { progressMonitor.subTask(JarPackagerMessages.getString("JarFileExportOperation.savingFiles")); saveFiles(); } } catch (IOException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCreateJarFle", ex.getMessage()); addError(message, ex); throw new InvocationTargetException(ex, message); } catch (CoreException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCreateJarFileDueToInvalidManifest", ex.getMessage()); addError(message, ex); throw new InvocationTargetException(ex, message); } finally { try { if (fJarWriter != null) fJarWriter.close(); } catch (IOException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.unableToCloseJarFile", ex.getMessage()); addError(message, ex); throw new InvocationTargetException(ex, message); }
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
progressMonitor.done(); } } protected boolean preconditionsOK() { if (!fJarPackage.areClassFilesExported() && !fJarPackage.areJavaFilesExported()) { addError(JarPackagerMessages.getString("JarFileExportOperation.noExportTypeChosen"), null); return false; } if (fJarPackage.getSelectedElements() == null || fJarPackage.getSelectedElements().size() == 0) { addError(JarPackagerMessages.getString("JarFileExportOperation.noResourcesSelected"), null); return false; } if (fJarPackage.getJarLocation() == null) { addError(JarPackagerMessages.getString("JarFileExportOperation.invalidJarLocation"), null); return false; } if (!fJarPackage.doesManifestExist()) { addError(JarPackagerMessages.getString("JarFileExportOperation.manifestDoesNotExist"), null); return false; } if (!fJarPackage.isMainClassValid(new BusyIndicatorRunnableContext())) { addError(JarPackagerMessages.getString("JarFileExportOperation.invalidMainClass"), null); return false; } IEditorPart[] dirtyEditors= JavaPlugin.getDirtyEditors(); if (dirtyEditors.length > 0) { List unsavedFiles= new ArrayList(dirtyEditors.length); List selection= fJarPackage.getSelectedResources(); for (int i= 0; i < dirtyEditors.length; i++) {
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
if (dirtyEditors[i].getEditorInput() instanceof IFileEditorInput) { IFile dirtyFile= ((IFileEditorInput)dirtyEditors[i].getEditorInput()).getFile(); if (selection.contains(dirtyFile)) { unsavedFiles.add(dirtyFile); addError(JarPackagerMessages.getFormattedString("JarFileExportOperation.fileUnsaved", dirtyFile.getFullPath()), null); } } } if (!unsavedFiles.isEmpty()) return false; } return true; } protected void saveFiles() { if (fJarPackage.isManifestSaved()) { try { saveManifest(); } catch (CoreException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingManifest"), ex); } catch (IOException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorSavingManifest"), ex); } } if (fJarPackage.isDescriptionSaved()) { try { saveDescription(); } catch (CoreException ex) {
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46: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(); JarPackageWriter objectStream= new JarPackageWriter(objectStreamOutput); ByteArrayInputStream fileInput= null; try { objectStream.writeXML(fJarPackage); fileInput= new ByteArrayInputStream(objectStreamOutput.toByteArray()); if (fJarPackage.getDescriptionFile().isAccessible()) { if (fJarPackage.canOverwriteDescription(fParentShell)) fJarPackage.getDescriptionFile().setContents(fileInput, true, true, null); } else { fJarPackage.getDescriptionFile().create(fileInput, true, null); } } finally { if (fileInput != null) fileInput.close(); if (objectStream != null) objectStream.close(); } }
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
protected void saveManifest() throws CoreException, IOException { ByteArrayOutputStream manifestOutput= new ByteArrayOutputStream(); ByteArrayInputStream fileInput= null; try { Manifest manifest= fJarPackage.getManifestProvider().create(fJarPackage); manifest.write(manifestOutput); fileInput= new ByteArrayInputStream(manifestOutput.toByteArray()); if (fJarPackage.getManifestFile().isAccessible()) { if (fJarPackage.canOverwriteManifest(fParentShell)) fJarPackage.getManifestFile().setContents(fileInput, true, true, null); } else { fJarPackage.getManifestFile().create(fileInput, true, null); } } finally { if (manifestOutput != null) manifestOutput.close(); if (fileInput != null) fileInput.close(); } } /** * Reads the JAR package spec from file. */ protected JarPackage readJarPackage(IFile description) { Assert.isLegal(description.isAccessible()); Assert.isNotNull(description.getFileExtension()); Assert.isLegal(description.getFileExtension().equals(JarPackage.DESCRIPTION_EXTENSION)); JarPackage jarPackage= null; JarPackageReader reader= null;
5,853
Bug 5853 Jar packager: progress reporting not optimal
- follow smoke test until step "Create a Jar from a Jar Package Description" - do the steps observe: the progress bar show 100% right from the beginning.
resolved fixed
dc99df8
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:02:43Z
2001-11-13T16:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarFileExportOperation.java
try { reader= new JarPackageReader(description.getContents()); jarPackage= reader.readXML(); jarPackage.setSaveManifest(false); jarPackage.setSaveDescription(false); } catch (CoreException ex) { addError(JarPackagerMessages.getString("JarFileExportOperation.errorReadingJarPackageFromDescription"), ex); } catch (IOException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.errorReadingFile", description.getFullPath(), ex.getMessage()); addError(message, null); } catch (SAXException ex) { String message= JarPackagerMessages.getFormattedString("JarFileExportOperation.badXmlFormat", description.getFullPath(), ex.getMessage()); addError(message, null); } finally { if ((jarPackage == null || jarPackage.logWarnings()) && reader != null) fProblems.addAll(reader.getWarnings()); try { if (reader != null) reader.close(); } catch (IOException ex) { addError(JarPackagerMessages.getFormattedString("JarFileExportOperation.errorClosingJarPackageDescriptionReader", description.getFullPath()), ex); } } return jarPackage; } }
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
/* * (c) Copyright IBM Corp. 2000, 2001.
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
* All Rights Reserved. */ package org.eclipse.jdt.internal.ui.wizards.buildpaths; import java.io.File; import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; import java.util.zip.ZipFile; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.DirectoryDialog; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.ViewerFilter;
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
import org.eclipse.ui.help.WorkbenchHelp; import org.eclipse.ui.model.WorkbenchContentProvider; import org.eclipse.ui.model.WorkbenchLabelProvider; import org.eclipse.jdt.core.IClasspathEntry; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaCore; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.ui.IJavaHelpContextIds; import org.eclipse.jdt.internal.ui.JavaPlugin; import org.eclipse.jdt.internal.ui.dialogs.ElementTreeSelectionDialog; import org.eclipse.jdt.internal.ui.dialogs.ISelectionValidator; import org.eclipse.jdt.internal.ui.dialogs.StatusInfo; import org.eclipse.jdt.internal.ui.dialogs.StatusUtil; import org.eclipse.jdt.internal.ui.util.SWTUtil; import org.eclipse.jdt.internal.ui.wizards.IStatusChangeListener; import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages; import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator; 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.IStringButtonAdapter; import org.eclipse.jdt.internal.ui.wizards.dialogfields.SelectionButtonDialogField; import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField; import org.eclipse.jdt.internal.ui.wizards.swt.MGridData; import org.eclipse.jdt.internal.ui.wizards.swt.MGridLayout; /** * UI to set the source attachment archive and root. * Same implementation for both setting attachments for libraries from * variable entries and for normal (internal or external) jar. */ public class SourceAttachmentBlock {
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
private IStatusChangeListener fContext; private StringButtonDialogField fFileNameField; private SelectionButtonDialogField fInternalButtonField; private StringButtonDialogField fPrefixField; private StringButtonDialogField fJavaDocField; private boolean fIsVariableEntry; private IStatus fNameStatus; private IStatus fPrefixStatus; private IStatus fJavaDocStatus; private IPath fJARPath; /** * The file to which the archive path points to. * Only set when the file exists. */ private File fResolvedFile; /** * The path to which the archive variable points. * Null if invalid path or not resolvable. Must not exist. */ private IPath fFileVariablePath; private URL fJavaDocLocation;
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
private IWorkspaceRoot fRoot; private Control fSWTWidget; private CLabel fFullPathResolvedLabel; private CLabel fPrefixResolvedLabel; private IClasspathEntry fOldEntry; public SourceAttachmentBlock(IWorkspaceRoot root, IStatusChangeListener context, IClasspathEntry oldEntry) { fContext= context; fRoot= root; fOldEntry= oldEntry; fIsVariableEntry= (oldEntry.getEntryKind() == IClasspathEntry.CPE_VARIABLE); fNameStatus= new StatusInfo(); fPrefixStatus= new StatusInfo(); fJavaDocStatus= new StatusInfo(); fJARPath= (oldEntry != null) ? oldEntry.getPath() : Path.EMPTY; SourceAttachmentAdapter adapter= new SourceAttachmentAdapter(); if (fIsVariableEntry) { fFileNameField= new VariablePathDialogField(adapter); fFileNameField.setDialogFieldListener(adapter);
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
fFileNameField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.filename.varlabel")); fFileNameField.setButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.filename.external.varbutton")); ((VariablePathDialogField)fFileNameField).setVariableButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.filename.variable.button")); fPrefixField= new VariablePathDialogField(adapter); fPrefixField.setDialogFieldListener(adapter); fPrefixField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.prefix.varlabel")); fPrefixField.setButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.prefix.varbutton")); ((VariablePathDialogField)fPrefixField).setVariableButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.prefix.variable.button")); } else { fFileNameField= new StringButtonDialogField(adapter); fFileNameField.setDialogFieldListener(adapter); fFileNameField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.filename.label")); fFileNameField.setButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.filename.external.button")); fInternalButtonField= new SelectionButtonDialogField(SWT.PUSH); fInternalButtonField.setDialogFieldListener(adapter); fInternalButtonField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.filename.internal.button")); fPrefixField= new StringButtonDialogField(adapter); fPrefixField.setDialogFieldListener(adapter); fPrefixField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.prefix.label")); fPrefixField.setButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.prefix.button")); } fJavaDocField= new StringButtonDialogField(adapter); fJavaDocField.setDialogFieldListener(adapter); fJavaDocField.setLabelText(NewWizardMessages.getString("SourceAttachmentBlock.javadoc.label"));
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
fJavaDocField.setButtonLabel(NewWizardMessages.getString("SourceAttachmentBlock.javadoc.button")); setDefaults(); } public void setDefaults() { if (fOldEntry != null && fOldEntry.getSourceAttachmentPath() != null) { fFileNameField.setText(fOldEntry.getSourceAttachmentPath().toString()); } else { fFileNameField.setText(""); } if (fOldEntry != null && fOldEntry.getSourceAttachmentRootPath() != null) { fPrefixField.setText(fOldEntry.getSourceAttachmentRootPath().toString()); } else { fPrefixField.setText(""); } } /** * Gets the source attachment path chosen by the user */ public IPath getSourceAttachmentPath() { if (fFileNameField.getText().length() == 0) { return null; } return new Path(fFileNameField.getText()); } /**
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
* Gets the source attachment root chosen by the user */ public IPath getSourceAttachmentRootPath() { if (getSourceAttachmentPath() == null) { return null; } else { return new Path(fPrefixField.getText()); } } /** * Creates the control */ public Control createControl(Composite parent) { fSWTWidget= parent; Composite composite= new Composite(parent, SWT.NONE); MGridLayout layout= new MGridLayout(); layout.marginHeight= 0; layout.marginWidth= 0; layout.minimumWidth= SWTUtil.convertWidthInCharsToPixels(80, composite); layout.numColumns= 4; composite.setLayout(layout); int widthHint= SWTUtil.convertWidthInCharsToPixels(fIsVariableEntry ? 50 : 60, composite); MGridData gd= new MGridData(MGridData.HORIZONTAL_ALIGN_FILL); gd.horizontalSpan= 4;
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
Label message= new Label(composite, SWT.LEFT); message.setLayoutData(gd); message.setText(NewWizardMessages.getFormattedString("SourceAttachmentBlock.message", fJARPath.lastSegment())); if (fIsVariableEntry) { DialogField.createEmptySpace(composite, 1); gd= new MGridData(MGridData.HORIZONTAL_ALIGN_FILL); gd.widthHint= widthHint; Label desc= new Label(composite, SWT.LEFT + SWT.WRAP); desc.setText(NewWizardMessages.getString("SourceAttachmentBlock.filename.description")); desc.setLayoutData(gd); DialogField.createEmptySpace(composite, 2); } fFileNameField.doFillIntoGrid(composite, 4); gd= (MGridData)fFileNameField.getTextControl(null).getLayoutData(); gd.widthHint= widthHint; if (!fIsVariableEntry) { DialogField.createEmptySpace(composite, 3); fInternalButtonField.doFillIntoGrid(composite, 1); } else { DialogField.createEmptySpace(composite, 1); fFullPathResolvedLabel= new CLabel(composite, SWT.LEFT); fFullPathResolvedLabel.setText(getResolvedLabelString(fFileNameField.getText(), true)); fFullPathResolvedLabel.setLayoutData(new MGridData(MGridData.HORIZONTAL_ALIGN_FILL)); DialogField.createEmptySpace(composite, 2);
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
} DialogField.createEmptySpace(composite, 1); gd= new MGridData(MGridData.HORIZONTAL_ALIGN_FILL); gd.widthHint= widthHint; Label desc= new Label(composite, SWT.LEFT + SWT.WRAP); desc.setText(NewWizardMessages.getString("SourceAttachmentBlock.prefix.description")); desc.setLayoutData(gd); DialogField.createEmptySpace(composite, 2); fPrefixField.doFillIntoGrid(composite, 4); gd= (MGridData)fPrefixField.getTextControl(null).getLayoutData(); gd.widthHint= widthHint; if (fIsVariableEntry) { DialogField.createEmptySpace(composite, 1); fPrefixResolvedLabel= new CLabel(composite, SWT.LEFT); fPrefixResolvedLabel.setText(getResolvedLabelString(fPrefixField.getText(), false)); fPrefixResolvedLabel.setLayoutData(new MGridData(MGridData.HORIZONTAL_ALIGN_FILL)); DialogField.createEmptySpace(composite, 2); } fFileNameField.postSetFocusOnDialogField(parent.getDisplay());
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
WorkbenchHelp.setHelp(composite, new Object[] { IJavaHelpContextIds.SOURCE_ATTACHMENT_BLOCK }); return composite; } private class SourceAttachmentAdapter implements IStringButtonAdapter, IDialogFieldListener { public void changeControlPressed(DialogField field) { attachmentChangeControlPressed(field); } public void dialogFieldChanged(DialogField field) { attachmentDialogFieldChanged(field); } } private void attachmentChangeControlPressed(DialogField field) { if (field == fFileNameField) { IPath jarFilePath= chooseExtJarFile(); if (jarFilePath != null) { fFileNameField.setText(jarFilePath.toString()); } } else if (field == fPrefixField) { IPath prefixPath= choosePrefix();
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
if (prefixPath != null) { fPrefixField.setText(prefixPath.toString()); } } else if (field == fJavaDocField) { URL jdocURL= chooseJavaDocLocation(); if (jdocURL != null) { fJavaDocField.setText(jdocURL.toExternalForm()); } } } private void attachmentDialogFieldChanged(DialogField field) { if (field == fFileNameField) { fNameStatus= updateFileNameStatus(); } else if (field == fInternalButtonField) { IPath jarFilePath= chooseInternalJarFile(fFileNameField.getText()); if (jarFilePath != null) { fFileNameField.setText(jarFilePath.toString()); } return; } else if (field == fPrefixField) { fPrefixStatus= updatePrefixStatus(); } else if (field == fJavaDocField) { fJavaDocStatus= updateJavaDocLocationStatus(); } doStatusLineUpdate(); } private void doStatusLineUpdate() {
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
fPrefixField.enableButton(canBrowsePrefix()); fFileNameField.enableButton(canBrowseFileName()); if (fFullPathResolvedLabel != null) { fFullPathResolvedLabel.setText(getResolvedLabelString(fFileNameField.getText(), true)); } if (fPrefixResolvedLabel != null) { fPrefixResolvedLabel.setText(getResolvedLabelString(fPrefixField.getText(), false)); } IStatus status= StatusUtil.getMostSevere(new IStatus[] { fNameStatus, fPrefixStatus, fJavaDocStatus }); fContext.statusChanged(status); } private boolean canBrowseFileName() { if (!fIsVariableEntry) { return true; } if (fFileVariablePath != null) { return fFileVariablePath.toFile().isDirectory(); } return false; } private boolean canBrowsePrefix() { if (fResolvedFile != null) {
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
if (fIsVariableEntry) { return fPrefixStatus.isOK() && fPrefixField.getText().length() > 0; } return true; } return false; } private String getResolvedLabelString(String path, boolean osPath) { IPath resolvedPath= getResolvedPath(new Path(path)); if (resolvedPath != null) { if (osPath) { return resolvedPath.toOSString(); } else { return resolvedPath.toString(); } } return ""; } private IPath getResolvedPath(IPath path) { if (path != null) { String varName= path.segment(0); if (varName != null) { IPath varPath= JavaCore.getClasspathVariable(varName); if (varPath != null) { return varPath.append(path.removeFirstSegments(1)); } }
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
} return null; } private IStatus updatePrefixStatus() { StatusInfo status= new StatusInfo(); String prefix= fPrefixField.getText(); if (prefix.length() == 0) { return status; } else { if (!Path.EMPTY.isValidPath(prefix)) { status.setError(NewWizardMessages.getString("SourceAttachmentBlock.prefix.error.notvalid")); return status; } IPath path= new Path(prefix); if (fIsVariableEntry) { IPath resolvedPath= getResolvedPath(path); if (resolvedPath == null) { status.setError(NewWizardMessages.getString("SourceAttachmentBlock.prefix.error.varnotexists")); return status; } if (resolvedPath.getDevice() != null) { status.setError(NewWizardMessages.getString("SourceAttachmentBlock.prefix.error.deviceinvar")); return status; } } else { if (path.getDevice() != null) {
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
status.setError(NewWizardMessages.getString("SourceAttachmentBlock.prefix.error.deviceinpath")); return status; } } } return status; } private IStatus updateFileNameStatus() { StatusInfo status= new StatusInfo(); fResolvedFile= null; fFileVariablePath= null; String fileName= fFileNameField.getText(); if (fileName.length() == 0) { return status; } else { if (!Path.EMPTY.isValidPath(fileName)) { status.setError(NewWizardMessages.getString("SourceAttachmentBlock.filename.error.notvalid")); return status; } IPath filePath= new Path(fileName); IPath resolvedPath; if (fIsVariableEntry) { if (filePath.getDevice() != null) { status.setError(NewWizardMessages.getString("SourceAttachmentBlock.filename.error.deviceinpath")); return status; } String varName= filePath.segment(0);
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
if (varName == null) { status.setError(NewWizardMessages.getString("SourceAttachmentBlock.filename.error.notvalid")); return status; } fFileVariablePath= JavaCore.getClasspathVariable(varName); if (fFileVariablePath == null) { status.setError(NewWizardMessages.getString("SourceAttachmentBlock.filename.error.varnotexists")); return status; } resolvedPath= fFileVariablePath.append(filePath.removeFirstSegments(1)); if (resolvedPath.isEmpty()) { status.setWarning(NewWizardMessages.getString("SourceAttachmentBlock.filename.warning.varempty")); return status; } File file= resolvedPath.toFile(); if (!file.isFile()) { String message= NewWizardMessages.getFormattedString("SourceAttachmentBlock.filename.error.filenotexists", resolvedPath.toOSString()); status.setWarning(message); return status; } fResolvedFile= file; } else { File file= filePath.toFile(); IResource res= fRoot.findMember(filePath); if (res != null) { file= res.getLocation().toFile(); } if (!file.isFile()) {
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
String message= NewWizardMessages.getFormattedString("SourceAttachmentBlock.filename.error.filenotexists", filePath.toString()); status.setError(message); return status; } fResolvedFile= file; } } return status; } private IStatus updateJavaDocLocationStatus() { StatusInfo status= new StatusInfo(); fJavaDocLocation= null; String jdocLocation= fJavaDocField.getText(); if (!"".equals(jdocLocation)) { try { URL url= new URL(jdocLocation); if ("file".equals(url.getProtocol())) { File dir= new File(url.getFile()); if (!dir.isDirectory()) { status.setError(NewWizardMessages.getString("SourceAttachmentBlock.javadoc.error.notafolder")); return status; } /*else { File indexFile= new File(dir, "index.html"); File packagesFile= new File(dir, "package-list"); if (!packagesFile.exists() || !indexFile.exists()) { fJavaDocStatusInfo.setWarning(NewWizardMessages.getString(ERR_JDOCLOCATION_IDXNOTFOUND)); // only a warning, go on
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
} }*/ } fJavaDocLocation= url; } catch (MalformedURLException e) { status.setError(NewWizardMessages.getFormattedString("SourceAttachmentBlock.javadoc.error.malformed", e.getLocalizedMessage())); return status; } } return status; } /* * Opens a dialog to choose a jar from the file system. */ private IPath chooseExtJarFile() { IPath currPath= new Path(fFileNameField.getText()); if (currPath.isEmpty()) { currPath= fJARPath; } IPath resolvedPath= currPath; if (fIsVariableEntry) { resolvedPath= getResolvedPath(currPath); if (resolvedPath == null) { resolvedPath= Path.EMPTY; } } if (ArchiveFileFilter.isArchivePath(resolvedPath)) { resolvedPath= resolvedPath.removeLastSegments(1);
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
} FileDialog dialog= new FileDialog(getShell()); dialog.setText(NewWizardMessages.getString("SourceAttachmentBlock.extjardialog.text")); dialog.setFilterExtensions(new String[] {"*.jar;*.zip"}); dialog.setFilterPath(resolvedPath.toOSString()); String res= dialog.open(); if (res != null) { IPath returnPath= new Path(res).makeAbsolute(); if (fIsVariableEntry) { returnPath= modifyPath(returnPath, currPath.segment(0)); } return returnPath; } return null; } /* * Opens a dialog to choose an internal jar. */ private IPath chooseInternalJarFile(String initSelection) { Class[] acceptedClasses= new Class[] { IFile.class }; ISelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, false); ViewerFilter filter= new ArchiveFileFilter(null); ILabelProvider lp= new WorkbenchLabelProvider(); ITreeContentProvider cp= new WorkbenchContentProvider(); IResource initSel= fRoot.findMember(new Path(initSelection)); if (initSel == null) { initSel= fRoot.findMember(fJARPath); }
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), lp, cp); dialog.setAllowMultiple(false); dialog.setValidator(validator); dialog.addFilter(filter); dialog.setTitle(NewWizardMessages.getString("SourceAttachmentBlock.intjardialog.title")); dialog.setMessage(NewWizardMessages.getString("SourceAttachmentBlock.intjardialog.message")); dialog.setInput(fRoot); dialog.setInitialSelection(initSel); if (dialog.open() == dialog.OK) { IFile file= (IFile) dialog.getFirstResult(); return file.getFullPath(); } return null; } /* * Opens a dialog to choose path in a zip file. */ private IPath choosePrefix() { if (fResolvedFile != null) { IPath currPath= new Path(fPrefixField.getText()); String initSelection= null; if (fIsVariableEntry) { IPath resolvedPath= getResolvedPath(currPath); if (resolvedPath != null) { initSelection= resolvedPath.toString(); } } else { initSelection= currPath.toString(); }
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
try { ZipFile zipFile= new ZipFile(fResolvedFile); ZipContentProvider contentProvider= new ZipContentProvider(); contentProvider.setInitialInput(zipFile); ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), new ZipLabelProvider(), contentProvider); dialog.setAllowMultiple(false); dialog.setTitle(NewWizardMessages.getString("SourceAttachmentBlock.prefixdialog.title")); dialog.setMessage(NewWizardMessages.getString("SourceAttachmentBlock.prefixdialog.message")); dialog.setInput(zipFile); dialog.setInitialSelection(contentProvider.getSelectedNode(initSelection)); if (dialog.open() == dialog.OK) { Object obj= dialog.getFirstResult(); IPath path= new Path(obj.toString()); if (fIsVariableEntry) { path= modifyPath(path, currPath.segment(0)); } return path; } } catch (IOException e) { String title= NewWizardMessages.getString("SourceAttachmentBlock.prefixdialog.error.title"); String message= NewWizardMessages.getFormattedString("SourceAttachmentBlock.prefixdialog.error.message", fResolvedFile.getPath()); MessageDialog.openError(getShell(), title, message); JavaPlugin.log(e); } } return null; } /*
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
* Opens a dialog to choose a root in the file system. */ private URL chooseJavaDocLocation() { String initPath= ""; if (fJavaDocLocation != null && "file".equals(fJavaDocLocation.getProtocol())) { initPath= (new File(fJavaDocLocation.getFile())).getPath(); } DirectoryDialog dialog= new DirectoryDialog(getShell()); dialog.setText(NewWizardMessages.getString("SourceAttachmentBlock.jdocdialog.text")); dialog.setMessage(NewWizardMessages.getString("SourceAttachmentBlock.jdocdialog.message")); dialog.setFilterPath(initPath); String res= dialog.open(); if (res != null) { try { return (new File(res)).toURL(); } catch (MalformedURLException e) { JavaPlugin.log(e); } } return null; } private Shell getShell() { if (fSWTWidget != null) { return fSWTWidget.getShell(); } return JavaPlugin.getActiveWorkbenchShell(); }
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
/** * Takes a path and replaces the beginning with a variable name * (if the beginning matches with the variables value) */ private IPath modifyPath(IPath path, String varName) { if (varName == null || path == null) { return null; } if (path.isEmpty()) { return new Path(varName); } IPath varPath= JavaCore.getClasspathVariable(varName); if (varPath != null) { if (varPath.isPrefixOf(path)) { path= path.removeFirstSegments(varPath.segmentCount()); } else { path= new Path(path.lastSegment()); } } else { path= new Path(path.lastSegment()); } return new Path(varName).append(path); } /** * Creates a runnable that sets the source attachment by modifying the project's classpath. */
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
public IRunnableWithProgress getRunnable(final IJavaProject jproject, final Shell shell) { return new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException { try { IClasspathEntry newEntry; if (fIsVariableEntry) { newEntry= JavaCore.newVariableEntry(fJARPath, getSourceAttachmentPath(), getSourceAttachmentRootPath(), false); } else { newEntry= JavaCore.newLibraryEntry(fJARPath, getSourceAttachmentPath(), getSourceAttachmentRootPath(), false); } IClasspathEntry[] entries= modifyClasspath(jproject, newEntry, shell); if (entries != null) { jproject.setRawClasspath(entries, monitor); } } catch (JavaModelException e) { throw new InvocationTargetException(e); } } }; } private IClasspathEntry[] modifyClasspath(IJavaProject jproject, IClasspathEntry newEntry, Shell shell) throws JavaModelException{ IClasspathEntry[] oldClasspath= jproject.getRawClasspath(); int nEntries= oldClasspath.length; ArrayList newEntries= new ArrayList(nEntries + 1); int entryKind= newEntry.getEntryKind(); IPath jarPath= newEntry.getPath(); boolean found= false; for (int i= 0; i < nEntries; i++) { IClasspathEntry curr= oldClasspath[i]; if (curr.getEntryKind() == entryKind && curr.getPath().equals(jarPath)) {
6,672
Bug 6672 jar no longer exported after attach source
1206 1. Create a project test. 2. Add a jar (say resources.jar) to the classpath and export the entry 3. Attach source (say resourcessrc.zip) to the jar. Notice, the jar is no longer exported - this information is discarded during the attach source process.
verified fixed
787255e
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-07T16:59:44Z
2001-12-07T15:46:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
newEntries.add(newEntry); found= true; } else { newEntries.add(curr); } } if (!found) { if (newEntry.getSourceAttachmentPath() == null || !putJarOnClasspathDialog(shell)) { return null; } newEntries.add(newEntry); } return (IClasspathEntry[]) newEntries.toArray(new IClasspathEntry[newEntries.size()]); } private boolean putJarOnClasspathDialog(Shell shell) { final boolean[] result= new boolean[1]; shell.getDisplay().syncExec(new Runnable() { public void run() { String title= NewWizardMessages.getString("SourceAttachmentBlock.putoncpdialog.title"); String message= NewWizardMessages.getString("SourceAttachmentBlock.putoncpdialog.message"); result[0]= MessageDialog.openQuestion(JavaPlugin.getActiveWorkbenchShell(), title, message); } }); return result[0]; } }
6,722
Bug 6722 JavaElementLabelProvider API - small issue
everytime i use this label provider it annoys me that i have to type new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT) if it's default then it should be default, if you know what i mean. all i need is: public JavaElementLabelProvider() { this(JavaElementLabelProvider.SHOW_DEFAULT); } it'd make things easier. i'd fix it myself but it's API so i guess it should be blessed first.
resolved fixed
566e615
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T16:13:28Z
2001-12-10T13:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabelProvider.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.ui; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.eclipse.swt.graphics.Image; import org.eclipse.core.resources.IStorage; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.ui.IEditorRegistry; import org.eclipse.ui.PlatformUI;
6,722
Bug 6722 JavaElementLabelProvider API - small issue
everytime i use this label provider it annoys me that i have to type new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT) if it's default then it should be default, if you know what i mean. all i need is: public JavaElementLabelProvider() { this(JavaElementLabelProvider.SHOW_DEFAULT); } it'd make things easier. i'd fix it myself but it's API so i guess it should be blessed first.
resolved fixed
566e615
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T16:13:28Z
2001-12-10T13:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabelProvider.java
import org.eclipse.ui.model.WorkbenchLabelProvider; import org.eclipse.jdt.core.IJavaElement; import org.eclipse.jdt.internal.ui.viewsupport.IErrorTickProvider; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementImageProvider; import org.eclipse.jdt.internal.ui.viewsupport.JavaElementLabels; /** * Standard label provider for Java elements. * Use this class when you want to present the Java elements in a viewer. * <p> * The implementation also handles non-Java elements by forwarding the requests to an * internal <code>WorkbenchLabelProvider</code>. * </p> * <p> * This class may be instantiated; it is not intended to be subclassed. * </p> * * @see org.eclipse.ui.model.WorkbenchLabelProvider */ public class JavaElementLabelProvider extends LabelProvider { /** * Flag (bit mask) indicating that methods labels include the method return type. (prepended) */ public final static int SHOW_RETURN_TYPE= 0x001; /** * Flag (bit mask) indicating that method label include method parameter types. */ public final static int SHOW_PARAMETERS= 0x002;
6,722
Bug 6722 JavaElementLabelProvider API - small issue
everytime i use this label provider it annoys me that i have to type new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT) if it's default then it should be default, if you know what i mean. all i need is: public JavaElementLabelProvider() { this(JavaElementLabelProvider.SHOW_DEFAULT); } it'd make things easier. i'd fix it myself but it's API so i guess it should be blessed first.
resolved fixed
566e615
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T16:13:28Z
2001-12-10T13:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabelProvider.java
/** * Flag (bit mask) indicating that the label of a member should include the container. * For example, include the name of the type enclosing a field. * @deprecated Use SHOW_QUALIFIED or SHOW_ROOT instead */ public final static int SHOW_CONTAINER= 0x004; /** * Flag (bit mask) indicating that the label of a type should be fully qualified. * For example, include the fully qualified name of the type enclosing a type. * @deprecated Use SHOW_QUALIFIED instead */ public final static int SHOW_CONTAINER_QUALIFICATION= 0x008; /** * Flag (bit mask) indicating that the label should include overlay icons * for element type and modifiers. */ public final static int SHOW_OVERLAY_ICONS= 0x010; /** * Flag (bit mask) indicating thata field label should include the declared type. */ public final static int SHOW_TYPE= 0x020; /** * Flag (bit mask) indicating that the label should include the name of the * package fragment root (appended). */ public final static int SHOW_ROOT= 0x040; /** * Flag (bit mask) indicating that the label qualification of a type should * be shown after the name.
6,722
Bug 6722 JavaElementLabelProvider API - small issue
everytime i use this label provider it annoys me that i have to type new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT) if it's default then it should be default, if you know what i mean. all i need is: public JavaElementLabelProvider() { this(JavaElementLabelProvider.SHOW_DEFAULT); } it'd make things easier. i'd fix it myself but it's API so i guess it should be blessed first.
resolved fixed
566e615
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T16:13:28Z
2001-12-10T13:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabelProvider.java
* @deprecated SHOW_POST_QUALIFIED instead */ public final static int SHOW_POSTIFIX_QUALIFICATION= 0x080; /** * Flag (bit mask) indicating that the label should show the icons with no space * reserved for overlays. */ public final static int SHOW_SMALL_ICONS= 0x100; /** * Flag (bit mask) indicating that the packagefragment roots from variables should * be rendered with the variable in the name */ public final static int SHOW_VARIABLE= 0x200; /** * Flag (bit mask) indicating that Complation Units, Class Files, Types, Declarations and Members * should be rendered qualified. * Examples: java.lang.String, java.util.Vector.size() */ public final static int SHOW_QUALIFIED= 0x400; /** * Flag (bit mask) indicating that Complation Units, Class Files, Types, Declarations and Members * should be rendered qualified. The qualifcation is appended * Examples: String - java.lang, size() - java.util.Vector */ public final static int SHOW_POST_QUALIFIED= 0x800; /**
6,722
Bug 6722 JavaElementLabelProvider API - small issue
everytime i use this label provider it annoys me that i have to type new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT) if it's default then it should be default, if you know what i mean. all i need is: public JavaElementLabelProvider() { this(JavaElementLabelProvider.SHOW_DEFAULT); } it'd make things easier. i'd fix it myself but it's API so i guess it should be blessed first.
resolved fixed
566e615
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T16:13:28Z
2001-12-10T13:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabelProvider.java
* Constant (value <code>0</code>) indicating that the label should show * the basic images only. */ public final static int SHOW_BASICS= 0x000; /** * Constant indicating the default label rendering. * Currently the default is equivalent to * <code>SHOW_PARAMETERS | SHOW_OVERLAY_ICONS</code>. */ public final static int SHOW_DEFAULT= new Integer(SHOW_PARAMETERS | SHOW_OVERLAY_ICONS).intValue(); private JavaElementImageProvider fImageLabelProvider; private WorkbenchLabelProvider fWorkbenchLabelProvider; private int fFlags; private int fImageFlags; private int fTextFlags; private Map fJarImageMap= new HashMap(10); /** * Creates a new label provider. * * @param flags the initial options; a bitwise OR of <code>SHOW_* </code> constants */ public JavaElementLabelProvider(int flags) { fImageLabelProvider= new JavaElementImageProvider(); fWorkbenchLabelProvider= new WorkbenchLabelProvider(); fFlags= flags;
6,722
Bug 6722 JavaElementLabelProvider API - small issue
everytime i use this label provider it annoys me that i have to type new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT) if it's default then it should be default, if you know what i mean. all i need is: public JavaElementLabelProvider() { this(JavaElementLabelProvider.SHOW_DEFAULT); } it'd make things easier. i'd fix it myself but it's API so i guess it should be blessed first.
resolved fixed
566e615
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T16:13:28Z
2001-12-10T13:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabelProvider.java
updateImageProviderFlags(); updateTextProviderFlags(); } private boolean getFlag( int flag) { return (fFlags & flag) != 0; } /** * Turns on the rendering options specified in the given flags. * * @param flags the options; a bitwise OR of <code>SHOW_* </code> constants */ public void turnOn(int flags) { fFlags |= flags; updateImageProviderFlags(); updateTextProviderFlags(); } /** * Turns off the rendering options specified in the given flags. * * @param flags the initial options; a bitwise OR of <code>SHOW_* </code> constants */ public void turnOff(int flags) { fFlags &= (~flags); updateImageProviderFlags(); updateTextProviderFlags(); }
6,722
Bug 6722 JavaElementLabelProvider API - small issue
everytime i use this label provider it annoys me that i have to type new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT) if it's default then it should be default, if you know what i mean. all i need is: public JavaElementLabelProvider() { this(JavaElementLabelProvider.SHOW_DEFAULT); } it'd make things easier. i'd fix it myself but it's API so i guess it should be blessed first.
resolved fixed
566e615
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T16:13:28Z
2001-12-10T13:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabelProvider.java
private void updateImageProviderFlags() { fImageFlags= 0; if (getFlag(SHOW_OVERLAY_ICONS)) { fImageFlags |= JavaElementImageProvider.OVERLAY_ICONS; } if (getFlag(SHOW_SMALL_ICONS)) { fImageFlags |= JavaElementImageProvider.SMALL_ICONS; } } private void updateTextProviderFlags() { fTextFlags= 0; if (getFlag(SHOW_RETURN_TYPE)) { fTextFlags |= JavaElementLabels.M_PRE_RETURNTYPE; } if (getFlag(SHOW_PARAMETERS)) { fTextFlags |= JavaElementLabels.M_PARAMETER_TYPES; } if (getFlag(SHOW_CONTAINER)) { fTextFlags |= JavaElementLabels.P_POST_QUALIFIED | JavaElementLabels.T_POST_QUALIFIED | JavaElementLabels.CF_POST_QUALIFIED | JavaElementLabels.CU_POST_QUALIFIED | JavaElementLabels.M_POST_QUALIFIED | JavaElementLabels.F_POST_QUALIFIED; } if (getFlag(SHOW_POSTIFIX_QUALIFICATION)) { fTextFlags |= (JavaElementLabels.T_POST_QUALIFIED | JavaElementLabels.CF_POST_QUALIFIED | JavaElementLabels.CU_POST_QUALIFIED); } else if (getFlag(SHOW_CONTAINER_QUALIFICATION)) { fTextFlags |=(JavaElementLabels.T_FULLY_QUALIFIED | JavaElementLabels.CF_QUALIFIED | JavaElementLabels.CU_QUALIFIED); } if (getFlag(SHOW_TYPE)) { fTextFlags |= JavaElementLabels.F_APP_TYPE_SIGNATURE; } if (getFlag(SHOW_ROOT)) {
6,722
Bug 6722 JavaElementLabelProvider API - small issue
everytime i use this label provider it annoys me that i have to type new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT) if it's default then it should be default, if you know what i mean. all i need is: public JavaElementLabelProvider() { this(JavaElementLabelProvider.SHOW_DEFAULT); } it'd make things easier. i'd fix it myself but it's API so i guess it should be blessed first.
resolved fixed
566e615
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T16:13:28Z
2001-12-10T13:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabelProvider.java
fTextFlags |= JavaElementLabels.APPEND_ROOT_PATH; } if (getFlag(SHOW_VARIABLE)) { fTextFlags |= JavaElementLabels.ROOT_VARIABLE; } if (getFlag(SHOW_QUALIFIED)) { fTextFlags |= (JavaElementLabels.F_FULLY_QUALIFIED | JavaElementLabels.M_FULLY_QUALIFIED | JavaElementLabels.I_FULLY_QUALIFIED | JavaElementLabels.T_FULLY_QUALIFIED | JavaElementLabels.D_QUALIFIED | JavaElementLabels.CF_QUALIFIED | JavaElementLabels.CU_QUALIFIED); } if (getFlag(SHOW_POST_QUALIFIED)) { fTextFlags |= (JavaElementLabels.F_POST_QUALIFIED | JavaElementLabels.M_POST_QUALIFIED | JavaElementLabels.I_POST_QUALIFIED | JavaElementLabels.T_POST_QUALIFIED | JavaElementLabels.D_POST_QUALIFIED | JavaElementLabels.CF_POST_QUALIFIED | JavaElementLabels.CU_POST_QUALIFIED); } } /* (non-Javadoc) * @see ILabelProvider#getImage */ public Image getImage(Object element) { if (element instanceof IJavaElement) { IJavaElement e= (IJavaElement) element; return fImageLabelProvider.getImageLabel(e, fImageFlags); } Image result= fWorkbenchLabelProvider.getImage(element); if (result != null) { return result; } if (element instanceof IStorage) return getImageForJarEntry((IStorage)element); return super.getImage(element);
6,722
Bug 6722 JavaElementLabelProvider API - small issue
everytime i use this label provider it annoys me that i have to type new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT) if it's default then it should be default, if you know what i mean. all i need is: public JavaElementLabelProvider() { this(JavaElementLabelProvider.SHOW_DEFAULT); } it'd make things easier. i'd fix it myself but it's API so i guess it should be blessed first.
resolved fixed
566e615
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T16:13:28Z
2001-12-10T13:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabelProvider.java
} /* (non-Javadoc) * @see ILabelProvider#getText */ public String getText(Object element) { if (element instanceof IJavaElement) { return JavaElementLabels.getElementLabel((IJavaElement) element, fTextFlags); } String text= fWorkbenchLabelProvider.getText(element); if (text.length() > 0) { return text; } if (element instanceof IStorage) { return ((IStorage)element).getName(); } return super.getText(element); } /* (non-Javadoc) * * @see IBaseLabelProvider#dispose */ public void dispose() { fWorkbenchLabelProvider.dispose(); disposeJarEntryImages(); } public void setErrorTickManager(IErrorTickProvider provider) { fImageLabelProvider.setErrorTickProvider(provider); }
6,722
Bug 6722 JavaElementLabelProvider API - small issue
everytime i use this label provider it annoys me that i have to type new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT) if it's default then it should be default, if you know what i mean. all i need is: public JavaElementLabelProvider() { this(JavaElementLabelProvider.SHOW_DEFAULT); } it'd make things easier. i'd fix it myself but it's API so i guess it should be blessed first.
resolved fixed
566e615
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T16:13:28Z
2001-12-10T13:13:20Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/JavaElementLabelProvider.java
/* * Dispose the cached images for JarEntry files */ private void disposeJarEntryImages() { Iterator each= fJarImageMap.values().iterator(); while (each.hasNext()) { Image image= (Image)each.next(); image.dispose(); } fJarImageMap.clear(); } /* * Gets and caches an image for a JarEntryFile. * The image for a JarEntryFile is retrieved from the EditorRegistry. */ private Image getImageForJarEntry(IStorage element) { String extension= element.getFullPath().getFileExtension(); Image image= (Image)fJarImageMap.get(extension); if (image != null) return image; IEditorRegistry registry= PlatformUI.getWorkbench().getEditorRegistry(); ImageDescriptor desc= registry.getImageDescriptor(element.getName()); image= desc.createImage(); fJarImageMap.put(extension, image); return image; } }
6,238
Bug 6238 jar packager: ide freezes on page flip, no progress shown
i selected org.eclipse.jdt.ui org.eclipse.jdt.ui.tests.refactoring (couple thousands of files) and opened the jar packager or flipping the page the whole ide froze. and there was no progress report shown. it took more or less 2 minutes - of total freeze - to flip to the other wizard page. i suggest performing it in another thread and showing progress
resolved fixed
d5959ae
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T18:11:45Z
2001-11-22T17:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
/* * (c) Copyright IBM Corp. 2000, 2001. * All Rights Reserved. */ package org.eclipse.jdt.internal.ui.jarpackager; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator;
6,238
Bug 6238 jar packager: ide freezes on page flip, no progress shown
i selected org.eclipse.jdt.ui org.eclipse.jdt.ui.tests.refactoring (couple thousands of files) and opened the jar packager or flipping the page the whole ide froze. and there was no progress report shown. it took more or less 2 minutes - of total freeze - to flip to the other wizard page. i suggest performing it in another thread and showing progress
resolved fixed
d5959ae
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T18:11:45Z
2001-11-22T17:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
import java.util.List; import java.util.Map; import java.util.Set; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.BusyIndicator; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.Tree; import org.eclipse.jface.viewers.CheckStateChangedEvent; import org.eclipse.jface.viewers.CheckboxTableViewer; import org.eclipse.jface.viewers.CheckboxTreeViewer; import org.eclipse.jface.viewers.ICheckStateListener; import org.eclipse.jface.viewers.ILabelProvider; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.ITreeViewerListener; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TreeExpansionEvent; import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.jface.viewers.ViewerSorter; /** * Combines a CheckboxTreeViewer and CheckboxListViewer. * All viewer selection-driven interactions are handled within this viewer */ public class CheckboxTreeAndListGroup implements ICheckStateListener, ISelectionChangedListener, ITreeViewerListener {
6,238
Bug 6238 jar packager: ide freezes on page flip, no progress shown
i selected org.eclipse.jdt.ui org.eclipse.jdt.ui.tests.refactoring (couple thousands of files) and opened the jar packager or flipping the page the whole ide froze. and there was no progress report shown. it took more or less 2 minutes - of total freeze - to flip to the other wizard page. i suggest performing it in another thread and showing progress
resolved fixed
d5959ae
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T18:11:45Z
2001-11-22T17:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
private Object fRoot; private Object fCurrentTreeSelection; private List fExpandedTreeNodes= new ArrayList(); private Map fCheckedStateStore= new HashMap(9); private List fWhiteCheckedTreeItems= new ArrayList(); private List fListeners= new ArrayList(); private ITreeContentProvider fTreeContentProvider; private IStructuredContentProvider fListContentProvider; private ILabelProvider fTreeLabelProvider; private ILabelProvider fListLabelProvider; private CheckboxTreeViewer fTreeViewer; private CheckboxTableViewer fListViewer; /** * Creates an instance of this class. Use this constructor if you wish to specify * the width and/or height of the combined widget (to only hardcode one of the * sizing dimensions, specify the other dimension's value as -1) * * @param parent org.eclipse.swt.widgets.Composite * @param style int * @param rootObject java.lang.Object * @param childPropertyName java.lang.String * @param parentPropertyName java.lang.String * @param listPropertyName java.lang.String * @param width int * @param height int */ public CheckboxTreeAndListGroup( Composite parent,
6,238
Bug 6238 jar packager: ide freezes on page flip, no progress shown
i selected org.eclipse.jdt.ui org.eclipse.jdt.ui.tests.refactoring (couple thousands of files) and opened the jar packager or flipping the page the whole ide froze. and there was no progress report shown. it took more or less 2 minutes - of total freeze - to flip to the other wizard page. i suggest performing it in another thread and showing progress
resolved fixed
d5959ae
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T18:11:45Z
2001-11-22T17:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
Object rootObject, ITreeContentProvider treeContentProvider, ILabelProvider treeLabelProvider, IStructuredContentProvider listContentProvider, ILabelProvider listLabelProvider, int style, int width, int height) { fRoot= rootObject; fTreeContentProvider= treeContentProvider; fListContentProvider= listContentProvider; fTreeLabelProvider= treeLabelProvider; fListLabelProvider= listLabelProvider; createContents(parent, width, height, style); } /** * This method must be called just before this window becomes visible. */ public void aboutToOpen() { determineWhiteCheckedDescendents(fRoot); checkNewTreeElements(getTreeChildren(fRoot)); fCurrentTreeSelection= null; Object[] elements= getTreeChildren(fRoot); Object primary= elements.length > 0 ? elements[0] : null; if (primary != null) { fTreeViewer.setSelection(new StructuredSelection(primary)); } fTreeViewer.getControl().setFocus(); }
6,238
Bug 6238 jar packager: ide freezes on page flip, no progress shown
i selected org.eclipse.jdt.ui org.eclipse.jdt.ui.tests.refactoring (couple thousands of files) and opened the jar packager or flipping the page the whole ide froze. and there was no progress report shown. it took more or less 2 minutes - of total freeze - to flip to the other wizard page. i suggest performing it in another thread and showing progress
resolved fixed
d5959ae
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T18:11:45Z
2001-11-22T17:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
/** * Adds the passed listener to self's collection of clients * that listen for changes to element checked states * * @param listener ICheckStateListener */ public void addCheckStateListener(ICheckStateListener listener) { fListeners.add(listener); } /** * Adds the receiver and all of it's ancestors to the checkedStateStore if they * are not already there. */ private void addToHierarchyToCheckedStore(Object treeElement) { if (!fCheckedStateStore.containsKey(treeElement)) fCheckedStateStore.put(treeElement, new ArrayList()); Object parent= fTreeContentProvider.getParent(treeElement); if (parent != null) addToHierarchyToCheckedStore(parent); } /** * Returns a boolean indicating whether all children of the passed tree element * are currently white-checked * * @return boolean * @param treeElement java.lang.Object */ protected boolean areAllChildrenWhiteChecked(Object treeElement) { Object[] children= getTreeChildren(treeElement);
6,238
Bug 6238 jar packager: ide freezes on page flip, no progress shown
i selected org.eclipse.jdt.ui org.eclipse.jdt.ui.tests.refactoring (couple thousands of files) and opened the jar packager or flipping the page the whole ide froze. and there was no progress report shown. it took more or less 2 minutes - of total freeze - to flip to the other wizard page. i suggest performing it in another thread and showing progress
resolved fixed
d5959ae
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T18:11:45Z
2001-11-22T17:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
for (int i= 0; i < children.length; ++i) { if (!fWhiteCheckedTreeItems.contains(children[i])) return false; } return true; } /** * Returns a boolean indicating whether all list elements associated with * the passed tree element are currently checked * * @return boolean * @param treeElement java.lang.Object */ protected boolean areAllElementsChecked(Object treeElement) { List checkedElements= (List)fCheckedStateStore.get(treeElement); if (checkedElements == null) return false; return getListItemsSize(treeElement) == checkedElements.size(); } /** * Iterates through the passed elements which are being realized for the first * time and check each one in the tree viewer as appropriate */ protected void checkNewTreeElements(Object[] elements) { for (int i= 0; i < elements.length; ++i) { Object currentElement= elements[i]; boolean checked= fCheckedStateStore.containsKey(currentElement); fTreeViewer.setChecked(currentElement, checked); fTreeViewer.setGrayed( currentElement,
6,238
Bug 6238 jar packager: ide freezes on page flip, no progress shown
i selected org.eclipse.jdt.ui org.eclipse.jdt.ui.tests.refactoring (couple thousands of files) and opened the jar packager or flipping the page the whole ide froze. and there was no progress report shown. it took more or less 2 minutes - of total freeze - to flip to the other wizard page. i suggest performing it in another thread and showing progress
resolved fixed
d5959ae
JDT
https://github.com/eclipse-jdt/eclipse.jdt.ui
eclipse-jdt/eclipse.jdt.ui
java
null
null
null
2001-12-10T18:11:45Z
2001-11-22T17:26:40Z
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/CheckboxTreeAndListGroup.java
checked && !fWhiteCheckedTreeItems.contains(currentElement)); } } /** * An item was checked in one of self's two views. Determine which * view this occurred in and delegate appropriately * * @param event CheckStateChangedEvent */ public void checkStateChanged(final CheckStateChangedEvent event) { BusyIndicator.showWhile(fTreeViewer.getControl().getDisplay(), new Runnable() { public void run() { if (event.getCheckable().equals(fTreeViewer)) treeItemChecked(event.getElement(), event.getChecked()); else listItemChecked(event.getElement(), event.getChecked(), true); notifyCheckStateChangeListeners(event); } }); } /** * Lay out and initialize self's visual components. * * @param parent org.eclipse.swt.widgets.Composite * @param width int * @param height int */ protected void createContents( Composite parent,