Bug 5128 JavaUI.revealInEditor doesn't handle ICompilationUnits properly
When calling JavaUI.revealInEditor with an ICompilationUnit, then the package declaration is revealed. This isn't useful, passing an ICompilationUnit should be treated as a no-op. Otherwise clients need to guard against revealing the package declaration in their code (see OpenResourceAction as an example)
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/JavaEditor.java
protected void setSelection(ISourceReference reference, boolean moveCursor) {
		
		if (reference != null) {
			
			try {
				
				ISourceRange range= reference.getSourceRange();
				int offset= range.getOffset();
				int length= range.getLength();
				
				setHighlightRange(offset, length, moveCursor);
				
				if (moveCursor && (reference instanceof IMember)) {
					range= ((IMember) reference).getNameRange();
					offset= range.getOffset();
					length= range.getLength();
					if (range != null && offset > -1 && length > 0) {
						if (getSourceViewer() != null) {
							getSourceViewer().revealRange(offset, length);
							getSourceViewer().setSelectedRange(offset, length);
						}
					}
				}
				
				return;
				
			} catch (JavaModelException x) {
			} catch (IllegalArgumentException x) {
			}
		}