Bug 18961 Adding new class creates class in wrong package in Java Browsing Perspective [browsing]
Hi, I'm working on a class in package A and want to create a class in package B in the Java Browsing perspective. I select package B in the Packages view go into the Types view, click the right mouse button and select New Class. The new class is created in package A instead of package B. Environment: Windows 2000 JSDK 1.4.0 Eclipse F2
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/browsing/JavaBrowsingPart.java
Iterator iter= ((StructuredSelection)selection).iterator();
		Object firstElement= iter.next();
		if (!(firstElement instanceof IJavaElement)) {
			if (firstElement instanceof ISearchResultViewEntry) {
				IJavaElement je= SearchUtil.getJavaElement((ISearchResultViewEntry)firstElement);
				if (je != null)
					return je;
				firstElement= ((ISearchResultViewEntry)firstElement).getResource();
			}
			if (firstElement instanceof IAdaptable) {
				IJavaElement je= (IJavaElement)((IAdaptable)firstElement).getAdapter(IJavaElement.class);
				if (je == null && firstElement instanceof IFile) { 
					IContainer parent= ((IFile)firstElement).getParent();
					if (parent != null)
						return (IJavaElement)parent.getAdapter(IJavaElement.class);
					else return null;
				} else 
					return je;
				
			} else
				return firstElement;
		}
		Object currentInput= (IJavaElement)getViewer().getInput();
		if (currentInput == null || !currentInput.equals(findInputForJavaElement((IJavaElement)firstElement)))
			if (iter.hasNext())
				
				return null;
			else