package br.ufmg.dcc.labsoft.apidiff.detect.parser;
import java.util.ArrayList;

import org.eclipse.jdt.core.dom.ASTVisitor;
import org.eclipse.jdt.core.dom.TypeDeclaration;

import br.ufmg.dcc.labsoft.apidiff.UtilTools;

public class TypeDeclarationVisitor extends ASTVisitor{
	private ArrayList<TypeDeclaration> acessibleTypes = new ArrayList<TypeDeclaration>();
	private ArrayList<TypeDeclaration> nonAcessibleTypes = new ArrayList<TypeDeclaration>();

	public ArrayList<TypeDeclaration> getAcessibleTypes() {
		return this.acessibleTypes;
	}

	public ArrayList<TypeDeclaration> getNonAcessibleTypes() {
		return this.nonAcessibleTypes;
	}

	public void addAcessibleType(TypeDeclaration type) {
		this.acessibleTypes.add(type);
	}

	public void addNonAcessibleTypes(TypeDeclaration type) {
		this.nonAcessibleTypes.add(type);
	}

	@Override
	public boolean visit(TypeDeclaration node) {
		if(UtilTools.isVisibilityPrivate(node)){
			this.addNonAcessibleTypes(node);
		} else {
			this.addAcessibleType(node);
		}

		return super.visit(node);
	}


}

@@ -941,21 +941,61 @@
 bilityPr
-ivate
+otected(node) %7C%7C UtilTools.isVisibilityPublic
 (node))%7B
@@ -1007,19 +1007,16 @@
 this.add
-Non
 Acessibl
@@ -1020,17 +1020,16 @@
 ibleType
-s
 (node);%0D
@@ -1036,14 +1036,16 @@
 %0A%09%09%7D
- 
+%0D%0A%09%09
 else
- 
 %7B%0D%0A%09
@@ -1046,32 +1046,35 @@
 se%7B%0D%0A%09%09%09this.add
+Non
 AcessibleType(no
@@ -1062,32 +1062,33 @@
 NonAcessibleType
+s
 (node);%0D%0A%09%09%7D%0D%0A%0D%0A
@@ -1085,18 +1085,16 @@
 ;%0D%0A%09%09%7D%0D%0A
-%0D%0A
 %09%09return

Ajuste das regras de types acessíveis, teste movido para o método visitor.