+ // We exclude fields that come from libraries (Java and Groovy), and also the infrastructure
+ private final static String[] EXCLUDED_FIELDS_STARTS_WITH_LIST =
+ // Java and Groovy libraries
+ { "java", "org", "sun", "com", "gov", "groovy"};
+ private final static String[] EXCLUDED_FIELDS_ENDS_WITH_LIST =
+ // Groovy library created fields
+ {"stMC", "callSiteArray", "metaClass", "staticClassInfo", "__constructor__",
+ // Infrastructure
+ "sendEvent", "Object", "reference", "location", "app", "state", "log", "functionList", "objectList",
+ "eventList", "valueList", "settings", "printToConsole", "app1", "app2"};
+ private final static String[] EXCLUDED_FIELDS_CONTAINS_LIST = {"_closure"};
+ private final static String[] EXCLUDED_FIELDS_WRITE_INSTRUCTIONS_STARTS_WITH_LIST = {"Event"};
+
+ private boolean isFieldExcluded(String field) {
+ // Check against "starts-with" list
+ for(String str : EXCLUDED_FIELDS_STARTS_WITH_LIST) {
+ if (field.startsWith(str)) {
+ return true;
+ }
+ }
+ // Check against "ends-with" list
+ for(String str : EXCLUDED_FIELDS_ENDS_WITH_LIST) {
+ if (field.endsWith(str)) {
+ return true;
+ }
+ }
+ // Check against "contains" list
+ for(String str : EXCLUDED_FIELDS_CONTAINS_LIST) {
+ if (field.contains(str)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+