Bug 63389 [projection] Do we need a folding region for the top-level type?
The Java editor is currently defining a folding region for the top-level type. I couldn't find a good use of this folding region and in particular it leads to some visual instability when hovering in the vertical rule in between methods. Therefore I suggest to not add this folding region.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/folding/DefaultJavaFoldingStructureProvider.java
Position position= createProjectionPosition(regions[i], null);
					boolean commentCollapse;
					if (position != null) {
						if (i == 0 && (regions.length > 2 || fHasHeaderComment) && element == fFirstType) {
							commentCollapse= fAllowCollapsing && fCollapseHeaderComments;
						} else {
							commentCollapse= fAllowCollapsing && fCollapseJavadoc;
						}
						map.put(new JavaProjectionAnnotation(element, commentCollapse, true), position);
					}
				}
				
				Position position= createProjectionPosition(regions[regions.length - 1], element);
				if (position != null)
					map.put(new JavaProjectionAnnotation(element, collapse, false), position);
			}
		}
	}
	private boolean isInnerType(IType type) {
		try {
			return type.isMember();
		} catch (JavaModelException x) {
			IJavaElement parent= type.getParent();
			if (parent != null) {
				int parentType= parent.getElementType();
				return (parentType != IJavaElement.COMPILATION_UNIT && parentType != IJavaElement.CLASS_FILE);
			}
		}
		return false;
	}