apt-mirror-api/src/main/java/com/sun/mirror/util/SourceOrderDeclScanner.java
public void visitTypeDeclaration(TypeDeclaration d) {
		d.accept(pre);

		SortedSet<Declaration> decls = new
				TreeSet<Declaration>(SourceOrderDeclScanner.comparator);

		for (TypeParameterDeclaration tpDecl : d.getFormalTypeParameters()) {
			decls.add(tpDecl);
		}

		for (FieldDeclaration fieldDecl : d.getFields()) {
			decls.add(fieldDecl);
		}

		for (MethodDeclaration methodDecl : d.getMethods()) {
			decls.add(methodDecl);
		}

		for (TypeDeclaration typeDecl : d.getNestedTypes()) {
			decls.add(typeDecl);
		}

		for (Declaration decl : decls)
			decl.accept(this);

		d.accept(post);
	}
public void visitTypeDeclaration(TypeDeclaration d) {
		d.accept(pre);

		SortedSet<Declaration> decls = new
				TreeSet<Declaration>(SourceOrderDeclScanner.comparator);

		for (TypeParameterDeclaration tpDecl : d.getFormalTypeParameters()) {
			decls.add(tpDecl);
		}

		for (FieldDeclaration fieldDecl : d.getFields()) {
			decls.add(fieldDecl);
		}

		for (MethodDeclaration methodDecl : d.getMethods()) {
			decls.add(methodDecl);
		}

		for (TypeDeclaration typeDecl : d.getNestedTypes()) {
			decls.add(typeDecl);
		}

		for (Declaration decl : decls)
			decl.accept(this);

		d.accept(post);
	}
Visits a type declaration.

@param d the declaration to visit