id
int32
0
12.9k
code
sequencelengths
2
264k
5,900
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "batch", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRuleSet", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "INameEnvironment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "NameEnvironmentAnswer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "public", "class", "FileSystem", "implements", "INameEnvironment", ",", "SuffixConstants", "{", "public", "interface", "Classpath", "{", "char", "[", "]", "[", "]", "[", "]", "findTypeNames", "(", "String", "qualifiedPackageName", ")", ";", "NameEnvironmentAnswer", "findClass", "(", "char", "[", "]", "typeName", ",", "String", "qualifiedPackageName", ",", "String", "qualifiedBinaryFileName", ")", ";", "NameEnvironmentAnswer", "findClass", "(", "char", "[", "]", "typeName", ",", "String", "qualifiedPackageName", ",", "String", "qualifiedBinaryFileName", ",", "boolean", "asBinaryOnly", ")", ";", "boolean", "isPackage", "(", "String", "qualifiedPackageName", ")", ";", "List", "fetchLinkedJars", "(", "ClasspathSectionProblemReporter", "problemReporter", ")", ";", "void", "reset", "(", ")", ";", "char", "[", "]", "normalizedPath", "(", ")", ";", "String", "getPath", "(", ")", ";", "void", "initialize", "(", ")", "throws", "IOException", ";", "}", "public", "interface", "ClasspathSectionProblemReporter", "{", "void", "invalidClasspathSection", "(", "String", "jarFilePath", ")", ";", "void", "multipleClasspathSections", "(", "String", "jarFilePath", ")", ";", "}", "public", "static", "class", "ClasspathNormalizer", "{", "public", "static", "ArrayList", "normalize", "(", "ArrayList", "classpaths", ")", "{", "ArrayList", "normalizedClasspath", "=", "new", "ArrayList", "(", ")", ";", "HashSet", "cache", "=", "new", "HashSet", "(", ")", ";", "for", "(", "Iterator", "iterator", "=", "classpaths", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "FileSystem", ".", "Classpath", "classpath", "=", "(", "FileSystem", ".", "Classpath", ")", "iterator", ".", "next", "(", ")", ";", "String", "path", "=", "classpath", ".", "getPath", "(", ")", ";", "if", "(", "!", "cache", ".", "contains", "(", "path", ")", ")", "{", "normalizedClasspath", ".", "add", "(", "classpath", ")", ";", "cache", ".", "add", "(", "path", ")", ";", "}", "}", "return", "normalizedClasspath", ";", "}", "}", "Classpath", "[", "]", "classpaths", ";", "Set", "knownFileNames", ";", "public", "FileSystem", "(", "String", "[", "]", "classpathNames", ",", "String", "[", "]", "initialFileNames", ",", "String", "encoding", ")", "{", "final", "int", "classpathSize", "=", "classpathNames", ".", "length", ";", "this", ".", "classpaths", "=", "new", "Classpath", "[", "classpathSize", "]", ";", "int", "counter", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classpathSize", ";", "i", "++", ")", "{", "Classpath", "classpath", "=", "getClasspath", "(", "classpathNames", "[", "i", "]", ",", "encoding", ",", "null", ")", ";", "try", "{", "classpath", ".", "initialize", "(", ")", ";", "this", ".", "classpaths", "[", "counter", "++", "]", "=", "classpath", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "if", "(", "counter", "!=", "classpathSize", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "classpaths", ",", "0", ",", "(", "this", ".", "classpaths", "=", "new", "Classpath", "[", "counter", "]", ")", ",", "0", ",", "counter", ")", ";", "}", "initializeKnownFileNames", "(", "initialFileNames", ")", ";", "}", "protected", "FileSystem", "(", "Classpath", "[", "]", "paths", ",", "String", "[", "]", "initialFileNames", ")", "{", "final", "int", "length", "=", "paths", ".", "length", ";", "int", "counter", "=", "0", ";", "this", ".", "classpaths", "=", "new", "FileSystem", ".", "Classpath", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "final", "Classpath", "classpath", "=", "paths", "[", "i", "]", ";", "try", "{", "classpath", ".", "initialize", "(", ")", ";", "this", ".", "classpaths", "[", "counter", "++", "]", "=", "classpath", ";", "}", "catch", "(", "IOException", "exception", ")", "{", "}", "}", "if", "(", "counter", "!=", "length", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "classpaths", ",", "0", ",", "(", "this", ".", "classpaths", "=", "new", "FileSystem", ".", "Classpath", "[", "counter", "]", ")", ",", "0", ",", "counter", ")", ";", "}", "initializeKnownFileNames", "(", "initialFileNames", ")", ";", "}", "public", "static", "Classpath", "getClasspath", "(", "String", "classpathName", ",", "String", "encoding", ",", "AccessRuleSet", "accessRuleSet", ")", "{", "return", "getClasspath", "(", "classpathName", ",", "encoding", ",", "false", ",", "accessRuleSet", ",", "null", ")", ";", "}", "public", "static", "Classpath", "getClasspath", "(", "String", "classpathName", ",", "String", "encoding", ",", "boolean", "isSourceOnly", ",", "AccessRuleSet", "accessRuleSet", ",", "String", "destinationPath", ")", "{", "Classpath", "result", "=", "null", ";", "File", "file", "=", "new", "File", "(", "convertPathSeparators", "(", "classpathName", ")", ")", ";", "if", "(", "file", ".", "isDirectory", "(", ")", ")", "{", "if", "(", "file", ".", "exists", "(", ")", ")", "{", "result", "=", "new", "ClasspathDirectory", "(", "file", ",", "encoding", ",", "isSourceOnly", "?", "ClasspathLocation", ".", "SOURCE", ":", "ClasspathLocation", ".", "SOURCE", "|", "ClasspathLocation", ".", "BINARY", ",", "accessRuleSet", ",", "destinationPath", "==", "null", "||", "destinationPath", "==", "Main", ".", "NONE", "?", "destinationPath", ":", "convertPathSeparators", "(", "destinationPath", ")", ")", ";", "}", "}", "else", "{", "if", "(", "Util", ".", "isPotentialZipArchive", "(", "classpathName", ")", ")", "{", "if", "(", "isSourceOnly", ")", "{", "result", "=", "new", "ClasspathSourceJar", "(", "file", ",", "true", ",", "accessRuleSet", ",", "encoding", ",", "destinationPath", "==", "null", "||", "destinationPath", "==", "Main", ".", "NONE", "?", "destinationPath", ":", "convertPathSeparators", "(", "destinationPath", ")", ")", ";", "}", "else", "if", "(", "destinationPath", "==", "null", ")", "{", "result", "=", "new", "ClasspathJar", "(", "file", ",", "true", ",", "accessRuleSet", ",", "null", ")", ";", "}", "}", "}", "return", "result", ";", "}", "private", "void", "initializeKnownFileNames", "(", "String", "[", "]", "initialFileNames", ")", "{", "if", "(", "initialFileNames", "==", "null", ")", "{", "this", ".", "knownFileNames", "=", "new", "HashSet", "(", "0", ")", ";", "return", ";", "}", "this", ".", "knownFileNames", "=", "new", "HashSet", "(", "initialFileNames", ".", "length", "*", "2", ")", ";", "for", "(", "int", "i", "=", "initialFileNames", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "{", "File", "compilationUnitFile", "=", "new", "File", "(", "initialFileNames", "[", "i", "]", ")", ";", "char", "[", "]", "fileName", "=", "null", ";", "try", "{", "fileName", "=", "compilationUnitFile", ".", "getCanonicalPath", "(", ")", ".", "toCharArray", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "continue", ";", "}", "char", "[", "]", "matchingPathName", "=", "null", ";", "final", "int", "lastIndexOf", "=", "CharOperation", ".", "lastIndexOf", "(", "'.'", ",", "fileName", ")", ";", "if", "(", "lastIndexOf", "!=", "-", "1", ")", "{", "fileName", "=", "CharOperation", ".", "subarray", "(", "fileName", ",", "0", ",", "lastIndexOf", ")", ";", "}", "CharOperation", ".", "replace", "(", "fileName", ",", "'\\\\'", ",", "'/'", ")", ";", "for", "(", "int", "j", "=", "0", ",", "max", "=", "this", ".", "classpaths", ".", "length", ";", "j", "<", "max", ";", "j", "++", ")", "{", "char", "[", "]", "matchCandidate", "=", "this", ".", "classpaths", "[", "j", "]", ".", "normalizedPath", "(", ")", ";", "if", "(", "this", ".", "classpaths", "[", "j", "]", "instanceof", "ClasspathDirectory", "&&", "CharOperation", ".", "prefixEquals", "(", "matchCandidate", ",", "fileName", ")", "&&", "(", "matchingPathName", "==", "null", "||", "matchCandidate", ".", "length", "<", "matchingPathName", ".", "length", ")", ")", "{", "matchingPathName", "=", "matchCandidate", ";", "}", "}", "if", "(", "matchingPathName", "==", "null", ")", "{", "this", ".", "knownFileNames", ".", "add", "(", "new", "String", "(", "fileName", ")", ")", ";", "}", "else", "{", "this", ".", "knownFileNames", ".", "add", "(", "new", "String", "(", "CharOperation", ".", "subarray", "(", "fileName", ",", "matchingPathName", ".", "length", ",", "fileName", ".", "length", ")", ")", ")", ";", "}", "matchingPathName", "=", "null", ";", "}", "}", "public", "void", "cleanup", "(", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "this", ".", "classpaths", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "this", ".", "classpaths", "[", "i", "]", ".", "reset", "(", ")", ";", "}", "private", "static", "String", "convertPathSeparators", "(", "String", "path", ")", "{", "return", "File", ".", "separatorChar", "==", "'/'", "?", "path", ".", "replace", "(", "'\\\\'", ",", "'/'", ")", ":", "path", ".", "replace", "(", "'/'", ",", "'\\\\'", ")", ";", "}", "private", "NameEnvironmentAnswer", "findClass", "(", "String", "qualifiedTypeName", ",", "char", "[", "]", "typeName", ",", "boolean", "asBinaryOnly", ")", "{", "if", "(", "this", ".", "knownFileNames", ".", "contains", "(", "qualifiedTypeName", ")", ")", "return", "null", ";", "String", "qualifiedBinaryFileName", "=", "qualifiedTypeName", "+", "SUFFIX_STRING_class", ";", "String", "qualifiedPackageName", "=", "qualifiedTypeName", ".", "length", "(", ")", "==", "typeName", ".", "length", "?", "Util", ".", "EMPTY_STRING", ":", "qualifiedBinaryFileName", ".", "substring", "(", "0", ",", "qualifiedTypeName", ".", "length", "(", ")", "-", "typeName", ".", "length", "-", "1", ")", ";", "String", "qp2", "=", "File", ".", "separatorChar", "==", "'/'", "?", "qualifiedPackageName", ":", "qualifiedPackageName", ".", "replace", "(", "'/'", ",", "File", ".", "separatorChar", ")", ";", "NameEnvironmentAnswer", "suggestedAnswer", "=", "null", ";", "if", "(", "qualifiedPackageName", "==", "qp2", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "classpaths", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "NameEnvironmentAnswer", "answer", "=", "this", ".", "classpaths", "[", "i", "]", ".", "findClass", "(", "typeName", ",", "qualifiedPackageName", ",", "qualifiedBinaryFileName", ",", "asBinaryOnly", ")", ";", "if", "(", "answer", "!=", "null", ")", "{", "if", "(", "!", "answer", ".", "ignoreIfBetter", "(", ")", ")", "{", "if", "(", "answer", ".", "isBetter", "(", "suggestedAnswer", ")", ")", "return", "answer", ";", "}", "else", "if", "(", "answer", ".", "isBetter", "(", "suggestedAnswer", ")", ")", "suggestedAnswer", "=", "answer", ";", "}", "}", "}", "else", "{", "String", "qb2", "=", "qualifiedBinaryFileName", ".", "replace", "(", "'/'", ",", "File", ".", "separatorChar", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "classpaths", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "Classpath", "p", "=", "this", ".", "classpaths", "[", "i", "]", ";", "NameEnvironmentAnswer", "answer", "=", "(", "p", "instanceof", "ClasspathJar", ")", "?", "p", ".", "findClass", "(", "typeName", ",", "qualifiedPackageName", ",", "qualifiedBinaryFileName", ",", "asBinaryOnly", ")", ":", "p", ".", "findClass", "(", "typeName", ",", "qp2", ",", "qb2", ",", "asBinaryOnly", ")", ";", "if", "(", "answer", "!=", "null", ")", "{", "if", "(", "!", "answer", ".", "ignoreIfBetter", "(", ")", ")", "{", "if", "(", "answer", ".", "isBetter", "(", "suggestedAnswer", ")", ")", "return", "answer", ";", "}", "else", "if", "(", "answer", ".", "isBetter", "(", "suggestedAnswer", ")", ")", "suggestedAnswer", "=", "answer", ";", "}", "}", "}", "if", "(", "suggestedAnswer", "!=", "null", ")", "return", "suggestedAnswer", ";", "return", "null", ";", "}", "public", "NameEnvironmentAnswer", "findType", "(", "char", "[", "]", "[", "]", "compoundName", ")", "{", "if", "(", "compoundName", "!=", "null", ")", "return", "findClass", "(", "new", "String", "(", "CharOperation", ".", "concatWith", "(", "compoundName", ",", "'/'", ")", ")", ",", "compoundName", "[", "compoundName", ".", "length", "-", "1", "]", ",", "false", ")", ";", "return", "null", ";", "}", "public", "char", "[", "]", "[", "]", "[", "]", "findTypeNames", "(", "char", "[", "]", "[", "]", "packageName", ")", "{", "char", "[", "]", "[", "]", "[", "]", "result", "=", "null", ";", "if", "(", "packageName", "!=", "null", ")", "{", "String", "qualifiedPackageName", "=", "new", "String", "(", "CharOperation", ".", "concatWith", "(", "packageName", ",", "'/'", ")", ")", ";", "String", "qualifiedPackageName2", "=", "File", ".", "separatorChar", "==", "'/'", "?", "qualifiedPackageName", ":", "qualifiedPackageName", ".", "replace", "(", "'/'", ",", "File", ".", "separatorChar", ")", ";", "if", "(", "qualifiedPackageName", "==", "qualifiedPackageName2", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "classpaths", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "char", "[", "]", "[", "]", "[", "]", "answers", "=", "this", ".", "classpaths", "[", "i", "]", ".", "findTypeNames", "(", "qualifiedPackageName", ")", ";", "if", "(", "answers", "!=", "null", ")", "{", "if", "(", "result", "==", "null", ")", "{", "result", "=", "answers", ";", "}", "else", "{", "int", "resultLength", "=", "result", ".", "length", ";", "int", "answersLength", "=", "answers", ".", "length", ";", "System", ".", "arraycopy", "(", "result", ",", "0", ",", "(", "result", "=", "new", "char", "[", "answersLength", "+", "resultLength", "]", "[", "]", "[", "]", ")", ",", "0", ",", "resultLength", ")", ";", "System", ".", "arraycopy", "(", "answers", ",", "0", ",", "result", ",", "resultLength", ",", "answersLength", ")", ";", "}", "}", "}", "}", "else", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "classpaths", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "Classpath", "p", "=", "this", ".", "classpaths", "[", "i", "]", ";", "char", "[", "]", "[", "]", "[", "]", "answers", "=", "(", "p", "instanceof", "ClasspathJar", ")", "?", "p", ".", "findTypeNames", "(", "qualifiedPackageName", ")", ":", "p", ".", "findTypeNames", "(", "qualifiedPackageName2", ")", ";", "if", "(", "answers", "!=", "null", ")", "{", "if", "(", "result", "==", "null", ")", "{", "result", "=", "answers", ";", "}", "else", "{", "int", "resultLength", "=", "result", ".", "length", ";", "int", "answersLength", "=", "answers", ".", "length", ";", "System", ".", "arraycopy", "(", "result", ",", "0", ",", "(", "result", "=", "new", "char", "[", "answersLength", "+", "resultLength", "]", "[", "]", "[", "]", ")", ",", "0", ",", "resultLength", ")", ";", "System", ".", "arraycopy", "(", "answers", ",", "0", ",", "result", ",", "resultLength", ",", "answersLength", ")", ";", "}", "}", "}", "}", "}", "return", "result", ";", "}", "public", "NameEnvironmentAnswer", "findType", "(", "char", "[", "]", "[", "]", "compoundName", ",", "boolean", "asBinaryOnly", ")", "{", "if", "(", "compoundName", "!=", "null", ")", "return", "findClass", "(", "new", "String", "(", "CharOperation", ".", "concatWith", "(", "compoundName", ",", "'/'", ")", ")", ",", "compoundName", "[", "compoundName", ".", "length", "-", "1", "]", ",", "asBinaryOnly", ")", ";", "return", "null", ";", "}", "public", "NameEnvironmentAnswer", "findType", "(", "char", "[", "]", "typeName", ",", "char", "[", "]", "[", "]", "packageName", ")", "{", "if", "(", "typeName", "!=", "null", ")", "return", "findClass", "(", "new", "String", "(", "CharOperation", ".", "concatWith", "(", "packageName", ",", "typeName", ",", "'/'", ")", ")", ",", "typeName", ",", "false", ")", ";", "return", "null", ";", "}", "public", "boolean", "isPackage", "(", "char", "[", "]", "[", "]", "compoundName", ",", "char", "[", "]", "packageName", ")", "{", "String", "qualifiedPackageName", "=", "new", "String", "(", "CharOperation", ".", "concatWith", "(", "compoundName", ",", "packageName", ",", "'/'", ")", ")", ";", "String", "qp2", "=", "File", ".", "separatorChar", "==", "'/'", "?", "qualifiedPackageName", ":", "qualifiedPackageName", ".", "replace", "(", "'/'", ",", "File", ".", "separatorChar", ")", ";", "if", "(", "qualifiedPackageName", "==", "qp2", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "classpaths", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "if", "(", "this", ".", "classpaths", "[", "i", "]", ".", "isPackage", "(", "qualifiedPackageName", ")", ")", "return", "true", ";", "}", "else", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "classpaths", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "Classpath", "p", "=", "this", ".", "classpaths", "[", "i", "]", ";", "if", "(", "(", "p", "instanceof", "ClasspathJar", ")", "?", "p", ".", "isPackage", "(", "qualifiedPackageName", ")", ":", "p", ".", "isPackage", "(", "qp2", ")", ")", "return", "true", ";", "}", "}", "return", "false", ";", "}", "}", "</s>" ]
5,901
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "batch", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "public", "class", "FileFinder", "{", "public", "static", "String", "[", "]", "find", "(", "File", "f", ",", "String", "pattern", ")", "{", "ArrayList", "files", "=", "new", "ArrayList", "(", ")", ";", "find0", "(", "f", ",", "pattern", ",", "files", ")", ";", "String", "[", "]", "result", "=", "new", "String", "[", "files", ".", "size", "(", ")", "]", ";", "files", ".", "toArray", "(", "result", ")", ";", "return", "result", ";", "}", "private", "static", "void", "find0", "(", "File", "f", ",", "String", "pattern", ",", "ArrayList", "collector", ")", "{", "if", "(", "f", ".", "isDirectory", "(", ")", ")", "{", "String", "[", "]", "files", "=", "f", ".", "list", "(", ")", ";", "if", "(", "files", "==", "null", ")", "return", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "files", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "File", "current", "=", "new", "File", "(", "f", ",", "files", "[", "i", "]", ")", ";", "if", "(", "current", ".", "isDirectory", "(", ")", ")", "{", "find0", "(", "current", ",", "pattern", ",", "collector", ")", ";", "}", "else", "{", "if", "(", "current", ".", "getName", "(", ")", ".", "toUpperCase", "(", ")", ".", "endsWith", "(", "pattern", ")", ")", "{", "collector", ".", "add", "(", "current", ".", "getAbsolutePath", "(", ")", ")", ";", "}", "}", "}", "}", "}", "}", "</s>" ]
5,902
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "batch", ";", "import", "java", ".", "io", ".", "BufferedInputStream", ";", "import", "java", ".", "io", ".", "ByteArrayInputStream", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "java", ".", "io", ".", "FileNotFoundException", ";", "import", "java", ".", "io", ".", "FileOutputStream", ";", "import", "java", ".", "io", ".", "FilenameFilter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "java", ".", "io", ".", "LineNumberReader", ";", "import", "java", ".", "io", ".", "OutputStreamWriter", ";", "import", "java", ".", "io", ".", "PrintWriter", ";", "import", "java", ".", "io", ".", "StringReader", ";", "import", "java", ".", "io", ".", "StringWriter", ";", "import", "java", ".", "io", ".", "UnsupportedEncodingException", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Field", ";", "import", "java", ".", "text", ".", "DateFormat", ";", "import", "java", ".", "text", ".", "MessageFormat", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "java", ".", "util", ".", "Date", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Locale", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "MissingResourceException", ";", "import", "java", ".", "util", ".", "Properties", ";", "import", "java", ".", "util", ".", "ResourceBundle", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "java", ".", "util", ".", "StringTokenizer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CompilationProgress", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "batch", ".", "BatchCompiler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "AbstractAnnotationProcessorManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "CompilationResult", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "Compiler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ICompilerRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "IErrorHandlingPolicy", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "IProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "batch", ".", "FileSystem", ".", "Classpath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRestriction", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRuleSet", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerStats", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "LookupEnvironment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "DefaultProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemReporter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemSeverities", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "GenericXMLWriter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "HashtableOfInt", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "HashtableOfObject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "public", "class", "Main", "implements", "ProblemSeverities", ",", "SuffixConstants", "{", "public", "static", "class", "Logger", "{", "private", "PrintWriter", "err", ";", "private", "PrintWriter", "log", ";", "private", "Main", "main", ";", "private", "PrintWriter", "out", ";", "private", "HashMap", "parameters", ";", "int", "tagBits", ";", "private", "static", "final", "String", "CLASS", "=", "\"class\"", ";", "private", "static", "final", "String", "CLASS_FILE", "=", "\"classfile\"", ";", "private", "static", "final", "String", "CLASSPATH", "=", "\"classpath\"", ";", "private", "static", "final", "String", "CLASSPATH_FILE", "=", "\"FILE\"", ";", "private", "static", "final", "String", "CLASSPATH_FOLDER", "=", "\"FOLDER\"", ";", "private", "static", "final", "String", "CLASSPATH_ID", "=", "\"id\"", ";", "private", "static", "final", "String", "CLASSPATH_JAR", "=", "\"JAR\"", ";", "private", "static", "final", "String", "CLASSPATHS", "=", "\"classpaths\"", ";", "private", "static", "final", "String", "COMMAND_LINE_ARGUMENT", "=", "\"argument\"", ";", "private", "static", "final", "String", "COMMAND_LINE_ARGUMENTS", "=", "\"command_line\"", ";", "private", "static", "final", "String", "COMPILER", "=", "\"compiler\"", ";", "private", "static", "final", "String", "COMPILER_COPYRIGHT", "=", "\"copyright\"", ";", "private", "static", "final", "String", "COMPILER_NAME", "=", "\"name\"", ";", "private", "static", "final", "String", "COMPILER_VERSION", "=", "\"version\"", ";", "public", "static", "final", "int", "EMACS", "=", "2", ";", "private", "static", "final", "String", "ERROR", "=", "\"ERROR\"", ";", "private", "static", "final", "String", "ERROR_TAG", "=", "\"error\"", ";", "private", "static", "final", "String", "WARNING_TAG", "=", "\"warning\"", ";", "private", "static", "final", "String", "EXCEPTION", "=", "\"exception\"", ";", "private", "static", "final", "String", "EXTRA_PROBLEM_TAG", "=", "\"\"", ";", "private", "static", "final", "String", "EXTRA_PROBLEMS", "=", "\"\"", ";", "private", "static", "final", "HashtableOfInt", "FIELD_TABLE", "=", "new", "HashtableOfInt", "(", ")", ";", "private", "static", "final", "String", "KEY", "=", "\"key\"", ";", "private", "static", "final", "String", "MESSAGE", "=", "\"message\"", ";", "private", "static", "final", "String", "NUMBER_OF_CLASSFILES", "=", "\"\"", ";", "private", "static", "final", "String", "NUMBER_OF_ERRORS", "=", "\"errors\"", ";", "private", "static", "final", "String", "NUMBER_OF_LINES", "=", "\"\"", ";", "private", "static", "final", "String", "NUMBER_OF_PROBLEMS", "=", "\"problems\"", ";", "private", "static", "final", "String", "NUMBER_OF_TASKS", "=", "\"tasks\"", ";", "private", "static", "final", "String", "NUMBER_OF_WARNINGS", "=", "\"warnings\"", ";", "private", "static", "final", "String", "OPTION", "=", "\"option\"", ";", "private", "static", "final", "String", "OPTIONS", "=", "\"options\"", ";", "private", "static", "final", "String", "OUTPUT", "=", "\"output\"", ";", "private", "static", "final", "String", "PACKAGE", "=", "\"package\"", ";", "private", "static", "final", "String", "PATH", "=", "\"path\"", ";", "private", "static", "final", "String", "PROBLEM_ARGUMENT", "=", "\"argument\"", ";", "private", "static", "final", "String", "PROBLEM_ARGUMENT_VALUE", "=", "\"value\"", ";", "private", "static", "final", "String", "PROBLEM_ARGUMENTS", "=", "\"arguments\"", ";", "private", "static", "final", "String", "PROBLEM_CATEGORY_ID", "=", "\"categoryID\"", ";", "private", "static", "final", "String", "ID", "=", "\"id\"", ";", "private", "static", "final", "String", "PROBLEM_ID", "=", "\"problemID\"", ";", "private", "static", "final", "String", "PROBLEM_LINE", "=", "\"line\"", ";", "private", "static", "final", "String", "PROBLEM_OPTION_KEY", "=", "\"optionKey\"", ";", "private", "static", "final", "String", "PROBLEM_MESSAGE", "=", "\"message\"", ";", "private", "static", "final", "String", "PROBLEM_SEVERITY", "=", "\"severity\"", ";", "private", "static", "final", "String", "PROBLEM_SOURCE_END", "=", "\"charEnd\"", ";", "private", "static", "final", "String", "PROBLEM_SOURCE_START", "=", "\"charStart\"", ";", "private", "static", "final", "String", "PROBLEM_SUMMARY", "=", "\"\"", ";", "private", "static", "final", "String", "PROBLEM_TAG", "=", "\"problem\"", ";", "private", "static", "final", "String", "PROBLEMS", "=", "\"problems\"", ";", "private", "static", "final", "String", "SOURCE", "=", "\"source\"", ";", "private", "static", "final", "String", "SOURCE_CONTEXT", "=", "\"\"", ";", "private", "static", "final", "String", "SOURCE_END", "=", "\"sourceEnd\"", ";", "private", "static", "final", "String", "SOURCE_START", "=", "\"sourceStart\"", ";", "private", "static", "final", "String", "SOURCES", "=", "\"sources\"", ";", "private", "static", "final", "String", "STATS", "=", "\"stats\"", ";", "private", "static", "final", "String", "TASK", "=", "\"task\"", ";", "private", "static", "final", "String", "TASKS", "=", "\"tasks\"", ";", "private", "static", "final", "String", "TIME", "=", "\"time\"", ";", "private", "static", "final", "String", "VALUE", "=", "\"value\"", ";", "private", "static", "final", "String", "WARNING", "=", "\"WARNING\"", ";", "public", "static", "final", "int", "XML", "=", "1", ";", "private", "static", "final", "String", "XML_DTD_DECLARATION", "=", "\"\"", ";", "static", "{", "try", "{", "Class", "c", "=", "IProblem", ".", "class", ";", "Field", "[", "]", "fields", "=", "c", ".", "getFields", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "fields", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "Field", "field", "=", "fields", "[", "i", "]", ";", "if", "(", "field", ".", "getType", "(", ")", ".", "equals", "(", "Integer", ".", "TYPE", ")", ")", "{", "Integer", "value", "=", "(", "Integer", ")", "field", ".", "get", "(", "null", ")", ";", "int", "key2", "=", "value", ".", "intValue", "(", ")", "&", "IProblem", ".", "IgnoreCategoriesMask", ";", "if", "(", "key2", "==", "0", ")", "{", "key2", "=", "Integer", ".", "MAX_VALUE", ";", "}", "Logger", ".", "FIELD_TABLE", ".", "put", "(", "key2", ",", "field", ".", "getName", "(", ")", ")", ";", "}", "}", "}", "catch", "(", "SecurityException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "public", "Logger", "(", "Main", "main", ",", "PrintWriter", "out", ",", "PrintWriter", "err", ")", "{", "this", ".", "out", "=", "out", ";", "this", ".", "err", "=", "err", ";", "this", ".", "parameters", "=", "new", "HashMap", "(", ")", ";", "this", ".", "main", "=", "main", ";", "}", "public", "String", "buildFileName", "(", "String", "outputPath", ",", "String", "relativeFileName", ")", "{", "char", "fileSeparatorChar", "=", "File", ".", "separatorChar", ";", "String", "fileSeparator", "=", "File", ".", "separator", ";", "outputPath", "=", "outputPath", ".", "replace", "(", "'/'", ",", "fileSeparatorChar", ")", ";", "StringBuffer", "outDir", "=", "new", "StringBuffer", "(", "outputPath", ")", ";", "if", "(", "!", "outputPath", ".", "endsWith", "(", "fileSeparator", ")", ")", "{", "outDir", ".", "append", "(", "fileSeparator", ")", ";", "}", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "relativeFileName", ",", "fileSeparator", ")", ";", "String", "token", "=", "tokenizer", ".", "nextToken", "(", ")", ";", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "{", "outDir", ".", "append", "(", "token", ")", ".", "append", "(", "fileSeparator", ")", ";", "token", "=", "tokenizer", ".", "nextToken", "(", ")", ";", "}", "return", "outDir", ".", "append", "(", "token", ")", ".", "toString", "(", ")", ";", "}", "public", "void", "close", "(", ")", "{", "if", "(", "this", ".", "log", "!=", "null", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "endTag", "(", "Logger", ".", "COMPILER", ")", ";", "flush", "(", ")", ";", "}", "this", ".", "log", ".", "close", "(", ")", ";", "}", "}", "public", "void", "compiling", "(", ")", "{", "printlnOut", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", ";", "}", "private", "void", "endLoggingExtraProblems", "(", ")", "{", "endTag", "(", "Logger", ".", "EXTRA_PROBLEMS", ")", ";", "}", "private", "void", "endLoggingProblems", "(", ")", "{", "endTag", "(", "Logger", ".", "PROBLEMS", ")", ";", "}", "public", "void", "endLoggingSource", "(", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "endTag", "(", "Logger", ".", "SOURCE", ")", ";", "}", "}", "public", "void", "endLoggingSources", "(", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "endTag", "(", "Logger", ".", "SOURCES", ")", ";", "}", "}", "public", "void", "endLoggingTasks", "(", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "endTag", "(", "Logger", ".", "TASKS", ")", ";", "}", "}", "private", "void", "endTag", "(", "String", "name", ")", "{", "if", "(", "this", ".", "log", "!=", "null", ")", "{", "(", "(", "GenericXMLWriter", ")", "this", ".", "log", ")", ".", "endTag", "(", "name", ",", "true", ",", "true", ")", ";", "}", "}", "private", "String", "errorReportSource", "(", "CategorizedProblem", "problem", ",", "char", "[", "]", "unitSource", ",", "int", "bits", ")", "{", "int", "startPosition", "=", "problem", ".", "getSourceStart", "(", ")", ";", "int", "endPosition", "=", "problem", ".", "getSourceEnd", "(", ")", ";", "if", "(", "unitSource", "==", "null", ")", "{", "if", "(", "problem", ".", "getOriginatingFileName", "(", ")", "!=", "null", ")", "{", "try", "{", "unitSource", "=", "Util", ".", "getFileCharContent", "(", "new", "File", "(", "new", "String", "(", "problem", ".", "getOriginatingFileName", "(", ")", ")", ")", ",", "null", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "int", "length", "=", "unitSource", "==", "null", "?", "0", ":", "unitSource", ".", "length", ";", "if", "(", "(", "startPosition", ">", "endPosition", ")", "||", "(", "(", "startPosition", "<", "0", ")", "&&", "(", "endPosition", "<", "0", ")", ")", "||", "length", "==", "0", ")", "return", "Messages", ".", "problem_noSourceInformation", ";", "StringBuffer", "errorBuffer", "=", "new", "StringBuffer", "(", ")", ";", "if", "(", "(", "bits", "&", "Main", ".", "Logger", ".", "EMACS", ")", "==", "0", ")", "{", "errorBuffer", ".", "append", "(", "'", "'", ")", ".", "append", "(", "Messages", ".", "bind", "(", "Messages", ".", "problem_atLine", ",", "String", ".", "valueOf", "(", "problem", ".", "getSourceLineNumber", "(", ")", ")", ")", ")", ";", "errorBuffer", ".", "append", "(", "Util", ".", "LINE_SEPARATOR", ")", ";", "}", "errorBuffer", ".", "append", "(", "'\\t'", ")", ";", "char", "c", ";", "final", "char", "SPACE", "=", "'", "'", ";", "final", "char", "MARK", "=", "'^'", ";", "final", "char", "TAB", "=", "'\\t'", ";", "int", "begin", ";", "int", "end", ";", "for", "(", "begin", "=", "startPosition", ">=", "length", "?", "length", "-", "1", ":", "startPosition", ";", "begin", ">", "0", ";", "begin", "--", ")", "{", "if", "(", "(", "c", "=", "unitSource", "[", "begin", "-", "1", "]", ")", "==", "'\\n'", "||", "c", "==", "'\\r'", ")", "break", ";", "}", "for", "(", "end", "=", "endPosition", ">=", "length", "?", "length", "-", "1", ":", "endPosition", ";", "end", "+", "1", "<", "length", ";", "end", "++", ")", "{", "if", "(", "(", "c", "=", "unitSource", "[", "end", "+", "1", "]", ")", "==", "'\\r'", "||", "c", "==", "'\\n'", ")", "break", ";", "}", "while", "(", "(", "c", "=", "unitSource", "[", "begin", "]", ")", "==", "'", "'", "||", "c", "==", "'\\t'", ")", "begin", "++", ";", "errorBuffer", ".", "append", "(", "unitSource", ",", "begin", ",", "end", "-", "begin", "+", "1", ")", ";", "errorBuffer", ".", "append", "(", "Util", ".", "LINE_SEPARATOR", ")", ".", "append", "(", "\"t\"", ")", ";", "for", "(", "int", "i", "=", "begin", ";", "i", "<", "startPosition", ";", "i", "++", ")", "{", "errorBuffer", ".", "append", "(", "(", "unitSource", "[", "i", "]", "==", "TAB", ")", "?", "TAB", ":", "SPACE", ")", ";", "}", "for", "(", "int", "i", "=", "startPosition", ";", "i", "<=", "(", "endPosition", ">=", "length", "?", "length", "-", "1", ":", "endPosition", ")", ";", "i", "++", ")", "{", "errorBuffer", ".", "append", "(", "MARK", ")", ";", "}", "return", "errorBuffer", ".", "toString", "(", ")", ";", "}", "private", "void", "extractContext", "(", "CategorizedProblem", "problem", ",", "char", "[", "]", "unitSource", ")", "{", "int", "startPosition", "=", "problem", ".", "getSourceStart", "(", ")", ";", "int", "endPosition", "=", "problem", ".", "getSourceEnd", "(", ")", ";", "if", "(", "unitSource", "==", "null", ")", "{", "if", "(", "problem", ".", "getOriginatingFileName", "(", ")", "!=", "null", ")", "{", "try", "{", "unitSource", "=", "Util", ".", "getFileCharContent", "(", "new", "File", "(", "new", "String", "(", "problem", ".", "getOriginatingFileName", "(", ")", ")", ")", ",", "null", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "int", "length", "=", "unitSource", "==", "null", "?", "0", ":", "unitSource", ".", "length", ";", "if", "(", "(", "startPosition", ">", "endPosition", ")", "||", "(", "(", "startPosition", "<", "0", ")", "&&", "(", "endPosition", "<", "0", ")", ")", "||", "(", "length", "<=", "0", ")", "||", "(", "endPosition", ">", "length", ")", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "VALUE", ",", "Messages", ".", "problem_noSourceInformation", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "SOURCE_START", ",", "\"-1\"", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "SOURCE_END", ",", "\"-1\"", ")", ";", "printTag", "(", "Logger", ".", "SOURCE_CONTEXT", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "return", ";", "}", "char", "c", ";", "int", "begin", ",", "end", ";", "for", "(", "begin", "=", "startPosition", ">=", "length", "?", "length", "-", "1", ":", "startPosition", ";", "begin", ">", "0", ";", "begin", "--", ")", "{", "if", "(", "(", "c", "=", "unitSource", "[", "begin", "-", "1", "]", ")", "==", "'\\n'", "||", "c", "==", "'\\r'", ")", "break", ";", "}", "for", "(", "end", "=", "endPosition", ">=", "length", "?", "length", "-", "1", ":", "endPosition", ";", "end", "+", "1", "<", "length", ";", "end", "++", ")", "{", "if", "(", "(", "c", "=", "unitSource", "[", "end", "+", "1", "]", ")", "==", "'\\r'", "||", "c", "==", "'\\n'", ")", "break", ";", "}", "while", "(", "(", "c", "=", "unitSource", "[", "begin", "]", ")", "==", "'", "'", "||", "c", "==", "'\\t'", ")", "begin", "++", ";", "while", "(", "(", "c", "=", "unitSource", "[", "end", "]", ")", "==", "'", "'", "||", "c", "==", "'\\t'", ")", "end", "--", ";", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "unitSource", ",", "begin", ",", "end", "-", "begin", "+", "1", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "VALUE", ",", "String", ".", "valueOf", "(", "buffer", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "SOURCE_START", ",", "Integer", ".", "toString", "(", "startPosition", "-", "begin", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "SOURCE_END", ",", "Integer", ".", "toString", "(", "endPosition", "-", "begin", ")", ")", ";", "printTag", "(", "Logger", ".", "SOURCE_CONTEXT", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "public", "void", "flush", "(", ")", "{", "this", ".", "out", ".", "flush", "(", ")", ";", "this", ".", "err", ".", "flush", "(", ")", ";", "if", "(", "this", ".", "log", "!=", "null", ")", "{", "this", ".", "log", ".", "flush", "(", ")", ";", "}", "}", "private", "String", "getFieldName", "(", "int", "id", ")", "{", "int", "key2", "=", "id", "&", "IProblem", ".", "IgnoreCategoriesMask", ";", "if", "(", "key2", "==", "0", ")", "{", "key2", "=", "Integer", ".", "MAX_VALUE", ";", "}", "return", "(", "String", ")", "Logger", ".", "FIELD_TABLE", ".", "get", "(", "key2", ")", ";", "}", "private", "String", "getProblemOptionKey", "(", "int", "problemID", ")", "{", "int", "irritant", "=", "ProblemReporter", ".", "getIrritant", "(", "problemID", ")", ";", "return", "CompilerOptions", ".", "optionKeyFromIrritant", "(", "irritant", ")", ";", "}", "public", "void", "logAverage", "(", ")", "{", "Arrays", ".", "sort", "(", "this", ".", "main", ".", "compilerStats", ")", ";", "long", "lineCount", "=", "this", ".", "main", ".", "compilerStats", "[", "0", "]", ".", "lineCount", ";", "final", "int", "length", "=", "this", ".", "main", ".", "maxRepetition", ";", "long", "sum", "=", "0", ";", "long", "parseSum", "=", "0", ",", "resolveSum", "=", "0", ",", "analyzeSum", "=", "0", ",", "generateSum", "=", "0", ";", "for", "(", "int", "i", "=", "1", ",", "max", "=", "length", "-", "1", ";", "i", "<", "max", ";", "i", "++", ")", "{", "CompilerStats", "stats", "=", "this", ".", "main", ".", "compilerStats", "[", "i", "]", ";", "sum", "+=", "stats", ".", "elapsedTime", "(", ")", ";", "parseSum", "+=", "stats", ".", "parseTime", ";", "resolveSum", "+=", "stats", ".", "resolveTime", ";", "analyzeSum", "+=", "stats", ".", "analyzeTime", ";", "generateSum", "+=", "stats", ".", "generateTime", ";", "}", "long", "time", "=", "sum", "/", "(", "length", "-", "2", ")", ";", "long", "parseTime", "=", "parseSum", "/", "(", "length", "-", "2", ")", ";", "long", "resolveTime", "=", "resolveSum", "/", "(", "length", "-", "2", ")", ";", "long", "analyzeTime", "=", "analyzeSum", "/", "(", "length", "-", "2", ")", ";", "long", "generateTime", "=", "generateSum", "/", "(", "length", "-", "2", ")", ";", "printlnOut", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "new", "String", "[", "]", "{", "String", ".", "valueOf", "(", "lineCount", ")", ",", "String", ".", "valueOf", "(", "time", ")", ",", "String", ".", "valueOf", "(", "(", "(", "int", ")", "(", "lineCount", "*", "10000.0", "/", "time", ")", ")", "/", "10.0", ")", ",", "}", ")", ")", ";", "if", "(", "(", "this", ".", "main", ".", "timing", "&", "Main", ".", "TIMING_DETAILED", ")", "!=", "0", ")", "{", "printlnOut", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "new", "String", "[", "]", "{", "String", ".", "valueOf", "(", "parseTime", ")", ",", "String", ".", "valueOf", "(", "(", "(", "int", ")", "(", "parseTime", "*", "1000.0", "/", "time", ")", ")", "/", "10.0", ")", ",", "String", ".", "valueOf", "(", "resolveTime", ")", ",", "String", ".", "valueOf", "(", "(", "(", "int", ")", "(", "resolveTime", "*", "1000.0", "/", "time", ")", ")", "/", "10.0", ")", ",", "String", ".", "valueOf", "(", "analyzeTime", ")", ",", "String", ".", "valueOf", "(", "(", "(", "int", ")", "(", "analyzeTime", "*", "1000.0", "/", "time", ")", ")", "/", "10.0", ")", ",", "String", ".", "valueOf", "(", "generateTime", ")", ",", "String", ".", "valueOf", "(", "(", "(", "int", ")", "(", "generateTime", "*", "1000.0", "/", "time", ")", ")", "/", "10.0", ")", ",", "}", ")", ")", ";", "}", "}", "public", "void", "logClassFile", "(", "boolean", "generatePackagesStructure", ",", "String", "outputPath", ",", "String", "relativeFileName", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "String", "fileName", "=", "null", ";", "if", "(", "generatePackagesStructure", ")", "{", "fileName", "=", "buildFileName", "(", "outputPath", ",", "relativeFileName", ")", ";", "}", "else", "{", "char", "fileSeparatorChar", "=", "File", ".", "separatorChar", ";", "String", "fileSeparator", "=", "File", ".", "separator", ";", "outputPath", "=", "outputPath", ".", "replace", "(", "'/'", ",", "fileSeparatorChar", ")", ";", "int", "indexOfPackageSeparator", "=", "relativeFileName", ".", "lastIndexOf", "(", "fileSeparatorChar", ")", ";", "if", "(", "indexOfPackageSeparator", "==", "-", "1", ")", "{", "if", "(", "outputPath", ".", "endsWith", "(", "fileSeparator", ")", ")", "{", "fileName", "=", "outputPath", "+", "relativeFileName", ";", "}", "else", "{", "fileName", "=", "outputPath", "+", "fileSeparator", "+", "relativeFileName", ";", "}", "}", "else", "{", "int", "length", "=", "relativeFileName", ".", "length", "(", ")", ";", "if", "(", "outputPath", ".", "endsWith", "(", "fileSeparator", ")", ")", "{", "fileName", "=", "outputPath", "+", "relativeFileName", ".", "substring", "(", "indexOfPackageSeparator", "+", "1", ",", "length", ")", ";", "}", "else", "{", "fileName", "=", "outputPath", "+", "fileSeparator", "+", "relativeFileName", ".", "substring", "(", "indexOfPackageSeparator", "+", "1", ",", "length", ")", ";", "}", "}", "}", "File", "f", "=", "new", "File", "(", "fileName", ")", ";", "try", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PATH", ",", "f", ".", "getCanonicalPath", "(", ")", ")", ";", "printTag", "(", "Logger", ".", "CLASS_FILE", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "logNoClassFileCreated", "(", "outputPath", ",", "relativeFileName", ",", "e", ")", ";", "}", "}", "}", "public", "void", "logClasspath", "(", "FileSystem", ".", "Classpath", "[", "]", "classpaths", ")", "{", "if", "(", "classpaths", "==", "null", ")", "return", ";", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "final", "int", "length", "=", "classpaths", ".", "length", ";", "if", "(", "length", "!=", "0", ")", "{", "printTag", "(", "Logger", ".", "CLASSPATHS", ",", "null", ",", "true", ",", "false", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "classpath", "=", "classpaths", "[", "i", "]", ".", "getPath", "(", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PATH", ",", "classpath", ")", ";", "File", "f", "=", "new", "File", "(", "classpath", ")", ";", "String", "id", "=", "null", ";", "if", "(", "f", ".", "isFile", "(", ")", ")", "{", "if", "(", "Util", ".", "isPotentialZipArchive", "(", "classpath", ")", ")", "{", "id", "=", "Logger", ".", "CLASSPATH_JAR", ";", "}", "else", "{", "id", "=", "Logger", ".", "CLASSPATH_FILE", ";", "}", "}", "else", "if", "(", "f", ".", "isDirectory", "(", ")", ")", "{", "id", "=", "Logger", ".", "CLASSPATH_FOLDER", ";", "}", "if", "(", "id", "!=", "null", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "CLASSPATH_ID", ",", "id", ")", ";", "printTag", "(", "Logger", ".", "CLASSPATH", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "}", "endTag", "(", "Logger", ".", "CLASSPATHS", ")", ";", "}", "}", "}", "public", "void", "logCommandLineArguments", "(", "String", "[", "]", "commandLineArguments", ")", "{", "if", "(", "commandLineArguments", "==", "null", ")", "return", ";", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "final", "int", "length", "=", "commandLineArguments", ".", "length", ";", "if", "(", "length", "!=", "0", ")", "{", "printTag", "(", "Logger", ".", "COMMAND_LINE_ARGUMENTS", ",", "null", ",", "true", ",", "false", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "VALUE", ",", "commandLineArguments", "[", "i", "]", ")", ";", "printTag", "(", "Logger", ".", "COMMAND_LINE_ARGUMENT", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "endTag", "(", "Logger", ".", "COMMAND_LINE_ARGUMENTS", ")", ";", "}", "}", "}", "public", "void", "logException", "(", "Exception", "e", ")", "{", "StringWriter", "writer", "=", "new", "StringWriter", "(", ")", ";", "PrintWriter", "printWriter", "=", "new", "PrintWriter", "(", "writer", ")", ";", "e", ".", "printStackTrace", "(", "printWriter", ")", ";", "printWriter", ".", "flush", "(", ")", ";", "printWriter", ".", "close", "(", ")", ";", "final", "String", "stackTrace", "=", "writer", ".", "toString", "(", ")", ";", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "LineNumberReader", "reader", "=", "new", "LineNumberReader", "(", "new", "StringReader", "(", "stackTrace", ")", ")", ";", "String", "line", ";", "int", "i", "=", "0", ";", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "String", "message", "=", "e", ".", "getMessage", "(", ")", ";", "if", "(", "message", "!=", "null", ")", "{", "buffer", ".", "append", "(", "message", ")", ".", "append", "(", "Util", ".", "LINE_SEPARATOR", ")", ";", "}", "try", "{", "while", "(", "(", "line", "=", "reader", ".", "readLine", "(", ")", ")", "!=", "null", "&&", "i", "<", "4", ")", "{", "buffer", ".", "append", "(", "line", ")", ".", "append", "(", "Util", ".", "LINE_SEPARATOR", ")", ";", "i", "++", ";", "}", "reader", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e1", ")", "{", "}", "message", "=", "buffer", ".", "toString", "(", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "MESSAGE", ",", "message", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "CLASS", ",", "e", ".", "getClass", "(", ")", ")", ";", "printTag", "(", "Logger", ".", "EXCEPTION", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "String", "message", "=", "e", ".", "getMessage", "(", ")", ";", "if", "(", "message", "==", "null", ")", "{", "this", ".", "printlnErr", "(", "stackTrace", ")", ";", "}", "else", "{", "this", ".", "printlnErr", "(", "message", ")", ";", "}", "}", "private", "void", "logExtraProblem", "(", "CategorizedProblem", "problem", ",", "int", "localErrorCount", ",", "int", "globalErrorCount", ")", "{", "char", "[", "]", "originatingFileName", "=", "problem", ".", "getOriginatingFileName", "(", ")", ";", "String", "fileName", "=", "originatingFileName", "==", "null", "?", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ":", "new", "String", "(", "originatingFileName", ")", ";", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "EMACS", ")", "!=", "0", ")", "{", "String", "result", "=", "fileName", "+", "\":\"", "+", "problem", ".", "getSourceLineNumber", "(", ")", "+", "\":", "\"", "+", "(", "problem", ".", "isError", "(", ")", "?", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ":", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", "+", "\":", "\"", "+", "problem", ".", "getMessage", "(", ")", ";", "this", ".", "printlnErr", "(", "result", ")", ";", "final", "String", "errorReportSource", "=", "errorReportSource", "(", "problem", ",", "null", ",", "this", ".", "tagBits", ")", ";", "this", ".", "printlnErr", "(", "errorReportSource", ")", ";", "}", "else", "{", "if", "(", "localErrorCount", "==", "0", ")", "{", "this", ".", "printlnErr", "(", "\"----------\"", ")", ";", "}", "printErr", "(", "problem", ".", "isError", "(", ")", "?", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "Integer", ".", "toString", "(", "globalErrorCount", ")", ",", "new", "String", "(", "fileName", ")", ")", ":", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "Integer", ".", "toString", "(", "globalErrorCount", ")", ",", "new", "String", "(", "fileName", ")", ")", ")", ";", "final", "String", "errorReportSource", "=", "errorReportSource", "(", "problem", ",", "null", ",", "0", ")", ";", "this", ".", "printlnErr", "(", "errorReportSource", ")", ";", "this", ".", "printlnErr", "(", "problem", ".", "getMessage", "(", ")", ")", ";", "this", ".", "printlnErr", "(", "\"----------\"", ")", ";", "}", "}", "public", "void", "loggingExtraProblems", "(", "Main", "currentMain", ")", "{", "ArrayList", "problems", "=", "currentMain", ".", "extraProblems", ";", "final", "int", "count", "=", "problems", ".", "size", "(", ")", ";", "int", "localErrorCount", "=", "0", ";", "int", "localProblemCount", "=", "0", ";", "if", "(", "count", "!=", "0", ")", "{", "int", "errors", "=", "0", ";", "int", "warnings", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "CategorizedProblem", "problem", "=", "(", "CategorizedProblem", ")", "problems", ".", "get", "(", "i", ")", ";", "if", "(", "problem", "!=", "null", ")", "{", "currentMain", ".", "globalProblemsCount", "++", ";", "logExtraProblem", "(", "problem", ",", "localProblemCount", ",", "currentMain", ".", "globalProblemsCount", ")", ";", "localProblemCount", "++", ";", "if", "(", "problem", ".", "isError", "(", ")", ")", "{", "localErrorCount", "++", ";", "errors", "++", ";", "currentMain", ".", "globalErrorsCount", "++", ";", "}", "else", "if", "(", "problem", ".", "isWarning", "(", ")", ")", "{", "currentMain", ".", "globalWarningsCount", "++", ";", "warnings", "++", ";", "}", "}", "}", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "if", "(", "(", "errors", "+", "warnings", ")", "!=", "0", ")", "{", "startLoggingExtraProblems", "(", "count", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "CategorizedProblem", "problem", "=", "(", "CategorizedProblem", ")", "problems", ".", "get", "(", "i", ")", ";", "if", "(", "problem", "!=", "null", ")", "{", "if", "(", "problem", ".", "getID", "(", ")", "!=", "IProblem", ".", "Task", ")", "{", "logXmlExtraProblem", "(", "problem", ",", "localProblemCount", ",", "currentMain", ".", "globalProblemsCount", ")", ";", "}", "}", "}", "endLoggingExtraProblems", "(", ")", ";", "}", "}", "}", "}", "public", "void", "logIncorrectVMVersionForAnnotationProcessing", "(", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "MESSAGE", ",", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", ";", "printTag", "(", "Logger", ".", "ERROR_TAG", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "this", ".", "printlnErr", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", ";", "}", "public", "void", "logNoClassFileCreated", "(", "String", "outputDir", ",", "String", "relativeFileName", ",", "IOException", "e", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "MESSAGE", ",", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "new", "String", "[", "]", "{", "outputDir", ",", "relativeFileName", ",", "e", ".", "getMessage", "(", ")", "}", ")", ")", ";", "printTag", "(", "Logger", ".", "ERROR_TAG", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "this", ".", "printlnErr", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "new", "String", "[", "]", "{", "outputDir", ",", "relativeFileName", ",", "e", ".", "getMessage", "(", ")", "}", ")", ")", ";", "}", "public", "void", "logNumberOfClassFilesGenerated", "(", "int", "exportedClassFilesCounter", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "VALUE", ",", "new", "Integer", "(", "exportedClassFilesCounter", ")", ")", ";", "printTag", "(", "Logger", ".", "NUMBER_OF_CLASSFILES", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "if", "(", "exportedClassFilesCounter", "==", "1", ")", "{", "printlnOut", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", ";", "}", "else", "{", "printlnOut", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "String", ".", "valueOf", "(", "exportedClassFilesCounter", ")", ")", ")", ";", "}", "}", "public", "void", "logOptions", "(", "Map", "options", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "printTag", "(", "Logger", ".", "OPTIONS", ",", "null", ",", "true", ",", "false", ")", ";", "final", "Set", "entriesSet", "=", "options", ".", "entrySet", "(", ")", ";", "Object", "[", "]", "entries", "=", "entriesSet", ".", "toArray", "(", ")", ";", "Arrays", ".", "sort", "(", "entries", ",", "new", "Comparator", "(", ")", "{", "public", "int", "compare", "(", "Object", "o1", ",", "Object", "o2", ")", "{", "Map", ".", "Entry", "entry1", "=", "(", "Map", ".", "Entry", ")", "o1", ";", "Map", ".", "Entry", "entry2", "=", "(", "Map", ".", "Entry", ")", "o2", ";", "return", "(", "(", "String", ")", "entry1", ".", "getKey", "(", ")", ")", ".", "compareTo", "(", "(", "String", ")", "entry2", ".", "getKey", "(", ")", ")", ";", "}", "}", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "entries", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", "[", "i", "]", ";", "String", "key", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "KEY", ",", "key", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "VALUE", ",", "entry", ".", "getValue", "(", ")", ")", ";", "printTag", "(", "Logger", ".", "OPTION", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "endTag", "(", "Logger", ".", "OPTIONS", ")", ";", "}", "}", "public", "void", "logPendingError", "(", "String", "error", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "MESSAGE", ",", "error", ")", ";", "printTag", "(", "Logger", ".", "ERROR_TAG", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "this", ".", "printlnErr", "(", "error", ")", ";", "}", "public", "void", "logWarning", "(", "String", "message", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "MESSAGE", ",", "message", ")", ";", "printTag", "(", "Logger", ".", "WARNING_TAG", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "this", ".", "printlnOut", "(", "message", ")", ";", "}", "private", "void", "logProblem", "(", "CategorizedProblem", "problem", ",", "int", "localErrorCount", ",", "int", "globalErrorCount", ",", "char", "[", "]", "unitSource", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "EMACS", ")", "!=", "0", ")", "{", "String", "result", "=", "(", "new", "String", "(", "problem", ".", "getOriginatingFileName", "(", ")", ")", "+", "\":\"", "+", "problem", ".", "getSourceLineNumber", "(", ")", "+", "\":", "\"", "+", "(", "problem", ".", "isError", "(", ")", "?", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ":", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", "+", "\":", "\"", "+", "problem", ".", "getMessage", "(", ")", ")", ";", "this", ".", "printlnErr", "(", "result", ")", ";", "final", "String", "errorReportSource", "=", "errorReportSource", "(", "problem", ",", "unitSource", ",", "this", ".", "tagBits", ")", ";", "if", "(", "errorReportSource", ".", "length", "(", ")", "!=", "0", ")", "this", ".", "printlnErr", "(", "errorReportSource", ")", ";", "}", "else", "{", "if", "(", "localErrorCount", "==", "0", ")", "{", "this", ".", "printlnErr", "(", "\"----------\"", ")", ";", "}", "printErr", "(", "problem", ".", "isError", "(", ")", "?", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "Integer", ".", "toString", "(", "globalErrorCount", ")", ",", "new", "String", "(", "problem", ".", "getOriginatingFileName", "(", ")", ")", ")", ":", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "Integer", ".", "toString", "(", "globalErrorCount", ")", ",", "new", "String", "(", "problem", ".", "getOriginatingFileName", "(", ")", ")", ")", ")", ";", "try", "{", "final", "String", "errorReportSource", "=", "errorReportSource", "(", "problem", ",", "unitSource", ",", "0", ")", ";", "this", ".", "printlnErr", "(", "errorReportSource", ")", ";", "this", ".", "printlnErr", "(", "problem", ".", "getMessage", "(", ")", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "this", ".", "printlnErr", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "problem", ".", "toString", "(", ")", ")", ")", ";", "}", "this", ".", "printlnErr", "(", "\"----------\"", ")", ";", "}", "}", "public", "int", "logProblems", "(", "CategorizedProblem", "[", "]", "problems", ",", "char", "[", "]", "unitSource", ",", "Main", "currentMain", ")", "{", "final", "int", "count", "=", "problems", ".", "length", ";", "int", "localErrorCount", "=", "0", ";", "int", "localProblemCount", "=", "0", ";", "if", "(", "count", "!=", "0", ")", "{", "int", "errors", "=", "0", ";", "int", "warnings", "=", "0", ";", "int", "tasks", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "CategorizedProblem", "problem", "=", "problems", "[", "i", "]", ";", "if", "(", "problem", "!=", "null", ")", "{", "currentMain", ".", "globalProblemsCount", "++", ";", "logProblem", "(", "problem", ",", "localProblemCount", ",", "currentMain", ".", "globalProblemsCount", ",", "unitSource", ")", ";", "localProblemCount", "++", ";", "if", "(", "problem", ".", "isError", "(", ")", ")", "{", "localErrorCount", "++", ";", "errors", "++", ";", "currentMain", ".", "globalErrorsCount", "++", ";", "}", "else", "if", "(", "problem", ".", "getID", "(", ")", "==", "IProblem", ".", "Task", ")", "{", "currentMain", ".", "globalTasksCount", "++", ";", "tasks", "++", ";", "}", "else", "{", "currentMain", ".", "globalWarningsCount", "++", ";", "warnings", "++", ";", "}", "}", "}", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "if", "(", "(", "errors", "+", "warnings", ")", "!=", "0", ")", "{", "startLoggingProblems", "(", "errors", ",", "warnings", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "CategorizedProblem", "problem", "=", "problems", "[", "i", "]", ";", "if", "(", "problem", "!=", "null", ")", "{", "if", "(", "problem", ".", "getID", "(", ")", "!=", "IProblem", ".", "Task", ")", "{", "logXmlProblem", "(", "problem", ",", "unitSource", ")", ";", "}", "}", "}", "endLoggingProblems", "(", ")", ";", "}", "if", "(", "tasks", "!=", "0", ")", "{", "startLoggingTasks", "(", "tasks", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "CategorizedProblem", "problem", "=", "problems", "[", "i", "]", ";", "if", "(", "problem", "!=", "null", ")", "{", "if", "(", "problem", ".", "getID", "(", ")", "==", "IProblem", ".", "Task", ")", "{", "logXmlTask", "(", "problem", ",", "unitSource", ")", ";", "}", "}", "}", "endLoggingTasks", "(", ")", ";", "}", "}", "}", "return", "localErrorCount", ";", "}", "public", "void", "logProblemsSummary", "(", "int", "globalProblemsCount", ",", "int", "globalErrorsCount", ",", "int", "globalWarningsCount", ",", "int", "globalTasksCount", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "NUMBER_OF_PROBLEMS", ",", "new", "Integer", "(", "globalProblemsCount", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "NUMBER_OF_ERRORS", ",", "new", "Integer", "(", "globalErrorsCount", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "NUMBER_OF_WARNINGS", ",", "new", "Integer", "(", "globalWarningsCount", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "NUMBER_OF_TASKS", ",", "new", "Integer", "(", "globalTasksCount", ")", ")", ";", "printTag", "(", "Logger", ".", "PROBLEM_SUMMARY", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "if", "(", "globalProblemsCount", "==", "1", ")", "{", "String", "message", "=", "null", ";", "if", "(", "globalErrorsCount", "==", "1", ")", "{", "message", "=", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ";", "}", "else", "{", "message", "=", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ";", "}", "printErr", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "message", ")", ")", ";", "}", "else", "{", "String", "errorMessage", "=", "null", ";", "String", "warningMessage", "=", "null", ";", "if", "(", "globalErrorsCount", ">", "0", ")", "{", "if", "(", "globalErrorsCount", "==", "1", ")", "{", "errorMessage", "=", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ";", "}", "else", "{", "errorMessage", "=", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "String", ".", "valueOf", "(", "globalErrorsCount", ")", ")", ";", "}", "}", "int", "warningsNumber", "=", "globalWarningsCount", "+", "globalTasksCount", ";", "if", "(", "warningsNumber", ">", "0", ")", "{", "if", "(", "warningsNumber", "==", "1", ")", "{", "warningMessage", "=", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ";", "}", "else", "{", "warningMessage", "=", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "String", ".", "valueOf", "(", "warningsNumber", ")", ")", ";", "}", "}", "if", "(", "errorMessage", "==", "null", "||", "warningMessage", "==", "null", ")", "{", "if", "(", "errorMessage", "==", "null", ")", "{", "printErr", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "String", ".", "valueOf", "(", "globalProblemsCount", ")", ",", "warningMessage", ")", ")", ";", "}", "else", "{", "printErr", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "String", ".", "valueOf", "(", "globalProblemsCount", ")", ",", "errorMessage", ")", ")", ";", "}", "}", "else", "{", "printErr", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "new", "String", "[", "]", "{", "String", ".", "valueOf", "(", "globalProblemsCount", ")", ",", "errorMessage", ",", "warningMessage", "}", ")", ")", ";", "}", "}", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "EMACS", ")", "!=", "0", ")", "{", "this", ".", "printlnErr", "(", ")", ";", "}", "}", "public", "void", "logProgress", "(", ")", "{", "printOut", "(", "'.'", ")", ";", "}", "public", "void", "logRepetition", "(", "int", "i", ",", "int", "repetitions", ")", "{", "printlnOut", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "String", ".", "valueOf", "(", "i", "+", "1", ")", ",", "String", ".", "valueOf", "(", "repetitions", ")", ")", ")", ";", "}", "public", "void", "logTiming", "(", "CompilerStats", "compilerStats", ")", "{", "long", "time", "=", "compilerStats", ".", "elapsedTime", "(", ")", ";", "long", "lineCount", "=", "compilerStats", ".", "lineCount", ";", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "VALUE", ",", "new", "Long", "(", "time", ")", ")", ";", "printTag", "(", "Logger", ".", "TIME", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "VALUE", ",", "new", "Long", "(", "lineCount", ")", ")", ";", "printTag", "(", "Logger", ".", "NUMBER_OF_LINES", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "if", "(", "lineCount", "!=", "0", ")", "{", "printlnOut", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "new", "String", "[", "]", "{", "String", ".", "valueOf", "(", "lineCount", ")", ",", "String", ".", "valueOf", "(", "time", ")", ",", "String", ".", "valueOf", "(", "(", "(", "int", ")", "(", "lineCount", "*", "10000.0", "/", "time", ")", ")", "/", "10.0", ")", ",", "}", ")", ")", ";", "}", "else", "{", "printlnOut", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "new", "String", "[", "]", "{", "String", ".", "valueOf", "(", "time", ")", ",", "}", ")", ")", ";", "}", "if", "(", "(", "this", ".", "main", ".", "timing", "&", "Main", ".", "TIMING_DETAILED", ")", "!=", "0", ")", "{", "printlnOut", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "new", "String", "[", "]", "{", "String", ".", "valueOf", "(", "compilerStats", ".", "parseTime", ")", ",", "String", ".", "valueOf", "(", "(", "(", "int", ")", "(", "compilerStats", ".", "parseTime", "*", "1000.0", "/", "time", ")", ")", "/", "10.0", ")", ",", "String", ".", "valueOf", "(", "compilerStats", ".", "resolveTime", ")", ",", "String", ".", "valueOf", "(", "(", "(", "int", ")", "(", "compilerStats", ".", "resolveTime", "*", "1000.0", "/", "time", ")", ")", "/", "10.0", ")", ",", "String", ".", "valueOf", "(", "compilerStats", ".", "analyzeTime", ")", ",", "String", ".", "valueOf", "(", "(", "(", "int", ")", "(", "compilerStats", ".", "analyzeTime", "*", "1000.0", "/", "time", ")", ")", "/", "10.0", ")", ",", "String", ".", "valueOf", "(", "compilerStats", ".", "generateTime", ")", ",", "String", ".", "valueOf", "(", "(", "(", "int", ")", "(", "compilerStats", ".", "generateTime", "*", "1000.0", "/", "time", ")", ")", "/", "10.0", ")", ",", "}", ")", ")", ";", "}", "}", "public", "void", "logUsage", "(", "String", "usage", ")", "{", "printlnOut", "(", "usage", ")", ";", "}", "public", "void", "logVersion", "(", "final", "boolean", "printToOut", ")", "{", "if", "(", "this", ".", "log", "!=", "null", "&&", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "==", "0", ")", "{", "final", "String", "version", "=", "this", ".", "main", ".", "bind", "(", "\"misc.version\"", ",", "new", "String", "[", "]", "{", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ",", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ",", "this", ".", "main", ".", "bind", "(", "\"\"", ")", "}", ")", ";", "this", ".", "log", ".", "println", "(", "\"#", "\"", "+", "version", ")", ";", "if", "(", "printToOut", ")", "{", "this", ".", "out", ".", "println", "(", "version", ")", ";", "this", ".", "out", ".", "flush", "(", ")", ";", "}", "}", "else", "if", "(", "printToOut", ")", "{", "final", "String", "version", "=", "this", ".", "main", ".", "bind", "(", "\"misc.version\"", ",", "new", "String", "[", "]", "{", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ",", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ",", "this", ".", "main", ".", "bind", "(", "\"\"", ")", "}", ")", ";", "this", ".", "out", ".", "println", "(", "version", ")", ";", "this", ".", "out", ".", "flush", "(", ")", ";", "}", "}", "public", "void", "logWrongJDK", "(", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "MESSAGE", ",", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", ";", "printTag", "(", "Logger", ".", "ERROR", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "this", ".", "printlnErr", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", ";", "}", "private", "void", "logXmlExtraProblem", "(", "CategorizedProblem", "problem", ",", "int", "globalErrorCount", ",", "int", "localErrorCount", ")", "{", "final", "int", "sourceStart", "=", "problem", ".", "getSourceStart", "(", ")", ";", "final", "int", "sourceEnd", "=", "problem", ".", "getSourceEnd", "(", ")", ";", "boolean", "isError", "=", "problem", ".", "isError", "(", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_SEVERITY", ",", "isError", "?", "Logger", ".", "ERROR", ":", "Logger", ".", "WARNING", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_LINE", ",", "new", "Integer", "(", "problem", ".", "getSourceLineNumber", "(", ")", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_SOURCE_START", ",", "new", "Integer", "(", "sourceStart", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_SOURCE_END", ",", "new", "Integer", "(", "sourceEnd", ")", ")", ";", "printTag", "(", "Logger", ".", "EXTRA_PROBLEM_TAG", ",", "this", ".", "parameters", ",", "true", ",", "false", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "VALUE", ",", "problem", ".", "getMessage", "(", ")", ")", ";", "printTag", "(", "Logger", ".", "PROBLEM_MESSAGE", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "extractContext", "(", "problem", ",", "null", ")", ";", "endTag", "(", "Logger", ".", "EXTRA_PROBLEM_TAG", ")", ";", "}", "private", "void", "logXmlProblem", "(", "CategorizedProblem", "problem", ",", "char", "[", "]", "unitSource", ")", "{", "final", "int", "sourceStart", "=", "problem", ".", "getSourceStart", "(", ")", ";", "final", "int", "sourceEnd", "=", "problem", ".", "getSourceEnd", "(", ")", ";", "final", "int", "id", "=", "problem", ".", "getID", "(", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "ID", ",", "getFieldName", "(", "id", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_ID", ",", "new", "Integer", "(", "id", ")", ")", ";", "boolean", "isError", "=", "problem", ".", "isError", "(", ")", ";", "int", "severity", "=", "isError", "?", "ProblemSeverities", ".", "Error", ":", "ProblemSeverities", ".", "Warning", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_SEVERITY", ",", "isError", "?", "Logger", ".", "ERROR", ":", "Logger", ".", "WARNING", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_LINE", ",", "new", "Integer", "(", "problem", ".", "getSourceLineNumber", "(", ")", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_SOURCE_START", ",", "new", "Integer", "(", "sourceStart", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_SOURCE_END", ",", "new", "Integer", "(", "sourceEnd", ")", ")", ";", "String", "problemOptionKey", "=", "getProblemOptionKey", "(", "id", ")", ";", "if", "(", "problemOptionKey", "!=", "null", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_OPTION_KEY", ",", "problemOptionKey", ")", ";", "}", "int", "categoryID", "=", "ProblemReporter", ".", "getProblemCategory", "(", "severity", ",", "id", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_CATEGORY_ID", ",", "new", "Integer", "(", "categoryID", ")", ")", ";", "printTag", "(", "Logger", ".", "PROBLEM_TAG", ",", "this", ".", "parameters", ",", "true", ",", "false", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "VALUE", ",", "problem", ".", "getMessage", "(", ")", ")", ";", "printTag", "(", "Logger", ".", "PROBLEM_MESSAGE", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "extractContext", "(", "problem", ",", "unitSource", ")", ";", "String", "[", "]", "arguments", "=", "problem", ".", "getArguments", "(", ")", ";", "final", "int", "length", "=", "arguments", ".", "length", ";", "if", "(", "length", "!=", "0", ")", "{", "printTag", "(", "Logger", ".", "PROBLEM_ARGUMENTS", ",", "null", ",", "true", ",", "false", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_ARGUMENT_VALUE", ",", "arguments", "[", "i", "]", ")", ";", "printTag", "(", "Logger", ".", "PROBLEM_ARGUMENT", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "}", "endTag", "(", "Logger", ".", "PROBLEM_ARGUMENTS", ")", ";", "}", "endTag", "(", "Logger", ".", "PROBLEM_TAG", ")", ";", "}", "private", "void", "logXmlTask", "(", "CategorizedProblem", "problem", ",", "char", "[", "]", "unitSource", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_LINE", ",", "new", "Integer", "(", "problem", ".", "getSourceLineNumber", "(", ")", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_SOURCE_START", ",", "new", "Integer", "(", "problem", ".", "getSourceStart", "(", ")", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_SOURCE_END", ",", "new", "Integer", "(", "problem", ".", "getSourceEnd", "(", ")", ")", ")", ";", "String", "problemOptionKey", "=", "getProblemOptionKey", "(", "problem", ".", "getID", "(", ")", ")", ";", "if", "(", "problemOptionKey", "!=", "null", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PROBLEM_OPTION_KEY", ",", "problemOptionKey", ")", ";", "}", "printTag", "(", "Logger", ".", "TASK", ",", "this", ".", "parameters", ",", "true", ",", "false", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "VALUE", ",", "problem", ".", "getMessage", "(", ")", ")", ";", "printTag", "(", "Logger", ".", "PROBLEM_MESSAGE", ",", "this", ".", "parameters", ",", "true", ",", "true", ")", ";", "extractContext", "(", "problem", ",", "unitSource", ")", ";", "endTag", "(", "Logger", ".", "TASK", ")", ";", "}", "private", "void", "printErr", "(", "String", "s", ")", "{", "this", ".", "err", ".", "print", "(", "s", ")", ";", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "==", "0", "&&", "this", ".", "log", "!=", "null", ")", "{", "this", ".", "log", ".", "print", "(", "s", ")", ";", "}", "}", "private", "void", "printlnErr", "(", ")", "{", "this", ".", "err", ".", "println", "(", ")", ";", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "==", "0", "&&", "this", ".", "log", "!=", "null", ")", "{", "this", ".", "log", ".", "println", "(", ")", ";", "}", "}", "private", "void", "printlnErr", "(", "String", "s", ")", "{", "this", ".", "err", ".", "println", "(", "s", ")", ";", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "==", "0", "&&", "this", ".", "log", "!=", "null", ")", "{", "this", ".", "log", ".", "println", "(", "s", ")", ";", "}", "}", "private", "void", "printlnOut", "(", "String", "s", ")", "{", "this", ".", "out", ".", "println", "(", "s", ")", ";", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "==", "0", "&&", "this", ".", "log", "!=", "null", ")", "{", "this", ".", "log", ".", "println", "(", "s", ")", ";", "}", "}", "public", "void", "printNewLine", "(", ")", "{", "this", ".", "out", ".", "println", "(", ")", ";", "}", "private", "void", "printOut", "(", "char", "c", ")", "{", "this", ".", "out", ".", "print", "(", "c", ")", ";", "}", "public", "void", "printStats", "(", ")", "{", "final", "boolean", "isTimed", "=", "(", "this", ".", "main", ".", "timing", "&", "TIMING_ENABLED", ")", "!=", "0", ";", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "printTag", "(", "Logger", ".", "STATS", ",", "null", ",", "true", ",", "false", ")", ";", "}", "if", "(", "isTimed", ")", "{", "CompilerStats", "compilerStats", "=", "this", ".", "main", ".", "batchCompiler", ".", "stats", ";", "compilerStats", ".", "startTime", "=", "this", ".", "main", ".", "startTime", ";", "compilerStats", ".", "endTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "logTiming", "(", "compilerStats", ")", ";", "}", "if", "(", "this", ".", "main", ".", "globalProblemsCount", ">", "0", ")", "{", "logProblemsSummary", "(", "this", ".", "main", ".", "globalProblemsCount", ",", "this", ".", "main", ".", "globalErrorsCount", ",", "this", ".", "main", ".", "globalWarningsCount", ",", "this", ".", "main", ".", "globalTasksCount", ")", ";", "}", "if", "(", "this", ".", "main", ".", "exportedClassFilesCounter", "!=", "0", "&&", "(", "this", ".", "main", ".", "showProgress", "||", "isTimed", "||", "this", ".", "main", ".", "verbose", ")", ")", "{", "logNumberOfClassFilesGenerated", "(", "this", ".", "main", ".", "exportedClassFilesCounter", ")", ";", "}", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "endTag", "(", "Logger", ".", "STATS", ")", ";", "}", "}", "private", "void", "printTag", "(", "String", "name", ",", "HashMap", "params", ",", "boolean", "insertNewLine", ",", "boolean", "closeTag", ")", "{", "if", "(", "this", ".", "log", "!=", "null", ")", "{", "(", "(", "GenericXMLWriter", ")", "this", ".", "log", ")", ".", "printTag", "(", "name", ",", "this", ".", "parameters", ",", "true", ",", "insertNewLine", ",", "closeTag", ")", ";", "}", "this", ".", "parameters", ".", "clear", "(", ")", ";", "}", "public", "void", "setEmacs", "(", ")", "{", "this", ".", "tagBits", "|=", "Logger", ".", "EMACS", ";", "}", "public", "void", "setLog", "(", "String", "logFileName", ")", "{", "final", "Date", "date", "=", "new", "Date", "(", ")", ";", "final", "DateFormat", "dateFormat", "=", "DateFormat", ".", "getDateTimeInstance", "(", "DateFormat", ".", "SHORT", ",", "DateFormat", ".", "LONG", ",", "Locale", ".", "getDefault", "(", ")", ")", ";", "try", "{", "int", "index", "=", "logFileName", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "index", "!=", "-", "1", ")", "{", "if", "(", "logFileName", ".", "substring", "(", "index", ")", ".", "toLowerCase", "(", ")", ".", "equals", "(", "\".xml\"", ")", ")", "{", "this", ".", "log", "=", "new", "GenericXMLWriter", "(", "new", "OutputStreamWriter", "(", "new", "FileOutputStream", "(", "logFileName", ",", "false", ")", ",", "Util", ".", "UTF_8", ")", ",", "Util", ".", "LINE_SEPARATOR", ",", "true", ")", ";", "this", ".", "tagBits", "|=", "Logger", ".", "XML", ";", "this", ".", "log", ".", "println", "(", "\"<!--", "\"", "+", "dateFormat", ".", "format", "(", "date", ")", "+", "\"", "-->\"", ")", ";", "this", ".", "log", ".", "println", "(", "Logger", ".", "XML_DTD_DECLARATION", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "COMPILER_NAME", ",", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "COMPILER_VERSION", ",", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "COMPILER_COPYRIGHT", ",", "this", ".", "main", ".", "bind", "(", "\"\"", ")", ")", ";", "printTag", "(", "Logger", ".", "COMPILER", ",", "this", ".", "parameters", ",", "true", ",", "false", ")", ";", "}", "else", "{", "this", ".", "log", "=", "new", "PrintWriter", "(", "new", "FileOutputStream", "(", "logFileName", ",", "false", ")", ")", ";", "this", ".", "log", ".", "println", "(", "\"#", "\"", "+", "dateFormat", ".", "format", "(", "date", ")", ")", ";", "}", "}", "else", "{", "this", ".", "log", "=", "new", "PrintWriter", "(", "new", "FileOutputStream", "(", "logFileName", ",", "false", ")", ")", ";", "this", ".", "log", ".", "println", "(", "\"#", "\"", "+", "dateFormat", ".", "format", "(", "date", ")", ")", ";", "}", "}", "catch", "(", "FileNotFoundException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "logFileName", ")", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "main", ".", "bind", "(", "\"\"", ",", "logFileName", ")", ")", ";", "}", "}", "private", "void", "startLoggingExtraProblems", "(", "int", "count", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "NUMBER_OF_PROBLEMS", ",", "new", "Integer", "(", "count", ")", ")", ";", "printTag", "(", "Logger", ".", "EXTRA_PROBLEMS", ",", "this", ".", "parameters", ",", "true", ",", "false", ")", ";", "}", "private", "void", "startLoggingProblems", "(", "int", "errors", ",", "int", "warnings", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "NUMBER_OF_PROBLEMS", ",", "new", "Integer", "(", "errors", "+", "warnings", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "NUMBER_OF_ERRORS", ",", "new", "Integer", "(", "errors", ")", ")", ";", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "NUMBER_OF_WARNINGS", ",", "new", "Integer", "(", "warnings", ")", ")", ";", "printTag", "(", "Logger", ".", "PROBLEMS", ",", "this", ".", "parameters", ",", "true", ",", "false", ")", ";", "}", "public", "void", "startLoggingSource", "(", "CompilationResult", "compilationResult", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "ICompilationUnit", "compilationUnit", "=", "compilationResult", ".", "compilationUnit", ";", "if", "(", "compilationUnit", "!=", "null", ")", "{", "char", "[", "]", "fileName", "=", "compilationUnit", ".", "getFileName", "(", ")", ";", "File", "f", "=", "new", "File", "(", "new", "String", "(", "fileName", ")", ")", ";", "if", "(", "fileName", "!=", "null", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PATH", ",", "f", ".", "getAbsolutePath", "(", ")", ")", ";", "}", "char", "[", "]", "[", "]", "packageName", "=", "compilationResult", ".", "packageName", ";", "if", "(", "packageName", "!=", "null", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "PACKAGE", ",", "new", "String", "(", "CharOperation", ".", "concatWith", "(", "packageName", ",", "File", ".", "separatorChar", ")", ")", ")", ";", "}", "CompilationUnit", "unit", "=", "(", "CompilationUnit", ")", "compilationUnit", ";", "String", "destinationPath", "=", "unit", ".", "destinationPath", ";", "if", "(", "destinationPath", "==", "null", ")", "{", "destinationPath", "=", "this", ".", "main", ".", "destinationPath", ";", "}", "if", "(", "destinationPath", "!=", "null", "&&", "destinationPath", "!=", "NONE", ")", "{", "if", "(", "File", ".", "separatorChar", "==", "'/'", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "OUTPUT", ",", "destinationPath", ")", ";", "}", "else", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "OUTPUT", ",", "destinationPath", ".", "replace", "(", "'/'", ",", "File", ".", "separatorChar", ")", ")", ";", "}", "}", "}", "printTag", "(", "Logger", ".", "SOURCE", ",", "this", ".", "parameters", ",", "true", ",", "false", ")", ";", "}", "}", "public", "void", "startLoggingSources", "(", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "printTag", "(", "Logger", ".", "SOURCES", ",", "null", ",", "true", ",", "false", ")", ";", "}", "}", "public", "void", "startLoggingTasks", "(", "int", "tasks", ")", "{", "if", "(", "(", "this", ".", "tagBits", "&", "Logger", ".", "XML", ")", "!=", "0", ")", "{", "this", ".", "parameters", ".", "put", "(", "Logger", ".", "NUMBER_OF_TASKS", ",", "new", "Integer", "(", "tasks", ")", ")", ";", "printTag", "(", "Logger", ".", "TASKS", ",", "this", ".", "parameters", ",", "true", ",", "false", ")", ";", "}", "}", "}", "public", "static", "class", "ResourceBundleFactory", "{", "private", "static", "HashMap", "Cache", "=", "new", "HashMap", "(", ")", ";", "public", "static", "synchronized", "ResourceBundle", "getBundle", "(", "Locale", "locale", ")", "{", "ResourceBundle", "bundle", "=", "(", "ResourceBundle", ")", "Cache", ".", "get", "(", "locale", ")", ";", "if", "(", "bundle", "==", "null", ")", "{", "bundle", "=", "ResourceBundle", ".", "getBundle", "(", "Main", ".", "bundleName", ",", "locale", ")", ";", "Cache", ".", "put", "(", "locale", ",", "bundle", ")", ";", "}", "return", "bundle", ";", "}", "}", "boolean", "enableJavadocOn", ";", "boolean", "warnJavadocOn", ";", "boolean", "warnAllJavadocOn", ";", "public", "Compiler", "batchCompiler", ";", "public", "ResourceBundle", "bundle", ";", "protected", "FileSystem", ".", "Classpath", "[", "]", "checkedClasspaths", ";", "public", "Locale", "compilerLocale", ";", "public", "CompilerOptions", "compilerOptions", ";", "public", "CompilationProgress", "progress", ";", "public", "String", "destinationPath", ";", "public", "String", "[", "]", "destinationPaths", ";", "private", "boolean", "didSpecifySource", ";", "private", "boolean", "didSpecifyTarget", ";", "public", "String", "[", "]", "encodings", ";", "public", "int", "exportedClassFilesCounter", ";", "public", "String", "[", "]", "filenames", ";", "public", "String", "[", "]", "classNames", ";", "public", "int", "globalErrorsCount", ";", "public", "int", "globalProblemsCount", ";", "public", "int", "globalTasksCount", ";", "public", "int", "globalWarningsCount", ";", "private", "File", "javaHomeCache", ";", "private", "boolean", "javaHomeChecked", "=", "false", ";", "public", "long", "lineCount0", ";", "public", "String", "log", ";", "public", "Logger", "logger", ";", "public", "int", "maxProblems", ";", "public", "Map", "options", ";", "protected", "PrintWriter", "out", ";", "public", "boolean", "proceed", "=", "true", ";", "public", "boolean", "proceedOnError", "=", "false", ";", "public", "boolean", "produceRefInfo", "=", "false", ";", "public", "int", "currentRepetition", ",", "maxRepetition", ";", "public", "boolean", "showProgress", "=", "false", ";", "public", "long", "startTime", ";", "public", "ArrayList", "pendingErrors", ";", "public", "boolean", "systemExitWhenFinished", "=", "true", ";", "public", "static", "final", "int", "TIMING_DISABLED", "=", "0", ";", "public", "static", "final", "int", "TIMING_ENABLED", "=", "1", ";", "public", "static", "final", "int", "TIMING_DETAILED", "=", "2", ";", "public", "int", "timing", "=", "TIMING_DISABLED", ";", "public", "CompilerStats", "[", "]", "compilerStats", ";", "public", "boolean", "verbose", "=", "false", ";", "private", "String", "[", "]", "expandedCommandLine", ";", "private", "PrintWriter", "err", ";", "ArrayList", "extraProblems", ";", "public", "final", "static", "String", "bundleName", "=", "\"\"", ";", "public", "static", "final", "int", "DEFAULT_SIZE_CLASSPATH", "=", "4", ";", "public", "static", "final", "String", "NONE", "=", "\"none\"", ";", "public", "static", "boolean", "compile", "(", "String", "commandLine", ")", "{", "return", "new", "Main", "(", "new", "PrintWriter", "(", "System", ".", "out", ")", ",", "new", "PrintWriter", "(", "System", ".", "err", ")", ",", "false", ",", "null", ",", "null", ")", ".", "compile", "(", "tokenize", "(", "commandLine", ")", ")", ";", "}", "public", "static", "boolean", "compile", "(", "String", "commandLine", ",", "PrintWriter", "outWriter", ",", "PrintWriter", "errWriter", ")", "{", "return", "new", "Main", "(", "outWriter", ",", "errWriter", ",", "false", ",", "null", ",", "null", ")", ".", "compile", "(", "tokenize", "(", "commandLine", ")", ")", ";", "}", "public", "static", "boolean", "compile", "(", "String", "[", "]", "commandLineArguments", ",", "PrintWriter", "outWriter", ",", "PrintWriter", "errWriter", ",", "CompilationProgress", "progress", ")", "{", "return", "new", "Main", "(", "outWriter", ",", "errWriter", ",", "false", ",", "null", ",", "progress", ")", ".", "compile", "(", "commandLineArguments", ")", ";", "}", "public", "static", "File", "[", "]", "[", "]", "getLibrariesFiles", "(", "File", "[", "]", "files", ")", "{", "FilenameFilter", "filter", "=", "new", "FilenameFilter", "(", ")", "{", "public", "boolean", "accept", "(", "File", "dir", ",", "String", "name", ")", "{", "return", "Util", ".", "isPotentialZipArchive", "(", "name", ")", ";", "}", "}", ";", "final", "int", "filesLength", "=", "files", ".", "length", ";", "File", "[", "]", "[", "]", "result", "=", "new", "File", "[", "filesLength", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "filesLength", ";", "i", "++", ")", "{", "File", "currentFile", "=", "files", "[", "i", "]", ";", "if", "(", "currentFile", ".", "exists", "(", ")", "&&", "currentFile", ".", "isDirectory", "(", ")", ")", "{", "result", "[", "i", "]", "=", "currentFile", ".", "listFiles", "(", "filter", ")", ";", "}", "}", "return", "result", ";", "}", "public", "static", "void", "main", "(", "String", "[", "]", "argv", ")", "{", "new", "Main", "(", "new", "PrintWriter", "(", "System", ".", "out", ")", ",", "new", "PrintWriter", "(", "System", ".", "err", ")", ",", "true", ",", "null", ",", "null", ")", ".", "compile", "(", "argv", ")", ";", "}", "public", "static", "String", "[", "]", "tokenize", "(", "String", "commandLine", ")", "{", "int", "count", "=", "0", ";", "String", "[", "]", "arguments", "=", "new", "String", "[", "10", "]", ";", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "commandLine", ",", "\"", "\\\"\"", ",", "true", ")", ";", "String", "token", "=", "Util", ".", "EMPTY_STRING", ";", "boolean", "insideQuotes", "=", "false", ";", "boolean", "startNewToken", "=", "true", ";", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "{", "token", "=", "tokenizer", ".", "nextToken", "(", ")", ";", "if", "(", "token", ".", "equals", "(", "\"", "\"", ")", ")", "{", "if", "(", "insideQuotes", ")", "{", "arguments", "[", "count", "-", "1", "]", "+=", "token", ";", "startNewToken", "=", "false", ";", "}", "else", "{", "startNewToken", "=", "true", ";", "}", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\\\"\"", ")", ")", "{", "if", "(", "!", "insideQuotes", "&&", "startNewToken", ")", "{", "if", "(", "count", "==", "arguments", ".", "length", ")", "System", ".", "arraycopy", "(", "arguments", ",", "0", ",", "(", "arguments", "=", "new", "String", "[", "count", "*", "2", "]", ")", ",", "0", ",", "count", ")", ";", "arguments", "[", "count", "++", "]", "=", "Util", ".", "EMPTY_STRING", ";", "}", "insideQuotes", "=", "!", "insideQuotes", ";", "startNewToken", "=", "false", ";", "}", "else", "{", "if", "(", "insideQuotes", ")", "{", "arguments", "[", "count", "-", "1", "]", "+=", "token", ";", "}", "else", "{", "if", "(", "token", ".", "length", "(", ")", ">", "0", "&&", "!", "startNewToken", ")", "{", "arguments", "[", "count", "-", "1", "]", "+=", "token", ";", "}", "else", "{", "if", "(", "count", "==", "arguments", ".", "length", ")", "System", ".", "arraycopy", "(", "arguments", ",", "0", ",", "(", "arguments", "=", "new", "String", "[", "count", "*", "2", "]", ")", ",", "0", ",", "count", ")", ";", "String", "trimmedToken", "=", "token", ".", "trim", "(", ")", ";", "if", "(", "trimmedToken", ".", "length", "(", ")", "!=", "0", ")", "{", "arguments", "[", "count", "++", "]", "=", "trimmedToken", ";", "}", "}", "}", "startNewToken", "=", "false", ";", "}", "}", "System", ".", "arraycopy", "(", "arguments", ",", "0", ",", "arguments", "=", "new", "String", "[", "count", "]", ",", "0", ",", "count", ")", ";", "return", "arguments", ";", "}", "public", "Main", "(", "PrintWriter", "outWriter", ",", "PrintWriter", "errWriter", ",", "boolean", "systemExitWhenFinished", ")", "{", "this", "(", "outWriter", ",", "errWriter", ",", "systemExitWhenFinished", ",", "null", ",", "null", ")", ";", "}", "public", "Main", "(", "PrintWriter", "outWriter", ",", "PrintWriter", "errWriter", ",", "boolean", "systemExitWhenFinished", ",", "Map", "customDefaultOptions", ")", "{", "this", "(", "outWriter", ",", "errWriter", ",", "systemExitWhenFinished", ",", "customDefaultOptions", ",", "null", ")", ";", "}", "public", "Main", "(", "PrintWriter", "outWriter", ",", "PrintWriter", "errWriter", ",", "boolean", "systemExitWhenFinished", ",", "Map", "customDefaultOptions", ",", "CompilationProgress", "compilationProgress", ")", "{", "this", ".", "initialize", "(", "outWriter", ",", "errWriter", ",", "systemExitWhenFinished", ",", "customDefaultOptions", ",", "compilationProgress", ")", ";", "this", ".", "relocalize", "(", ")", ";", "}", "public", "void", "addExtraProblems", "(", "CategorizedProblem", "problem", ")", "{", "if", "(", "this", ".", "extraProblems", "==", "null", ")", "{", "this", ".", "extraProblems", "=", "new", "ArrayList", "(", ")", ";", "}", "this", ".", "extraProblems", ".", "add", "(", "problem", ")", ";", "}", "protected", "void", "addNewEntry", "(", "ArrayList", "paths", ",", "String", "currentClasspathName", ",", "ArrayList", "currentRuleSpecs", ",", "String", "customEncoding", ",", "String", "destPath", ",", "boolean", "isSourceOnly", ",", "boolean", "rejectDestinationPathOnJars", ")", "{", "int", "rulesSpecsSize", "=", "currentRuleSpecs", ".", "size", "(", ")", ";", "AccessRuleSet", "accessRuleSet", "=", "null", ";", "if", "(", "rulesSpecsSize", "!=", "0", ")", "{", "AccessRule", "[", "]", "accessRules", "=", "new", "AccessRule", "[", "currentRuleSpecs", ".", "size", "(", ")", "]", ";", "boolean", "rulesOK", "=", "true", ";", "Iterator", "i", "=", "currentRuleSpecs", ".", "iterator", "(", ")", ";", "int", "j", "=", "0", ";", "while", "(", "i", ".", "hasNext", "(", ")", ")", "{", "String", "ruleSpec", "=", "(", "String", ")", "i", ".", "next", "(", ")", ";", "char", "key", "=", "ruleSpec", ".", "charAt", "(", "0", ")", ";", "String", "pattern", "=", "ruleSpec", ".", "substring", "(", "1", ")", ";", "if", "(", "pattern", ".", "length", "(", ")", ">", "0", ")", "{", "switch", "(", "key", ")", "{", "case", "'+'", ":", "accessRules", "[", "j", "++", "]", "=", "new", "AccessRule", "(", "pattern", ".", "toCharArray", "(", ")", ",", "0", ")", ";", "break", ";", "case", "'~'", ":", "accessRules", "[", "j", "++", "]", "=", "new", "AccessRule", "(", "pattern", ".", "toCharArray", "(", ")", ",", "IProblem", ".", "DiscouragedReference", ")", ";", "break", ";", "case", "'-'", ":", "accessRules", "[", "j", "++", "]", "=", "new", "AccessRule", "(", "pattern", ".", "toCharArray", "(", ")", ",", "IProblem", ".", "ForbiddenReference", ")", ";", "break", ";", "case", "'?'", ":", "accessRules", "[", "j", "++", "]", "=", "new", "AccessRule", "(", "pattern", ".", "toCharArray", "(", ")", ",", "IProblem", ".", "ForbiddenReference", ",", "true", ")", ";", "break", ";", "default", ":", "rulesOK", "=", "false", ";", "}", "}", "else", "{", "rulesOK", "=", "false", ";", "}", "}", "if", "(", "rulesOK", ")", "{", "accessRuleSet", "=", "new", "AccessRuleSet", "(", "accessRules", ",", "AccessRestriction", ".", "COMMAND_LINE", ",", "currentClasspathName", ")", ";", "}", "else", "{", "if", "(", "currentClasspathName", ".", "length", "(", ")", "!=", "0", ")", "{", "addPendingErrors", "(", "this", ".", "bind", "(", "\"\"", ",", "currentClasspathName", ")", ")", ";", "}", "return", ";", "}", "}", "if", "(", "NONE", ".", "equals", "(", "destPath", ")", ")", "{", "destPath", "=", "NONE", ";", "}", "if", "(", "rejectDestinationPathOnJars", "&&", "destPath", "!=", "null", "&&", "Util", ".", "isPotentialZipArchive", "(", "currentClasspathName", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentClasspathName", ")", ")", ";", "}", "FileSystem", ".", "Classpath", "currentClasspath", "=", "FileSystem", ".", "getClasspath", "(", "currentClasspathName", ",", "customEncoding", ",", "isSourceOnly", ",", "accessRuleSet", ",", "destPath", ")", ";", "if", "(", "currentClasspath", "!=", "null", ")", "{", "paths", ".", "add", "(", "currentClasspath", ")", ";", "}", "else", "if", "(", "currentClasspathName", ".", "length", "(", ")", "!=", "0", ")", "{", "addPendingErrors", "(", "this", ".", "bind", "(", "\"\"", ",", "currentClasspathName", ")", ")", ";", "}", "}", "void", "addPendingErrors", "(", "String", "message", ")", "{", "if", "(", "this", ".", "pendingErrors", "==", "null", ")", "{", "this", ".", "pendingErrors", "=", "new", "ArrayList", "(", ")", ";", "}", "this", ".", "pendingErrors", ".", "add", "(", "message", ")", ";", "}", "public", "String", "bind", "(", "String", "id", ")", "{", "return", "bind", "(", "id", ",", "(", "String", "[", "]", ")", "null", ")", ";", "}", "public", "String", "bind", "(", "String", "id", ",", "String", "binding", ")", "{", "return", "bind", "(", "id", ",", "new", "String", "[", "]", "{", "binding", "}", ")", ";", "}", "public", "String", "bind", "(", "String", "id", ",", "String", "binding1", ",", "String", "binding2", ")", "{", "return", "bind", "(", "id", ",", "new", "String", "[", "]", "{", "binding1", ",", "binding2", "}", ")", ";", "}", "public", "String", "bind", "(", "String", "id", ",", "String", "[", "]", "arguments", ")", "{", "if", "(", "id", "==", "null", ")", "return", "\"\"", ";", "String", "message", "=", "null", ";", "try", "{", "message", "=", "this", ".", "bundle", ".", "getString", "(", "id", ")", ";", "}", "catch", "(", "MissingResourceException", "e", ")", "{", "return", "\"\"", "+", "id", "+", "\"", "in:", "\"", "+", "Main", ".", "bundleName", ";", "}", "return", "MessageFormat", ".", "format", "(", "message", ",", "arguments", ")", ";", "}", "private", "boolean", "checkVMVersion", "(", "long", "minimalSupportedVersion", ")", "{", "String", "classFileVersion", "=", "System", ".", "getProperty", "(", "\"\"", ")", ";", "if", "(", "classFileVersion", "==", "null", ")", "{", "return", "false", ";", "}", "int", "index", "=", "classFileVersion", ".", "indexOf", "(", "'.'", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "return", "false", ";", "}", "int", "majorVersion", ";", "try", "{", "majorVersion", "=", "Integer", ".", "parseInt", "(", "classFileVersion", ".", "substring", "(", "0", ",", "index", ")", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "return", "false", ";", "}", "switch", "(", "majorVersion", ")", "{", "case", "45", ":", "return", "ClassFileConstants", ".", "JDK1_1", ">=", "minimalSupportedVersion", ";", "case", "46", ":", "return", "ClassFileConstants", ".", "JDK1_2", ">=", "minimalSupportedVersion", ";", "case", "47", ":", "return", "ClassFileConstants", ".", "JDK1_3", ">=", "minimalSupportedVersion", ";", "case", "48", ":", "return", "ClassFileConstants", ".", "JDK1_4", ">=", "minimalSupportedVersion", ";", "case", "49", ":", "return", "ClassFileConstants", ".", "JDK1_5", ">=", "minimalSupportedVersion", ";", "case", "50", ":", "return", "ClassFileConstants", ".", "JDK1_6", ">=", "minimalSupportedVersion", ";", "case", "51", ":", "return", "ClassFileConstants", ".", "JDK1_7", ">=", "minimalSupportedVersion", ";", "}", "return", "false", ";", "}", "public", "boolean", "compile", "(", "String", "[", "]", "argv", ")", "{", "try", "{", "configure", "(", "argv", ")", ";", "if", "(", "this", ".", "progress", "!=", "null", ")", "this", ".", "progress", ".", "begin", "(", "this", ".", "filenames", "==", "null", "?", "0", ":", "this", ".", "filenames", ".", "length", "*", "this", ".", "maxRepetition", ")", ";", "if", "(", "this", ".", "proceed", ")", "{", "if", "(", "this", ".", "showProgress", ")", "this", ".", "logger", ".", "compiling", "(", ")", ";", "for", "(", "this", ".", "currentRepetition", "=", "0", ";", "this", ".", "currentRepetition", "<", "this", ".", "maxRepetition", ";", "this", ".", "currentRepetition", "++", ")", "{", "this", ".", "globalProblemsCount", "=", "0", ";", "this", ".", "globalErrorsCount", "=", "0", ";", "this", ".", "globalWarningsCount", "=", "0", ";", "this", ".", "globalTasksCount", "=", "0", ";", "this", ".", "exportedClassFilesCounter", "=", "0", ";", "if", "(", "this", ".", "maxRepetition", ">", "1", ")", "{", "this", ".", "logger", ".", "flush", "(", ")", ";", "this", ".", "logger", ".", "logRepetition", "(", "this", ".", "currentRepetition", ",", "this", ".", "maxRepetition", ")", ";", "}", "performCompilation", "(", ")", ";", "}", "if", "(", "this", ".", "compilerStats", "!=", "null", ")", "{", "this", ".", "logger", ".", "logAverage", "(", ")", ";", "}", "if", "(", "this", ".", "showProgress", ")", "this", ".", "logger", ".", "printNewLine", "(", ")", ";", "}", "if", "(", "this", ".", "systemExitWhenFinished", ")", "{", "this", ".", "logger", ".", "flush", "(", ")", ";", "this", ".", "logger", ".", "close", "(", ")", ";", "System", ".", "exit", "(", "this", ".", "globalErrorsCount", ">", "0", "?", "-", "1", ":", "0", ")", ";", "}", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "this", ".", "logger", ".", "logException", "(", "e", ")", ";", "if", "(", "this", ".", "systemExitWhenFinished", ")", "{", "this", ".", "logger", ".", "flush", "(", ")", ";", "this", ".", "logger", ".", "close", "(", ")", ";", "System", ".", "exit", "(", "-", "1", ")", ";", "}", "return", "false", ";", "}", "catch", "(", "RuntimeException", "e", ")", "{", "this", ".", "logger", ".", "logException", "(", "e", ")", ";", "if", "(", "this", ".", "systemExitWhenFinished", ")", "{", "this", ".", "logger", ".", "flush", "(", ")", ";", "this", ".", "logger", ".", "close", "(", ")", ";", "System", ".", "exit", "(", "-", "1", ")", ";", "}", "return", "false", ";", "}", "finally", "{", "this", ".", "logger", ".", "flush", "(", ")", ";", "this", ".", "logger", ".", "close", "(", ")", ";", "if", "(", "this", ".", "progress", "!=", "null", ")", "this", ".", "progress", ".", "done", "(", ")", ";", "}", "if", "(", "this", ".", "globalErrorsCount", "==", "0", "&&", "(", "this", ".", "progress", "==", "null", "||", "!", "this", ".", "progress", ".", "isCanceled", "(", ")", ")", ")", "return", "true", ";", "return", "false", ";", "}", "public", "void", "configure", "(", "String", "[", "]", "argv", ")", "{", "if", "(", "(", "argv", "==", "null", ")", "||", "(", "argv", ".", "length", "==", "0", ")", ")", "{", "printUsage", "(", ")", ";", "return", ";", "}", "final", "int", "INSIDE_CLASSPATH_start", "=", "1", ";", "final", "int", "INSIDE_DESTINATION_PATH", "=", "3", ";", "final", "int", "INSIDE_TARGET", "=", "4", ";", "final", "int", "INSIDE_LOG", "=", "5", ";", "final", "int", "INSIDE_REPETITION", "=", "6", ";", "final", "int", "INSIDE_SOURCE", "=", "7", ";", "final", "int", "INSIDE_DEFAULT_ENCODING", "=", "8", ";", "final", "int", "INSIDE_BOOTCLASSPATH_start", "=", "9", ";", "final", "int", "INSIDE_MAX_PROBLEMS", "=", "11", ";", "final", "int", "INSIDE_EXT_DIRS", "=", "12", ";", "final", "int", "INSIDE_SOURCE_PATH_start", "=", "13", ";", "final", "int", "INSIDE_ENDORSED_DIRS", "=", "15", ";", "final", "int", "INSIDE_SOURCE_DIRECTORY_DESTINATION_PATH", "=", "16", ";", "final", "int", "INSIDE_PROCESSOR_PATH_start", "=", "17", ";", "final", "int", "INSIDE_PROCESSOR_start", "=", "18", ";", "final", "int", "INSIDE_S_start", "=", "19", ";", "final", "int", "INSIDE_CLASS_NAMES", "=", "20", ";", "final", "int", "INSIDE_WARNINGS_PROPERTIES", "=", "21", ";", "final", "int", "DEFAULT", "=", "0", ";", "ArrayList", "bootclasspaths", "=", "new", "ArrayList", "(", "DEFAULT_SIZE_CLASSPATH", ")", ";", "String", "sourcepathClasspathArg", "=", "null", ";", "ArrayList", "sourcepathClasspaths", "=", "new", "ArrayList", "(", "DEFAULT_SIZE_CLASSPATH", ")", ";", "ArrayList", "classpaths", "=", "new", "ArrayList", "(", "DEFAULT_SIZE_CLASSPATH", ")", ";", "ArrayList", "extdirsClasspaths", "=", "null", ";", "ArrayList", "endorsedDirClasspaths", "=", "null", ";", "int", "index", "=", "-", "1", ";", "int", "filesCount", "=", "0", ";", "int", "classCount", "=", "0", ";", "int", "argCount", "=", "argv", ".", "length", ";", "int", "mode", "=", "DEFAULT", ";", "this", ".", "maxRepetition", "=", "0", ";", "boolean", "printUsageRequired", "=", "false", ";", "String", "usageSection", "=", "null", ";", "boolean", "printVersionRequired", "=", "false", ";", "boolean", "didSpecifyDeprecation", "=", "false", ";", "boolean", "didSpecifyCompliance", "=", "false", ";", "boolean", "didSpecifyDisabledAnnotationProcessing", "=", "false", ";", "boolean", "encounteredGroovySourceFile", "=", "false", ";", "String", "customEncoding", "=", "null", ";", "String", "customDestinationPath", "=", "null", ";", "String", "currentSourceDirectory", "=", "null", ";", "String", "currentArg", "=", "Util", ".", "EMPTY_STRING", ";", "Set", "specifiedEncodings", "=", "null", ";", "boolean", "needExpansion", "=", "false", ";", "loop", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argCount", ";", "i", "++", ")", "{", "if", "(", "argv", "[", "i", "]", ".", "startsWith", "(", "\"@\"", ")", ")", "{", "needExpansion", "=", "true", ";", "break", "loop", ";", "}", "}", "String", "[", "]", "newCommandLineArgs", "=", "null", ";", "if", "(", "needExpansion", ")", "{", "newCommandLineArgs", "=", "new", "String", "[", "argCount", "]", ";", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argCount", ";", "i", "++", ")", "{", "String", "[", "]", "newArgs", "=", "null", ";", "String", "arg", "=", "argv", "[", "i", "]", ".", "trim", "(", ")", ";", "if", "(", "arg", ".", "startsWith", "(", "\"@\"", ")", ")", "{", "try", "{", "LineNumberReader", "reader", "=", "new", "LineNumberReader", "(", "new", "StringReader", "(", "new", "String", "(", "Util", ".", "getFileCharContent", "(", "new", "File", "(", "arg", ".", "substring", "(", "1", ")", ")", ",", "null", ")", ")", ")", ")", ";", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "String", "line", ";", "while", "(", "(", "line", "=", "reader", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "line", "=", "line", ".", "trim", "(", ")", ";", "if", "(", "!", "line", ".", "startsWith", "(", "\"#\"", ")", ")", "{", "buffer", ".", "append", "(", "line", ")", ".", "append", "(", "\"", "\"", ")", ";", "}", "}", "newArgs", "=", "tokenize", "(", "buffer", ".", "toString", "(", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "arg", ")", ")", ";", "}", "}", "if", "(", "newArgs", "!=", "null", ")", "{", "int", "newCommandLineArgsLength", "=", "newCommandLineArgs", ".", "length", ";", "int", "newArgsLength", "=", "newArgs", ".", "length", ";", "System", ".", "arraycopy", "(", "newCommandLineArgs", ",", "0", ",", "(", "newCommandLineArgs", "=", "new", "String", "[", "newCommandLineArgsLength", "+", "newArgsLength", "-", "1", "]", ")", ",", "0", ",", "index", ")", ";", "System", ".", "arraycopy", "(", "newArgs", ",", "0", ",", "newCommandLineArgs", ",", "index", ",", "newArgsLength", ")", ";", "index", "+=", "newArgsLength", ";", "}", "else", "{", "newCommandLineArgs", "[", "index", "++", "]", "=", "arg", ";", "}", "}", "index", "=", "-", "1", ";", "}", "else", "{", "newCommandLineArgs", "=", "argv", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argCount", ";", "i", "++", ")", "{", "newCommandLineArgs", "[", "i", "]", "=", "newCommandLineArgs", "[", "i", "]", ".", "trim", "(", ")", ";", "}", "}", "argCount", "=", "newCommandLineArgs", ".", "length", ";", "this", ".", "expandedCommandLine", "=", "newCommandLineArgs", ";", "while", "(", "++", "index", "<", "argCount", ")", "{", "if", "(", "customEncoding", "!=", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ",", "customEncoding", ")", ")", ";", "}", "currentArg", "=", "newCommandLineArgs", "[", "index", "]", ";", "switch", "(", "mode", ")", "{", "case", "DEFAULT", ":", "if", "(", "currentArg", ".", "startsWith", "(", "\"[\"", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "if", "(", "currentArg", ".", "endsWith", "(", "\"]\"", ")", ")", "{", "int", "encodingStart", "=", "currentArg", ".", "indexOf", "(", "'['", ")", "+", "1", ";", "if", "(", "encodingStart", "<=", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "int", "encodingEnd", "=", "currentArg", ".", "length", "(", ")", "-", "1", ";", "if", "(", "encodingStart", ">=", "1", ")", "{", "if", "(", "encodingStart", "<", "encodingEnd", ")", "{", "customEncoding", "=", "currentArg", ".", "substring", "(", "encodingStart", ",", "encodingEnd", ")", ";", "try", "{", "new", "InputStreamReader", "(", "new", "ByteArrayInputStream", "(", "new", "byte", "[", "0", "]", ")", ",", "customEncoding", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "customEncoding", ")", ")", ";", "}", "}", "currentArg", "=", "currentArg", ".", "substring", "(", "0", ",", "encodingStart", "-", "1", ")", ";", "}", "}", "if", "(", "currentArg", ".", "endsWith", "(", "SuffixConstants", ".", "SUFFIX_STRING_java", ")", "||", "currentArg", ".", "endsWith", "(", "\".groovy\"", ")", ")", "{", "if", "(", "currentArg", ".", "endsWith", "(", "\".groovy\"", ")", ")", "{", "encounteredGroovySourceFile", "=", "true", ";", "}", "if", "(", "this", ".", "filenames", "==", "null", ")", "{", "this", ".", "filenames", "=", "new", "String", "[", "argCount", "-", "index", "]", ";", "this", ".", "encodings", "=", "new", "String", "[", "argCount", "-", "index", "]", ";", "this", ".", "destinationPaths", "=", "new", "String", "[", "argCount", "-", "index", "]", ";", "}", "else", "if", "(", "filesCount", "==", "this", ".", "filenames", ".", "length", ")", "{", "int", "length", "=", "this", ".", "filenames", ".", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "filenames", ",", "0", ",", "(", "this", ".", "filenames", "=", "new", "String", "[", "length", "+", "argCount", "-", "index", "]", ")", ",", "0", ",", "length", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "encodings", ",", "0", ",", "(", "this", ".", "encodings", "=", "new", "String", "[", "length", "+", "argCount", "-", "index", "]", ")", ",", "0", ",", "length", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "destinationPaths", ",", "0", ",", "(", "this", ".", "destinationPaths", "=", "new", "String", "[", "length", "+", "argCount", "-", "index", "]", ")", ",", "0", ",", "length", ")", ";", "}", "this", ".", "filenames", "[", "filesCount", "]", "=", "currentArg", ";", "this", ".", "encodings", "[", "filesCount", "++", "]", "=", "customEncoding", ";", "customEncoding", "=", "null", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-log\"", ")", ")", "{", "if", "(", "this", ".", "log", "!=", "null", ")", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "mode", "=", "INSIDE_LOG", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-repeat\"", ")", ")", "{", "if", "(", "this", ".", "maxRepetition", ">", "0", ")", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "mode", "=", "INSIDE_REPETITION", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-maxProblems\"", ")", ")", "{", "if", "(", "this", ".", "maxProblems", ">", "0", ")", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "mode", "=", "INSIDE_MAX_PROBLEMS", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-source\"", ")", ")", "{", "mode", "=", "INSIDE_SOURCE", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-encoding\"", ")", ")", "{", "mode", "=", "INSIDE_DEFAULT_ENCODING", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-1.3\"", ")", ")", "{", "if", "(", "didSpecifyCompliance", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "didSpecifyCompliance", "=", "true", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Compliance", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-1.4\"", ")", ")", "{", "if", "(", "didSpecifyCompliance", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "didSpecifyCompliance", "=", "true", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Compliance", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-1.5\"", ")", "||", "currentArg", ".", "equals", "(", "\"-5\"", ")", "||", "currentArg", ".", "equals", "(", "\"-5.0\"", ")", ")", "{", "if", "(", "didSpecifyCompliance", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "didSpecifyCompliance", "=", "true", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Compliance", ",", "CompilerOptions", ".", "VERSION_1_5", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-1.6\"", ")", "||", "currentArg", ".", "equals", "(", "\"-6\"", ")", "||", "currentArg", ".", "equals", "(", "\"-6.0\"", ")", ")", "{", "if", "(", "didSpecifyCompliance", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "didSpecifyCompliance", "=", "true", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Compliance", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-1.7\"", ")", "||", "currentArg", ".", "equals", "(", "\"-7\"", ")", "||", "currentArg", ".", "equals", "(", "\"-7.0\"", ")", ")", "{", "if", "(", "didSpecifyCompliance", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "didSpecifyCompliance", "=", "true", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Compliance", ",", "CompilerOptions", ".", "VERSION_1_7", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-d\"", ")", ")", "{", "if", "(", "this", ".", "destinationPath", "!=", "null", ")", "{", "StringBuffer", "errorMessage", "=", "new", "StringBuffer", "(", ")", ";", "errorMessage", ".", "append", "(", "currentArg", ")", ";", "if", "(", "(", "index", "+", "1", ")", "<", "argCount", ")", "{", "errorMessage", ".", "append", "(", "'", "'", ")", ";", "errorMessage", ".", "append", "(", "newCommandLineArgs", "[", "index", "+", "1", "]", ")", ";", "}", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "errorMessage", ".", "toString", "(", ")", ")", ")", ";", "}", "mode", "=", "INSIDE_DESTINATION_PATH", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-classpath\"", ")", "||", "currentArg", ".", "equals", "(", "\"-cp\"", ")", ")", "{", "mode", "=", "INSIDE_CLASSPATH_start", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"\"", ")", ")", "{", "if", "(", "bootclasspaths", ".", "size", "(", ")", ">", "0", ")", "{", "StringBuffer", "errorMessage", "=", "new", "StringBuffer", "(", ")", ";", "errorMessage", ".", "append", "(", "currentArg", ")", ";", "if", "(", "(", "index", "+", "1", ")", "<", "argCount", ")", "{", "errorMessage", ".", "append", "(", "'", "'", ")", ";", "errorMessage", ".", "append", "(", "newCommandLineArgs", "[", "index", "+", "1", "]", ")", ";", "}", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "errorMessage", ".", "toString", "(", ")", ")", ")", ";", "}", "mode", "=", "INSIDE_BOOTCLASSPATH_start", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-sourcepath\"", ")", ")", "{", "if", "(", "sourcepathClasspathArg", "!=", "null", ")", "{", "StringBuffer", "errorMessage", "=", "new", "StringBuffer", "(", ")", ";", "errorMessage", ".", "append", "(", "currentArg", ")", ";", "if", "(", "(", "index", "+", "1", ")", "<", "argCount", ")", "{", "errorMessage", ".", "append", "(", "'", "'", ")", ";", "errorMessage", ".", "append", "(", "newCommandLineArgs", "[", "index", "+", "1", "]", ")", ";", "}", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "errorMessage", ".", "toString", "(", ")", ")", ")", ";", "}", "mode", "=", "INSIDE_SOURCE_PATH_start", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-extdirs\"", ")", ")", "{", "if", "(", "extdirsClasspaths", "!=", "null", ")", "{", "StringBuffer", "errorMessage", "=", "new", "StringBuffer", "(", ")", ";", "errorMessage", ".", "append", "(", "currentArg", ")", ";", "if", "(", "(", "index", "+", "1", ")", "<", "argCount", ")", "{", "errorMessage", ".", "append", "(", "'", "'", ")", ";", "errorMessage", ".", "append", "(", "newCommandLineArgs", "[", "index", "+", "1", "]", ")", ";", "}", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "errorMessage", ".", "toString", "(", ")", ")", ")", ";", "}", "mode", "=", "INSIDE_EXT_DIRS", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"\"", ")", ")", "{", "if", "(", "endorsedDirClasspaths", "!=", "null", ")", "{", "StringBuffer", "errorMessage", "=", "new", "StringBuffer", "(", ")", ";", "errorMessage", ".", "append", "(", "currentArg", ")", ";", "if", "(", "(", "index", "+", "1", ")", "<", "argCount", ")", "{", "errorMessage", ".", "append", "(", "'", "'", ")", ";", "errorMessage", ".", "append", "(", "newCommandLineArgs", "[", "index", "+", "1", "]", ")", ";", "}", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "errorMessage", ".", "toString", "(", ")", ")", ")", ";", "}", "mode", "=", "INSIDE_ENDORSED_DIRS", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-progress\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "this", ".", "showProgress", "=", "true", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "startsWith", "(", "\"\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "int", "length", "=", "currentArg", ".", "length", "(", ")", ";", "if", "(", "length", ">", "15", ")", "{", "if", "(", "currentArg", ".", "equals", "(", "\"\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_FatalOptionalError", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "}", "else", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_FatalOptionalError", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "}", "this", ".", "proceedOnError", "=", "true", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-time\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "this", ".", "timing", "=", "TIMING_ENABLED", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-time:detail\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "this", ".", "timing", "=", "TIMING_ENABLED", "|", "TIMING_DETAILED", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-version\"", ")", "||", "currentArg", ".", "equals", "(", "\"-v\"", ")", ")", "{", "this", ".", "logger", ".", "logVersion", "(", "true", ")", ";", "this", ".", "proceed", "=", "false", ";", "return", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-showversion\"", ")", ")", "{", "printVersionRequired", "=", "true", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "\"-deprecation\"", ".", "equals", "(", "currentArg", ")", ")", "{", "didSpecifyDeprecation", "=", "true", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeprecation", ",", "CompilerOptions", ".", "WARNING", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-help\"", ")", "||", "currentArg", ".", "equals", "(", "\"-?\"", ")", ")", "{", "printUsageRequired", "=", "true", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-help:warn\"", ")", "||", "currentArg", ".", "equals", "(", "\"-?:warn\"", ")", ")", "{", "printUsageRequired", "=", "true", ";", "usageSection", "=", "\"\"", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-noExit\"", ")", ")", "{", "this", ".", "systemExitWhenFinished", "=", "false", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-verbose\"", ")", ")", "{", "this", ".", "verbose", "=", "true", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"\"", ")", ")", "{", "this", ".", "produceRefInfo", "=", "true", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-inlineJSR\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_InlineJsr", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "startsWith", "(", "\"-g\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "String", "debugOption", "=", "currentArg", ";", "int", "length", "=", "currentArg", ".", "length", "(", ")", ";", "if", "(", "length", "==", "2", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_LocalVariableAttribute", ",", "CompilerOptions", ".", "GENERATE", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_LineNumberAttribute", ",", "CompilerOptions", ".", "GENERATE", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_SourceFileAttribute", ",", "CompilerOptions", ".", "GENERATE", ")", ";", "continue", ";", "}", "if", "(", "length", ">", "3", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_LocalVariableAttribute", ",", "CompilerOptions", ".", "DO_NOT_GENERATE", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_LineNumberAttribute", ",", "CompilerOptions", ".", "DO_NOT_GENERATE", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_SourceFileAttribute", ",", "CompilerOptions", ".", "DO_NOT_GENERATE", ")", ";", "if", "(", "length", "==", "7", "&&", "debugOption", ".", "equals", "(", "\"-g:\"", "+", "NONE", ")", ")", "continue", ";", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "debugOption", ".", "substring", "(", "3", ",", "debugOption", ".", "length", "(", ")", ")", ",", "\",\"", ")", ";", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "{", "String", "token", "=", "tokenizer", ".", "nextToken", "(", ")", ";", "if", "(", "token", ".", "equals", "(", "\"vars\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_LocalVariableAttribute", ",", "CompilerOptions", ".", "GENERATE", ")", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"lines\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_LineNumberAttribute", ",", "CompilerOptions", ".", "GENERATE", ")", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"source\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_SourceFileAttribute", ",", "CompilerOptions", ".", "GENERATE", ")", ";", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "debugOption", ")", ")", ";", "}", "}", "continue", ";", "}", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "debugOption", ")", ")", ";", "}", "if", "(", "currentArg", ".", "startsWith", "(", "\"-nowarn\"", ")", ")", "{", "disableWarnings", "(", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "startsWith", "(", "\"-warn\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "String", "warningOption", "=", "currentArg", ";", "int", "length", "=", "currentArg", ".", "length", "(", ")", ";", "if", "(", "length", "==", "10", "&&", "warningOption", ".", "equals", "(", "\"-warn:\"", "+", "NONE", ")", ")", "{", "disableWarnings", "(", ")", ";", "continue", ";", "}", "if", "(", "length", "<=", "6", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "warningOption", ")", ")", ";", "}", "int", "warnTokenStart", ";", "boolean", "isEnabling", ",", "allowPlusOrMinus", ";", "switch", "(", "warningOption", ".", "charAt", "(", "6", ")", ")", "{", "case", "'+'", ":", "warnTokenStart", "=", "7", ";", "isEnabling", "=", "true", ";", "allowPlusOrMinus", "=", "true", ";", "break", ";", "case", "'-'", ":", "warnTokenStart", "=", "7", ";", "isEnabling", "=", "false", ";", "allowPlusOrMinus", "=", "true", ";", "break", ";", "default", ":", "disableWarnings", "(", ")", ";", "warnTokenStart", "=", "6", ";", "isEnabling", "=", "true", ";", "allowPlusOrMinus", "=", "false", ";", "}", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "warningOption", ".", "substring", "(", "warnTokenStart", ",", "warningOption", ".", "length", "(", ")", ")", ",", "\",\"", ")", ";", "int", "tokenCounter", "=", "0", ";", "if", "(", "didSpecifyDeprecation", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeprecation", ",", "CompilerOptions", ".", "WARNING", ")", ";", "}", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "{", "String", "token", "=", "tokenizer", ".", "nextToken", "(", ")", ";", "tokenCounter", "++", ";", "switch", "(", "token", ".", "charAt", "(", "0", ")", ")", "{", "case", "'+'", ":", "if", "(", "allowPlusOrMinus", ")", "{", "isEnabling", "=", "true", ";", "token", "=", "token", ".", "substring", "(", "1", ")", ";", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "token", ")", ")", ";", "}", "break", ";", "case", "'-'", ":", "if", "(", "allowPlusOrMinus", ")", "{", "isEnabling", "=", "false", ";", "token", "=", "token", ".", "substring", "(", "1", ")", ";", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "token", ")", ")", ";", "}", "}", "handleWarningToken", "(", "token", ",", "isEnabling", ")", ";", "}", "if", "(", "tokenCounter", "==", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "continue", ";", "}", "if", "(", "currentArg", ".", "startsWith", "(", "\"-err\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "String", "errorOption", "=", "currentArg", ";", "int", "length", "=", "currentArg", ".", "length", "(", ")", ";", "if", "(", "length", "<=", "5", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "errorOption", ")", ")", ";", "}", "int", "errorTokenStart", ";", "boolean", "isEnabling", ",", "allowPlusOrMinus", ";", "switch", "(", "errorOption", ".", "charAt", "(", "5", ")", ")", "{", "case", "'+'", ":", "errorTokenStart", "=", "6", ";", "isEnabling", "=", "true", ";", "allowPlusOrMinus", "=", "true", ";", "break", ";", "case", "'-'", ":", "errorTokenStart", "=", "6", ";", "isEnabling", "=", "false", ";", "allowPlusOrMinus", "=", "true", ";", "break", ";", "default", ":", "disableErrors", "(", ")", ";", "errorTokenStart", "=", "5", ";", "isEnabling", "=", "true", ";", "allowPlusOrMinus", "=", "false", ";", "}", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "errorOption", ".", "substring", "(", "errorTokenStart", ",", "errorOption", ".", "length", "(", ")", ")", ",", "\",\"", ")", ";", "int", "tokenCounter", "=", "0", ";", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "{", "String", "token", "=", "tokenizer", ".", "nextToken", "(", ")", ";", "tokenCounter", "++", ";", "switch", "(", "token", ".", "charAt", "(", "0", ")", ")", "{", "case", "'+'", ":", "if", "(", "allowPlusOrMinus", ")", "{", "isEnabling", "=", "true", ";", "token", "=", "token", ".", "substring", "(", "1", ")", ";", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "token", ")", ")", ";", "}", "break", ";", "case", "'-'", ":", "if", "(", "allowPlusOrMinus", ")", "{", "isEnabling", "=", "false", ";", "token", "=", "token", ".", "substring", "(", "1", ")", ";", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "token", ")", ")", ";", "}", "break", ";", "}", "handleErrorToken", "(", "token", ",", "isEnabling", ")", ";", "}", "if", "(", "tokenCounter", "==", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-target\"", ")", ")", "{", "mode", "=", "INSIDE_TARGET", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_PreserveUnusedLocal", ",", "CompilerOptions", ".", "PRESERVE", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "this", ".", "enableJavadocOn", "=", "true", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-Xemacs\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "this", ".", "logger", ".", "setEmacs", "(", ")", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "startsWith", "(", "\"-A\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"\"", ")", ")", "{", "mode", "=", "INSIDE_PROCESSOR_PATH_start", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-processor\"", ")", ")", "{", "mode", "=", "INSIDE_PROCESSOR_start", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-proc:only\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_GenerateClassFiles", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-proc:none\"", ")", ")", "{", "didSpecifyDisabledAnnotationProcessing", "=", "true", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Process_Annotations", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-s\"", ")", ")", "{", "mode", "=", "INSIDE_S_start", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"\"", ")", "||", "currentArg", ".", "equals", "(", "\"\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "startsWith", "(", "\"-X\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "startsWith", "(", "\"-J\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-O\"", ")", ")", "{", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-classNames\"", ")", ")", "{", "mode", "=", "INSIDE_CLASS_NAMES", ";", "continue", ";", "}", "if", "(", "currentArg", ".", "equals", "(", "\"-properties\"", ")", ")", "{", "mode", "=", "INSIDE_WARNINGS_PROPERTIES", ";", "continue", ";", "}", "break", ";", "case", "INSIDE_TARGET", ":", "if", "(", "this", ".", "didSpecifyTarget", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "this", ".", "didSpecifyTarget", "=", "true", ";", "if", "(", "currentArg", ".", "equals", "(", "\"1.1\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_1", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"1.2\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_2", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"1.3\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"1.4\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"1.5\"", ")", "||", "currentArg", ".", "equals", "(", "\"5\"", ")", "||", "currentArg", ".", "equals", "(", "\"5.0\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_5", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"1.6\"", ")", "||", "currentArg", ".", "equals", "(", "\"6\"", ")", "||", "currentArg", ".", "equals", "(", "\"6.0\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"1.7\"", ")", "||", "currentArg", ".", "equals", "(", "\"7\"", ")", "||", "currentArg", ".", "equals", "(", "\"7.0\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_7", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"jsr14\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_JSR14", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"cldc1.1\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_CLDC1_1", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_InlineJsr", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_LOG", ":", "this", ".", "log", "=", "currentArg", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_REPETITION", ":", "try", "{", "this", ".", "maxRepetition", "=", "Integer", ".", "parseInt", "(", "currentArg", ")", ";", "if", "(", "this", ".", "maxRepetition", "<=", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_MAX_PROBLEMS", ":", "try", "{", "this", ".", "maxProblems", "=", "Integer", ".", "parseInt", "(", "currentArg", ")", ";", "if", "(", "this", ".", "maxProblems", "<=", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_MaxProblemPerUnit", ",", "currentArg", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_SOURCE", ":", "if", "(", "this", ".", "didSpecifySource", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "this", ".", "didSpecifySource", "=", "true", ";", "if", "(", "currentArg", ".", "equals", "(", "\"1.3\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"1.4\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"1.5\"", ")", "||", "currentArg", ".", "equals", "(", "\"5\"", ")", "||", "currentArg", ".", "equals", "(", "\"5.0\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_5", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"1.6\"", ")", "||", "currentArg", ".", "equals", "(", "\"6\"", ")", "||", "currentArg", ".", "equals", "(", "\"6.0\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ";", "}", "else", "if", "(", "currentArg", ".", "equals", "(", "\"1.7\"", ")", "||", "currentArg", ".", "equals", "(", "\"7\"", ")", "||", "currentArg", ".", "equals", "(", "\"7.0\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_7", ")", ";", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_DEFAULT_ENCODING", ":", "if", "(", "specifiedEncodings", "!=", "null", ")", "{", "if", "(", "!", "specifiedEncodings", ".", "contains", "(", "currentArg", ")", ")", "{", "if", "(", "specifiedEncodings", ".", "size", "(", ")", ">", "1", ")", "{", "this", ".", "logger", ".", "logWarning", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ",", "getAllEncodings", "(", "specifiedEncodings", ")", ")", ")", ";", "}", "else", "{", "this", ".", "logger", ".", "logWarning", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ",", "getAllEncodings", "(", "specifiedEncodings", ")", ")", ")", ";", "}", "}", "}", "else", "{", "specifiedEncodings", "=", "new", "HashSet", "(", ")", ";", "}", "try", "{", "new", "InputStreamReader", "(", "new", "ByteArrayInputStream", "(", "new", "byte", "[", "0", "]", ")", ",", "currentArg", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "specifiedEncodings", ".", "add", "(", "currentArg", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Encoding", ",", "currentArg", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_DESTINATION_PATH", ":", "setDestinationPath", "(", "currentArg", ".", "equals", "(", "NONE", ")", "?", "NONE", ":", "currentArg", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_CLASSPATH_start", ":", "mode", "=", "DEFAULT", ";", "index", "+=", "processPaths", "(", "newCommandLineArgs", ",", "index", ",", "currentArg", ",", "classpaths", ")", ";", "continue", ";", "case", "INSIDE_BOOTCLASSPATH_start", ":", "mode", "=", "DEFAULT", ";", "index", "+=", "processPaths", "(", "newCommandLineArgs", ",", "index", ",", "currentArg", ",", "bootclasspaths", ")", ";", "continue", ";", "case", "INSIDE_SOURCE_PATH_start", ":", "mode", "=", "DEFAULT", ";", "String", "[", "]", "sourcePaths", "=", "new", "String", "[", "1", "]", ";", "index", "+=", "processPaths", "(", "newCommandLineArgs", ",", "index", ",", "currentArg", ",", "sourcePaths", ")", ";", "sourcepathClasspathArg", "=", "sourcePaths", "[", "0", "]", ";", "continue", ";", "case", "INSIDE_EXT_DIRS", ":", "if", "(", "currentArg", ".", "indexOf", "(", "\"[-d\"", ")", "!=", "-", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "\"-extdir\"", ")", ")", ";", "}", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "currentArg", ",", "File", ".", "pathSeparator", ",", "false", ")", ";", "extdirsClasspaths", "=", "new", "ArrayList", "(", "DEFAULT_SIZE_CLASSPATH", ")", ";", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "extdirsClasspaths", ".", "add", "(", "tokenizer", ".", "nextToken", "(", ")", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_ENDORSED_DIRS", ":", "if", "(", "currentArg", ".", "indexOf", "(", "\"[-d\"", ")", "!=", "-", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "\"\"", ")", ")", ";", "}", "tokenizer", "=", "new", "StringTokenizer", "(", "currentArg", ",", "File", ".", "pathSeparator", ",", "false", ")", ";", "endorsedDirClasspaths", "=", "new", "ArrayList", "(", "DEFAULT_SIZE_CLASSPATH", ")", ";", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "endorsedDirClasspaths", ".", "add", "(", "tokenizer", ".", "nextToken", "(", ")", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_SOURCE_DIRECTORY_DESTINATION_PATH", ":", "if", "(", "currentArg", ".", "endsWith", "(", "\"]\"", ")", ")", "{", "customDestinationPath", "=", "currentArg", ".", "substring", "(", "0", ",", "currentArg", ".", "length", "(", ")", "-", "1", ")", ";", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "\"[-d", "\"", "+", "currentArg", ")", ")", ";", "}", "break", ";", "case", "INSIDE_PROCESSOR_PATH_start", ":", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_PROCESSOR_start", ":", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_S_start", ":", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_CLASS_NAMES", ":", "tokenizer", "=", "new", "StringTokenizer", "(", "currentArg", ",", "\",\"", ")", ";", "if", "(", "this", ".", "classNames", "==", "null", ")", "{", "this", ".", "classNames", "=", "new", "String", "[", "DEFAULT_SIZE_CLASSPATH", "]", ";", "}", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "{", "if", "(", "this", ".", "classNames", ".", "length", "==", "classCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "classNames", ",", "0", ",", "(", "this", ".", "classNames", "=", "new", "String", "[", "classCount", "*", "2", "]", ")", ",", "0", ",", "classCount", ")", ";", "}", "this", ".", "classNames", "[", "classCount", "++", "]", "=", "tokenizer", ".", "nextToken", "(", ")", ";", "}", "mode", "=", "DEFAULT", ";", "continue", ";", "case", "INSIDE_WARNINGS_PROPERTIES", ":", "initializeWarnings", "(", "currentArg", ")", ";", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "customDestinationPath", "==", "null", ")", "{", "if", "(", "File", ".", "separatorChar", "!=", "'/'", ")", "{", "currentArg", "=", "currentArg", ".", "replace", "(", "'/'", ",", "File", ".", "separatorChar", ")", ";", "}", "if", "(", "currentArg", ".", "endsWith", "(", "\"[-d\"", ")", ")", "{", "currentSourceDirectory", "=", "currentArg", ".", "substring", "(", "0", ",", "currentArg", ".", "length", "(", ")", "-", "3", ")", ";", "mode", "=", "INSIDE_SOURCE_DIRECTORY_DESTINATION_PATH", ";", "continue", ";", "}", "currentSourceDirectory", "=", "currentArg", ";", "}", "File", "dir", "=", "new", "File", "(", "currentSourceDirectory", ")", ";", "if", "(", "!", "dir", ".", "isDirectory", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentSourceDirectory", ")", ")", ";", "}", "String", "[", "]", "result", "=", "FileFinder", ".", "find", "(", "dir", ",", "SuffixConstants", ".", "SUFFIX_STRING_JAVA", ")", ";", "if", "(", "NONE", ".", "equals", "(", "customDestinationPath", ")", ")", "{", "customDestinationPath", "=", "NONE", ";", "}", "if", "(", "this", ".", "filenames", "!=", "null", ")", "{", "int", "length", "=", "result", ".", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "filenames", ",", "0", ",", "(", "this", ".", "filenames", "=", "new", "String", "[", "length", "+", "filesCount", "]", ")", ",", "0", ",", "filesCount", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "encodings", ",", "0", ",", "(", "this", ".", "encodings", "=", "new", "String", "[", "length", "+", "filesCount", "]", ")", ",", "0", ",", "filesCount", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "destinationPaths", ",", "0", ",", "(", "this", ".", "destinationPaths", "=", "new", "String", "[", "length", "+", "filesCount", "]", ")", ",", "0", ",", "filesCount", ")", ";", "System", ".", "arraycopy", "(", "result", ",", "0", ",", "this", ".", "filenames", ",", "filesCount", ",", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "this", ".", "encodings", "[", "filesCount", "+", "i", "]", "=", "customEncoding", ";", "this", ".", "destinationPaths", "[", "filesCount", "+", "i", "]", "=", "customDestinationPath", ";", "}", "filesCount", "+=", "length", ";", "customEncoding", "=", "null", ";", "customDestinationPath", "=", "null", ";", "currentSourceDirectory", "=", "null", ";", "}", "else", "{", "this", ".", "filenames", "=", "result", ";", "filesCount", "=", "this", ".", "filenames", ".", "length", ";", "this", ".", "encodings", "=", "new", "String", "[", "filesCount", "]", ";", "this", ".", "destinationPaths", "=", "new", "String", "[", "filesCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "filesCount", ";", "i", "++", ")", "{", "this", ".", "encodings", "[", "i", "]", "=", "customEncoding", ";", "this", ".", "destinationPaths", "[", "i", "]", "=", "customDestinationPath", ";", "}", "customEncoding", "=", "null", ";", "customDestinationPath", "=", "null", ";", "currentSourceDirectory", "=", "null", ";", "}", "mode", "=", "DEFAULT", ";", "continue", ";", "}", "if", "(", "this", ".", "enableJavadocOn", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_DocCommentSupport", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "}", "else", "if", "(", "this", ".", "warnJavadocOn", "||", "this", ".", "warnAllJavadocOn", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_DocCommentSupport", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedParameterIncludeDocCommentReference", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedDeclaredThrownExceptionIncludeDocCommentReference", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "}", "if", "(", "this", ".", "warnJavadocOn", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportInvalidJavadocTags", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportInvalidJavadocTagsDeprecatedRef", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportInvalidJavadocTagsNotVisibleRef", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocTagsVisibility", ",", "CompilerOptions", ".", "PRIVATE", ")", ";", "}", "if", "(", "encounteredGroovySourceFile", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_BuildGroovyFiles", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "}", "else", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_BuildGroovyFiles", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "}", "if", "(", "printUsageRequired", "||", "(", "filesCount", "==", "0", "&&", "classCount", "==", "0", ")", ")", "{", "if", "(", "usageSection", "==", "null", ")", "{", "printUsage", "(", ")", ";", "}", "else", "{", "printUsage", "(", "usageSection", ")", ";", "}", "this", ".", "proceed", "=", "false", ";", "return", ";", "}", "if", "(", "this", ".", "log", "!=", "null", ")", "{", "this", ".", "logger", ".", "setLog", "(", "this", ".", "log", ")", ";", "}", "else", "{", "this", ".", "showProgress", "=", "false", ";", "}", "this", ".", "logger", ".", "logVersion", "(", "printVersionRequired", ")", ";", "validateOptions", "(", "didSpecifyCompliance", ")", ";", "if", "(", "!", "didSpecifyDisabledAnnotationProcessing", "&&", "CompilerOptions", ".", "versionToJdkLevel", "(", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Compliance", ")", ")", ">=", "ClassFileConstants", ".", "JDK1_6", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Process_Annotations", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "}", "this", ".", "logger", ".", "logCommandLineArguments", "(", "newCommandLineArgs", ")", ";", "this", ".", "logger", ".", "logOptions", "(", "this", ".", "options", ")", ";", "if", "(", "this", ".", "maxRepetition", "==", "0", ")", "{", "this", ".", "maxRepetition", "=", "1", ";", "}", "if", "(", "this", ".", "maxRepetition", ">=", "3", "&&", "(", "this", ".", "timing", "&", "TIMING_ENABLED", ")", "!=", "0", ")", "{", "this", ".", "compilerStats", "=", "new", "CompilerStats", "[", "this", ".", "maxRepetition", "]", ";", "}", "if", "(", "filesCount", "!=", "0", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "filenames", ",", "0", ",", "(", "this", ".", "filenames", "=", "new", "String", "[", "filesCount", "]", ")", ",", "0", ",", "filesCount", ")", ";", "}", "if", "(", "classCount", "!=", "0", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "classNames", ",", "0", ",", "(", "this", ".", "classNames", "=", "new", "String", "[", "classCount", "]", ")", ",", "0", ",", "classCount", ")", ";", "}", "setPaths", "(", "bootclasspaths", ",", "sourcepathClasspathArg", ",", "sourcepathClasspaths", ",", "classpaths", ",", "extdirsClasspaths", ",", "endorsedDirClasspaths", ",", "customEncoding", ")", ";", "if", "(", "specifiedEncodings", "!=", "null", "&&", "specifiedEncodings", ".", "size", "(", ")", ">", "1", ")", "{", "this", ".", "logger", ".", "logWarning", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Encoding", ")", ",", "getAllEncodings", "(", "specifiedEncodings", ")", ")", ")", ";", "}", "if", "(", "this", ".", "pendingErrors", "!=", "null", ")", "{", "for", "(", "Iterator", "iterator", "=", "this", ".", "pendingErrors", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "String", "message", "=", "(", "String", ")", "iterator", ".", "next", "(", ")", ";", "this", ".", "logger", ".", "logPendingError", "(", "message", ")", ";", "}", "this", ".", "pendingErrors", "=", "null", ";", "}", "}", "private", "static", "String", "getAllEncodings", "(", "Set", "encodings", ")", "{", "int", "size", "=", "encodings", ".", "size", "(", ")", ";", "String", "[", "]", "allEncodings", "=", "new", "String", "[", "size", "]", ";", "encodings", ".", "toArray", "(", "allEncodings", ")", ";", "Arrays", ".", "sort", "(", "allEncodings", ")", ";", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "buffer", ".", "append", "(", "\",", "\"", ")", ";", "}", "buffer", ".", "append", "(", "allEncodings", "[", "i", "]", ")", ";", "}", "return", "String", ".", "valueOf", "(", "buffer", ")", ";", "}", "private", "void", "initializeWarnings", "(", "String", "propertiesFile", ")", "{", "File", "file", "=", "new", "File", "(", "propertiesFile", ")", ";", "if", "(", "!", "file", ".", "exists", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "propertiesFile", ")", ")", ";", "}", "BufferedInputStream", "stream", "=", "null", ";", "Properties", "properties", "=", "null", ";", "try", "{", "stream", "=", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "propertiesFile", ")", ")", ";", "properties", "=", "new", "Properties", "(", ")", ";", "properties", ".", "load", "(", "stream", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "propertiesFile", ")", ")", ";", "}", "finally", "{", "if", "(", "stream", "!=", "null", ")", "{", "try", "{", "stream", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "for", "(", "Iterator", "iterator", "=", "properties", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "iterator", ".", "hasNext", "(", ")", ";", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "iterator", ".", "next", "(", ")", ";", "final", "String", "key", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "if", "(", "key", ".", "startsWith", "(", "\"\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "key", ",", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "}", "protected", "void", "disableWarnings", "(", ")", "{", "Object", "[", "]", "entries", "=", "this", ".", "options", ".", "entrySet", "(", ")", ".", "toArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "entries", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", "[", "i", "]", ";", "if", "(", "!", "(", "entry", ".", "getKey", "(", ")", "instanceof", "String", ")", ")", "continue", ";", "if", "(", "!", "(", "entry", ".", "getValue", "(", ")", "instanceof", "String", ")", ")", "continue", ";", "if", "(", "(", "(", "String", ")", "entry", ".", "getValue", "(", ")", ")", ".", "equals", "(", "CompilerOptions", ".", "WARNING", ")", ")", "{", "this", ".", "options", ".", "put", "(", "entry", ".", "getKey", "(", ")", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "}", "}", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TaskTags", ",", "Util", ".", "EMPTY_STRING", ")", ";", "}", "protected", "void", "disableErrors", "(", ")", "{", "Object", "[", "]", "entries", "=", "this", ".", "options", ".", "entrySet", "(", ")", ".", "toArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "entries", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", "[", "i", "]", ";", "if", "(", "!", "(", "entry", ".", "getKey", "(", ")", "instanceof", "String", ")", ")", "continue", ";", "if", "(", "!", "(", "entry", ".", "getValue", "(", ")", "instanceof", "String", ")", ")", "continue", ";", "if", "(", "(", "(", "String", ")", "entry", ".", "getValue", "(", ")", ")", ".", "equals", "(", "CompilerOptions", ".", "ERROR", ")", ")", "{", "this", ".", "options", ".", "put", "(", "entry", ".", "getKey", "(", ")", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "}", "}", "}", "public", "String", "extractDestinationPathFromSourceFile", "(", "CompilationResult", "result", ")", "{", "ICompilationUnit", "compilationUnit", "=", "result", ".", "compilationUnit", ";", "if", "(", "compilationUnit", "!=", "null", ")", "{", "char", "[", "]", "fileName", "=", "compilationUnit", ".", "getFileName", "(", ")", ";", "int", "lastIndex", "=", "CharOperation", ".", "lastIndexOf", "(", "java", ".", "io", ".", "File", ".", "separatorChar", ",", "fileName", ")", ";", "if", "(", "lastIndex", "!=", "-", "1", ")", "{", "final", "String", "outputPathName", "=", "new", "String", "(", "fileName", ",", "0", ",", "lastIndex", ")", ";", "final", "File", "output", "=", "new", "File", "(", "outputPathName", ")", ";", "if", "(", "output", ".", "exists", "(", ")", "&&", "output", ".", "isDirectory", "(", ")", ")", "{", "return", "outputPathName", ";", "}", "}", "}", "return", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ";", "}", "public", "ICompilerRequestor", "getBatchRequestor", "(", ")", "{", "return", "new", "ICompilerRequestor", "(", ")", "{", "int", "lineDelta", "=", "0", ";", "public", "void", "acceptResult", "(", "CompilationResult", "compilationResult", ")", "{", "if", "(", "compilationResult", ".", "lineSeparatorPositions", "!=", "null", ")", "{", "int", "unitLineCount", "=", "compilationResult", ".", "lineSeparatorPositions", ".", "length", ";", "this", ".", "lineDelta", "+=", "unitLineCount", ";", "if", "(", "Main", ".", "this", ".", "showProgress", "&&", "this", ".", "lineDelta", ">", "2000", ")", "{", "Main", ".", "this", ".", "logger", ".", "logProgress", "(", ")", ";", "this", ".", "lineDelta", "=", "0", ";", "}", "}", "Main", ".", "this", ".", "logger", ".", "startLoggingSource", "(", "compilationResult", ")", ";", "if", "(", "compilationResult", ".", "hasProblems", "(", ")", "||", "compilationResult", ".", "hasTasks", "(", ")", ")", "{", "Main", ".", "this", ".", "logger", ".", "logProblems", "(", "compilationResult", ".", "getAllProblems", "(", ")", ",", "compilationResult", ".", "compilationUnit", ".", "getContents", "(", ")", ",", "Main", ".", "this", ")", ";", "}", "outputClassFiles", "(", "compilationResult", ")", ";", "Main", ".", "this", ".", "logger", ".", "endLoggingSource", "(", ")", ";", "}", "}", ";", "}", "public", "CompilationUnit", "[", "]", "getCompilationUnits", "(", ")", "{", "int", "fileCount", "=", "this", ".", "filenames", ".", "length", ";", "CompilationUnit", "[", "]", "units", "=", "new", "CompilationUnit", "[", "fileCount", "]", ";", "HashtableOfObject", "knownFileNames", "=", "new", "HashtableOfObject", "(", "fileCount", ")", ";", "String", "defaultEncoding", "=", "(", "String", ")", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Encoding", ")", ";", "if", "(", "Util", ".", "EMPTY_STRING", ".", "equals", "(", "defaultEncoding", ")", ")", "defaultEncoding", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fileCount", ";", "i", "++", ")", "{", "char", "[", "]", "charName", "=", "this", ".", "filenames", "[", "i", "]", ".", "toCharArray", "(", ")", ";", "if", "(", "knownFileNames", ".", "get", "(", "charName", ")", "!=", "null", ")", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"unit.more\"", ",", "this", ".", "filenames", "[", "i", "]", ")", ")", ";", "knownFileNames", ".", "put", "(", "charName", ",", "charName", ")", ";", "File", "file", "=", "new", "File", "(", "this", ".", "filenames", "[", "i", "]", ")", ";", "if", "(", "!", "file", ".", "exists", "(", ")", ")", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"unit.missing\"", ",", "this", ".", "filenames", "[", "i", "]", ")", ")", ";", "String", "encoding", "=", "this", ".", "encodings", "[", "i", "]", ";", "if", "(", "encoding", "==", "null", ")", "encoding", "=", "defaultEncoding", ";", "units", "[", "i", "]", "=", "new", "CompilationUnit", "(", "null", ",", "this", ".", "filenames", "[", "i", "]", ",", "encoding", ",", "this", ".", "destinationPaths", "[", "i", "]", ")", ";", "}", "return", "units", ";", "}", "public", "IErrorHandlingPolicy", "getHandlingPolicy", "(", ")", "{", "return", "new", "IErrorHandlingPolicy", "(", ")", "{", "public", "boolean", "proceedOnErrors", "(", ")", "{", "return", "Main", ".", "this", ".", "proceedOnError", ";", "}", "public", "boolean", "stopOnFirstError", "(", ")", "{", "return", "false", ";", "}", "}", ";", "}", "public", "File", "getJavaHome", "(", ")", "{", "if", "(", "!", "this", ".", "javaHomeChecked", ")", "{", "this", ".", "javaHomeChecked", "=", "true", ";", "this", ".", "javaHomeCache", "=", "Util", ".", "getJavaHome", "(", ")", ";", "}", "return", "this", ".", "javaHomeCache", ";", "}", "public", "FileSystem", "getLibraryAccess", "(", ")", "{", "return", "new", "FileSystem", "(", "this", ".", "checkedClasspaths", ",", "this", ".", "filenames", ")", ";", "}", "public", "IProblemFactory", "getProblemFactory", "(", ")", "{", "return", "new", "DefaultProblemFactory", "(", "this", ".", "compilerLocale", ")", ";", "}", "protected", "ArrayList", "handleBootclasspath", "(", "ArrayList", "bootclasspaths", ",", "String", "customEncoding", ")", "{", "final", "int", "bootclasspathsSize", "=", "bootclasspaths", "==", "null", "?", "0", ":", "bootclasspaths", ".", "size", "(", ")", ";", "if", "(", "bootclasspathsSize", "!=", "0", ")", "{", "String", "[", "]", "paths", "=", "new", "String", "[", "bootclasspathsSize", "]", ";", "bootclasspaths", ".", "toArray", "(", "paths", ")", ";", "bootclasspaths", ".", "clear", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bootclasspathsSize", ";", "i", "++", ")", "{", "processPathEntries", "(", "DEFAULT_SIZE_CLASSPATH", ",", "bootclasspaths", ",", "paths", "[", "i", "]", ",", "customEncoding", ",", "false", ",", "true", ")", ";", "}", "}", "else", "{", "bootclasspaths", "=", "new", "ArrayList", "(", "DEFAULT_SIZE_CLASSPATH", ")", ";", "try", "{", "Util", ".", "collectRunningVMBootclasspath", "(", "bootclasspaths", ")", ";", "}", "catch", "(", "IllegalStateException", "e", ")", "{", "this", ".", "logger", ".", "logWrongJDK", "(", ")", ";", "this", ".", "proceed", "=", "false", ";", "return", "null", ";", "}", "}", "return", "bootclasspaths", ";", "}", "protected", "ArrayList", "handleClasspath", "(", "ArrayList", "classpaths", ",", "String", "customEncoding", ")", "{", "final", "int", "classpathsSize", "=", "classpaths", "==", "null", "?", "0", ":", "classpaths", ".", "size", "(", ")", ";", "if", "(", "classpathsSize", "!=", "0", ")", "{", "String", "[", "]", "paths", "=", "new", "String", "[", "classpathsSize", "]", ";", "classpaths", ".", "toArray", "(", "paths", ")", ";", "classpaths", ".", "clear", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classpathsSize", ";", "i", "++", ")", "{", "processPathEntries", "(", "DEFAULT_SIZE_CLASSPATH", ",", "classpaths", ",", "paths", "[", "i", "]", ",", "customEncoding", ",", "false", ",", "true", ")", ";", "}", "}", "else", "{", "classpaths", "=", "new", "ArrayList", "(", "DEFAULT_SIZE_CLASSPATH", ")", ";", "String", "classProp", "=", "System", ".", "getProperty", "(", "\"\"", ")", ";", "if", "(", "(", "classProp", "==", "null", ")", "||", "(", "classProp", ".", "length", "(", ")", "==", "0", ")", ")", "{", "addPendingErrors", "(", "this", ".", "bind", "(", "\"\"", ")", ")", ";", "final", "Classpath", "classpath", "=", "FileSystem", ".", "getClasspath", "(", "System", ".", "getProperty", "(", "\"user.dir\"", ")", ",", "customEncoding", ",", "null", ")", ";", "if", "(", "classpath", "!=", "null", ")", "{", "classpaths", ".", "add", "(", "classpath", ")", ";", "}", "}", "else", "{", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "classProp", ",", "File", ".", "pathSeparator", ")", ";", "String", "token", ";", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "{", "token", "=", "tokenizer", ".", "nextToken", "(", ")", ";", "FileSystem", ".", "Classpath", "currentClasspath", "=", "FileSystem", ".", "getClasspath", "(", "token", ",", "customEncoding", ",", "null", ")", ";", "if", "(", "currentClasspath", "!=", "null", ")", "{", "classpaths", ".", "add", "(", "currentClasspath", ")", ";", "}", "else", "if", "(", "token", ".", "length", "(", ")", "!=", "0", ")", "{", "addPendingErrors", "(", "this", ".", "bind", "(", "\"\"", ",", "token", ")", ")", ";", "}", "}", "}", "}", "ArrayList", "result", "=", "new", "ArrayList", "(", ")", ";", "HashMap", "knownNames", "=", "new", "HashMap", "(", ")", ";", "FileSystem", ".", "ClasspathSectionProblemReporter", "problemReporter", "=", "new", "FileSystem", ".", "ClasspathSectionProblemReporter", "(", ")", "{", "public", "void", "invalidClasspathSection", "(", "String", "jarFilePath", ")", "{", "addPendingErrors", "(", "bind", "(", "\"\"", ",", "jarFilePath", ")", ")", ";", "}", "public", "void", "multipleClasspathSections", "(", "String", "jarFilePath", ")", "{", "addPendingErrors", "(", "bind", "(", "\"\"", ",", "jarFilePath", ")", ")", ";", "}", "}", ";", "while", "(", "!", "classpaths", ".", "isEmpty", "(", ")", ")", "{", "Classpath", "current", "=", "(", "Classpath", ")", "classpaths", ".", "remove", "(", "0", ")", ";", "String", "currentPath", "=", "current", ".", "getPath", "(", ")", ";", "if", "(", "knownNames", ".", "get", "(", "currentPath", ")", "==", "null", ")", "{", "knownNames", ".", "put", "(", "currentPath", ",", "current", ")", ";", "result", ".", "add", "(", "current", ")", ";", "List", "linkedJars", "=", "current", ".", "fetchLinkedJars", "(", "problemReporter", ")", ";", "if", "(", "linkedJars", "!=", "null", ")", "{", "classpaths", ".", "addAll", "(", "0", ",", "linkedJars", ")", ";", "}", "}", "}", "return", "result", ";", "}", "protected", "ArrayList", "handleEndorseddirs", "(", "ArrayList", "endorsedDirClasspaths", ")", "{", "final", "File", "javaHome", "=", "getJavaHome", "(", ")", ";", "if", "(", "endorsedDirClasspaths", "==", "null", ")", "{", "endorsedDirClasspaths", "=", "new", "ArrayList", "(", "DEFAULT_SIZE_CLASSPATH", ")", ";", "String", "endorsedDirsStr", "=", "System", ".", "getProperty", "(", "\"\"", ")", ";", "if", "(", "endorsedDirsStr", "==", "null", ")", "{", "if", "(", "javaHome", "!=", "null", ")", "{", "endorsedDirClasspaths", ".", "add", "(", "javaHome", ".", "getAbsolutePath", "(", ")", "+", "\"\"", ")", ";", "}", "}", "else", "{", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "endorsedDirsStr", ",", "File", ".", "pathSeparator", ")", ";", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "{", "endorsedDirClasspaths", ".", "add", "(", "tokenizer", ".", "nextToken", "(", ")", ")", ";", "}", "}", "}", "if", "(", "endorsedDirClasspaths", ".", "size", "(", ")", "!=", "0", ")", "{", "File", "[", "]", "directoriesToCheck", "=", "new", "File", "[", "endorsedDirClasspaths", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "directoriesToCheck", ".", "length", ";", "i", "++", ")", "directoriesToCheck", "[", "i", "]", "=", "new", "File", "(", "(", "String", ")", "endorsedDirClasspaths", ".", "get", "(", "i", ")", ")", ";", "endorsedDirClasspaths", ".", "clear", "(", ")", ";", "File", "[", "]", "[", "]", "endorsedDirsJars", "=", "getLibrariesFiles", "(", "directoriesToCheck", ")", ";", "if", "(", "endorsedDirsJars", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "endorsedDirsJars", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "File", "[", "]", "current", "=", "endorsedDirsJars", "[", "i", "]", ";", "if", "(", "current", "!=", "null", ")", "{", "for", "(", "int", "j", "=", "0", ",", "max2", "=", "current", ".", "length", ";", "j", "<", "max2", ";", "j", "++", ")", "{", "FileSystem", ".", "Classpath", "classpath", "=", "FileSystem", ".", "getClasspath", "(", "current", "[", "j", "]", ".", "getAbsolutePath", "(", ")", ",", "null", ",", "null", ")", ";", "if", "(", "classpath", "!=", "null", ")", "{", "endorsedDirClasspaths", ".", "add", "(", "classpath", ")", ";", "}", "}", "}", "else", "if", "(", "directoriesToCheck", "[", "i", "]", ".", "isFile", "(", ")", ")", "{", "addPendingErrors", "(", "this", ".", "bind", "(", "\"\"", ",", "directoriesToCheck", "[", "i", "]", ".", "getAbsolutePath", "(", ")", ")", ")", ";", "}", "}", "}", "}", "return", "endorsedDirClasspaths", ";", "}", "protected", "ArrayList", "handleExtdirs", "(", "ArrayList", "extdirsClasspaths", ")", "{", "final", "File", "javaHome", "=", "getJavaHome", "(", ")", ";", "if", "(", "extdirsClasspaths", "==", "null", ")", "{", "extdirsClasspaths", "=", "new", "ArrayList", "(", "DEFAULT_SIZE_CLASSPATH", ")", ";", "String", "extdirsStr", "=", "System", ".", "getProperty", "(", "\"\"", ")", ";", "if", "(", "extdirsStr", "==", "null", ")", "{", "extdirsClasspaths", ".", "add", "(", "javaHome", ".", "getAbsolutePath", "(", ")", "+", "\"/lib/ext\"", ")", ";", "}", "else", "{", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "extdirsStr", ",", "File", ".", "pathSeparator", ")", ";", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "extdirsClasspaths", ".", "add", "(", "tokenizer", ".", "nextToken", "(", ")", ")", ";", "}", "}", "if", "(", "extdirsClasspaths", ".", "size", "(", ")", "!=", "0", ")", "{", "File", "[", "]", "directoriesToCheck", "=", "new", "File", "[", "extdirsClasspaths", ".", "size", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "directoriesToCheck", ".", "length", ";", "i", "++", ")", "directoriesToCheck", "[", "i", "]", "=", "new", "File", "(", "(", "String", ")", "extdirsClasspaths", ".", "get", "(", "i", ")", ")", ";", "extdirsClasspaths", ".", "clear", "(", ")", ";", "File", "[", "]", "[", "]", "extdirsJars", "=", "getLibrariesFiles", "(", "directoriesToCheck", ")", ";", "if", "(", "extdirsJars", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "extdirsJars", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "File", "[", "]", "current", "=", "extdirsJars", "[", "i", "]", ";", "if", "(", "current", "!=", "null", ")", "{", "for", "(", "int", "j", "=", "0", ",", "max2", "=", "current", ".", "length", ";", "j", "<", "max2", ";", "j", "++", ")", "{", "FileSystem", ".", "Classpath", "classpath", "=", "FileSystem", ".", "getClasspath", "(", "current", "[", "j", "]", ".", "getAbsolutePath", "(", ")", ",", "null", ",", "null", ")", ";", "if", "(", "classpath", "!=", "null", ")", "{", "extdirsClasspaths", ".", "add", "(", "classpath", ")", ";", "}", "}", "}", "else", "if", "(", "directoriesToCheck", "[", "i", "]", ".", "isFile", "(", ")", ")", "{", "addPendingErrors", "(", "this", ".", "bind", "(", "\"\"", ",", "directoriesToCheck", "[", "i", "]", ".", "getAbsolutePath", "(", ")", ")", ")", ";", "}", "}", "}", "}", "return", "extdirsClasspaths", ";", "}", "protected", "void", "handleWarningToken", "(", "String", "token", ",", "boolean", "isEnabling", ")", "{", "handleErrorOrWarningToken", "(", "token", ",", "isEnabling", ",", "ProblemSeverities", ".", "Warning", ")", ";", "}", "protected", "void", "handleErrorToken", "(", "String", "token", ",", "boolean", "isEnabling", ")", "{", "handleErrorOrWarningToken", "(", "token", ",", "isEnabling", ",", "ProblemSeverities", ".", "Error", ")", ";", "}", "private", "void", "setSeverity", "(", "String", "compilerOptions", ",", "int", "severity", ",", "boolean", "isEnabling", ")", "{", "if", "(", "isEnabling", ")", "{", "switch", "(", "severity", ")", "{", "case", "ProblemSeverities", ".", "Error", ":", "this", ".", "options", ".", "put", "(", "compilerOptions", ",", "CompilerOptions", ".", "ERROR", ")", ";", "break", ";", "case", "ProblemSeverities", ".", "Warning", ":", "this", ".", "options", ".", "put", "(", "compilerOptions", ",", "CompilerOptions", ".", "WARNING", ")", ";", "break", ";", "default", ":", "this", ".", "options", ".", "put", "(", "compilerOptions", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "}", "}", "else", "{", "switch", "(", "severity", ")", "{", "case", "ProblemSeverities", ".", "Error", ":", "String", "currentValue", "=", "(", "String", ")", "this", ".", "options", ".", "get", "(", "compilerOptions", ")", ";", "if", "(", "CompilerOptions", ".", "ERROR", ".", "equals", "(", "currentValue", ")", ")", "{", "this", ".", "options", ".", "put", "(", "compilerOptions", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "}", "break", ";", "case", "ProblemSeverities", ".", "Warning", ":", "currentValue", "=", "(", "String", ")", "this", ".", "options", ".", "get", "(", "compilerOptions", ")", ";", "if", "(", "CompilerOptions", ".", "WARNING", ".", "equals", "(", "currentValue", ")", ")", "{", "this", ".", "options", ".", "put", "(", "compilerOptions", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "}", "break", ";", "default", ":", "this", ".", "options", ".", "put", "(", "compilerOptions", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "}", "}", "}", "private", "void", "handleErrorOrWarningToken", "(", "String", "token", ",", "boolean", "isEnabling", ",", "int", "severity", ")", "{", "if", "(", "token", ".", "length", "(", ")", "==", "0", ")", "return", ";", "switch", "(", "token", ".", "charAt", "(", "0", ")", ")", "{", "case", "'a'", ":", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportDeprecation", ",", "severity", ",", "isEnabling", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeprecationInDeprecatedCode", ",", "isEnabling", "?", "CompilerOptions", ".", "ENABLED", ":", "CompilerOptions", ".", "DISABLED", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeprecationWhenOverridingDeprecatedMethod", ",", "isEnabling", "?", "CompilerOptions", ".", "ENABLED", ":", "CompilerOptions", ".", "DISABLED", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"allJavadoc\"", ")", ")", "{", "this", ".", "warnAllJavadocOn", "=", "this", ".", "warnJavadocOn", "=", "isEnabling", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportInvalidJavadoc", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocTags", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocComments", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportAssertIdentifier", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"allDeadCode\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportDeadCode", ",", "severity", ",", "isEnabling", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeadCodeInTrivialIfStatement", ",", "isEnabling", "?", "CompilerOptions", ".", "ENABLED", ":", "CompilerOptions", ".", "DISABLED", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"allOver-ann\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMissingOverrideAnnotation", ",", "severity", ",", "isEnabling", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation", ",", "isEnabling", "?", "CompilerOptions", ".", "ENABLED", ":", "CompilerOptions", ".", "DISABLED", ")", ";", "return", ";", "}", "break", ";", "case", "'b'", ":", "if", "(", "token", ".", "equals", "(", "\"boxing\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportAutoboxing", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'c'", ":", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMethodWithConstructorName", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportPossibleAccidentalBooleanAssignment", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportComparingIdentical", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"charConcat\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportNoImplicitStringConversion", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'d'", ":", "if", "(", "token", ".", "equals", "(", "\"deprecation\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportDeprecation", ",", "severity", ",", "isEnabling", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeprecationInDeprecatedCode", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeprecationWhenOverridingDeprecatedMethod", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"dep-ann\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMissingDeprecatedAnnotation", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"discouraged\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportDiscouragedReference", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"deadCode\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportDeadCode", ",", "severity", ",", "isEnabling", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeadCodeInTrivialIfStatement", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "return", ";", "}", "break", ";", "case", "'e'", ":", "if", "(", "token", ".", "equals", "(", "\"enumSwitch\"", ")", "||", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportIncompleteEnumSwitch", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"emptyBlock\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUndocumentedEmptyBlock", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportEnumIdentifier", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'f'", ":", "if", "(", "token", ".", "equals", "(", "\"fieldHiding\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportFieldHiding", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"finalBound\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportFinalParameterBound", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"finally\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportFinallyBlockNotCompletingNormally", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"forbidden\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportForbiddenReference", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"fallthrough\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportFallthroughCase", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'h'", ":", "if", "(", "token", ".", "equals", "(", "\"hiding\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportHiddenCatchBlock", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportLocalVariableHiding", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportFieldHiding", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportTypeParameterHiding", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"hashCode\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMissingHashCodeMethod", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'i'", ":", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportIndirectStaticAccess", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", "||", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportIncompatibleNonInheritedInterfaceMethod", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportAnnotationSuperInterface", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportRedundantSuperinterface", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'j'", ":", "if", "(", "token", ".", "equals", "(", "\"javadoc\"", ")", ")", "{", "this", ".", "warnJavadocOn", "=", "isEnabling", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportInvalidJavadoc", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocTags", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'l'", ":", "if", "(", "token", ".", "equals", "(", "\"localHiding\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportLocalVariableHiding", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'m'", ":", "if", "(", "token", ".", "equals", "(", "\"\"", ")", "||", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportHiddenCatchBlock", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'n'", ":", "if", "(", "token", ".", "equals", "(", "\"nls\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportNonExternalizedStringLiteral", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportNoEffectAssignment", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportNoImplicitStringConversion", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"null\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportNullReference", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportPotentialNullReference", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportRedundantNullCheck", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportNullReference", ",", "severity", ",", "isEnabling", ")", ";", "if", "(", "!", "isEnabling", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportPotentialNullReference", ",", "ProblemSeverities", ".", "Ignore", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportRedundantNullCheck", ",", "ProblemSeverities", ".", "Ignore", ",", "isEnabling", ")", ";", "}", "return", ";", "}", "break", ";", "case", "'o'", ":", "if", "(", "token", ".", "equals", "(", "\"over-sync\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMissingSynchronizedOnInheritedMethod", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"over-ann\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMissingOverrideAnnotation", ",", "severity", ",", "isEnabling", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "return", ";", "}", "break", ";", "case", "'p'", ":", "if", "(", "token", ".", "equals", "(", "\"\"", ")", "||", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportOverridingPackageDefaultMethod", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"paramAssign\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportParameterAssignment", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'r'", ":", "if", "(", "token", ".", "equals", "(", "\"raw\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportRawTypeReference", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportRedundantSuperinterface", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'s'", ":", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportSpecialParameterHidingField", ",", "isEnabling", "?", "CompilerOptions", ".", "ENABLED", ":", "CompilerOptions", ".", "DISABLED", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", "||", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportSyntheticAccessEmulation", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportNonStaticAccessToStatic", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"syncOverride\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMissingSynchronizedOnInheritedMethod", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"semicolon\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportEmptyStatement", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"serial\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportMissingSerialVersion", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"suppress\"", ")", ")", "{", "switch", "(", "severity", ")", "{", "case", "ProblemSeverities", ".", "Warning", ":", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_SuppressWarnings", ",", "isEnabling", "?", "CompilerOptions", ".", "ENABLED", ":", "CompilerOptions", ".", "DISABLED", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_SuppressOptionalErrors", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "break", ";", "case", "ProblemSeverities", ".", "Error", ":", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_SuppressWarnings", ",", "isEnabling", "?", "CompilerOptions", ".", "ENABLED", ":", "CompilerOptions", ".", "DISABLED", ")", ";", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_SuppressOptionalErrors", ",", "isEnabling", "?", "CompilerOptions", ".", "ENABLED", ":", "CompilerOptions", ".", "DISABLED", ")", ";", "}", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportNonStaticAccessToStatic", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportIndirectStaticAccess", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"super\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportOverridingMethodWithoutSuperInvocation", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'t'", ":", "if", "(", "token", ".", "startsWith", "(", "\"tasks\"", ")", ")", "{", "String", "taskTags", "=", "Util", ".", "EMPTY_STRING", ";", "int", "start", "=", "token", ".", "indexOf", "(", "'('", ")", ";", "int", "end", "=", "token", ".", "indexOf", "(", "')'", ")", ";", "if", "(", "start", ">=", "0", "&&", "end", ">=", "0", "&&", "start", "<", "end", ")", "{", "taskTags", "=", "token", ".", "substring", "(", "start", "+", "1", ",", "end", ")", ".", "trim", "(", ")", ";", "taskTags", "=", "taskTags", ".", "replace", "(", "'|'", ",", "','", ")", ";", "}", "if", "(", "taskTags", ".", "length", "(", ")", "==", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "token", ")", ")", ";", "}", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TaskTags", ",", "isEnabling", "?", "taskTags", ":", "Util", ".", "EMPTY_STRING", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportTasks", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"typeHiding\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportTypeParameterHiding", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'u'", ":", "if", "(", "token", ".", "equals", "(", "\"unusedLocal\"", ")", "||", "token", ".", "equals", "(", "\"unusedLocals\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedLocal", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", "||", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedParameter", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"unusedImport\"", ")", "||", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedImport", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedObjectAllocation", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedPrivateMember", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"unusedLabel\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedLabel", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnnecessaryTypeCheck", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"unchecked\"", ")", "||", "token", ".", "equals", "(", "\"unsafe\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUncheckedTypeOperation", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnnecessaryElse", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"unusedThrown\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedDeclaredThrownException", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", "||", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnqualifiedFieldAccess", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"unused\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedLocal", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedParameter", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedImport", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedPrivateMember", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedDeclaredThrownException", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedLabel", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedTypeArgumentsForMethodInvocation", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "else", "if", "(", "token", ".", "equals", "(", "\"\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedTypeArgumentsForMethodInvocation", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'v'", ":", "if", "(", "token", ".", "equals", "(", "\"varargsCast\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportVarargsArgumentNeedCast", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "case", "'w'", ":", "if", "(", "token", ".", "equals", "(", "\"warningToken\"", ")", ")", "{", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnhandledWarningToken", ",", "severity", ",", "isEnabling", ")", ";", "setSeverity", "(", "CompilerOptions", ".", "OPTION_ReportUnusedWarningToken", ",", "severity", ",", "isEnabling", ")", ";", "return", ";", "}", "break", ";", "}", "String", "message", "=", "null", ";", "switch", "(", "severity", ")", "{", "case", "ProblemSeverities", ".", "Warning", ":", "message", "=", "this", ".", "bind", "(", "\"\"", ",", "token", ")", ";", "break", ";", "case", "ProblemSeverities", ".", "Error", ":", "message", "=", "this", ".", "bind", "(", "\"\"", ",", "token", ")", ";", "}", "addPendingErrors", "(", "message", ")", ";", "}", "protected", "void", "initialize", "(", "PrintWriter", "outWriter", ",", "PrintWriter", "errWriter", ",", "boolean", "systemExit", ")", "{", "this", ".", "initialize", "(", "outWriter", ",", "errWriter", ",", "systemExit", ",", "null", ",", "null", ")", ";", "}", "protected", "void", "initialize", "(", "PrintWriter", "outWriter", ",", "PrintWriter", "errWriter", ",", "boolean", "systemExit", ",", "Map", "customDefaultOptions", ")", "{", "this", ".", "initialize", "(", "outWriter", ",", "errWriter", ",", "systemExit", ",", "customDefaultOptions", ",", "null", ")", ";", "}", "protected", "void", "initialize", "(", "PrintWriter", "outWriter", ",", "PrintWriter", "errWriter", ",", "boolean", "systemExit", ",", "Map", "customDefaultOptions", ",", "CompilationProgress", "compilationProgress", ")", "{", "this", ".", "logger", "=", "new", "Logger", "(", "this", ",", "outWriter", ",", "errWriter", ")", ";", "this", ".", "proceed", "=", "true", ";", "this", ".", "out", "=", "outWriter", ";", "this", ".", "err", "=", "errWriter", ";", "this", ".", "systemExitWhenFinished", "=", "systemExit", ";", "this", ".", "options", "=", "new", "CompilerOptions", "(", ")", ".", "getMap", "(", ")", ";", "this", ".", "progress", "=", "compilationProgress", ";", "if", "(", "customDefaultOptions", "!=", "null", ")", "{", "this", ".", "didSpecifySource", "=", "customDefaultOptions", ".", "get", "(", "CompilerOptions", ".", "OPTION_Source", ")", "!=", "null", ";", "this", ".", "didSpecifyTarget", "=", "customDefaultOptions", ".", "get", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ")", "!=", "null", ";", "for", "(", "Iterator", "iter", "=", "customDefaultOptions", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "iter", ".", "next", "(", ")", ";", "this", ".", "options", ".", "put", "(", "entry", ".", "getKey", "(", ")", ",", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "else", "{", "this", ".", "didSpecifySource", "=", "false", ";", "this", ".", "didSpecifyTarget", "=", "false", ";", "}", "this", ".", "classNames", "=", "null", ";", "}", "protected", "void", "initializeAnnotationProcessorManager", "(", ")", "{", "try", "{", "Class", "c", "=", "Class", ".", "forName", "(", "\"\"", ")", ";", "AbstractAnnotationProcessorManager", "annotationManager", "=", "(", "AbstractAnnotationProcessorManager", ")", "c", ".", "newInstance", "(", ")", ";", "annotationManager", ".", "configure", "(", "this", ",", "this", ".", "expandedCommandLine", ")", ";", "annotationManager", ".", "setErr", "(", "this", ".", "err", ")", ";", "annotationManager", ".", "setOut", "(", "this", ".", "out", ")", ";", "this", ".", "batchCompiler", ".", "annotationProcessorManager", "=", "annotationManager", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "}", "catch", "(", "InstantiationException", "e", ")", "{", "throw", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "AbortCompilation", "(", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "throw", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "AbortCompilation", "(", ")", ";", "}", "catch", "(", "UnsupportedClassVersionError", "e", ")", "{", "this", ".", "logger", ".", "logIncorrectVMVersionForAnnotationProcessing", "(", ")", ";", "}", "}", "public", "void", "outputClassFiles", "(", "CompilationResult", "unitResult", ")", "{", "if", "(", "!", "(", "(", "unitResult", "==", "null", ")", "||", "(", "unitResult", ".", "hasErrors", "(", ")", "&&", "!", "this", ".", "proceedOnError", ")", ")", ")", "{", "ClassFile", "[", "]", "classFiles", "=", "unitResult", ".", "getClassFiles", "(", ")", ";", "String", "currentDestinationPath", "=", "null", ";", "boolean", "generateClasspathStructure", "=", "false", ";", "CompilationUnit", "compilationUnit", "=", "(", "CompilationUnit", ")", "unitResult", ".", "compilationUnit", ";", "if", "(", "compilationUnit", ".", "destinationPath", "==", "null", ")", "{", "if", "(", "this", ".", "destinationPath", "==", "null", ")", "{", "currentDestinationPath", "=", "extractDestinationPathFromSourceFile", "(", "unitResult", ")", ";", "}", "else", "if", "(", "this", ".", "destinationPath", "!=", "NONE", ")", "{", "currentDestinationPath", "=", "this", ".", "destinationPath", ";", "generateClasspathStructure", "=", "true", ";", "}", "}", "else", "if", "(", "compilationUnit", ".", "destinationPath", "!=", "NONE", ")", "{", "currentDestinationPath", "=", "compilationUnit", ".", "destinationPath", ";", "generateClasspathStructure", "=", "true", ";", "}", "if", "(", "currentDestinationPath", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "fileCount", "=", "classFiles", ".", "length", ";", "i", "<", "fileCount", ";", "i", "++", ")", "{", "ClassFile", "classFile", "=", "classFiles", "[", "i", "]", ";", "char", "[", "]", "filename", "=", "classFile", ".", "fileName", "(", ")", ";", "int", "length", "=", "filename", ".", "length", ";", "char", "[", "]", "relativeName", "=", "new", "char", "[", "length", "+", "6", "]", ";", "System", ".", "arraycopy", "(", "filename", ",", "0", ",", "relativeName", ",", "0", ",", "length", ")", ";", "System", ".", "arraycopy", "(", "SuffixConstants", ".", "SUFFIX_class", ",", "0", ",", "relativeName", ",", "length", ",", "6", ")", ";", "CharOperation", ".", "replace", "(", "relativeName", ",", "'/'", ",", "File", ".", "separatorChar", ")", ";", "String", "relativeStringName", "=", "new", "String", "(", "relativeName", ")", ";", "try", "{", "if", "(", "this", ".", "compilerOptions", ".", "verbose", ")", "this", ".", "out", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "compilation_write", ",", "new", "String", "[", "]", "{", "String", ".", "valueOf", "(", "this", ".", "exportedClassFilesCounter", "+", "1", ")", ",", "relativeStringName", "}", ")", ")", ";", "Util", ".", "writeToDisk", "(", "generateClasspathStructure", ",", "currentDestinationPath", ",", "relativeStringName", ",", "classFile", ")", ";", "this", ".", "logger", ".", "logClassFile", "(", "generateClasspathStructure", ",", "currentDestinationPath", ",", "relativeStringName", ")", ";", "this", ".", "exportedClassFilesCounter", "++", ";", "}", "catch", "(", "IOException", "e", ")", "{", "this", ".", "logger", ".", "logNoClassFileCreated", "(", "currentDestinationPath", ",", "relativeStringName", ",", "e", ")", ";", "}", "}", "this", ".", "batchCompiler", ".", "lookupEnvironment", ".", "releaseClassFiles", "(", "classFiles", ")", ";", "}", "}", "}", "public", "void", "performCompilation", "(", ")", "{", "this", ".", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "FileSystem", "environment", "=", "getLibraryAccess", "(", ")", ";", "this", ".", "compilerOptions", "=", "new", "CompilerOptions", "(", "this", ".", "options", ")", ";", "this", ".", "compilerOptions", ".", "performMethodsFullRecovery", "=", "false", ";", "this", ".", "compilerOptions", ".", "performStatementsRecovery", "=", "false", ";", "this", ".", "batchCompiler", "=", "new", "Compiler", "(", "environment", ",", "getHandlingPolicy", "(", ")", ",", "this", ".", "compilerOptions", ",", "getBatchRequestor", "(", ")", ",", "getProblemFactory", "(", ")", ",", "this", ".", "out", ",", "this", ".", "progress", ")", ";", "this", ".", "batchCompiler", ".", "remainingIterations", "=", "this", ".", "maxRepetition", "-", "this", ".", "currentRepetition", ";", "String", "setting", "=", "System", ".", "getProperty", "(", "\"\"", ")", ";", "this", ".", "batchCompiler", ".", "useSingleThread", "=", "setting", "!=", "null", "&&", "setting", ".", "equals", "(", "\"true\"", ")", ";", "if", "(", "this", ".", "compilerOptions", ".", "complianceLevel", ">=", "ClassFileConstants", ".", "JDK1_6", "&&", "this", ".", "compilerOptions", ".", "processAnnotations", ")", "{", "if", "(", "checkVMVersion", "(", "ClassFileConstants", ".", "JDK1_6", ")", ")", "{", "initializeAnnotationProcessorManager", "(", ")", ";", "if", "(", "this", ".", "classNames", "!=", "null", ")", "{", "this", ".", "batchCompiler", ".", "setBinaryTypes", "(", "processClassNames", "(", "this", ".", "batchCompiler", ".", "lookupEnvironment", ")", ")", ";", "}", "}", "else", "{", "this", ".", "logger", ".", "logIncorrectVMVersionForAnnotationProcessing", "(", ")", ";", "}", "}", "this", ".", "compilerOptions", ".", "verbose", "=", "this", ".", "verbose", ";", "this", ".", "compilerOptions", ".", "produceReferenceInfo", "=", "this", ".", "produceRefInfo", ";", "try", "{", "this", ".", "logger", ".", "startLoggingSources", "(", ")", ";", "this", ".", "batchCompiler", ".", "compile", "(", "getCompilationUnits", "(", ")", ")", ";", "}", "finally", "{", "this", ".", "logger", ".", "endLoggingSources", "(", ")", ";", "}", "if", "(", "this", ".", "extraProblems", "!=", "null", ")", "{", "this", ".", "logger", ".", "loggingExtraProblems", "(", "this", ")", ";", "this", ".", "extraProblems", "=", "null", ";", "}", "if", "(", "this", ".", "compilerStats", "!=", "null", ")", "{", "this", ".", "compilerStats", "[", "this", ".", "currentRepetition", "]", "=", "this", ".", "batchCompiler", ".", "stats", ";", "}", "this", ".", "logger", ".", "printStats", "(", ")", ";", "environment", ".", "cleanup", "(", ")", ";", "}", "public", "void", "printUsage", "(", ")", "{", "printUsage", "(", "\"misc.usage\"", ")", ";", "}", "private", "void", "printUsage", "(", "String", "sectionID", ")", "{", "this", ".", "logger", ".", "logUsage", "(", "this", ".", "bind", "(", "sectionID", ",", "new", "String", "[", "]", "{", "System", ".", "getProperty", "(", "\"\"", ")", ",", "this", ".", "bind", "(", "\"\"", ")", ",", "this", ".", "bind", "(", "\"\"", ")", ",", "this", ".", "bind", "(", "\"\"", ")", "}", ")", ")", ";", "this", ".", "logger", ".", "flush", "(", ")", ";", "}", "private", "ReferenceBinding", "[", "]", "processClassNames", "(", "LookupEnvironment", "environment", ")", "{", "int", "length", "=", "this", ".", "classNames", ".", "length", ";", "ReferenceBinding", "[", "]", "referenceBindings", "=", "new", "ReferenceBinding", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "currentName", "=", "this", ".", "classNames", "[", "i", "]", ";", "char", "[", "]", "[", "]", "compoundName", "=", "null", ";", "if", "(", "currentName", ".", "indexOf", "(", "'.'", ")", "!=", "-", "1", ")", "{", "char", "[", "]", "typeName", "=", "currentName", ".", "toCharArray", "(", ")", ";", "compoundName", "=", "CharOperation", ".", "splitOn", "(", "'.'", ",", "typeName", ")", ";", "}", "else", "{", "compoundName", "=", "new", "char", "[", "]", "[", "]", "{", "currentName", ".", "toCharArray", "(", ")", "}", ";", "}", "ReferenceBinding", "type", "=", "environment", ".", "getType", "(", "compoundName", ")", ";", "if", "(", "type", "!=", "null", "&&", "type", ".", "isValidBinding", "(", ")", ")", "{", "if", "(", "type", ".", "isBinaryBinding", "(", ")", ")", "{", "referenceBindings", "[", "i", "]", "=", "type", ";", "}", "}", "else", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentName", ")", ")", ";", "}", "}", "return", "referenceBindings", ";", "}", "public", "void", "processPathEntries", "(", "final", "int", "defaultSize", ",", "final", "ArrayList", "paths", ",", "final", "String", "currentPath", ",", "String", "customEncoding", ",", "boolean", "isSourceOnly", ",", "boolean", "rejectDestinationPathOnJars", ")", "{", "String", "currentClasspathName", "=", "null", ";", "String", "currentDestinationPath", "=", "null", ";", "ArrayList", "currentRuleSpecs", "=", "new", "ArrayList", "(", "defaultSize", ")", ";", "StringTokenizer", "tokenizer", "=", "new", "StringTokenizer", "(", "currentPath", ",", "File", ".", "pathSeparator", "+", "\"[]\"", ",", "true", ")", ";", "ArrayList", "tokens", "=", "new", "ArrayList", "(", ")", ";", "while", "(", "tokenizer", ".", "hasMoreTokens", "(", ")", ")", "{", "tokens", ".", "add", "(", "tokenizer", ".", "nextToken", "(", ")", ")", ";", "}", "final", "int", "start", "=", "0", ";", "final", "int", "readyToClose", "=", "1", ";", "final", "int", "readyToCloseEndingWithRules", "=", "2", ";", "final", "int", "readyToCloseOrOtherEntry", "=", "3", ";", "final", "int", "rulesNeedAnotherRule", "=", "4", ";", "final", "int", "rulesStart", "=", "5", ";", "final", "int", "rulesReadyToClose", "=", "6", ";", "final", "int", "destinationPathReadyToClose", "=", "7", ";", "final", "int", "readyToCloseEndingWithDestinationPath", "=", "8", ";", "final", "int", "destinationPathStart", "=", "9", ";", "final", "int", "bracketOpened", "=", "10", ";", "final", "int", "bracketClosed", "=", "11", ";", "final", "int", "error", "=", "99", ";", "int", "state", "=", "start", ";", "String", "token", "=", "null", ";", "int", "cursor", "=", "0", ",", "tokensNb", "=", "tokens", ".", "size", "(", ")", ",", "bracket", "=", "-", "1", ";", "while", "(", "cursor", "<", "tokensNb", "&&", "state", "!=", "error", ")", "{", "token", "=", "(", "String", ")", "tokens", ".", "get", "(", "cursor", "++", ")", ";", "if", "(", "token", ".", "equals", "(", "File", ".", "pathSeparator", ")", ")", "{", "switch", "(", "state", ")", "{", "case", "start", ":", "case", "readyToCloseOrOtherEntry", ":", "case", "bracketOpened", ":", "break", ";", "case", "readyToClose", ":", "case", "readyToCloseEndingWithRules", ":", "case", "readyToCloseEndingWithDestinationPath", ":", "state", "=", "readyToCloseOrOtherEntry", ";", "addNewEntry", "(", "paths", ",", "currentClasspathName", ",", "currentRuleSpecs", ",", "customEncoding", ",", "currentDestinationPath", ",", "isSourceOnly", ",", "rejectDestinationPathOnJars", ")", ";", "currentRuleSpecs", ".", "clear", "(", ")", ";", "break", ";", "case", "rulesReadyToClose", ":", "state", "=", "rulesNeedAnotherRule", ";", "break", ";", "case", "destinationPathReadyToClose", ":", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentPath", ")", ")", ";", "case", "bracketClosed", ":", "cursor", "=", "bracket", "+", "1", ";", "state", "=", "rulesStart", ";", "break", ";", "default", ":", "state", "=", "error", ";", "}", "}", "else", "if", "(", "token", ".", "equals", "(", "\"[\"", ")", ")", "{", "switch", "(", "state", ")", "{", "case", "start", ":", "currentClasspathName", "=", "\"\"", ";", "case", "readyToClose", ":", "bracket", "=", "cursor", "-", "1", ";", "case", "bracketClosed", ":", "state", "=", "bracketOpened", ";", "break", ";", "case", "readyToCloseEndingWithRules", ":", "state", "=", "destinationPathStart", ";", "break", ";", "case", "readyToCloseEndingWithDestinationPath", ":", "state", "=", "rulesStart", ";", "break", ";", "case", "bracketOpened", ":", "default", ":", "state", "=", "error", ";", "}", "}", "else", "if", "(", "token", ".", "equals", "(", "\"]\"", ")", ")", "{", "switch", "(", "state", ")", "{", "case", "rulesReadyToClose", ":", "state", "=", "readyToCloseEndingWithRules", ";", "break", ";", "case", "destinationPathReadyToClose", ":", "state", "=", "readyToCloseEndingWithDestinationPath", ";", "break", ";", "case", "bracketOpened", ":", "state", "=", "bracketClosed", ";", "break", ";", "case", "bracketClosed", ":", "default", ":", "state", "=", "error", ";", "}", "}", "else", "{", "switch", "(", "state", ")", "{", "case", "start", ":", "case", "readyToCloseOrOtherEntry", ":", "state", "=", "readyToClose", ";", "currentClasspathName", "=", "token", ";", "break", ";", "case", "rulesStart", ":", "if", "(", "token", ".", "startsWith", "(", "\"-d", "\"", ")", ")", "{", "if", "(", "currentDestinationPath", "!=", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentPath", ")", ")", ";", "}", "currentDestinationPath", "=", "token", ".", "substring", "(", "3", ")", ".", "trim", "(", ")", ";", "state", "=", "destinationPathReadyToClose", ";", "break", ";", "}", "case", "rulesNeedAnotherRule", ":", "if", "(", "currentDestinationPath", "!=", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentPath", ")", ")", ";", "}", "state", "=", "rulesReadyToClose", ";", "currentRuleSpecs", ".", "add", "(", "token", ")", ";", "break", ";", "case", "destinationPathStart", ":", "if", "(", "!", "token", ".", "startsWith", "(", "\"-d", "\"", ")", ")", "{", "state", "=", "error", ";", "}", "else", "{", "currentDestinationPath", "=", "token", ".", "substring", "(", "3", ")", ".", "trim", "(", ")", ";", "state", "=", "destinationPathReadyToClose", ";", "}", "break", ";", "case", "bracketClosed", ":", "for", "(", "int", "i", "=", "bracket", ";", "i", "<", "cursor", ";", "i", "++", ")", "{", "currentClasspathName", "+=", "(", "String", ")", "tokens", ".", "get", "(", "i", ")", ";", "}", "state", "=", "readyToClose", ";", "break", ";", "case", "bracketOpened", ":", "break", ";", "default", ":", "state", "=", "error", ";", "}", "}", "if", "(", "state", "==", "bracketClosed", "&&", "cursor", "==", "tokensNb", ")", "{", "cursor", "=", "bracket", "+", "1", ";", "state", "=", "rulesStart", ";", "}", "}", "switch", "(", "state", ")", "{", "case", "readyToCloseOrOtherEntry", ":", "break", ";", "case", "readyToClose", ":", "case", "readyToCloseEndingWithRules", ":", "case", "readyToCloseEndingWithDestinationPath", ":", "addNewEntry", "(", "paths", ",", "currentClasspathName", ",", "currentRuleSpecs", ",", "customEncoding", ",", "currentDestinationPath", ",", "isSourceOnly", ",", "rejectDestinationPathOnJars", ")", ";", "break", ";", "case", "bracketOpened", ":", "case", "bracketClosed", ":", "default", ":", "if", "(", "currentPath", ".", "length", "(", ")", "!=", "0", ")", "{", "addPendingErrors", "(", "this", ".", "bind", "(", "\"\"", ",", "currentPath", ")", ")", ";", "}", "}", "}", "private", "int", "processPaths", "(", "String", "[", "]", "args", ",", "int", "index", ",", "String", "currentArg", ",", "ArrayList", "paths", ")", "{", "int", "localIndex", "=", "index", ";", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "currentArg", ".", "length", "(", ")", ";", "i", "<", "max", ";", "i", "++", ")", "{", "switch", "(", "currentArg", ".", "charAt", "(", "i", ")", ")", "{", "case", "'['", ":", "count", "++", ";", "break", ";", "case", "']'", ":", "count", "--", ";", "break", ";", "}", "}", "if", "(", "count", "==", "0", ")", "{", "paths", ".", "add", "(", "currentArg", ")", ";", "}", "else", "if", "(", "count", ">", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "else", "{", "StringBuffer", "currentPath", "=", "new", "StringBuffer", "(", "currentArg", ")", ";", "while", "(", "true", ")", "{", "if", "(", "localIndex", ">=", "args", ".", "length", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "localIndex", "++", ";", "String", "nextArg", "=", "args", "[", "localIndex", "]", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "nextArg", ".", "length", "(", ")", ";", "i", "<", "max", ";", "i", "++", ")", "{", "switch", "(", "nextArg", ".", "charAt", "(", "i", ")", ")", "{", "case", "'['", ":", "if", "(", "count", ">", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "nextArg", ")", ")", ";", "}", "count", "++", ";", "break", ";", "case", "']'", ":", "count", "--", ";", "break", ";", "}", "}", "if", "(", "count", "==", "0", ")", "{", "currentPath", ".", "append", "(", "'", "'", ")", ";", "currentPath", ".", "append", "(", "nextArg", ")", ";", "paths", ".", "add", "(", "currentPath", ".", "toString", "(", ")", ")", ";", "return", "localIndex", "-", "index", ";", "}", "else", "if", "(", "count", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "nextArg", ")", ")", ";", "}", "else", "{", "currentPath", ".", "append", "(", "'", "'", ")", ";", "currentPath", ".", "append", "(", "nextArg", ")", ";", "}", "}", "}", "return", "localIndex", "-", "index", ";", "}", "private", "int", "processPaths", "(", "String", "[", "]", "args", ",", "int", "index", ",", "String", "currentArg", ",", "String", "[", "]", "paths", ")", "{", "int", "localIndex", "=", "index", ";", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "currentArg", ".", "length", "(", ")", ";", "i", "<", "max", ";", "i", "++", ")", "{", "switch", "(", "currentArg", ".", "charAt", "(", "i", ")", ")", "{", "case", "'['", ":", "count", "++", ";", "break", ";", "case", "']'", ":", "count", "--", ";", "break", ";", "}", "}", "if", "(", "count", "==", "0", ")", "{", "paths", "[", "0", "]", "=", "currentArg", ";", "}", "else", "{", "StringBuffer", "currentPath", "=", "new", "StringBuffer", "(", "currentArg", ")", ";", "while", "(", "true", ")", "{", "localIndex", "++", ";", "if", "(", "localIndex", ">=", "args", ".", "length", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "String", "nextArg", "=", "args", "[", "localIndex", "]", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "nextArg", ".", "length", "(", ")", ";", "i", "<", "max", ";", "i", "++", ")", "{", "switch", "(", "nextArg", ".", "charAt", "(", "i", ")", ")", "{", "case", "'['", ":", "if", "(", "count", ">", "1", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "count", "++", ";", "break", ";", "case", "']'", ":", "count", "--", ";", "break", ";", "}", "}", "if", "(", "count", "==", "0", ")", "{", "currentPath", ".", "append", "(", "'", "'", ")", ";", "currentPath", ".", "append", "(", "nextArg", ")", ";", "paths", "[", "0", "]", "=", "currentPath", ".", "toString", "(", ")", ";", "return", "localIndex", "-", "index", ";", "}", "else", "if", "(", "count", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "currentArg", ")", ")", ";", "}", "else", "{", "currentPath", ".", "append", "(", "'", "'", ")", ";", "currentPath", ".", "append", "(", "nextArg", ")", ";", "}", "}", "}", "return", "localIndex", "-", "index", ";", "}", "public", "void", "relocalize", "(", ")", "{", "relocalize", "(", "Locale", ".", "getDefault", "(", ")", ")", ";", "}", "private", "void", "relocalize", "(", "Locale", "locale", ")", "{", "this", ".", "compilerLocale", "=", "locale", ";", "try", "{", "this", ".", "bundle", "=", "ResourceBundleFactory", ".", "getBundle", "(", "locale", ")", ";", "}", "catch", "(", "MissingResourceException", "e", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "Main", ".", "bundleName", ".", "replace", "(", "'.'", ",", "'/'", ")", "+", "\"\"", "+", "locale", ")", ";", "throw", "e", ";", "}", "}", "public", "void", "setDestinationPath", "(", "String", "dest", ")", "{", "this", ".", "destinationPath", "=", "dest", ";", "}", "public", "void", "setLocale", "(", "Locale", "locale", ")", "{", "relocalize", "(", "locale", ")", ";", "}", "protected", "void", "setPaths", "(", "ArrayList", "bootclasspaths", ",", "String", "sourcepathClasspathArg", ",", "ArrayList", "sourcepathClasspaths", ",", "ArrayList", "classpaths", ",", "ArrayList", "extdirsClasspaths", ",", "ArrayList", "endorsedDirClasspaths", ",", "String", "customEncoding", ")", "{", "bootclasspaths", "=", "handleBootclasspath", "(", "bootclasspaths", ",", "customEncoding", ")", ";", "classpaths", "=", "handleClasspath", "(", "classpaths", ",", "customEncoding", ")", ";", "if", "(", "sourcepathClasspathArg", "!=", "null", ")", "{", "processPathEntries", "(", "DEFAULT_SIZE_CLASSPATH", ",", "sourcepathClasspaths", ",", "sourcepathClasspathArg", ",", "customEncoding", ",", "true", ",", "false", ")", ";", "}", "extdirsClasspaths", "=", "handleExtdirs", "(", "extdirsClasspaths", ")", ";", "endorsedDirClasspaths", "=", "handleEndorseddirs", "(", "endorsedDirClasspaths", ")", ";", "bootclasspaths", ".", "addAll", "(", "endorsedDirClasspaths", ")", ";", "bootclasspaths", ".", "addAll", "(", "extdirsClasspaths", ")", ";", "bootclasspaths", ".", "addAll", "(", "sourcepathClasspaths", ")", ";", "bootclasspaths", ".", "addAll", "(", "classpaths", ")", ";", "classpaths", "=", "bootclasspaths", ";", "classpaths", "=", "FileSystem", ".", "ClasspathNormalizer", ".", "normalize", "(", "classpaths", ")", ";", "this", ".", "checkedClasspaths", "=", "new", "FileSystem", ".", "Classpath", "[", "classpaths", ".", "size", "(", ")", "]", ";", "classpaths", ".", "toArray", "(", "this", ".", "checkedClasspaths", ")", ";", "this", ".", "logger", ".", "logClasspath", "(", "this", ".", "checkedClasspaths", ")", ";", "}", "protected", "void", "validateOptions", "(", "boolean", "didSpecifyCompliance", ")", "{", "if", "(", "didSpecifyCompliance", ")", "{", "Object", "version", "=", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Compliance", ")", ";", "if", "(", "CompilerOptions", ".", "VERSION_1_3", ".", "equals", "(", "version", ")", ")", "{", "if", "(", "!", "this", ".", "didSpecifySource", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_1", ")", ";", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_4", ".", "equals", "(", "version", ")", ")", "{", "if", "(", "this", ".", "didSpecifySource", ")", "{", "Object", "source", "=", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Source", ")", ";", "if", "(", "CompilerOptions", ".", "VERSION_1_3", ".", "equals", "(", "source", ")", ")", "{", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_2", ")", ";", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_4", ".", "equals", "(", "source", ")", ")", "{", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ";", "}", "}", "else", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_2", ")", ";", "}", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_5", ".", "equals", "(", "version", ")", ")", "{", "if", "(", "this", ".", "didSpecifySource", ")", "{", "Object", "source", "=", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Source", ")", ";", "if", "(", "CompilerOptions", ".", "VERSION_1_3", ".", "equals", "(", "source", ")", "||", "CompilerOptions", ".", "VERSION_1_4", ".", "equals", "(", "source", ")", ")", "{", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ";", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_5", ".", "equals", "(", "source", ")", ")", "{", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_5", ")", ";", "}", "}", "else", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_5", ")", ";", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_5", ")", ";", "}", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_6", ".", "equals", "(", "version", ")", ")", "{", "if", "(", "this", ".", "didSpecifySource", ")", "{", "Object", "source", "=", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Source", ")", ";", "if", "(", "CompilerOptions", ".", "VERSION_1_3", ".", "equals", "(", "source", ")", "||", "CompilerOptions", ".", "VERSION_1_4", ".", "equals", "(", "source", ")", ")", "{", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ";", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_5", ".", "equals", "(", "source", ")", "||", "CompilerOptions", ".", "VERSION_1_6", ".", "equals", "(", "source", ")", ")", "{", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ";", "}", "}", "else", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ";", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ";", "}", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_7", ".", "equals", "(", "version", ")", ")", "{", "if", "(", "this", ".", "didSpecifySource", ")", "{", "Object", "source", "=", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Source", ")", ";", "if", "(", "CompilerOptions", ".", "VERSION_1_3", ".", "equals", "(", "source", ")", "||", "CompilerOptions", ".", "VERSION_1_4", ".", "equals", "(", "source", ")", ")", "{", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ";", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_5", ".", "equals", "(", "source", ")", "||", "CompilerOptions", ".", "VERSION_1_6", ".", "equals", "(", "source", ")", ")", "{", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ";", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_7", ".", "equals", "(", "source", ")", ")", "{", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_7", ")", ";", "}", "}", "else", "{", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_7", ")", ";", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_7", ")", ";", "}", "}", "}", "else", "if", "(", "this", ".", "didSpecifySource", ")", "{", "Object", "version", "=", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Source", ")", ";", "if", "(", "CompilerOptions", ".", "VERSION_1_4", ".", "equals", "(", "version", ")", ")", "{", "if", "(", "!", "didSpecifyCompliance", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Compliance", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ";", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ";", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_5", ".", "equals", "(", "version", ")", ")", "{", "if", "(", "!", "didSpecifyCompliance", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Compliance", ",", "CompilerOptions", ".", "VERSION_1_5", ")", ";", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_5", ")", ";", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_6", ".", "equals", "(", "version", ")", ")", "{", "if", "(", "!", "didSpecifyCompliance", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Compliance", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ";", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ";", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_1_7", ".", "equals", "(", "version", ")", ")", "{", "if", "(", "!", "didSpecifyCompliance", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_Compliance", ",", "CompilerOptions", ".", "VERSION_1_7", ")", ";", "if", "(", "!", "this", ".", "didSpecifyTarget", ")", "this", ".", "options", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_7", ")", ";", "}", "}", "final", "Object", "sourceVersion", "=", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Source", ")", ";", "final", "Object", "compliance", "=", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Compliance", ")", ";", "if", "(", "sourceVersion", ".", "equals", "(", "CompilerOptions", ".", "VERSION_1_7", ")", "&&", "CompilerOptions", ".", "versionToJdkLevel", "(", "compliance", ")", "<", "ClassFileConstants", ".", "JDK1_7", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Compliance", ")", ",", "CompilerOptions", ".", "VERSION_1_7", ")", ")", ";", "}", "else", "if", "(", "sourceVersion", ".", "equals", "(", "CompilerOptions", ".", "VERSION_1_6", ")", "&&", "CompilerOptions", ".", "versionToJdkLevel", "(", "compliance", ")", "<", "ClassFileConstants", ".", "JDK1_6", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Compliance", ")", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ")", ";", "}", "else", "if", "(", "sourceVersion", ".", "equals", "(", "CompilerOptions", ".", "VERSION_1_5", ")", "&&", "CompilerOptions", ".", "versionToJdkLevel", "(", "compliance", ")", "<", "ClassFileConstants", ".", "JDK1_5", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Compliance", ")", ",", "CompilerOptions", ".", "VERSION_1_5", ")", ")", ";", "}", "else", "if", "(", "sourceVersion", ".", "equals", "(", "CompilerOptions", ".", "VERSION_1_4", ")", "&&", "CompilerOptions", ".", "versionToJdkLevel", "(", "compliance", ")", "<", "ClassFileConstants", ".", "JDK1_4", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Compliance", ")", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ")", ";", "}", "if", "(", "this", ".", "didSpecifyTarget", ")", "{", "final", "Object", "targetVersion", "=", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ")", ";", "if", "(", "CompilerOptions", ".", "VERSION_JSR14", ".", "equals", "(", "targetVersion", ")", ")", "{", "if", "(", "CompilerOptions", ".", "versionToJdkLevel", "(", "sourceVersion", ")", "<", "ClassFileConstants", ".", "JDK1_5", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "targetVersion", ",", "(", "String", ")", "sourceVersion", ")", ")", ";", "}", "}", "else", "if", "(", "CompilerOptions", ".", "VERSION_CLDC1_1", ".", "equals", "(", "targetVersion", ")", ")", "{", "if", "(", "this", ".", "didSpecifySource", "&&", "CompilerOptions", ".", "versionToJdkLevel", "(", "sourceVersion", ")", ">=", "ClassFileConstants", ".", "JDK1_4", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "targetVersion", ",", "(", "String", ")", "sourceVersion", ")", ")", ";", "}", "if", "(", "CompilerOptions", ".", "versionToJdkLevel", "(", "compliance", ")", ">=", "ClassFileConstants", ".", "JDK1_5", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "targetVersion", ",", "(", "String", ")", "sourceVersion", ")", ")", ";", "}", "}", "else", "{", "if", "(", "CompilerOptions", ".", "versionToJdkLevel", "(", "sourceVersion", ")", ">=", "ClassFileConstants", ".", "JDK1_7", "&&", "CompilerOptions", ".", "versionToJdkLevel", "(", "targetVersion", ")", "<", "ClassFileConstants", ".", "JDK1_7", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "targetVersion", ",", "CompilerOptions", ".", "VERSION_1_7", ")", ")", ";", "}", "if", "(", "CompilerOptions", ".", "versionToJdkLevel", "(", "sourceVersion", ")", ">=", "ClassFileConstants", ".", "JDK1_6", "&&", "CompilerOptions", ".", "versionToJdkLevel", "(", "targetVersion", ")", "<", "ClassFileConstants", ".", "JDK1_6", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "targetVersion", ",", "CompilerOptions", ".", "VERSION_1_6", ")", ")", ";", "}", "if", "(", "CompilerOptions", ".", "versionToJdkLevel", "(", "sourceVersion", ")", ">=", "ClassFileConstants", ".", "JDK1_5", "&&", "CompilerOptions", ".", "versionToJdkLevel", "(", "targetVersion", ")", "<", "ClassFileConstants", ".", "JDK1_5", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "targetVersion", ",", "CompilerOptions", ".", "VERSION_1_5", ")", ")", ";", "}", "if", "(", "CompilerOptions", ".", "versionToJdkLevel", "(", "sourceVersion", ")", ">=", "ClassFileConstants", ".", "JDK1_4", "&&", "CompilerOptions", ".", "versionToJdkLevel", "(", "targetVersion", ")", "<", "ClassFileConstants", ".", "JDK1_4", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "targetVersion", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ")", ";", "}", "if", "(", "CompilerOptions", ".", "versionToJdkLevel", "(", "compliance", ")", "<", "CompilerOptions", ".", "versionToJdkLevel", "(", "targetVersion", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "this", ".", "bind", "(", "\"\"", ",", "(", "String", ")", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Compliance", ")", ",", "(", "String", ")", "targetVersion", ")", ")", ";", "}", "}", "}", "}", "}", "</s>" ]
5,903
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "batch", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FilenameFilter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "Hashtable", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFormatException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRuleSet", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "NameEnvironmentAnswer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "public", "class", "ClasspathDirectory", "extends", "ClasspathLocation", "{", "private", "Hashtable", "directoryCache", ";", "private", "String", "[", "]", "missingPackageHolder", "=", "new", "String", "[", "1", "]", ";", "private", "int", "mode", ";", "private", "String", "encoding", ";", "ClasspathDirectory", "(", "File", "directory", ",", "String", "encoding", ",", "int", "mode", ",", "AccessRuleSet", "accessRuleSet", ",", "String", "destinationPath", ")", "{", "super", "(", "accessRuleSet", ",", "destinationPath", ")", ";", "this", ".", "mode", "=", "mode", ";", "try", "{", "this", ".", "path", "=", "directory", ".", "getCanonicalPath", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "this", ".", "path", "=", "directory", ".", "getAbsolutePath", "(", ")", ";", "}", "if", "(", "!", "this", ".", "path", ".", "endsWith", "(", "File", ".", "separator", ")", ")", "this", ".", "path", "+=", "File", ".", "separator", ";", "this", ".", "directoryCache", "=", "new", "Hashtable", "(", "11", ")", ";", "this", ".", "encoding", "=", "encoding", ";", "}", "String", "[", "]", "directoryList", "(", "String", "qualifiedPackageName", ")", "{", "String", "[", "]", "dirList", "=", "(", "String", "[", "]", ")", "this", ".", "directoryCache", ".", "get", "(", "qualifiedPackageName", ")", ";", "if", "(", "dirList", "==", "this", ".", "missingPackageHolder", ")", "return", "null", ";", "if", "(", "dirList", "!=", "null", ")", "return", "dirList", ";", "File", "dir", "=", "new", "File", "(", "this", ".", "path", "+", "qualifiedPackageName", ")", ";", "notFound", ":", "if", "(", "dir", ".", "isDirectory", "(", ")", ")", "{", "int", "index", "=", "qualifiedPackageName", ".", "length", "(", ")", ";", "int", "last", "=", "qualifiedPackageName", ".", "lastIndexOf", "(", "File", ".", "separatorChar", ")", ";", "while", "(", "--", "index", ">", "last", "&&", "!", "ScannerHelper", ".", "isUpperCase", "(", "qualifiedPackageName", ".", "charAt", "(", "index", ")", ")", ")", "{", "}", "if", "(", "index", ">", "last", ")", "{", "if", "(", "last", "==", "-", "1", ")", "{", "if", "(", "!", "doesFileExist", "(", "qualifiedPackageName", ",", "Util", ".", "EMPTY_STRING", ")", ")", "break", "notFound", ";", "}", "else", "{", "String", "packageName", "=", "qualifiedPackageName", ".", "substring", "(", "last", "+", "1", ")", ";", "String", "parentPackage", "=", "qualifiedPackageName", ".", "substring", "(", "0", ",", "last", ")", ";", "if", "(", "!", "doesFileExist", "(", "packageName", ",", "parentPackage", ")", ")", "break", "notFound", ";", "}", "}", "if", "(", "(", "dirList", "=", "dir", ".", "list", "(", ")", ")", "==", "null", ")", "dirList", "=", "CharOperation", ".", "NO_STRINGS", ";", "this", ".", "directoryCache", ".", "put", "(", "qualifiedPackageName", ",", "dirList", ")", ";", "return", "dirList", ";", "}", "this", ".", "directoryCache", ".", "put", "(", "qualifiedPackageName", ",", "this", ".", "missingPackageHolder", ")", ";", "return", "null", ";", "}", "boolean", "doesFileExist", "(", "String", "fileName", ",", "String", "qualifiedPackageName", ")", "{", "String", "[", "]", "dirList", "=", "directoryList", "(", "qualifiedPackageName", ")", ";", "if", "(", "dirList", "==", "null", ")", "return", "false", ";", "for", "(", "int", "i", "=", "dirList", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "if", "(", "fileName", ".", "equals", "(", "dirList", "[", "i", "]", ")", ")", "return", "true", ";", "return", "false", ";", "}", "public", "List", "fetchLinkedJars", "(", "FileSystem", ".", "ClasspathSectionProblemReporter", "problemReporter", ")", "{", "return", "null", ";", "}", "public", "NameEnvironmentAnswer", "findClass", "(", "char", "[", "]", "typeName", ",", "String", "qualifiedPackageName", ",", "String", "qualifiedBinaryFileName", ")", "{", "return", "findClass", "(", "typeName", ",", "qualifiedPackageName", ",", "qualifiedBinaryFileName", ",", "false", ")", ";", "}", "public", "NameEnvironmentAnswer", "findClass", "(", "char", "[", "]", "typeName", ",", "String", "qualifiedPackageName", ",", "String", "qualifiedBinaryFileName", ",", "boolean", "asBinaryOnly", ")", "{", "if", "(", "!", "isPackage", "(", "qualifiedPackageName", ")", ")", "return", "null", ";", "String", "fileName", "=", "new", "String", "(", "typeName", ")", ";", "boolean", "binaryExists", "=", "(", "(", "this", ".", "mode", "&", "BINARY", ")", "!=", "0", ")", "&&", "doesFileExist", "(", "fileName", "+", "SUFFIX_STRING_class", ",", "qualifiedPackageName", ")", ";", "boolean", "sourceExists", "=", "(", "(", "this", ".", "mode", "&", "SOURCE", ")", "!=", "0", ")", "&&", "doesFileExist", "(", "fileName", "+", "SUFFIX_STRING_java", ",", "qualifiedPackageName", ")", ";", "if", "(", "sourceExists", "&&", "!", "asBinaryOnly", ")", "{", "String", "fullSourcePath", "=", "this", ".", "path", "+", "qualifiedBinaryFileName", ".", "substring", "(", "0", ",", "qualifiedBinaryFileName", ".", "length", "(", ")", "-", "6", ")", "+", "SUFFIX_STRING_java", ";", "if", "(", "!", "binaryExists", ")", "return", "new", "NameEnvironmentAnswer", "(", "new", "CompilationUnit", "(", "null", ",", "fullSourcePath", ",", "this", ".", "encoding", ",", "this", ".", "destinationPath", ")", ",", "fetchAccessRestriction", "(", "qualifiedBinaryFileName", ")", ")", ";", "String", "fullBinaryPath", "=", "this", ".", "path", "+", "qualifiedBinaryFileName", ";", "long", "binaryModified", "=", "new", "File", "(", "fullBinaryPath", ")", ".", "lastModified", "(", ")", ";", "long", "sourceModified", "=", "new", "File", "(", "fullSourcePath", ")", ".", "lastModified", "(", ")", ";", "if", "(", "sourceModified", ">", "binaryModified", ")", "return", "new", "NameEnvironmentAnswer", "(", "new", "CompilationUnit", "(", "null", ",", "fullSourcePath", ",", "this", ".", "encoding", ",", "this", ".", "destinationPath", ")", ",", "fetchAccessRestriction", "(", "qualifiedBinaryFileName", ")", ")", ";", "}", "if", "(", "binaryExists", ")", "{", "try", "{", "ClassFileReader", "reader", "=", "ClassFileReader", ".", "read", "(", "this", ".", "path", "+", "qualifiedBinaryFileName", ")", ";", "if", "(", "reader", "!=", "null", ")", "return", "new", "NameEnvironmentAnswer", "(", "reader", ",", "fetchAccessRestriction", "(", "qualifiedBinaryFileName", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "catch", "(", "ClassFormatException", "e", ")", "{", "}", "}", "return", "null", ";", "}", "public", "char", "[", "]", "[", "]", "[", "]", "findTypeNames", "(", "String", "qualifiedPackageName", ")", "{", "if", "(", "!", "isPackage", "(", "qualifiedPackageName", ")", ")", "{", "return", "null", ";", "}", "File", "dir", "=", "new", "File", "(", "this", ".", "path", "+", "qualifiedPackageName", ")", ";", "if", "(", "!", "dir", ".", "exists", "(", ")", "||", "!", "dir", ".", "isDirectory", "(", ")", ")", "{", "return", "null", ";", "}", "String", "[", "]", "listFiles", "=", "dir", ".", "list", "(", "new", "FilenameFilter", "(", ")", "{", "public", "boolean", "accept", "(", "File", "directory", ",", "String", "name", ")", "{", "String", "fileName", "=", "name", ".", "toLowerCase", "(", ")", ";", "return", "fileName", ".", "endsWith", "(", "\".class\"", ")", "||", "fileName", ".", "endsWith", "(", "\".java\"", ")", ";", "}", "}", ")", ";", "int", "length", ";", "if", "(", "listFiles", "==", "null", "||", "(", "length", "=", "listFiles", ".", "length", ")", "==", "0", ")", "{", "return", "null", ";", "}", "char", "[", "]", "[", "]", "[", "]", "result", "=", "new", "char", "[", "length", "]", "[", "]", "[", "]", ";", "char", "[", "]", "[", "]", "packageName", "=", "CharOperation", ".", "splitOn", "(", "File", ".", "separatorChar", ",", "qualifiedPackageName", ".", "toCharArray", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "fileName", "=", "listFiles", "[", "i", "]", ";", "int", "indexOfLastDot", "=", "fileName", ".", "indexOf", "(", "'.'", ")", ";", "result", "[", "i", "]", "=", "CharOperation", ".", "arrayConcat", "(", "packageName", ",", "fileName", ".", "substring", "(", "0", ",", "indexOfLastDot", ")", ".", "toCharArray", "(", ")", ")", ";", "}", "return", "result", ";", "}", "public", "void", "initialize", "(", ")", "throws", "IOException", "{", "}", "public", "boolean", "isPackage", "(", "String", "qualifiedPackageName", ")", "{", "return", "directoryList", "(", "qualifiedPackageName", ")", "!=", "null", ";", "}", "public", "void", "reset", "(", ")", "{", "this", ".", "directoryCache", "=", "new", "Hashtable", "(", "11", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"\"", "+", "this", ".", "path", ";", "}", "public", "char", "[", "]", "normalizedPath", "(", ")", "{", "if", "(", "this", ".", "normalizedPath", "==", "null", ")", "{", "this", ".", "normalizedPath", "=", "this", ".", "path", ".", "toCharArray", "(", ")", ";", "if", "(", "File", ".", "separatorChar", "==", "'\\\\'", ")", "{", "CharOperation", ".", "replace", "(", "this", ".", "normalizedPath", ",", "'\\\\'", ",", "'/'", ")", ";", "}", "}", "return", "this", ".", "normalizedPath", ";", "}", "public", "String", "getPath", "(", ")", "{", "return", "this", ".", "path", ";", "}", "}", "</s>" ]
5,904
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "batch", ";", "import", "java", ".", "io", ".", "PrintWriter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CompilationProgress", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "batch", ".", "Main", ";", "public", "final", "class", "BatchCompiler", "{", "public", "static", "boolean", "compile", "(", "String", "commandLine", ",", "PrintWriter", "outWriter", ",", "PrintWriter", "errWriter", ",", "CompilationProgress", "progress", ")", "{", "return", "Main", ".", "compile", "(", "Main", ".", "tokenize", "(", "commandLine", ")", ",", "outWriter", ",", "errWriter", ",", "progress", ")", ";", "}", "public", "static", "boolean", "compile", "(", "String", "[", "]", "commandLineArguments", ",", "PrintWriter", "outWriter", ",", "PrintWriter", "errWriter", ",", "CompilationProgress", "progress", ")", "{", "return", "Main", ".", "compile", "(", "commandLineArguments", ",", "outWriter", ",", "errWriter", ",", "progress", ")", ";", "}", "private", "BatchCompiler", "(", ")", "{", "}", "}", "</s>" ]
5,905
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Collection", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Stack", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "AnnotationNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "FieldNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "BindingSet", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "GroovyDSLDContext", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "IPointcut", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyCompilationUnit", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "ModuleNodeMapper", ".", "ModuleNodeInfo", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "groovy", ".", "tests", ".", "search", ".", "AbstractGroovySearchTest", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "groovy", ".", "search", ".", "ITypeRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "groovy", ".", "search", ".", "TypeInferencingVisitorWithRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "groovy", ".", "search", ".", "TypeLookupResult", ";", "public", "class", "PointcutEvaluationTests", "extends", "AbstractGroovySearchTest", "{", "public", "static", "Test", "suite", "(", ")", "{", "return", "new", "TestSuite", "(", "PointcutEvaluationTests", ".", "class", ")", ";", "}", "class", "PointcutEvaluationRequestor", "implements", "ITypeRequestor", "{", "private", "final", "IPointcut", "toMatch", ";", "private", "final", "GroovyDSLDContext", "context", ";", "Stack", "<", "BindingSet", ">", "matches", "=", "new", "Stack", "<", "BindingSet", ">", "(", ")", ";", "BindingSet", "largestMatch", "=", "null", ";", "Collection", "<", "?", ">", "largestMatchResult", "=", "null", ";", "public", "PointcutEvaluationRequestor", "(", "IPointcut", "toMatch", ",", "GroovyCompilationUnit", "unit", ")", "throws", "CoreException", "{", "super", "(", ")", ";", "this", ".", "toMatch", "=", "toMatch", ";", "this", ".", "context", "=", "createContext", "(", "unit", ")", ";", "}", "private", "GroovyDSLDContext", "createContext", "(", "GroovyCompilationUnit", "unit", ")", "throws", "CoreException", "{", "ModuleNodeInfo", "info", "=", "unit", ".", "getModuleInfo", "(", "true", ")", ";", "GroovyDSLDContext", "context", "=", "new", "GroovyDSLDContext", "(", "unit", ",", "info", ".", "module", ",", "info", ".", "resolver", ")", ";", "context", ".", "resetBinding", "(", ")", ";", "return", "context", ";", "}", "public", "VisitStatus", "acceptASTNode", "(", "ASTNode", "node", ",", "TypeLookupResult", "result", ",", "IJavaElement", "enclosingElement", ")", "{", "context", ".", "setCurrentScope", "(", "result", ".", "scope", ")", ";", "context", ".", "setTargetType", "(", "result", ".", "type", ")", ";", "context", ".", "resetBinding", "(", ")", ";", "Collection", "<", "?", ">", "matchResult", "=", "toMatch", ".", "matches", "(", "context", ",", "result", ".", "type", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "BindingSet", "set", "=", "context", ".", "getCurrentBinding", "(", ")", ";", "matches", ".", "push", "(", "set", ")", ";", "if", "(", "largestMatch", "==", "null", "||", "largestMatch", ".", "size", "(", ")", "<=", "set", ".", "size", "(", ")", ")", "{", "largestMatch", "=", "set", ";", "largestMatchResult", "=", "matchResult", ";", "}", "}", "return", "VisitStatus", ".", "CONTINUE", ";", "}", "Collection", "<", "?", ">", "getLargestMatchResult", "(", ")", "{", "return", "largestMatchResult", ";", "}", "BindingSet", "getLargestMatch", "(", ")", "{", "return", "largestMatch", ";", "}", "boolean", "hasMatches", "(", ")", "{", "return", "!", "matches", ".", "isEmpty", "(", ")", ";", "}", "}", "class", "BindingResult", "{", "public", "BindingResult", "(", "String", "bindingName", ",", "String", "bindingToString", ")", "{", "super", "(", ")", ";", "this", ".", "bindingName", "=", "bindingName", ";", "this", ".", "bindingToString", "=", "bindingToString", ";", "}", "final", "String", "bindingName", ";", "final", "String", "bindingToString", ";", "@", "Override", "public", "String", "toString", "(", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "builder", ".", "append", "(", "\"\"", ")", ";", "builder", ".", "append", "(", "\"bindingName=\"", ")", ";", "builder", ".", "append", "(", "bindingName", ")", ";", "builder", ".", "append", "(", "\"\"", ")", ";", "builder", ".", "append", "(", "bindingToString", ")", ";", "builder", ".", "append", "(", "\"]\"", ")", ";", "return", "builder", ".", "toString", "(", ")", ";", "}", "}", "public", "PointcutEvaluationTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField1", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField2", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField3", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField4Fail", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "null", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField5", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField5b", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField5c", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField6Fail_a", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "null", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField6Fail_b", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "null", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField6Fail_c", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", ",", "null", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField7a", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField7b", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField8", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField8b", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField9Fail_a", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "null", ")", ";", "}", "public", "void", "testEvaluateTypeMethodField9Fail_b", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "null", ")", ";", "}", "public", "void", "testAnnotation1", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastMatch", "(", "\"\"", ",", "\"\"", ",", "\"p.Foo\"", ")", ";", "}", "public", "void", "testAnnotation2", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastMatch", "(", "\"\"", ",", "\"\"", ",", "\"p.Foo\"", ")", ";", "}", "public", "void", "testAnnotation3", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastMatch", "(", "\"\"", ",", "\"\"", ",", "\"p.Foo\"", ")", ";", "}", "public", "void", "testAnnotation4", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastMatch", "(", "\"\"", ",", "\"\"", ",", "\"p.Foo\"", ")", ";", "}", "public", "void", "testAnnotation5", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastMatch", "(", "\"\"", ",", "\"\"", ",", "\"p.Foo\"", ")", ";", "}", "public", "void", "testAnnotation6", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastMatch", "(", "\"\"", ",", "\"\"", ",", "\"p.Foo\"", ")", ";", "}", "public", "void", "testAnnotation7Fail", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastMatch", "(", "\"\"", ",", "\"\"", ",", "null", ")", ";", "}", "public", "void", "testAnnotation8", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastMatch", "(", "\"\"", ",", "\"\"", ",", "\"p.Foo\"", ")", ";", "}", "public", "void", "testEvaluateFileExtension1", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateFileExtension2Fail", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "null", ")", ";", "}", "public", "void", "testEvaluateNature1", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testEvaluateNature2Fail", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "null", ")", ";", "}", "public", "void", "testPackagePath", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"p\"", ",", "\"package", "pn2\"", ",", "\"\"", ",", "\"p\"", ")", ";", "}", "public", "void", "testPackagePathFail", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"p\"", ",", "\"package", "pn2\"", ",", "\"\"", ",", "null", ")", ";", "}", "public", "void", "testNamedBinding1", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testNamedBinding2", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"c\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testNamedBinding3", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", "+", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"c\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testNamedBinding4", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", "+", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"c\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testNamedBinding5", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", "+", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testNamedBinding6", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", "+", "\"\"", ")", ";", "}", "public", "void", "testNamedBinding6a", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", "+", "\"\"", ",", "new", "BindingResult", "(", "\"c\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding1", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding2", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", "+", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding3", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", "+", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"c\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding4", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding4Fail", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ")", ";", "}", "public", "void", "testTypesNamedBinding5", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding6", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding7", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding8", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding9", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding10Fail", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ")", ";", "}", "public", "void", "testTypesNamedBinding11", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding12", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding13", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Bar\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"p.Bar\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding14", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Bar\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"p.Foo\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding15", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Bar\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding16", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"p.Foo\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding17", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"p.Foo\"", ")", ")", ";", "}", "public", "void", "testTypesNamedBinding18Fail", "(", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ")", ";", "}", "public", "void", "testAnd1", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"a\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"c\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"d\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testAnd2", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "null", ")", ";", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"c\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testOr1", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"a\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"c\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"d\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testOr2", "(", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"package", "pn2\"", ",", "\"\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"package", "pn2\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"a\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ",", "new", "BindingResult", "(", "\"c\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testAnnotationBinding1", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testAnnotationBinding2", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"p.Foo.t\"", ")", ")", ";", "}", "public", "void", "testAnnotationBinding3", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"p.Foo.t\"", ")", ")", ";", "}", "public", "void", "testAnnotationBinding4", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testAnnotationBinding5", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testAnnotationBinding6", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testAnnotationBinding7Fail", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testAnnotationBinding8", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testAnnotationBinding9", "(", ")", "throws", "Exception", "{", "createUnit", "(", "\"p\"", ",", "\"Foo\"", ",", "\"\"", ")", ";", "doTestOfLastBindingSet", "(", "\"\"", ",", "\"\"", ",", "new", "BindingResult", "(", "\"b\"", ",", "\"\"", ")", ")", ";", "}", "private", "void", "doTestOfLastBindingSet", "(", "String", "cuContents", ",", "String", "pointcutText", ",", "BindingResult", "...", "results", ")", "throws", "Exception", "{", "doTestOfLastBindingSet", "(", "\"p\"", ",", "cuContents", ",", "pointcutText", ",", "results", ")", ";", "}", "private", "void", "doTestOfLastBindingSet", "(", "String", "pkg", ",", "String", "cuContents", ",", "String", "pointcutText", ",", "BindingResult", "...", "results", ")", "throws", "Exception", "{", "GroovyCompilationUnit", "unit", "=", "createUnit", "(", "pkg", ",", "\"Unit\"", ",", "cuContents", ")", ";", "BindingSet", "bindings", "=", "evaluateForBindings", "(", "unit", ",", "pointcutText", ")", ";", "assertAllBindings", "(", "bindings", ",", "results", ")", ";", "}", "private", "void", "doTestOfLastMatch", "(", "String", "cuContents", ",", "String", "pointcutText", ",", "String", "name", ")", "throws", "Exception", "{", "doTestOfLastMatch", "(", "\"p\"", ",", "cuContents", ",", "pointcutText", ",", "name", ")", ";", "}", "private", "void", "doTestOfLastMatch", "(", "String", "pkg", ",", "String", "cuContents", ",", "String", "pointcutText", ",", "String", "name", ")", "throws", "Exception", "{", "GroovyCompilationUnit", "unit", "=", "createUnit", "(", "pkg", ",", "\"Unit\"", ",", "cuContents", ")", ";", "Collection", "<", "?", ">", "match", "=", "evaluateForMatch", "(", "unit", ",", "pointcutText", ")", ";", "assertSingleBinding", "(", "name", ",", "match", ")", ";", "}", "private", "void", "assertAllBindings", "(", "BindingSet", "bindings", ",", "BindingResult", "...", "results", ")", "{", "if", "(", "results", ".", "length", "==", "0", ")", "{", "assertEquals", "(", "\"\"", ",", "0", ",", "bindings", ".", "getBindings", "(", ")", ".", "size", "(", ")", ")", ";", "return", ";", "}", "assertNotNull", "(", "\"\"", "+", "Arrays", ".", "toString", "(", "results", ")", ",", "bindings", ")", ";", "for", "(", "BindingResult", "result", ":", "results", ")", "{", "Collection", "<", "?", ">", "o", "=", "bindings", ".", "getBinding", "(", "result", ".", "bindingName", ")", ";", "if", "(", "o", "==", "null", ")", "{", "fail", "(", "\"\"", "+", "result", ".", "bindingName", "+", "\"\"", "+", "\"\"", "+", "bindings", ".", "getBindings", "(", ")", ")", ";", "}", "assertSingleBinding", "(", "result", ".", "bindingToString", ",", "o", ")", ";", "}", "assertEquals", "(", "\"\"", "+", "Arrays", ".", "toString", "(", "results", ")", "+", "\"\"", "+", "bindings", ".", "getBindings", "(", ")", ",", "results", ".", "length", ",", "bindings", ".", "getBindings", "(", ")", ".", "size", "(", ")", ")", ";", "}", "private", "void", "assertSingleBinding", "(", "String", "bindingToString", ",", "Collection", "<", "?", ">", "binding", ")", "{", "if", "(", "bindingToString", "==", "null", ")", "{", "assertNull", "(", "\"\"", ",", "binding", ")", ";", "return", ";", "}", "assertNotNull", "(", "\"\"", ",", "binding", ")", ";", "String", "[", "]", "split", "=", "bindingToString", ".", "split", "(", "\",", "\"", ")", ";", "assertEquals", "(", "\"\"", "+", "BindingSet", ".", "printCollection", "(", "binding", ")", ",", "split", ".", "length", ",", "binding", ".", "size", "(", ")", ")", ";", "List", "<", "String", ">", "asList", "=", "Arrays", ".", "asList", "(", "split", ")", ";", "for", "(", "Object", "object", ":", "binding", ")", "{", "String", "name", "=", "extractName", "(", "object", ")", ";", "assertTrue", "(", "\"\"", "+", "name", "+", "\"\"", "+", "asList", ",", "asList", ".", "contains", "(", "name", ")", ")", ";", "}", "}", "private", "String", "extractName", "(", "Object", "defaultBinding", ")", "{", "if", "(", "defaultBinding", "==", "null", ")", "{", "return", "null", ";", "}", "else", "if", "(", "defaultBinding", "instanceof", "ClassNode", ")", "{", "return", "(", "(", "ClassNode", ")", "defaultBinding", ")", ".", "getName", "(", ")", ";", "}", "else", "if", "(", "defaultBinding", "instanceof", "FieldNode", ")", "{", "FieldNode", "fieldNode", "=", "(", "FieldNode", ")", "defaultBinding", ";", "return", "fieldNode", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", "+", "\".\"", "+", "fieldNode", ".", "getName", "(", ")", ";", "}", "else", "if", "(", "defaultBinding", "instanceof", "MethodNode", ")", "{", "MethodNode", "methodNode", "=", "(", "MethodNode", ")", "defaultBinding", ";", "return", "methodNode", ".", "getDeclaringClass", "(", ")", ".", "getName", "(", ")", "+", "\".\"", "+", "methodNode", ".", "getName", "(", ")", ";", "}", "else", "if", "(", "defaultBinding", "instanceof", "AnnotationNode", ")", "{", "AnnotationNode", "annotationNode", "=", "(", "AnnotationNode", ")", "defaultBinding", ";", "return", "\"@\"", "+", "annotationNode", ".", "getClassNode", "(", ")", ".", "getName", "(", ")", ";", "}", "else", "if", "(", "defaultBinding", "instanceof", "Collection", "<", "?", ">", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "Object", "item", ":", "(", "(", "Collection", "<", "?", ">", ")", "defaultBinding", ")", ")", "{", "sb", ".", "append", "(", "extractName", "(", "item", ")", ")", ";", "sb", ".", "append", "(", "\",", "\"", ")", ";", "}", "sb", ".", "replace", "(", "sb", ".", "length", "(", ")", "-", "2", ",", "sb", ".", "length", "(", ")", ",", "\"\"", ")", ";", "return", "sb", ".", "toString", "(", ")", ";", "}", "else", "{", "return", "defaultBinding", ".", "toString", "(", ")", ";", "}", "}", "private", "Collection", "<", "?", ">", "evaluateForMatch", "(", "GroovyCompilationUnit", "unit", ",", "String", "pointcutText", ")", "throws", "CoreException", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "pointcutText", ")", ";", "PointcutEvaluationRequestor", "requestor", "=", "new", "PointcutEvaluationRequestor", "(", "pc", ",", "unit", ")", ";", "TypeInferencingVisitorWithRequestor", "visitor", "=", "factory", ".", "createVisitor", "(", "unit", ")", ";", "visitor", ".", "visitCompilationUnit", "(", "requestor", ")", ";", "return", "requestor", ".", "hasMatches", "(", ")", "?", "requestor", ".", "getLargestMatchResult", "(", ")", ":", "null", ";", "}", "private", "BindingSet", "evaluateForBindings", "(", "GroovyCompilationUnit", "unit", ",", "String", "pointcutText", ")", "throws", "CoreException", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "pointcutText", ")", ";", "PointcutEvaluationRequestor", "requestor", "=", "new", "PointcutEvaluationRequestor", "(", "pc", ",", "unit", ")", ";", "TypeInferencingVisitorWithRequestor", "visitor", "=", "factory", ".", "createVisitor", "(", "unit", ")", ";", "visitor", ".", "visitCompilationUnit", "(", "requestor", ")", ";", "return", "requestor", ".", "hasMatches", "(", ")", "?", "requestor", ".", "getLargestMatch", "(", ")", ":", "null", ";", "}", "}", "</s>" ]
5,906
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "net", ".", "MalformedURLException", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ".", "CompletionTestCase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "model", ".", "GroovyRuntime", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "GroovyDSLCoreActivator", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "RefreshDSLDJob", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "FileLocator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "tests", ".", "util", ".", "GroovyUtils", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Document", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "DSLContentAssistTests", "extends", "CompletionTestCase", "{", "private", "static", "final", "String", "COMMAND_CHAIN_NO_ARGS", "=", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "private", "static", "final", "String", "COMMAND_CHAIN_ONE_ARG", "=", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "private", "static", "final", "String", "COMMAND_CHAIN_TWO_ARGS", "=", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "private", "static", "final", "String", "NO_PARENS_FOR_DELEGATE", "=", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "private", "static", "final", "String", "SET_DELEGATE_ON_INT", "=", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "public", "DSLContentAssistTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "createGenericProject", "(", ")", ";", "IProject", "project", "=", "getDefaultProject", "(", ")", ";", "AbstractDSLInferencingTest", ".", "refreshExternalFoldersProject", "(", ")", ";", "GroovyRuntime", ".", "addLibraryToClasspath", "(", "JavaCore", ".", "create", "(", "project", ")", ",", "GroovyDSLCoreActivator", ".", "CLASSPATH_CONTAINER_ID", ",", "false", ")", ";", "env", ".", "fullBuild", "(", ")", ";", "new", "RefreshDSLDJob", "(", "project", ")", ".", "run", "(", "null", ")", ";", "GroovyDSLCoreActivator", ".", "getDefault", "(", ")", ".", "getContainerListener", "(", ")", ".", "ignoreProject", "(", "project", ")", ";", "}", "public", "void", "testDSLProposalFirstStaticField", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"instance\"", ",", "\"aaa\"", ")", ";", "}", "public", "void", "testDSLProposalFirstStaticMethod", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"getInstance\"", ",", "\"aaa\"", ")", ";", "}", "public", "void", "testDSLProposalFirstMethod1", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", ">=", "20", ")", "{", "AbstractDSLInferencingTest", ".", "addGroovyJarToProject", "(", "\"\"", ",", "getDefaultProject", "(", ")", ")", ";", "}", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"delegate.xn\"", "+", "\"}\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"delegate.\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"frame\"", ",", "\"\"", ")", ";", "}", "public", "void", "testDSLProposalFirstMethod2", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", ">=", "20", ")", "{", "AbstractDSLInferencingTest", ".", "addGroovyJarToProject", "(", "\"\"", ",", "getDefaultProject", "(", ")", ")", ";", "}", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"n\"", "+", "\"}\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"{n\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"frame\"", ",", "\"\"", ")", ";", "}", "public", "void", "testDSLProposalFirstMethod3", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", ">=", "20", ")", "{", "AbstractDSLInferencingTest", ".", "addGroovyJarToProject", "(", "\"\"", ",", "getDefaultProject", "(", ")", ")", ";", "}", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"this.xn\"", "+", "\"}\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"this.\"", ")", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"frame\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "0", ")", ";", "}", "public", "void", "testEmptyClosure1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_ON_INT", ")", ";", "String", "contents", "=", "\"1.foo", "{n\"", "+", "\"", "//", "heren\"", "+", "\"}\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"n", "\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"substring\"", ",", "2", ")", ";", "proposalExists", "(", "proposals", ",", "\"bytes\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"abs\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"capitalize\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"digits\"", ",", "0", ")", ";", "}", "public", "void", "testEmptyClosure2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_ON_INT", ")", ";", "String", "contents", "=", "\"1.foo", "{n\"", "+", "\"", "ton\"", "+", "\"}\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"n", "\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "0", ")", ";", "}", "public", "void", "testCommandChain1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "COMMAND_CHAIN_NO_ARGS", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"val.fla\"", ";", "Document", "doc", "=", "new", "Document", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\".fla\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"flart\"", ",", "1", ")", ";", "ICompletionProposal", "proposal", "=", "findFirstProposal", "(", "proposals", ",", "\"flart\"", ",", "false", ")", ";", "applyProposalAndCheck", "(", "doc", ",", "proposal", ",", "contents", ".", "replace", "(", "\"val.fla\"", ",", "\"val.flart\"", ")", ")", ";", "}", "public", "void", "testCommandChain2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "COMMAND_CHAIN_NO_ARGS", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", ";", "Document", "doc", "=", "new", "Document", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "fl\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"flart\"", ",", "1", ")", ";", "ICompletionProposal", "proposal", "=", "findFirstProposal", "(", "proposals", ",", "\"flart\"", ",", "false", ")", ";", "applyProposalAndCheck", "(", "doc", ",", "proposal", ",", "contents", ".", "replace", "(", "\"", "fl\"", ",", "\"", "flart\"", ")", ")", ";", "}", "public", "void", "testCommandChain3", "(", ")", "throws", "Exception", "{", "createDsls", "(", "COMMAND_CHAIN_NO_ARGS", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", ";", "Document", "doc", "=", "new", "Document", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "fl\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"flart\"", ",", "1", ")", ";", "ICompletionProposal", "proposal", "=", "findFirstProposal", "(", "proposals", ",", "\"flart\"", ",", "false", ")", ";", "applyProposalAndCheck", "(", "doc", ",", "proposal", ",", "contents", ".", "replace", "(", "\"", "fl\"", ",", "\"", "flart\"", ")", ")", ";", "}", "public", "void", "testCommandChain4", "(", ")", "throws", "Exception", "{", "createDsls", "(", "COMMAND_CHAIN_ONE_ARG", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", ";", "Document", "doc", "=", "new", "Document", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "fl\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"flart\"", ",", "1", ")", ";", "ICompletionProposal", "proposal", "=", "findFirstProposal", "(", "proposals", ",", "\"flart\"", ",", "false", ")", ";", "applyProposalAndCheck", "(", "doc", ",", "proposal", ",", "contents", ".", "replace", "(", "\"", "fl\"", ",", "\"", "flart", "0", "\"", ")", ")", ";", "}", "public", "void", "testCommandChain5", "(", ")", "throws", "Exception", "{", "createDsls", "(", "COMMAND_CHAIN_TWO_ARGS", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", ";", "Document", "doc", "=", "new", "Document", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "fl\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"flart\"", ",", "1", ")", ";", "ICompletionProposal", "proposal", "=", "findFirstProposal", "(", "proposals", ",", "\"flart\"", ",", "false", ")", ";", "applyProposalAndCheck", "(", "doc", ",", "proposal", ",", "contents", ".", "replace", "(", "\"", "fl\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testDelegatesToNoParens1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "NO_PARENS_FOR_DELEGATE", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"val.bl\"", ";", "Document", "doc", "=", "new", "Document", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"val.bl\"", ")", ")", ";", "ICompletionProposal", "proposal", "=", "findFirstProposal", "(", "proposals", ",", "\"blart\"", ",", "false", ")", ";", "applyProposalAndCheck", "(", "doc", ",", "proposal", ",", "contents", ".", "replace", "(", "\"val.bl\"", ",", "\"\"", ")", ")", ";", "}", "public", "void", "testDelegatesToNoParens2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "NO_PARENS_FOR_DELEGATE", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"val.fl\"", ";", "Document", "doc", "=", "new", "Document", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"val.fl\"", ")", ")", ";", "ICompletionProposal", "proposal", "=", "findFirstProposal", "(", "proposals", ",", "\"flart\"", ",", "false", ")", ";", "applyProposalAndCheck", "(", "doc", ",", "proposal", ",", "contents", ".", "replace", "(", "\"val.fl\"", ",", "\"\"", ")", ")", ";", "}", "protected", "void", "addJarToProject", "(", "String", "jarName", ")", "throws", "JavaModelException", ",", "IOException", "{", "String", "externalFilePath", "=", "findExternalFilePath", "(", "jarName", ")", ";", "env", ".", "addExternalJar", "(", "getDefaultProject", "(", ")", ".", "getFullPath", "(", ")", ",", "externalFilePath", ")", ";", "}", "protected", "String", "findExternalFilePath", "(", "String", "jarName", ")", "throws", "MalformedURLException", ",", "IOException", "{", "URL", "url", "=", "GroovyDSLDTestsActivator", ".", "getDefault", "(", ")", ".", "getTestResourceURL", "(", "jarName", ")", ";", "URL", "resolved", "=", "FileLocator", ".", "resolve", "(", "url", ")", ";", "String", "externalFilePath", "=", "resolved", ".", "getFile", "(", ")", ";", "return", "externalFilePath", ";", "}", "protected", "String", "[", "]", "createDsls", "(", "String", "...", "dsls", ")", "{", "return", "createDsls", "(", "0", ",", "dsls", ")", ";", "}", "protected", "String", "[", "]", "createDsls", "(", "int", "startWith", ",", "String", "...", "dsls", ")", "{", "int", "i", "=", "startWith", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "dsls", ".", "length", "+", "\"", "DSLD", "files.\"", ")", ";", "for", "(", "String", "dsl", ":", "dsls", ")", "{", "System", ".", "out", ".", "println", "(", "\"Creating:n\"", "+", "dsl", "+", "\"n\"", ")", ";", "IPath", "path", "=", "env", ".", "addFile", "(", "getDefaultProject", "(", ")", ".", "getFullPath", "(", ")", ",", "\"dsl\"", "+", "i", "++", "+", "\".dsld\"", ",", "dsl", ")", ";", "IFile", "file", "=", "env", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getFile", "(", "path", ")", ";", "if", "(", "!", "file", ".", "exists", "(", ")", ")", "{", "fail", "(", "\"File", "\"", "+", "file", "+", "\"\"", ")", ";", "}", "}", "return", "dsls", ";", "}", "protected", "IProject", "getDefaultProject", "(", ")", "{", "return", "env", ".", "getProject", "(", "\"Project\"", ")", ";", "}", "}", "</s>" ]
5,907
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "List", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "model", ".", "GroovyRuntime", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "GroovyDSLCoreActivator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathContainer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "tests", ".", "util", ".", "GroovyUtils", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "ExternalPackageFragmentRoot", ";", "public", "class", "BuiltInDSLInferencingTests", "extends", "AbstractDSLInferencingTest", "{", "public", "BuiltInDSLInferencingTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "static", "Test", "suite", "(", ")", "{", "return", "new", "TestSuite", "(", "BuiltInDSLInferencingTests", ".", "class", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "doRemoveClasspathContainer", "=", "false", ";", "super", ".", "setUp", "(", ")", ";", "}", "public", "void", "testSanity", "(", ")", "throws", "Exception", "{", "IJavaProject", "javaProject", "=", "JavaCore", ".", "create", "(", "project", ")", ";", "assertTrue", "(", "\"\"", ",", "GroovyRuntime", ".", "hasClasspathContainer", "(", "javaProject", ",", "GroovyDSLCoreActivator", ".", "CLASSPATH_CONTAINER_ID", ")", ")", ";", "IClasspathContainer", "container", "=", "JavaCore", ".", "getClasspathContainer", "(", "GroovyDSLCoreActivator", ".", "CLASSPATH_CONTAINER_ID", ",", "javaProject", ")", ";", "IClasspathEntry", "[", "]", "cpes", "=", "container", ".", "getClasspathEntries", "(", ")", ";", "assertEquals", "(", "\"\"", "+", "Arrays", ".", "toString", "(", "cpes", ")", ",", "2", ",", "cpes", ".", "length", ")", ";", "IClasspathEntry", "pluginEntry", "=", "null", ";", "IClasspathEntry", "[", "]", "entries", "=", "javaProject", ".", "getResolvedClasspath", "(", "true", ")", ";", "for", "(", "IClasspathEntry", "entry", ":", "entries", ")", "{", "if", "(", "entry", ".", "getPath", "(", ")", ".", "toString", "(", ")", ".", "contains", "(", "\"plugin_dsld\"", ")", ")", "{", "pluginEntry", "=", "entry", ";", "}", "}", "IPackageFragmentRoot", "root", "=", "null", ";", "List", "<", "String", ">", "elements", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "IJavaElement", "elt", ":", "javaProject", ".", "getChildren", "(", ")", ")", "{", "elements", ".", "add", "(", "elt", ".", "getElementName", "(", ")", ")", ";", "if", "(", "elt", ".", "getElementName", "(", ")", ".", "contains", "(", "\"plugin_dsld\"", ")", ")", "{", "root", "=", "(", "IPackageFragmentRoot", ")", "elt", ";", "}", "}", "List", "<", "String", ">", "possibleFrags", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "for", "(", "IPackageFragment", "frag", ":", "javaProject", ".", "getPackageFragments", "(", ")", ")", "{", "if", "(", "frag", ".", "getElementName", "(", ")", ".", "equals", "(", "\"dsld\"", ")", ")", "{", "possibleFrags", ".", "add", "(", "frag", ".", "toString", "(", ")", ")", ";", "possibleFrags", ".", "add", "(", "\"", "[\"", ")", ";", "for", "(", "IJavaElement", "child", ":", "frag", ".", "getChildren", "(", ")", ")", "{", "possibleFrags", ".", "add", "(", "\"", "\"", "+", "child", ".", "getElementName", "(", ")", ")", ";", "}", "possibleFrags", ".", "add", "(", "\"", "]\"", ")", ";", "}", "}", "assertNotNull", "(", "\"\"", "+", "printList", "(", "elements", ")", "+", "\"\"", "+", "printList", "(", "possibleFrags", ")", ",", "pluginEntry", ")", ";", "assertNotNull", "(", "\"\"", "+", "printList", "(", "elements", ")", "+", "\"\"", "+", "printList", "(", "possibleFrags", ")", ",", "root", ")", ";", "assertTrue", "(", "\"\"", ",", "root", ".", "exists", "(", ")", ")", ";", "ExternalPackageFragmentRoot", "ext", "=", "(", "ExternalPackageFragmentRoot", ")", "root", ";", "ext", ".", "resource", "(", ")", ".", "refreshLocal", "(", "IResource", ".", "DEPTH_INFINITE", ",", "null", ")", ";", "root", ".", "close", "(", ")", ";", "root", ".", "open", "(", "null", ")", ";", "IPackageFragment", "frag", "=", "root", ".", "getPackageFragment", "(", "\"dsld\"", ")", ";", "assertTrue", "(", "\"\"", ",", "frag", ".", "exists", "(", ")", ")", ";", "}", "private", "String", "printList", "(", "List", "<", "String", ">", "elements", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"[n\"", ")", ";", "for", "(", "String", "elt", ":", "elements", ")", "{", "sb", ".", "append", "(", "elt", ")", ".", "append", "(", "\"n\"", ")", ";", "}", "sb", ".", "append", "(", "\"]\"", ")", ";", "return", "sb", ".", "toString", "(", ")", ";", "}", "public", "void", "testSingleton", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"instance\"", ")", ";", "int", "end", "=", "start", "+", "\"instance\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"Foo\"", ",", "\"Singleton\"", ",", "true", ")", ";", "start", "=", "contents", ".", "lastIndexOf", "(", "\"getInstance\"", ")", ";", "end", "=", "start", "+", "\"getInstance\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"Foo\"", ",", "\"Singleton\"", ",", "true", ")", ";", "}", "public", "void", "testDelegate1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"get\"", ")", ";", "int", "end", "=", "start", "+", "\"get\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "\"Delegate\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testDelegate2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "start", "=", "contents", ".", "indexOf", "(", "\"get\"", ")", ";", "int", "end", "=", "start", "+", "\"get\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "\"Delegate\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "start", "=", "contents", ".", "lastIndexOf", "(", "\"getFile\"", ")", ";", "end", "=", "start", "+", "\"getFile\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "\"Delegate\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"java.net.URL\"", ",", "true", ")", ";", "}", "public", "void", "testMixin", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"dive\"", ")", ";", "int", "end", "=", "start", "+", "\"dive\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "\"Mixin\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fly\"", ",", "start", ")", ";", "end", "=", "start", "+", "\"fly\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "\"Mixin\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "start", "=", "contents", ".", "lastIndexOf", "(", "\"dive\"", ",", "start", ")", ";", "end", "=", "start", "+", "\"dive\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "\"Mixin\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fly\"", ",", "start", ")", ";", "end", "=", "start", "+", "\"fly\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "\"Mixin\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSwingBuilder1", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", ">=", "20", ")", "{", "addGroovyJarToProject", "(", "\"\"", ")", ";", "}", "String", "contents", "=", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"frame\"", ")", ";", "int", "end", "=", "start", "+", "\"frame\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "\"SwingBuilder\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSwingBuilder2", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", ">=", "20", ")", "{", "addGroovyJarToProject", "(", "\"\"", ")", ";", "}", "String", "contents", "=", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"frame\"", ")", ";", "int", "end", "=", "start", "+", "\"frame\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "\"SwingBuilder\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "}", "</s>" ]
5,908
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "StringObjectVector", ";", "public", "class", "StringObjectVectorTests", "extends", "TestCase", "{", "private", "final", "Object", "obj1", "=", "new", "Object", "(", ")", ";", "private", "final", "Object", "obj2", "=", "new", "Object", "(", ")", ";", "private", "final", "Object", "obj3", "=", "new", "Object", "(", ")", ";", "private", "final", "Object", "obj4", "=", "new", "Object", "(", ")", ";", "private", "final", "Object", "obj5", "=", "new", "Object", "(", ")", ";", "private", "final", "String", "str1", "=", "\"1\"", ";", "private", "final", "String", "str2", "=", "\"2\"", ";", "private", "final", "String", "str3", "=", "\"3\"", ";", "private", "final", "String", "str4", "=", "\"4\"", ";", "private", "final", "String", "str5", "=", "\"5\"", ";", "public", "void", "testCreateAndResiveVector", "(", ")", "throws", "Exception", "{", "StringObjectVector", "vector", "=", "new", "StringObjectVector", "(", "3", ")", ";", "assertEquals", "(", "0", ",", "vector", ".", "size", ")", ";", "assertEquals", "(", "3", ",", "vector", ".", "maxSize", ")", ";", "vector", ".", "add", "(", "str1", ",", "obj1", ")", ";", "assertEquals", "(", "1", ",", "vector", ".", "size", ")", ";", "assertEquals", "(", "3", ",", "vector", ".", "maxSize", ")", ";", "vector", ".", "add", "(", "str2", ",", "obj2", ")", ";", "assertEquals", "(", "2", ",", "vector", ".", "size", ")", ";", "assertEquals", "(", "3", ",", "vector", ".", "maxSize", ")", ";", "vector", ".", "add", "(", "str3", ",", "obj3", ")", ";", "assertEquals", "(", "3", ",", "vector", ".", "size", ")", ";", "assertEquals", "(", "3", ",", "vector", ".", "maxSize", ")", ";", "vector", ".", "add", "(", "str4", ",", "obj4", ")", ";", "assertEquals", "(", "4", ",", "vector", ".", "size", ")", ";", "assertEquals", "(", "6", ",", "vector", ".", "maxSize", ")", ";", "vector", ".", "add", "(", "str5", ",", "obj5", ")", ";", "assertEquals", "(", "5", ",", "vector", ".", "size", ")", ";", "assertEquals", "(", "6", ",", "vector", ".", "maxSize", ")", ";", "}", "public", "void", "testFindAndContains", "(", ")", "throws", "Exception", "{", "StringObjectVector", "vector", "=", "new", "StringObjectVector", "(", "3", ")", ";", "vector", ".", "add", "(", "str1", ",", "obj1", ")", ";", "vector", ".", "add", "(", "str2", ",", "obj2", ")", ";", "vector", ".", "add", "(", "str3", ",", "obj3", ")", ";", "vector", ".", "add", "(", "str4", ",", "obj4", ")", ";", "vector", ".", "add", "(", "str5", ",", "obj5", ")", ";", "assertEquals", "(", "\"\"", ",", "obj1", ",", "vector", ".", "find", "(", "str1", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "obj2", ",", "vector", ".", "find", "(", "str2", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "obj3", ",", "vector", ".", "find", "(", "str3", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "obj4", ",", "vector", ".", "find", "(", "str4", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "obj5", ",", "vector", ".", "find", "(", "str5", ")", ")", ";", "assertFalse", "(", "vector", ".", "contains", "(", "null", ")", ")", ";", "assertFalse", "(", "vector", ".", "contains", "(", "new", "Object", "(", ")", ")", ")", ";", "assertFalse", "(", "vector", ".", "containsName", "(", "\"\"", ")", ")", ";", "assertFalse", "(", "vector", ".", "contains", "(", "str1", ")", ")", ";", "assertTrue", "(", "vector", ".", "contains", "(", "obj1", ")", ")", ";", "assertTrue", "(", "vector", ".", "contains", "(", "obj2", ")", ")", ";", "assertTrue", "(", "vector", ".", "contains", "(", "obj3", ")", ")", ";", "assertTrue", "(", "vector", ".", "contains", "(", "obj4", ")", ")", ";", "assertTrue", "(", "vector", ".", "contains", "(", "obj5", ")", ")", ";", "assertTrue", "(", "vector", ".", "containsName", "(", "str1", ")", ")", ";", "assertTrue", "(", "vector", ".", "containsName", "(", "str2", ")", ")", ";", "assertTrue", "(", "vector", ".", "containsName", "(", "str3", ")", ")", ";", "assertTrue", "(", "vector", ".", "containsName", "(", "str4", ")", ")", ";", "assertTrue", "(", "vector", ".", "containsName", "(", "str5", ")", ")", ";", "assertNull", "(", "vector", ".", "find", "(", "\"\"", ")", ")", ";", "assertNull", "(", "vector", ".", "find", "(", "null", ")", ")", ";", "assertEquals", "(", "5", ",", "vector", ".", "size", ")", ";", "vector", ".", "add", "(", "null", ",", "obj1", ")", ";", "assertEquals", "(", "6", ",", "vector", ".", "size", ")", ";", "assertEquals", "(", "obj1", ",", "vector", ".", "find", "(", "null", ")", ")", ";", "}", "public", "void", "testElementAtNameAt", "(", ")", "throws", "Exception", "{", "StringObjectVector", "vector", "=", "new", "StringObjectVector", "(", "3", ")", ";", "try", "{", "vector", ".", "elementAt", "(", "0", ")", ";", "fail", "(", "\"\"", ")", ";", "}", "catch", "(", "ArrayIndexOutOfBoundsException", "e", ")", "{", "}", "try", "{", "vector", ".", "nameAt", "(", "0", ")", ";", "fail", "(", "\"\"", ")", ";", "}", "catch", "(", "ArrayIndexOutOfBoundsException", "e", ")", "{", "}", "vector", ".", "add", "(", "str1", ",", "obj1", ")", ";", "vector", ".", "add", "(", "str2", ",", "obj2", ")", ";", "vector", ".", "add", "(", "str3", ",", "obj3", ")", ";", "vector", ".", "add", "(", "str4", ",", "obj4", ")", ";", "vector", ".", "add", "(", "str5", ",", "obj5", ")", ";", "assertEquals", "(", "\"\"", ",", "obj1", ",", "vector", ".", "elementAt", "(", "0", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "obj2", ",", "vector", ".", "elementAt", "(", "1", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "obj3", ",", "vector", ".", "elementAt", "(", "2", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "obj4", ",", "vector", ".", "elementAt", "(", "3", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "obj5", ",", "vector", ".", "elementAt", "(", "4", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "str1", ",", "vector", ".", "nameAt", "(", "0", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "str2", ",", "vector", ".", "nameAt", "(", "1", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "str3", ",", "vector", ".", "nameAt", "(", "2", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "str4", ",", "vector", ".", "nameAt", "(", "3", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "str5", ",", "vector", ".", "nameAt", "(", "4", ")", ")", ";", "try", "{", "vector", ".", "elementAt", "(", "5", ")", ";", "fail", "(", "\"\"", ")", ";", "}", "catch", "(", "ArrayIndexOutOfBoundsException", "e", ")", "{", "}", "try", "{", "vector", ".", "nameAt", "(", "5", ")", ";", "fail", "(", "\"\"", ")", ";", "}", "catch", "(", "ArrayIndexOutOfBoundsException", "e", ")", "{", "}", "try", "{", "vector", ".", "elementAt", "(", "-", "1", ")", ";", "fail", "(", "\"\"", ")", ";", "}", "catch", "(", "ArrayIndexOutOfBoundsException", "e", ")", "{", "}", "try", "{", "vector", ".", "nameAt", "(", "-", "1", ")", ";", "fail", "(", "\"\"", ")", ";", "}", "catch", "(", "ArrayIndexOutOfBoundsException", "e", ")", "{", "}", "vector", ".", "add", "(", "null", ",", "null", ")", ";", "vector", ".", "add", "(", "null", ",", "null", ")", ";", "assertEquals", "(", "\"\"", ",", "null", ",", "vector", ".", "nameAt", "(", "5", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "null", ",", "vector", ".", "nameAt", "(", "6", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "null", ",", "vector", ".", "elementAt", "(", "5", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "null", ",", "vector", ".", "elementAt", "(", "6", ")", ")", ";", "}", "public", "void", "testGetNameAndValue", "(", ")", "throws", "Exception", "{", "StringObjectVector", "vector", "=", "new", "StringObjectVector", "(", "3", ")", ";", "vector", ".", "add", "(", "str1", ",", "obj1", ")", ";", "vector", ".", "add", "(", "str2", ",", "obj2", ")", ";", "vector", ".", "add", "(", "str3", ",", "obj3", ")", ";", "vector", ".", "add", "(", "str4", ",", "obj4", ")", ";", "vector", ".", "add", "(", "str5", ",", "obj5", ")", ";", "Object", "[", "]", "elts", "=", "vector", ".", "getElements", "(", ")", ";", "assertEquals", "(", "5", ",", "elts", ".", "length", ")", ";", "assertEquals", "(", "obj1", ",", "elts", "[", "0", "]", ")", ";", "assertEquals", "(", "obj2", ",", "elts", "[", "1", "]", ")", ";", "assertEquals", "(", "obj3", ",", "elts", "[", "2", "]", ")", ";", "assertEquals", "(", "obj4", ",", "elts", "[", "3", "]", ")", ";", "assertEquals", "(", "obj5", ",", "elts", "[", "4", "]", ")", ";", "String", "[", "]", "names", "=", "vector", ".", "getNames", "(", ")", ";", "assertEquals", "(", "5", ",", "names", ".", "length", ")", ";", "assertEquals", "(", "str1", ",", "names", "[", "0", "]", ")", ";", "assertEquals", "(", "str2", ",", "names", "[", "1", "]", ")", ";", "assertEquals", "(", "str3", ",", "names", "[", "2", "]", ")", ";", "assertEquals", "(", "str4", ",", "names", "[", "3", "]", ")", ";", "assertEquals", "(", "str5", ",", "names", "[", "4", "]", ")", ";", "vector", ".", "add", "(", "null", ",", "null", ")", ";", "vector", ".", "add", "(", "null", ",", "null", ")", ";", "elts", "=", "vector", ".", "getElements", "(", ")", ";", "assertEquals", "(", "7", ",", "elts", ".", "length", ")", ";", "assertEquals", "(", "obj1", ",", "elts", "[", "0", "]", ")", ";", "assertEquals", "(", "obj2", ",", "elts", "[", "1", "]", ")", ";", "assertEquals", "(", "obj3", ",", "elts", "[", "2", "]", ")", ";", "assertEquals", "(", "obj4", ",", "elts", "[", "3", "]", ")", ";", "assertEquals", "(", "obj5", ",", "elts", "[", "4", "]", ")", ";", "assertEquals", "(", "null", ",", "elts", "[", "5", "]", ")", ";", "assertEquals", "(", "null", ",", "elts", "[", "6", "]", ")", ";", "names", "=", "vector", ".", "getNames", "(", ")", ";", "assertEquals", "(", "7", ",", "names", ".", "length", ")", ";", "assertEquals", "(", "str1", ",", "names", "[", "0", "]", ")", ";", "assertEquals", "(", "str2", ",", "names", "[", "1", "]", ")", ";", "assertEquals", "(", "str3", ",", "names", "[", "2", "]", ")", ";", "assertEquals", "(", "str4", ",", "names", "[", "3", "]", ")", ";", "assertEquals", "(", "str5", ",", "names", "[", "4", "]", ")", ";", "assertEquals", "(", "null", ",", "names", "[", "5", "]", ")", ";", "assertEquals", "(", "null", ",", "names", "[", "6", "]", ")", ";", "}", "}", "</s>" ]
5,909
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "java", ".", "util", ".", "Collections", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "DSLDStore", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "DSLPreferences", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "CurrentTypePointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "FindFieldPointcut", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IStorage", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "public", "class", "DSLStoreTests", "extends", "AbstractDSLInferencingTest", "{", "public", "static", "Test", "suite", "(", ")", "{", "return", "new", "TestSuite", "(", "DSLStoreTests", ".", "class", ")", ";", "}", "public", "DSLStoreTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testNothing", "(", ")", "throws", "Exception", "{", "assertDSLStore", "(", "0", ",", "Collections", ".", "EMPTY_MAP", ",", "Collections", ".", "EMPTY_MAP", ")", ";", "}", "public", "void", "testSingleSimple", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "assertDSLStore", "(", "1", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", "}", ")", ")", ";", "}", "public", "void", "testSingleTwice", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"g.accept", "{", "}\"", ")", ";", "assertDSLStore", "(", "1", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ",", "new", "Integer", "[", "]", "{", "2", "}", ")", ")", ";", "}", "public", "void", "testTwoPointcuts", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "assertDSLStore", "(", "1", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "0", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "0", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", ",", "1", "}", ")", ")", ";", "}", "public", "void", "testTwoPointcutsTwoFiles", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ",", "\"\"", ")", ";", "assertDSLStore", "(", "2", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", ",", "1", "}", ")", ")", ";", "}", "public", "void", "testTwoFilesEachWith2Pointcuts", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ",", "\"\"", ")", ";", "assertDSLStore", "(", "2", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "0", ")", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "1", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "1", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", ",", "1", ",", "1", ",", "1", "}", ")", ")", ";", "}", "public", "void", "testTwoFilesEachWith2PointcutsEachUsedTwice", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ",", "\"\"", ")", ";", "assertDSLStore", "(", "2", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "0", ")", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "1", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "1", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ",", "new", "Integer", "[", "]", "{", "2", ",", "2", ",", "2", ",", "2", "}", ")", ")", ";", "}", "public", "void", "testCraziness", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "assertDSLStore", "(", "3", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "0", ")", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "1", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "2", ")", "}", ",", "new", "String", "[", "]", "{", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "1", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", ",", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "2", ")", "}", ",", "new", "Integer", "[", "]", "{", "2", ",", "2", ",", "2", ",", "2", ",", "5", "}", ")", ")", ";", "}", "public", "void", "testAddAndRemove", "(", ")", "throws", "Exception", "{", "assertDSLStore", "(", "0", ",", "Collections", ".", "EMPTY_MAP", ",", "Collections", ".", "EMPTY_MAP", ")", ";", "createDsls", "(", "\"\"", ")", ";", "assertDSLStore", "(", "1", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", "}", ")", ")", ";", "createDsls", "(", "1", ",", "\"\"", ")", ";", "assertDSLStore", "(", "2", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "1", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "1", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", ",", "1", "}", ")", ")", ";", "deleteDslFile", "(", "1", ")", ";", "assertDSLStore", "(", "1", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", "}", ")", ")", ";", "deleteDslFile", "(", "0", ")", ";", "assertDSLStore", "(", "0", ",", "Collections", ".", "EMPTY_MAP", ",", "Collections", ".", "EMPTY_MAP", ")", ";", "}", "public", "void", "testChange", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "assertDSLStore", "(", "1", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", "}", ")", ")", ";", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "assertDSLStore", "(", "1", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "0", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "0", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", ",", "1", "}", ")", ")", ";", "}", "public", "void", "testDisabledOfFile", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ",", "\"\"", ")", ";", "assertDSLStore", "(", "2", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", ",", "1", "}", ")", ")", ";", "DSLPreferences", ".", "setDisabledScripts", "(", "new", "String", "[", "]", "{", "DSLDStore", ".", "toUniqueString", "(", "project", ".", "getFile", "(", "\"dsl0.dsld\"", ")", ")", "}", ")", ";", "assertDSLStore", "(", "2", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", "}", ")", ")", ";", "DSLPreferences", ".", "setDisabledScripts", "(", "new", "String", "[", "]", "{", "}", ")", ";", "createDsls", "(", "\"\"", ",", "\"\"", ")", ";", "assertDSLStore", "(", "2", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "0", ")", ",", "createSemiUniqueName", "(", "FindFieldPointcut", ".", "class", ",", "1", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", ",", "1", "}", ")", ")", ";", "}", "public", "void", "testDisabledOfJar", "(", ")", "throws", "Exception", "{", "addJarToProject", "(", "\"\"", ")", ";", "env", ".", "fullBuild", "(", ")", ";", "IPackageFragmentRoot", "root", "=", "JavaCore", ".", "create", "(", "project", ")", ".", "getPackageFragmentRoot", "(", "findExternalFilePath", "(", "\"\"", ")", ")", ";", "IStorage", "storage", "=", "(", "IStorage", ")", "root", ".", "getPackageFragment", "(", "\"dsld\"", ")", ".", "getNonJavaResources", "(", ")", "[", "0", "]", ";", "assertDSLStore", "(", "1", ",", "createExpectedPointcuts", "(", "new", "IStorage", "[", "]", "{", "storage", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "storage", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "storage", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", "}", ")", ")", ";", "DSLPreferences", ".", "setDisabledScripts", "(", "new", "String", "[", "]", "{", "DSLDStore", ".", "toUniqueString", "(", "storage", ")", "}", ")", ";", "assertDSLStore", "(", "1", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "}", ",", "new", "Integer", "[", "]", "{", "}", ")", ")", ";", "DSLPreferences", ".", "setDisabledScripts", "(", "new", "String", "[", "]", "{", "}", ")", ";", "assertDSLStore", "(", "1", ",", "createExpectedPointcuts", "(", "new", "IStorage", "[", "]", "{", "storage", "}", ",", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "storage", ")", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "createSemiUniqueName", "(", "CurrentTypePointcut", ".", "class", ",", "storage", ")", "}", ",", "new", "Integer", "[", "]", "{", "1", "}", ")", ")", ";", "removeJarFromProject", "(", "\"\"", ")", ";", "assertDSLStore", "(", "0", ",", "createExpectedPointcuts", "(", "new", "String", "[", "]", "{", "}", ")", ",", "createExpectedContributionCount", "(", "new", "String", "[", "]", "{", "}", ",", "new", "Integer", "[", "]", "{", "}", ")", ")", ";", "}", "}", "</s>" ]
5,910
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "RefreshDSLDJob", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "public", "class", "DSLInferencingTests", "extends", "AbstractDSLInferencingTest", "{", "private", "static", "final", "String", "SET_DELEGATE_TYPE_SCRIPT", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "private", "static", "final", "String", "SET_DELEGATE_TYPE_DSLD", "=", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "public", "DSLInferencingTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "static", "Test", "suite", "(", ")", "{", "return", "new", "TestSuite", "(", "DSLInferencingTests", ".", "class", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "createDSL", "(", ")", ";", "}", "public", "void", "testRegisteredPointcut1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"2.phat\"", ";", "String", "name", "=", "\"phat\"", ";", "assertDeclaringType", "(", "contents", ",", "contents", ".", "indexOf", "(", "name", ")", ",", "contents", ".", "indexOf", "(", "name", ")", "+", "name", ".", "length", "(", ")", ",", "\"\"", ")", ";", "}", "public", "void", "testRegisteredPointcut2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "name", "=", "\"valueInteger\"", ";", "assertDeclaringType", "(", "contents", ",", "contents", ".", "indexOf", "(", "name", ")", ",", "contents", ".", "indexOf", "(", "name", ")", "+", "name", ".", "length", "(", ")", ",", "\"\"", ")", ";", "}", "public", "void", "testContiribution1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"blar\"", ")", ";", "int", "end", "=", "start", "+", "\"blar\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"Other\"", ",", "true", ")", ";", "}", "public", "void", "testDelegatesTo1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"blar\"", ")", ";", "int", "end", "=", "start", "+", "\"blar\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"Other\"", ",", "true", ")", ";", "}", "public", "void", "testDelegatesTo2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"blar\"", ")", ";", "int", "end", "=", "start", "+", "\"blar\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"Other\"", ",", "true", ")", ";", "}", "public", "void", "_testDelegatesTo3", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"Foo.blar()\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"blar\"", ")", ";", "int", "end", "=", "start", "+", "\"blar\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"Other\"", ",", "true", ")", ";", "}", "public", "void", "testDelegatesTo4", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"Foo.blar()\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"blar\"", ")", ";", "int", "end", "=", "start", "+", "\"blar\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"Other\"", ",", "true", ")", ";", "}", "public", "void", "testDelegatesTo5", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"blar\"", ")", ";", "int", "end", "=", "start", "+", "\"blar\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"Other\"", ",", "true", ")", ";", "start", "=", "contents", ".", "lastIndexOf", "(", "\"flar\"", ")", ";", "end", "=", "start", "+", "\"flar\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"Foo\"", ",", "true", ")", ";", "}", "public", "void", "testDelegatesTo6", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"glar\"", ")", ";", "int", "end", "=", "start", "+", "\"glar\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"Foo\"", ")", ";", "start", "=", "contents", ".", "lastIndexOf", "(", "\"flar\"", ")", ";", "end", "=", "start", "+", "\"flar\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "assertDeclaringType", "(", "contents", ",", "start", ",", "end", ",", "\"Other\"", ",", "true", ")", ";", "}", "public", "void", "testGenerics1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"}n\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fooProp\"", ")", ";", "int", "end", "=", "start", "+", "\"fooProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testGenerics2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"}n\"", "+", "\"\"", "+", "\"x\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"x\"", ")", ";", "int", "end", "=", "start", "+", "\"x\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testGenerics3", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"}n\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fooProp\"", ")", ";", "int", "end", "=", "start", "+", "\"fooProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testDeprecated1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"}n\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fooProp\"", ")", ";", "int", "end", "=", "start", "+", "\"fooProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "assertDeprecated", "(", "contents", ",", "start", ",", "end", ")", ";", "}", "public", "void", "testDeprecated2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"}n\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fooProp\"", ")", ";", "int", "end", "=", "start", "+", "\"fooProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "assertDeprecated", "(", "contents", ",", "start", ",", "end", ")", ";", "}", "public", "void", "testAssertVersion1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"}n\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fooProp\"", ")", ";", "int", "end", "=", "start", "+", "\"fooProp\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"Foo\"", ",", "false", ")", ";", "}", "public", "void", "testAssertVersion2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"}n\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fooProp\"", ")", ";", "int", "end", "=", "start", "+", "\"fooProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSupportsVersion3", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"}n\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fooProp\"", ")", ";", "int", "end", "=", "start", "+", "\"fooProp\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"Foo\"", ",", "false", ")", ";", "}", "public", "void", "testSupportsVersion2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"}n\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fooProp\"", ")", ";", "int", "end", "=", "start", "+", "\"fooProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testIsThisType1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"def", "k()", "{", "n\"", "+", "\"", "thisTypen\"", "+", "\"\"", "+", "\"\"", "+", "\"def", "l", "=", "{", "n\"", "+", "\"", "thisTypen\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "int", "loc", "=", "0", ";", "int", "len", "=", "\"thisType\"", ".", "length", "(", ")", ";", "int", "num", "=", "0", ";", "do", "{", "loc", "=", "contents", ".", "indexOf", "(", "\"thisType\"", ",", "loc", "+", "1", ")", ";", "if", "(", "loc", ">", "0", ")", "{", "if", "(", "num", "%", "3", "==", "0", ")", "{", "assertType", "(", "contents", ",", "loc", ",", "loc", "+", "len", ",", "\"\"", ",", "true", ")", ";", "}", "else", "if", "(", "num", "%", "3", "==", "2", ")", "{", "assertUnknownConfidence", "(", "contents", ",", "loc", ",", "loc", "+", "len", ",", "\"Foo\"", ",", "true", ")", ";", "}", "else", "if", "(", "num", "%", "3", "==", "2", ")", "{", "assertUnknownConfidence", "(", "contents", ",", "loc", ",", "loc", "+", "len", ",", "\"\"", ",", "true", ")", ";", "}", "}", "num", "++", ";", "}", "while", "(", "loc", ">", "0", ")", ";", "}", "public", "void", "testEnclosingCall1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"foo(", "yes", ")\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"yes\"", ")", ";", "int", "end", "=", "start", "+", "\"yes\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testEnclosingCall2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"foo(", "yes", ")\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"yes\"", ")", ";", "int", "end", "=", "start", "+", "\"yes\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testEnclosingCall3", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"yesProp\"", ")", ";", "int", "end", "=", "start", "+", "\"yesProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testEnclosingCall4", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"argProp\"", ")", ";", "int", "end", "=", "start", "+", "\"argProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testEnclosingCall5", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"argProp\"", ")", ";", "int", "end", "=", "start", "+", "\"argProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testEnclosingCall6", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"argProp\"", ")", ";", "int", "end", "=", "start", "+", "\"argProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testEnclosingCall7", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", ")", ";", "String", "contents", "=", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"argProp\"", ")", ";", "int", "end", "=", "start", "+", "\"argProp\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testAnnotatedBy1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"}", "n\"", "+", "\"\"", "+", "\"\"", "+", "\"", "namen\"", "+", "\"}\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"name\"", ")", ";", "int", "end", "=", "start", "+", "\"name\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testAnnotatedBy2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"", "name", "n\"", "+", "\"}\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"name\"", ")", ";", "int", "end", "=", "start", "+", "\"name\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testHasArgument1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"arg\"", ")", ";", "int", "end", "=", "start", "+", "\"arg\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"Flart\"", ",", "true", ")", ";", "}", "public", "void", "testHasArgument2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"arg\"", ")", ";", "int", "end", "=", "start", "+", "\"arg\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"Flart\"", ",", "true", ")", ";", "}", "public", "void", "testStaticContext1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"testme\"", ")", ";", "int", "end", "=", "start", "+", "\"testme\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testStaticContext2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"testme\"", ")", ";", "int", "end", "=", "start", "+", "\"testme\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"Flart\"", ",", "true", ")", ";", "}", "public", "void", "testStaticContext3", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"", "testme\"", "+", "\"}", "}\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"testme\"", ")", ";", "int", "end", "=", "start", "+", "\"testme\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testStaticContext4", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}", "}\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"testme\"", ")", ";", "int", "end", "=", "start", "+", "\"testme\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"Flart\"", ",", "true", ")", ";", "}", "public", "void", "testStaticContext5", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}", "}\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"testme\"", ")", ";", "int", "end", "=", "start", "+", "\"testme\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testOperatorOverloading1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"xxx\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"xxx\"", ")", ";", "int", "end", "=", "start", "+", "\"xxx\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testOperatorOverloading2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"xxx\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"xxx\"", ")", ";", "int", "end", "=", "start", "+", "\"xxx\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testOperatorOverloading3", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"xxx\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"xxx\"", ")", ";", "int", "end", "=", "start", "+", "\"xxx\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testOperatorOverloading4", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"xxx\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"xxx\"", ")", ";", "int", "end", "=", "start", "+", "\"xxx\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testOperatorOverloading5", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"xxx\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"xxx\"", ")", ";", "int", "end", "=", "start", "+", "\"xxx\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testOperatorOverloading6", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"xxx\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"xxx\"", ")", ";", "int", "end", "=", "start", "+", "\"xxx\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testIsThisType2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"hi\"", ")", ";", "int", "end", "=", "start", "+", "\"hi\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testIsThisType3", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", ")", ";", "String", "contents", "=", "\"class", "Foo", "{n\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"hi\"", ")", ";", "int", "end", "=", "start", "+", "\"hi\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"Foo\"", ",", "true", ")", ";", "}", "public", "void", "testEnclosingCallName1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"foo", "{n\"", "+", "\"", "bar", "{n\"", "+", "\"", "hin\"", "+", "\"", "}n\"", "+", "\"}\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"hi\"", ")", ";", "int", "end", "=", "start", "+", "\"hi\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"Search\"", ",", "true", ")", ";", "}", "public", "void", "testEnclosingCallName2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"foo", "{n\"", "+", "\"", "bar", "{n\"", "+", "\"", "hin\"", "+", "\"", "}n\"", "+", "\"}\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"hi\"", ")", ";", "int", "end", "=", "start", "+", "\"hi\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testDelegatesTo7", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "}n\"", "+", "\"\\\"\\\".getFoo()\"", "+", "\"\\\"\\\".foo()\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"foo\"", ")", ";", "int", "end", "=", "start", "+", "\"foo\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "start", "=", "contents", ".", "lastIndexOf", "(", "\"getFoo\"", ")", ";", "end", "=", "start", "+", "\"getFoo\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testDelegatesTo8", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"getSomething\"", ")", ";", "int", "end", "=", "start", "+", "\"getSomething\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "start", "=", "contents", ".", "lastIndexOf", "(", "\"something\"", ")", ";", "end", "=", "start", "+", "\"something\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testDelegatesTo9", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"isSomething\"", ")", ";", "int", "end", "=", "start", "+", "\"isSomething\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "start", "=", "contents", ".", "lastIndexOf", "(", "\"something\"", ")", ";", "end", "=", "start", "+", "\"something\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSetDelegateType1", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_TYPE_DSLD", ")", ";", "String", "contents", "=", "SET_DELEGATE_TYPE_SCRIPT", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"delegate\"", ")", ";", "int", "end", "=", "start", "+", "\"delegate\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"Obj\"", ",", "true", ")", ";", "}", "public", "void", "testSetDelegateType1a", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_TYPE_DSLD", ")", ";", "String", "contents", "=", "SET_DELEGATE_TYPE_SCRIPT", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"this\"", ")", ";", "int", "end", "=", "start", "+", "\"this\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"Search\"", ",", "true", ")", ";", "}", "public", "void", "testSetDelegateType2", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_TYPE_DSLD", ")", ";", "String", "contents", "=", "SET_DELEGATE_TYPE_SCRIPT", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"getFoo\"", ")", ";", "int", "end", "=", "start", "+", "\"getFoo\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSetDelegateType3", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_TYPE_DSLD", ")", ";", "String", "contents", "=", "SET_DELEGATE_TYPE_SCRIPT", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"FOO1\"", ")", ";", "int", "end", "=", "start", "+", "\"FOO1\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSetDelegateType4", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_TYPE_DSLD", ")", ";", "String", "contents", "=", "SET_DELEGATE_TYPE_SCRIPT", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"FOO2\"", ")", ";", "int", "end", "=", "start", "+", "\"FOO2\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSetDelegateType5", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_TYPE_DSLD", ")", ";", "String", "contents", "=", "SET_DELEGATE_TYPE_SCRIPT", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"OTHER\"", ")", ";", "int", "end", "=", "start", "+", "\"OTHER\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSetDelegateType6", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_TYPE_DSLD", ")", ";", "String", "contents", "=", "SET_DELEGATE_TYPE_SCRIPT", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"BAR\"", ")", ";", "int", "end", "=", "start", "+", "\"BAR\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSetDelegateType7", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_TYPE_DSLD", ")", ";", "String", "contents", "=", "SET_DELEGATE_TYPE_SCRIPT", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"BAZ1\"", ")", ";", "int", "end", "=", "start", "+", "\"BAZ1\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSetDelegateType8", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_TYPE_DSLD", ")", ";", "String", "contents", "=", "SET_DELEGATE_TYPE_SCRIPT", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"BAZ2\"", ")", ";", "int", "end", "=", "start", "+", "\"BAZ2\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testSetDelegateType9", "(", ")", "throws", "Exception", "{", "createDsls", "(", "SET_DELEGATE_TYPE_DSLD", ")", ";", "String", "contents", "=", "SET_DELEGATE_TYPE_SCRIPT", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"BAZ3\"", ")", ";", "int", "end", "=", "start", "+", "\"BAZ3\"", ".", "length", "(", ")", ";", "assertUnknownConfidence", "(", "contents", ",", "start", ",", "end", ",", "\"Search\"", ",", "true", ")", ";", "}", "public", "void", "testMultiProject", "(", ")", "throws", "Exception", "{", "IPath", "otherPath", "=", "env", ".", "addProject", "(", "\"Other\"", ",", "\"1.5\"", ")", ";", "env", ".", "removePackageFragmentRoot", "(", "otherPath", ",", "\"\"", ")", ";", "IPath", "root", "=", "env", ".", "addPackageFragmentRoot", "(", "otherPath", ",", "\"src\"", ",", "null", ",", "null", ",", "\"bin\"", ")", ";", "env", ".", "addFile", "(", "env", ".", "addFolder", "(", "root", ",", "\"dsld\"", ")", ",", "\"\"", ",", "\"\"", ")", ";", "env", ".", "fullBuild", "(", "\"Other\"", ")", ";", "env", ".", "addRequiredProject", "(", "project", ".", "getFullPath", "(", ")", ",", "otherPath", ")", ";", "RefreshDSLDJob", "job", "=", "new", "RefreshDSLDJob", "(", "project", ")", ";", "job", ".", "run", "(", "new", "NullProgressMonitor", "(", ")", ")", ";", "String", "contents", "=", "\"''.other\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"other\"", ")", ";", "int", "end", "=", "start", "+", "\"other\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testNullType", "(", ")", "throws", "Exception", "{", "createDsls", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"n\"", "+", "\"flart", "'',", "{n\"", "+", "\"", "foon\"", "+", "\"}\"", ";", "int", "start", "=", "contents", ".", "lastIndexOf", "(", "\"fo\"", ")", ";", "int", "end", "=", "start", "+", "\"foo\"", ".", "length", "(", ")", ";", "assertType", "(", "contents", ",", "start", ",", "end", ",", "\"\"", ")", ";", "}", "private", "void", "createDSL", "(", ")", "throws", "IOException", "{", "defaultFileExtension", "=", "\"dsld\"", ";", "createUnit", "(", "\"\"", ",", "GroovyDSLDTestsActivator", ".", "getDefault", "(", ")", ".", "getTestResourceContents", "(", "\"\"", ")", ")", ";", "defaultFileExtension", "=", "\"groovy\"", ";", "env", ".", "fullBuild", "(", ")", ";", "expectingNoProblems", "(", ")", ";", "}", "}", "</s>" ]
5,911
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "net", ".", "MalformedURLException", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "GroovyLogManager", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "IGroovyLogger", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "TraceCategory", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "compiler", ".", "CompilerUtils", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "model", ".", "GroovyRuntime", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "DSLDStore", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "DSLDStoreManager", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "DSLPreferences", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "GroovyDSLCoreActivator", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "RefreshDSLDJob", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "contributions", ".", "IContributionGroup", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "IPointcut", ";", "import", "org", ".", "eclipse", ".", "core", ".", "internal", ".", "resources", ".", "Folder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "internal", ".", "resources", ".", "Workspace", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IStorage", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "FileLocator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "groovy", ".", "tests", ".", "search", ".", "AbstractInferencingTest", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "groovy", ".", "core", ".", "util", ".", "ReflectionUtils", ";", "public", "class", "AbstractDSLInferencingTest", "extends", "AbstractInferencingTest", "{", "public", "AbstractDSLInferencingTest", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "static", "class", "TestLogger", "implements", "IGroovyLogger", "{", "public", "void", "log", "(", "TraceCategory", "category", ",", "String", "message", ")", "{", "System", ".", "out", ".", "println", "(", "category", ".", "getPaddedLabel", "(", ")", "+", "\":", "\"", "+", "message", ")", ";", "}", "public", "boolean", "isCategoryEnabled", "(", "TraceCategory", "category", ")", "{", "return", "true", ";", "}", "}", "TestLogger", "logger", "=", "new", "TestLogger", "(", ")", ";", "protected", "boolean", "doRemoveClasspathContainer", "=", "true", ";", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "GroovyLogManager", ".", "manager", ".", "addLogger", "(", "logger", ")", ";", "if", "(", "doRemoveClasspathContainer", ")", "{", "GroovyRuntime", ".", "removeClasspathContainer", "(", "GroovyDSLCoreActivator", ".", "CLASSPATH_CONTAINER_ID", ",", "JavaCore", ".", "create", "(", "project", ")", ")", ";", "}", "else", "{", "refreshExternalFoldersProject", "(", ")", ";", "GroovyRuntime", ".", "addLibraryToClasspath", "(", "JavaCore", ".", "create", "(", "project", ")", ",", "GroovyDSLCoreActivator", ".", "CLASSPATH_CONTAINER_ID", ",", "false", ")", ";", "env", ".", "fullBuild", "(", ")", ";", "new", "RefreshDSLDJob", "(", "project", ")", ".", "run", "(", "null", ")", ";", "}", "GroovyDSLCoreActivator", ".", "getDefault", "(", ")", ".", "getContainerListener", "(", ")", ".", "ignoreProject", "(", "project", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "GroovyLogManager", ".", "manager", ".", "removeLogger", "(", "logger", ")", ";", "defaultFileExtension", "=", "\"groovy\"", ";", "super", ".", "tearDown", "(", ")", ";", "}", "protected", "String", "[", "]", "createDsls", "(", "String", "...", "dsls", ")", "{", "return", "createDsls", "(", "0", ",", "dsls", ")", ";", "}", "protected", "String", "[", "]", "createDsls", "(", "int", "startWith", ",", "String", "...", "dsls", ")", "{", "return", "createDsls", "(", "startWith", ",", "project", ",", "dsls", ")", ";", "}", "protected", "String", "[", "]", "createDsls", "(", "int", "startWith", ",", "IProject", "theProject", ",", "String", "...", "dsls", ")", "{", "int", "i", "=", "startWith", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "dsls", ".", "length", "+", "\"", "DSLD", "files.\"", ")", ";", "for", "(", "String", "dsl", ":", "dsls", ")", "{", "System", ".", "out", ".", "println", "(", "\"Creating:n\"", "+", "dsl", "+", "\"n\"", ")", ";", "IPath", "path", "=", "env", ".", "addFile", "(", "theProject", ".", "getFullPath", "(", ")", ",", "\"dsl\"", "+", "i", "++", "+", "\".dsld\"", ",", "dsl", ")", ";", "IFile", "file", "=", "env", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getFile", "(", "path", ")", ";", "if", "(", "!", "file", ".", "exists", "(", ")", ")", "{", "fail", "(", "\"File", "\"", "+", "file", "+", "\"\"", ")", ";", "}", "}", "return", "dsls", ";", "}", "protected", "void", "deleteDslFile", "(", "int", "fileNum", ")", "{", "env", ".", "removeFile", "(", "project", ".", "getFile", "(", "\"dsl\"", "+", "fileNum", "+", "\".dsld\"", ")", ".", "getFullPath", "(", ")", ")", ";", "}", "protected", "String", "[", "]", "createDSLsFromFiles", "(", "String", "...", "fileNames", ")", "throws", "IOException", "{", "String", "[", "]", "dslContents", "=", "new", "String", "[", "fileNames", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fileNames", ".", "length", ";", "i", "++", ")", "{", "dslContents", "[", "i", "]", "=", "GroovyDSLDTestsActivator", ".", "getDefault", "(", ")", ".", "getTestResourceContents", "(", "fileNames", "[", "i", "]", ")", ";", "}", "return", "createDsls", "(", "dslContents", ")", ";", "}", "protected", "void", "addJarToProject", "(", "String", "jarName", ")", "throws", "JavaModelException", ",", "IOException", "{", "String", "externalFilePath", "=", "findExternalFilePath", "(", "jarName", ")", ";", "env", ".", "addExternalJar", "(", "project", ".", "getFullPath", "(", ")", ",", "externalFilePath", ")", ";", "}", "protected", "void", "addGroovyJarToProject", "(", "String", "jarName", ")", "throws", "JavaModelException", ",", "IOException", "{", "addGroovyJarToProject", "(", "jarName", ",", "project", ")", ";", "}", "static", "protected", "void", "addGroovyJarToProject", "(", "String", "jarName", ",", "IProject", "project", ")", "throws", "JavaModelException", ",", "IOException", "{", "URL", "url", "=", "CompilerUtils", ".", "getJarInGroovyLib", "(", "jarName", ")", ";", "if", "(", "url", "!=", "null", ")", "{", "env", ".", "addExternalJar", "(", "project", ".", "getFullPath", "(", ")", ",", "url", ".", "getFile", "(", ")", ")", ";", "}", "else", "{", "fail", "(", "\"\"", "+", "jarName", "+", "\"\"", ")", ";", "}", "}", "protected", "String", "findExternalFilePath", "(", "String", "jarName", ")", "throws", "MalformedURLException", ",", "IOException", "{", "URL", "url", "=", "GroovyDSLDTestsActivator", ".", "getDefault", "(", ")", ".", "getTestResourceURL", "(", "jarName", ")", ";", "URL", "resolved", "=", "FileLocator", ".", "resolve", "(", "url", ")", ";", "String", "externalFilePath", "=", "resolved", ".", "getFile", "(", ")", ";", "return", "externalFilePath", ";", "}", "protected", "void", "removeJarFromProject", "(", "String", "jarName", ")", "throws", "JavaModelException", ",", "IOException", "{", "URL", "url", "=", "GroovyDSLDTestsActivator", ".", "getDefault", "(", ")", ".", "getTestResourceURL", "(", "jarName", ")", ";", "URL", "resolved", "=", "FileLocator", ".", "resolve", "(", "url", ")", ";", "env", ".", "removeExternalJar", "(", "project", ".", "getFullPath", "(", ")", ",", "new", "Path", "(", "resolved", ".", "getFile", "(", ")", ")", ")", ";", "}", "protected", "void", "assertDSLStore", "(", "int", "expectedNumDslFiles", ",", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "allExpectedPointcuts", ",", "Map", "<", "String", ",", "Integer", ">", "expectedContributionCounts", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "GroovyRuntime", ".", "removeClasspathContainer", "(", "GroovyDSLCoreActivator", ".", "CLASSPATH_CONTAINER_ID", ",", "JavaCore", ".", "create", "(", "project", ")", ")", ";", "env", ".", "fullBuild", "(", ")", ";", "RefreshDSLDJob", "job", "=", "new", "RefreshDSLDJob", "(", "project", ")", ";", "job", ".", "run", "(", "new", "NullProgressMonitor", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "DSLDStoreManager", "manager", "=", "GroovyDSLCoreActivator", ".", "getDefault", "(", ")", ".", "getContextStoreManager", "(", ")", ";", "DSLDStore", "store", "=", "manager", ".", "getDSLDStore", "(", "project", ")", ";", "Set", "<", "String", ">", "disabledScripts", "=", "DSLPreferences", ".", "getDisabledScriptsAsSet", "(", ")", ";", "IStorage", "[", "]", "keys", "=", "store", ".", "getAllContextKeys", "(", ")", ";", "Arrays", ".", "sort", "(", "keys", ",", "new", "Comparator", "<", "IStorage", ">", "(", ")", "{", "public", "int", "compare", "(", "IStorage", "o1", ",", "IStorage", "o2", ")", "{", "return", "o1", ".", "getFullPath", "(", ")", ".", "toPortableString", "(", ")", ".", "compareTo", "(", "o2", ".", "getFullPath", "(", ")", ".", "toPortableString", "(", ")", ")", ";", "}", "}", ")", ";", "assertEquals", "(", "expectedNumDslFiles", ",", "keys", ".", "length", ")", ";", "int", "i", "=", "0", ";", "for", "(", "IStorage", "key", ":", "keys", ")", "{", "String", "uniqueString", "=", "DSLDStore", ".", "toUniqueString", "(", "key", ")", ";", "if", "(", "key", "instanceof", "IFile", ")", "{", "assertEquals", "(", "project", ".", "getFullPath", "(", ")", "+", "\"/dsl\"", "+", "i", "++", "+", "\".dsld\"", ",", "uniqueString", ")", ";", "}", "if", "(", "disabledScripts", ".", "contains", "(", "uniqueString", ")", ")", "{", "continue", ";", "}", "Set", "<", "IPointcut", ">", "pcs", "=", "(", "(", "Map", "<", "IStorage", ",", "Set", "<", "IPointcut", ">", ">", ")", "ReflectionUtils", ".", "getPrivateField", "(", "DSLDStore", ".", "class", ",", "\"\"", ",", "store", ")", ")", ".", "get", "(", "key", ")", ";", "List", "<", "String", ">", "expectedPcs", "=", "allExpectedPointcuts", ".", "get", "(", "uniqueString", ")", ";", "for", "(", "IPointcut", "pc", ":", "pcs", ")", "{", "assertTrue", "(", "\"\"", "+", "pc", "+", "\"", "inn\"", "+", "expectedPcs", ",", "expectedPcs", ".", "contains", "(", "createSemiUniqueName", "(", "pc", ")", ")", ")", ";", "List", "<", "IContributionGroup", ">", "group", "=", "(", "(", "Map", "<", "IPointcut", ",", "List", "<", "IContributionGroup", ">", ">", ")", "ReflectionUtils", ".", "getPrivateField", "(", "DSLDStore", ".", "class", ",", "\"\"", ",", "store", ")", ")", ".", "get", "(", "pc", ")", ";", "int", "groupSize", "=", "group", ".", "size", "(", ")", ";", "int", "expectedSize", "=", "expectedContributionCounts", ".", "get", "(", "createSemiUniqueName", "(", "pc", ")", ")", ";", "assertEquals", "(", "\"\"", "+", "pc", ",", "expectedSize", ",", "groupSize", ")", ";", "}", "assertEquals", "(", "\"\"", "+", "expectedPcs", "+", "\"nActual:", "\"", "+", "pcs", ",", "expectedPcs", ".", "size", "(", ")", ",", "pcs", ".", "size", "(", ")", ")", ";", "}", "}", "protected", "Map", "<", "String", ",", "Integer", ">", "createExpectedContributionCount", "(", "String", "[", "]", "pcs", ",", "Integer", "[", "]", "counts", ")", "{", "Map", "<", "String", ",", "Integer", ">", "map", "=", "new", "HashMap", "<", "String", ",", "Integer", ">", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "counts", ".", "length", ";", "i", "++", ")", "{", "map", ".", "put", "(", "pcs", "[", "i", "]", ",", "counts", "[", "i", "]", ")", ";", "}", "return", "map", ";", "}", "protected", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "createExpectedPointcuts", "(", "String", "[", "]", "...", "pointcuts", ")", "{", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "map", "=", "new", "HashMap", "<", "String", ",", "List", "<", "String", ">", ">", "(", ")", ";", "int", "i", "=", "0", ";", "for", "(", "String", "[", "]", "strings", ":", "pointcuts", ")", "{", "String", "name", "=", "DSLDStore", ".", "toUniqueString", "(", "project", ".", "getFile", "(", "\"dsl\"", "+", "i", "++", "+", "\".dsld\"", ")", ")", ";", "map", ".", "put", "(", "name", ",", "Arrays", ".", "asList", "(", "strings", ")", ")", ";", "}", "return", "map", ";", "}", "protected", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "createExpectedPointcuts", "(", "IStorage", "[", "]", "storages", ",", "String", "[", "]", "...", "pointcuts", ")", "{", "Map", "<", "String", ",", "List", "<", "String", ">", ">", "map", "=", "new", "HashMap", "<", "String", ",", "List", "<", "String", ">", ">", "(", ")", ";", "int", "i", "=", "0", ";", "for", "(", "String", "[", "]", "strings", ":", "pointcuts", ")", "{", "String", "name", "=", "DSLDStore", ".", "toUniqueString", "(", "storages", "[", "i", "++", "]", ")", ";", "map", ".", "put", "(", "name", ",", "Arrays", ".", "asList", "(", "strings", ")", ")", ";", "}", "return", "map", ";", "}", "protected", "String", "createSemiUniqueName", "(", "IPointcut", "pc", ")", "{", "return", "pc", ".", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\":\"", "+", "pc", ".", "getContainerIdentifier", "(", ")", ".", "getFullPath", "(", ")", ".", "lastSegment", "(", ")", ";", "}", "protected", "String", "createSemiUniqueName", "(", "Class", "<", "?", "extends", "IPointcut", ">", "pc", ",", "int", "cnt", ")", "{", "return", "pc", ".", "getName", "(", ")", "+", "\":\"", "+", "\"dsl\"", "+", "cnt", "+", "\".dsld\"", ";", "}", "protected", "String", "createSemiUniqueName", "(", "Class", "<", "?", "extends", "IPointcut", ">", "pc", ",", "IStorage", "storage", ")", "{", "return", "pc", ".", "getName", "(", ")", "+", "\":\"", "+", "DSLDStore", ".", "toUniqueString", "(", "storage", ")", ";", "}", "protected", "void", "assertDSLType", "(", "String", "contents", ",", "String", "name", ")", "{", "assertDeclaringType", "(", "contents", ",", "contents", ".", "indexOf", "(", "name", ")", ",", "contents", ".", "indexOf", "(", "name", ")", "+", "name", ".", "length", "(", ")", ",", "\"p.IPointcut\"", ",", "true", ")", ";", "}", "protected", "void", "assertUnknownDSLType", "(", "String", "contents", ",", "String", "name", ")", "{", "assertUnknownConfidence", "(", "contents", ",", "contents", ".", "indexOf", "(", "name", ")", ",", "contents", ".", "indexOf", "(", "name", ")", "+", "name", ".", "length", "(", ")", ",", "\"Search\"", ",", "true", ")", ";", "}", "protected", "static", "void", "refreshExternalFoldersProject", "(", ")", "throws", "CoreException", "{", "Workspace", "workspace", "=", "(", "Workspace", ")", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "IProject", "externalProject", "=", "workspace", ".", "getRoot", "(", ")", ".", "getProject", "(", "\"\"", ")", ";", "if", "(", "externalProject", ".", "exists", "(", ")", ")", "{", "for", "(", "IResource", "member", ":", "externalProject", ".", "members", "(", ")", ")", "{", "if", "(", "member", "instanceof", "Folder", ")", "{", "Folder", "folder", "=", "(", "Folder", ")", "member", ";", "workspace", ".", "getAliasManager", "(", ")", ".", "updateAliases", "(", "folder", ",", "folder", ".", "getStore", "(", ")", ",", "IResource", ".", "DEPTH_INFINITE", ",", "null", ")", ";", "if", "(", "folder", ".", "exists", "(", ")", ")", "{", "folder", ".", "refreshLocal", "(", "IResource", ".", "DEPTH_INFINITE", ",", "null", ")", ";", "}", "}", "}", "}", "}", "}", "</s>" ]
5,912
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "static", "org", ".", "junit", ".", "Assert", ".", "assertTrue", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileReader", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyCompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "groovy", ".", "tests", ".", "search", ".", "AbstractInferencingTest", ";", "public", "class", "InferencerWorkload", "implements", "Iterable", "<", "InferencerWorkload", ".", "InferencerTask", ">", "{", "private", "static", "final", "String", "BEG_MARK_START", "=", "\"/*!\"", ";", "private", "static", "final", "String", "BEG_MARK_SEPARATOR", "=", "\":\"", ";", "private", "static", "final", "String", "BEG_MARK_END", "=", "\"!*/\"", ";", "private", "static", "final", "String", "END_MARK", "=", "\"/*!*/\"", ";", "private", "static", "final", "Map", "<", "String", ",", "String", ">", "DEFAULT_ALIASES", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "static", "{", "DEFAULT_ALIASES", ".", "put", "(", "\"B\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"C\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"D\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"F\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"I\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"L\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"S\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"V\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"Z\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"STR\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"LIST\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"MAP\"", ",", "\"\"", ")", ";", "DEFAULT_ALIASES", ".", "put", "(", "\"O\"", ",", "\"\"", ")", ";", "}", "public", "class", "InferencerTask", "{", "public", "final", "int", "start", ";", "public", "final", "int", "end", ";", "public", "final", "String", "expectedResultType", ";", "public", "final", "String", "expectedDeclaringType", ";", "public", "InferencerTask", "(", "int", "start", ",", "int", "end", ",", "String", "expectResultType", ",", "String", "expectDeclaringType", ")", "{", "this", ".", "start", "=", "start", ";", "this", ".", "end", "=", "end", ";", "this", ".", "expectedResultType", "=", "expectResultType", ";", "this", ".", "expectedDeclaringType", "=", "expectDeclaringType", ";", "}", "public", "String", "getContents", "(", ")", "{", "return", "InferencerWorkload", ".", "this", ".", "getContents", "(", ")", ";", "}", "@", "Override", "public", "String", "toString", "(", ")", "{", "return", "\"Type:", "\"", "+", "expectedResultType", "+", "\"nDeclaring:", "\"", "+", "expectedDeclaringType", "+", "\"nContents:", "\"", "+", "getContents", "(", ")", ".", "substring", "(", "start", ",", "end", ")", ";", "}", "}", "private", "List", "<", "InferencerTask", ">", "tasks", ";", "private", "String", "contents", ";", "private", "final", "Map", "<", "String", ",", "String", ">", "aliases", ";", "private", "boolean", "aliasesLocked", "=", "false", ";", "public", "InferencerWorkload", "(", "File", "workloadDefinitionFile", ",", "String", "...", "extraAliases", ")", "throws", "Exception", "{", "this", "(", "extractContents", "(", "workloadDefinitionFile", ")", ",", "extraAliases", ")", ";", "}", "private", "static", "String", "extractContents", "(", "File", "workloadDefinitionFile", ")", "throws", "Exception", "{", "Reader", "r", "=", "new", "FileReader", "(", "workloadDefinitionFile", ")", ";", "BufferedReader", "br", "=", "new", "BufferedReader", "(", "r", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "try", "{", "String", "line", ";", "while", "(", "(", "line", "=", "br", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "sb", ".", "append", "(", "line", "+", "\"n\"", ")", ";", "}", "}", "finally", "{", "br", ".", "close", "(", ")", ";", "}", "return", "sb", ".", "toString", "(", ")", ";", "}", "public", "InferencerWorkload", "(", "String", "workloadDefinition", ",", "String", "...", "extraAliases", ")", "{", "aliases", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", "DEFAULT_ALIASES", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "extraAliases", ".", "length", ";", "i", "++", ")", "{", "defAlias", "(", "extraAliases", "[", "i", "++", "]", ",", "extraAliases", "[", "i", "]", ")", ";", "}", "aliasesLocked", "=", "true", ";", "StringBuilder", "stripped", "=", "new", "StringBuilder", "(", ")", ";", "tasks", "=", "new", "ArrayList", "<", "InferencerWorkload", ".", "InferencerTask", ">", "(", ")", ";", "int", "readPos", "=", "0", ";", "while", "(", "readPos", ">=", "0", "&&", "readPos", "<", "workloadDefinition", ".", "length", "(", ")", ")", "{", "int", "headStart", "=", "workloadDefinition", ".", "indexOf", "(", "BEG_MARK_START", ",", "readPos", ")", ";", "int", "separator", "=", "-", "1", ";", "int", "headEnd", "=", "-", "1", ";", "int", "tail", "=", "-", "1", ";", "if", "(", "headStart", ">=", "0", ")", "{", "separator", "=", "workloadDefinition", ".", "indexOf", "(", "BEG_MARK_SEPARATOR", ",", "headStart", ")", ";", "headEnd", "=", "workloadDefinition", ".", "indexOf", "(", "BEG_MARK_END", ",", "headStart", ")", ";", "tail", "=", "workloadDefinition", ".", "indexOf", "(", "END_MARK", ",", "headStart", ")", ";", "}", "if", "(", "headStart", ">=", "0", "&&", "separator", ">", "headStart", "&&", "headEnd", ">", "separator", "&&", "tail", ">", "headEnd", ")", "{", "int", "start", "=", "readPos", ";", "int", "end", "=", "headStart", ";", "stripped", ".", "append", "(", "workloadDefinition", ".", "substring", "(", "start", ",", "end", ")", ")", ";", "start", "=", "headStart", "+", "BEG_MARK_START", ".", "length", "(", ")", ";", "end", "=", "separator", ";", "String", "resultType", "=", "workloadDefinition", ".", "substring", "(", "start", ",", "end", ")", ";", "if", "(", "aliases", ".", "containsKey", "(", "resultType", ")", ")", "{", "resultType", "=", "aliases", ".", "get", "(", "resultType", ")", ";", "}", "if", "(", "resultType", ".", "length", "(", ")", "==", "0", ")", "{", "resultType", "=", "null", ";", "}", "start", "=", "separator", "+", "BEG_MARK_SEPARATOR", ".", "length", "(", ")", ";", "end", "=", "headEnd", ";", "String", "declType", "=", "workloadDefinition", ".", "substring", "(", "start", ",", "end", ")", ";", "if", "(", "aliases", ".", "containsKey", "(", "declType", ")", ")", "{", "declType", "=", "aliases", ".", "get", "(", "declType", ")", ";", "}", "if", "(", "declType", ".", "length", "(", ")", "==", "0", ")", "{", "declType", "=", "null", ";", "}", "start", "=", "headEnd", "+", "BEG_MARK_END", ".", "length", "(", ")", ";", "end", "=", "tail", ";", "String", "expression", "=", "workloadDefinition", ".", "substring", "(", "start", ",", "end", ")", ";", "start", "=", "stripped", ".", "length", "(", ")", ";", "stripped", ".", "append", "(", "expression", ")", ";", "end", "=", "stripped", ".", "length", "(", ")", ";", "tasks", ".", "add", "(", "new", "InferencerTask", "(", "start", ",", "end", ",", "resultType", ",", "declType", ")", ")", ";", "readPos", "=", "tail", "+", "END_MARK", ".", "length", "(", ")", ";", "}", "else", "{", "stripped", ".", "append", "(", "workloadDefinition", ".", "substring", "(", "readPos", ")", ")", ";", "readPos", "=", "-", "1", ";", "}", "}", "contents", "=", "stripped", ".", "toString", "(", ")", ";", "}", "protected", "void", "defAlias", "(", "String", "name", ",", "String", "expansion", ")", "{", "Assert", ".", "assertTrue", "(", "\"\"", ",", "!", "aliasesLocked", ")", ";", "String", "existing", "=", "aliases", ".", "get", "(", "name", ")", ";", "if", "(", "existing", "!=", "null", ")", "{", "Assert", ".", "fail", "(", "\"\"", "+", "name", "+", "\"", "first", "=", "\"", "+", "expansion", "+", "\"", "second", "=", "\"", "+", "expansion", ")", ";", "}", "else", "{", "aliases", ".", "put", "(", "name", ",", "expansion", ")", ";", "}", "}", "public", "String", "getContents", "(", ")", "{", "return", "contents", ";", "}", "public", "Iterator", "<", "InferencerTask", ">", "iterator", "(", ")", "{", "return", "tasks", ".", "iterator", "(", ")", ";", "}", "public", "void", "perform", "(", "GroovyCompilationUnit", "unit", ",", "boolean", "assumeNoUnknowns", ")", "throws", "Exception", "{", "boolean", "doneSomething", "=", "false", ";", "try", "{", "unit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "InferencerTask", "task", ":", "this", ")", "{", "doneSomething", "=", "true", ";", "String", "res", "=", "AbstractInferencingTest", ".", "checkType", "(", "unit", ",", "task", ".", "start", ",", "task", ".", "end", ",", "task", ".", "expectedResultType", ",", "task", ".", "expectedDeclaringType", ",", "assumeNoUnknowns", ",", "false", ")", ";", "if", "(", "res", "!=", "null", ")", "{", "sb", ".", "append", "(", "\"\"", "+", "res", ")", ";", "}", "assumeNoUnknowns", "=", "false", ";", "}", "if", "(", "sb", ".", "length", "(", ")", ">", "0", ")", "{", "Assert", ".", "fail", "(", "sb", ".", "toString", "(", ")", ")", ";", "}", "}", "finally", "{", "unit", ".", "discardWorkingCopy", "(", ")", ";", "}", "assertTrue", "(", "\"\"", ",", "doneSomething", ")", ";", "}", "public", "void", "perform", "(", "GroovyCompilationUnit", "unit", ")", "throws", "Exception", "{", "perform", "(", "unit", ",", "false", ")", ";", "}", "}", "</s>" ]
5,913
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "IPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "PointcutVerificationException", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "AbstractModifierPointcut", ".", "FinalPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "AbstractModifierPointcut", ".", "PrivatePointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "AbstractModifierPointcut", ".", "PublicPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "AbstractModifierPointcut", ".", "StaticPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "AndPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "BindPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "CurrentTypePointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "EnclosingClassPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "EnclosingFieldPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "EnclosingMethodPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "EnclosingScriptPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "FileExtensionPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "FindAnnotationPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "FindFieldPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "FindPropertyPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "NamePointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "OrPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "impl", ".", "ProjectNaturePointcut", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "groovy", ".", "tests", ".", "search", ".", "AbstractGroovySearchTest", ";", "public", "class", "PointcutCreationTests", "extends", "AbstractGroovySearchTest", "{", "public", "static", "Test", "suite", "(", ")", "{", "return", "new", "TestSuite", "(", "PointcutCreationTests", ".", "class", ")", ";", "}", "public", "PointcutCreationTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testPointcutCreation1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertTrue", "(", "\"\"", ",", "pc", "instanceof", "CurrentTypePointcut", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "\"\"", ",", "pc", ".", "getFirstArgument", "(", ")", ")", ";", "}", "public", "void", "testPointcutCreation2", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertTrue", "(", "\"\"", ",", "pc", "instanceof", "CurrentTypePointcut", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "Object", "firstArgument", "=", "pc", ".", "getFirstArgument", "(", ")", ";", "assertTrue", "(", "firstArgument", "instanceof", "FindFieldPointcut", ")", ";", "pc", "=", "(", "IPointcut", ")", "firstArgument", ";", "firstArgument", "=", "pc", ".", "getFirstArgument", "(", ")", ";", "assertTrue", "(", "firstArgument", "instanceof", "FindAnnotationPointcut", ")", ";", "pc", "=", "(", "IPointcut", ")", "firstArgument", ";", "}", "public", "void", "testValidPointcutCreation1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertTrue", "(", "\"\"", ",", "pc", "instanceof", "CurrentTypePointcut", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "}", "public", "void", "testInvalidPointcutCreation1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertTrue", "(", "\"\"", ",", "pc", "instanceof", "FileExtensionPointcut", ")", ";", "assertInvalidPointcut", "(", "\"\"", ",", "pc", ")", ";", "}", "public", "void", "testValidPointcutCreation2", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertTrue", "(", "\"\"", ",", "pc", "instanceof", "CurrentTypePointcut", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "}", "public", "void", "testInvalidPointcutCreation2", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertTrue", "(", "\"\"", ",", "pc", "instanceof", "CurrentTypePointcut", ")", ";", "assertInvalidPointcut", "(", "\"\"", ",", "pc", ")", ";", "}", "public", "void", "testAnd1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "\"\"", ",", "AndPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "2", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testAnd2", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "pc", "=", "pc", ".", "normalize", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "AndPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "3", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testAnd3", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "pc", "=", "pc", ".", "normalize", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "AndPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "3", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testAnd4", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "pc", "=", "pc", ".", "normalize", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "AndPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "3", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testValidAnd1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "\"\"", ",", "AndPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "}", "public", "void", "testInvalidAnd1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "\"\"", ",", "AndPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertInvalidPointcut", "(", "\"\"", ",", "pc", ")", ";", "}", "public", "void", "testOr1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "\"\"", ",", "OrPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "2", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testOr2", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "pc", "=", "pc", ".", "normalize", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "OrPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "3", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testOr3", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "pc", "=", "pc", ".", "normalize", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "OrPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "3", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testOr4", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "pc", "=", "pc", ".", "normalize", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "OrPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "2", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "3", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testOrAnd1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "\"\"", ",", "OrPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "2", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "assertEquals", "(", "AndPointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "}", "public", "void", "testAndOr1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "\"\"", ",", "OrPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "\"\"", ",", "2", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "assertEquals", "(", "AndPointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "CurrentTypePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "}", "public", "void", "testEnclosing1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "\"\"", ",", "EnclosingClassPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "\"\"", ",", "AndPointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "pc", "=", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "2", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "assertEquals", "(", "FindPropertyPointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "StaticPointcut", ".", "class", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "0", ",", "(", "(", "IPointcut", ")", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "assertEquals", "(", "NamePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"yes\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ";", "}", "public", "void", "testEnclosing2", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "\"\"", ",", "EnclosingFieldPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "\"\"", ",", "AndPointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "pc", "=", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "2", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "assertEquals", "(", "FindPropertyPointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "PublicPointcut", ".", "class", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "0", ",", "(", "(", "IPointcut", ")", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "assertEquals", "(", "NamePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"yes\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ";", "}", "public", "void", "testEnclosing3", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "\"\"", ",", "EnclosingMethodPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "\"\"", ",", "AndPointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "pc", "=", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "2", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "assertEquals", "(", "FindPropertyPointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "PrivatePointcut", ".", "class", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "0", ",", "(", "(", "IPointcut", ")", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "assertEquals", "(", "NamePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"yes\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ";", "}", "public", "void", "testEnclosing4", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "\"\"", ",", "EnclosingScriptPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "\"\"", ",", "AndPointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "pc", "=", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ";", "assertEquals", "(", "\"\"", ",", "2", ",", "pc", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "assertEquals", "(", "FindPropertyPointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "FinalPointcut", ".", "class", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", ",", "0", ",", "(", "(", "IPointcut", ")", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getArgumentValues", "(", ")", ".", "length", ")", ";", "assertEquals", "(", "NamePointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"yes\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ";", "}", "public", "void", "testBindAndFileExtension", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "BindPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "FileExtensionPointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"b\"", ",", "pc", ".", "getFirstArgumentName", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "\"fdafdsfds\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "}", "public", "void", "testBindAndNature", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "BindPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "ProjectNaturePointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"b\"", ",", "pc", ".", "getFirstArgumentName", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "\"fdafdsfds\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "}", "public", "void", "testBindAndFileExtensionInvalid", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "BindPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "FileExtensionPointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertInvalidPointcut", "(", "\"\"", ",", "pc", ")", ";", "assertEquals", "(", "\"fdafdsfds\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "}", "public", "void", "testVariable1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "BindPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"b\"", ",", "pc", ".", "getFirstArgumentName", "(", ")", ")", ";", "assertEquals", "(", "FileExtensionPointcut", ".", "class", ",", "pc", ".", "getFirstArgument", "(", ")", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "\"fdafdsfds\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getFirstArgument", "(", ")", ")", ".", "getFirstArgument", "(", ")", ")", ";", "}", "public", "void", "testVariable2", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", ")", ";", "assertEquals", "(", "AndPointcut", ".", "class", ",", "pc", ".", "getClass", "(", ")", ")", ";", "assertValidPointcut", "(", "pc", ")", ";", "assertEquals", "(", "FileExtensionPointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "FileExtensionPointcut", ".", "class", ",", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"fdafdsfds\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "0", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "assertEquals", "(", "\"fdafdsfds\"", ",", "(", "(", "IPointcut", ")", "pc", ".", "getArgumentValues", "(", ")", "[", "1", "]", ")", ".", "getFirstArgument", "(", ")", ")", ";", "}", "public", "void", "testCustomPointcut1", "(", ")", "throws", "Exception", "{", "IPointcut", "pc", "=", "new", "PointcutScriptExecutor", "(", ")", ".", "createPointcut", "(", "\"\"", "+", "\"mine()\"", ")", ";", "assertEquals", "(", "\"\"", ",", "pc", ".", "getClass", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "protected", "void", "assertValidPointcut", "(", "IPointcut", "pc", ")", "throws", "PointcutVerificationException", "{", "try", "{", "pc", ".", "verify", "(", ")", ";", "}", "catch", "(", "PointcutVerificationException", "e", ")", "{", "fail", "(", "\"\"", "+", "e", ".", "getPointcutMessage", "(", ")", ")", ";", "}", "}", "protected", "void", "assertInvalidPointcut", "(", "String", "expectedMessage", ",", "IPointcut", "pc", ")", "{", "try", "{", "pc", ".", "verify", "(", ")", ";", "fail", "(", "\"\"", "+", "pc", ")", ";", "}", "catch", "(", "PointcutVerificationException", "e", ")", "{", "if", "(", "!", "e", ".", "getMessage", "(", ")", ".", "equals", "(", "expectedMessage", ")", ")", "{", "fail", "(", "\"\"", "+", "expectedMessage", "+", "\"nBut", "was:n\"", "+", "e", ".", "getPointcutMessage", "(", ")", ")", ";", "}", "}", "}", "}", "</s>" ]
5,914
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "tests", ".", "util", ".", "GroovyUtils", ";", "public", "class", "MetaDSLInferencingTests", "extends", "AbstractDSLInferencingTest", "{", "public", "MetaDSLInferencingTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "static", "Test", "suite", "(", ")", "{", "return", "new", "TestSuite", "(", "MetaDSLInferencingTests", ".", "class", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "createMetaDSL", "(", ")", ";", "}", "public", "void", "testSimpleDSL", "(", ")", "throws", "Exception", "{", "assertType", "(", "\"foo\"", ",", "\"\"", ",", "true", ")", ";", "createDsls", "(", "\"\"", ")", ";", "assertType", "(", "\"foo\"", ",", "\"\"", ",", "true", ")", ";", "deleteDslFile", "(", "0", ")", ";", "assertType", "(", "\"foo\"", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testMetaDSL1", "(", ")", "throws", "Exception", "{", "assertType", "(", "\"currentType\"", ",", "\"p.IPointcut\"", ",", "true", ")", ";", "}", "public", "void", "testMetaDSL2", "(", ")", "throws", "Exception", "{", "assertType", "(", "\"\"", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testMetaDSL3", "(", ")", "throws", "Exception", "{", "assertType", "(", "\"\"", ",", "\"\"", ",", "true", ")", ";", "}", "public", "void", "testMetaDSL4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"", "methodn\"", "+", "\"", "wormholen\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "assertDSLType", "(", "contents", ",", "\"method\"", ")", ";", "assertDSLType", "(", "contents", ",", "\"wormhole\"", ")", ";", "assertDSLType", "(", "contents", ",", "\"\"", ")", ";", "assertDSLType", "(", "contents", ",", "\"delegatesTo\"", ")", ";", "assertDSLType", "(", "contents", ",", "\"\"", ")", ";", "}", "public", "void", "testMetaDSL5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"", "methodn\"", "+", "\"", "wormholen\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "assertUnknownDSLType", "(", "contents", ",", "\"method\"", ")", ";", "assertUnknownDSLType", "(", "contents", ",", "\"wormhole\"", ")", ";", "assertUnknownDSLType", "(", "contents", ",", "\"\"", ")", ";", "assertUnknownDSLType", "(", "contents", ",", "\"delegatesTo\"", ")", ";", "assertUnknownDSLType", "(", "contents", ",", "\"\"", ")", ";", "}", "public", "void", "testMetaDSL6", "(", ")", "throws", "Exception", "{", "defaultFileExtension", "=", "\"groovy\"", ";", "String", "contents", "=", "\"\"", "+", "\"", "methodn\"", "+", "\"", "wormholen\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "assertUnknownDSLType", "(", "contents", ",", "\"method\"", ")", ";", "assertUnknownDSLType", "(", "contents", ",", "\"wormhole\"", ")", ";", "assertUnknownDSLType", "(", "contents", ",", "\"\"", ")", ";", "assertUnknownDSLType", "(", "contents", ",", "\"delegatesTo\"", ")", ";", "assertUnknownDSLType", "(", "contents", ",", "\"\"", ")", ";", "}", "public", "void", "testMetaDSL7", "(", ")", "throws", "Exception", "{", "defaultFileExtension", "=", "\"groovy\"", ";", "String", "contents", "=", "\"\"", "+", "\"}\"", ";", "assertUnknownDSLType", "(", "contents", ",", "\"currentType\"", ")", ";", "assertUnknownDSLType", "(", "contents", ",", "\"accept\"", ")", ";", "}", "public", "void", "testBindings", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"bn\"", "+", "\"}\"", ";", "String", "name", "=", "\"b\"", ";", "assertDeclaringType", "(", "contents", ",", "contents", ".", "lastIndexOf", "(", "name", ")", ",", "contents", ".", "lastIndexOf", "(", "name", ")", "+", "name", ".", "length", "(", ")", ",", "\"p.IPointcut\"", ",", "true", ")", ";", "}", "private", "void", "createMetaDSL", "(", ")", "throws", "IOException", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", ">", "17", ")", "{", "createJavaUnit", "(", "\"p\"", ",", "\"IPointcut\"", ",", "\"\"", ")", ";", "}", "else", "{", "createJavaUnit", "(", "\"p\"", ",", "\"IPointcut\"", ",", "\"\"", ")", ";", "}", "defaultFileExtension", "=", "\"dsld\"", ";", "createUnit", "(", "\"\"", ",", "GroovyDSLDTestsActivator", ".", "getDefault", "(", ")", ".", "getTestResourceContents", "(", "\"\"", ")", ")", ";", "env", ".", "fullBuild", "(", ")", ";", "expectingNoProblems", "(", ")", ";", "}", "}", "</s>" ]
5,915
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "public", "class", "SuggestionInferencingTests", "extends", "AbstractDSLInferencingTest", "{", "public", "SuggestionInferencingTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "static", "Test", "suite", "(", ")", "{", "return", "new", "TestSuite", "(", "SuggestionInferencingTests", ".", "class", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "}", "public", "void", "testDoNothing", "(", ")", "throws", "Exception", "{", "}", "}", "</s>" ]
5,916
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "public", "class", "AllDSLTests", "{", "public", "static", "Test", "suite", "(", ")", "{", "final", "TestSuite", "suite", "=", "new", "TestSuite", "(", "AllDSLTests", ".", "class", ".", "getPackage", "(", ")", ".", "getName", "(", ")", ")", ";", "suite", ".", "addTest", "(", "PointcutCreationTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "PointcutEvaluationTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "MetaDSLInferencingTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "DSLInferencingTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "BuiltInDSLInferencingTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "DSLStoreTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTestSuite", "(", "StringObjectVectorTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "DSLContentAssistTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "DSLNamedArgContentAssistTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "SuggestionInferencingTests", ".", "class", ")", ";", "return", "suite", ";", "}", "}", "</s>" ]
5,917
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ".", "CompletionTestCase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "model", ".", "GroovyRuntime", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "GroovyDSLCoreActivator", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "RefreshDSLDJob", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "DSLNamedArgContentAssistTests", "extends", "CompletionTestCase", "{", "public", "DSLNamedArgContentAssistTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "createGenericProject", "(", ")", ";", "IProject", "project", "=", "env", ".", "getProject", "(", "\"Project\"", ")", ";", "GroovyRuntime", ".", "addLibraryToClasspath", "(", "JavaCore", ".", "create", "(", "project", ")", ",", "GroovyDSLCoreActivator", ".", "CLASSPATH_CONTAINER_ID", ",", "false", ")", ";", "env", ".", "fullBuild", "(", ")", ";", "new", "RefreshDSLDJob", "(", "project", ")", ".", "run", "(", "null", ")", ";", "GroovyDSLCoreActivator", ".", "getDefault", "(", ")", ".", "getContainerListener", "(", ")", ".", "ignoreProject", "(", "project", ")", ";", "}", "public", "void", "testNamedArgs1", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"flar()\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testNoNamedArgs1", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"flar()\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs2", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs3", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\",\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs4", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\",\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs5", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\",\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testNoNamedArgs6", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"flar", "\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testOptionalArgs1", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"flar(", ")\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"(", "\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testOptionalArgs2", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"flar(", ")\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"(", "\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testOptionalArgs3", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"flar(", ")\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"(", "\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs7", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"r", "\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs8", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\",\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"flar\"", ",", "1", ")", ";", "}", "public", "void", "testParamGuessing1", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"String", "xxxn\"", "+", "\"int", "yyyn\"", "+", "\"boolean", "zzzn\"", "+", "\"flar()\"", ";", "String", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "{", "\"yyy\"", ",", "\"0\"", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"flar(\"", ",", "\"aaa\"", ",", "\"aaa:", "__,", "\"", ",", "expectedChoices", ")", ";", "}", "public", "void", "testParamGuessing3", "(", ")", "throws", "Exception", "{", "createDSL", "(", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"String", "xxxn\"", "+", "\"boolean", "zzzn\"", "+", "\"\"", "+", "\"", "int", "yyyn\"", "+", "\"", "flar()n\"", "+", "\"}\"", ";", "String", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "{", "\"iii\"", ",", "\"yyy\"", ",", "\"0\"", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"flar(\"", ",", "\"aaa\"", ",", "\"aaa:", "__,", "\"", ",", "expectedChoices", ")", ";", "}", "private", "static", "final", "String", "closuredsld", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "private", "static", "final", "String", "closureContents", "=", "\"\"", ";", "public", "void", "testClostureOp1", "(", ")", "throws", "Exception", "{", "createDSL", "(", "closuredsld", ")", ";", "checkProposalApplicationNonType", "(", "closureContents", ",", "closureContents", "+", "\"1", "{\"", ",", "closureContents", ".", "length", "(", ")", ",", "\"test1\"", ")", ";", "}", "public", "void", "testClostureOp2", "(", ")", "throws", "Exception", "{", "createDSL", "(", "closuredsld", ")", ";", "checkProposalApplicationNonType", "(", "closureContents", ",", "closureContents", "+", "\"2(\\\"\\\")", "{\"", ",", "closureContents", ".", "length", "(", ")", ",", "\"test2\"", ")", ";", "}", "public", "void", "testClostureOp3", "(", ")", "throws", "Exception", "{", "createDSL", "(", "closuredsld", ")", ";", "checkProposalApplicationNonType", "(", "closureContents", ",", "closureContents", "+", "\"3(op:{", "})\"", ",", "closureContents", ".", "length", "(", ")", ",", "\"test3\"", ")", ";", "}", "public", "void", "testClostureOp4", "(", ")", "throws", "Exception", "{", "createDSL", "(", "closuredsld", ")", ";", "checkProposalApplicationNonType", "(", "closureContents", ",", "closureContents", "+", "\"\"", ",", "closureContents", ".", "length", "(", ")", ",", "\"test4\"", ")", ";", "}", "public", "void", "testClostureOp5", "(", ")", "throws", "Exception", "{", "createDSL", "(", "closuredsld", ")", ";", "checkProposalApplicationNonType", "(", "closureContents", ",", "closureContents", "+", "\"\"", ",", "closureContents", ".", "length", "(", ")", ",", "\"test5\"", ")", ";", "}", "public", "void", "testClostureOp6", "(", ")", "throws", "Exception", "{", "createDSL", "(", "closuredsld", ")", ";", "checkProposalApplicationNonType", "(", "closureContents", ",", "closureContents", "+", "\"\"", ",", "closureContents", ".", "length", "(", ")", ",", "\"test6\"", ")", ";", "}", "public", "void", "testClostureOp7", "(", ")", "throws", "Exception", "{", "createDSL", "(", "closuredsld", ")", ";", "checkProposalApplicationNonType", "(", "closureContents", ",", "closureContents", "+", "\"\"", ",", "closureContents", ".", "length", "(", ")", ",", "\"test7\"", ")", ";", "}", "public", "void", "testClostureOp8", "(", ")", "throws", "Exception", "{", "createDSL", "(", "closuredsld", ")", ";", "checkProposalApplicationNonType", "(", "closureContents", ",", "closureContents", "+", "\"\"", ",", "closureContents", ".", "length", "(", ")", ",", "\"test8\"", ")", ";", "}", "public", "void", "testClostureOp9", "(", ")", "throws", "Exception", "{", "createDSL", "(", "closuredsld", ")", ";", "checkProposalApplicationNonType", "(", "closureContents", ",", "closureContents", "+", "\"\"", ",", "closureContents", ".", "length", "(", ")", ",", "\"test9\"", ")", ";", "}", "public", "void", "testClostureOp0", "(", ")", "throws", "Exception", "{", "createDSL", "(", "closuredsld", ")", ";", "checkProposalApplicationNonType", "(", "closureContents", ",", "closureContents", "+", "\"\"", ",", "closureContents", ".", "length", "(", ")", ",", "\"test0\"", ")", ";", "}", "private", "void", "createDSL", "(", "String", "dsldContents", ")", "throws", "Exception", "{", "defaultFileExtension", "=", "\"dsld\"", ";", "create", "(", "\"MyDsld\"", ",", "dsldContents", ")", ";", "defaultFileExtension", "=", "\"groovy\"", ";", "env", ".", "fullBuild", "(", ")", ";", "expectingNoProblems", "(", ")", ";", "}", "}", "</s>" ]
5,918
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "java", ".", "net", ".", "MalformedURLException", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "ui", ".", "plugin", ".", "AbstractUIPlugin", ";", "import", "org", ".", "osgi", ".", "framework", ".", "BundleContext", ";", "public", "class", "GroovyDSLDTestsActivator", "extends", "AbstractUIPlugin", "{", "public", "static", "final", "String", "PLUGIN_ID", "=", "\"\"", ";", "private", "static", "GroovyDSLDTestsActivator", "plugin", ";", "public", "GroovyDSLDTestsActivator", "(", ")", "{", "}", "public", "void", "start", "(", "BundleContext", "context", ")", "throws", "Exception", "{", "super", ".", "start", "(", "context", ")", ";", "plugin", "=", "this", ";", "}", "public", "void", "stop", "(", "BundleContext", "context", ")", "throws", "Exception", "{", "plugin", "=", "null", ";", "super", ".", "stop", "(", "context", ")", ";", "}", "public", "static", "GroovyDSLDTestsActivator", "getDefault", "(", ")", "{", "return", "plugin", ";", "}", "public", "InputStream", "getTestResourceStream", "(", "String", "fileName", ")", "throws", "IOException", "{", "return", "getTestResourceURL", "(", "fileName", ")", ".", "openStream", "(", ")", ";", "}", "public", "String", "getTestResourceContents", "(", "String", "fileName", ")", "throws", "IOException", "{", "InputStream", "stream", "=", "getTestResourceStream", "(", "fileName", ")", ";", "return", "getContents", "(", "stream", ")", ";", "}", "public", "URL", "getTestResourceURL", "(", "String", "fileName", ")", "throws", "MalformedURLException", "{", "IPath", "path", "=", "new", "Path", "(", "\"\"", ")", ".", "append", "(", "fileName", ")", ";", "return", "new", "URL", "(", "getBundle", "(", ")", ".", "getEntry", "(", "\"/\"", ")", ",", "path", ".", "toString", "(", ")", ")", ";", "}", "public", "String", "getContents", "(", "InputStream", "in", ")", "throws", "IOException", "{", "BufferedReader", "br", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "in", ")", ")", ";", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "300", ")", ";", "try", "{", "int", "read", "=", "0", ";", "while", "(", "(", "read", "=", "br", ".", "read", "(", ")", ")", "!=", "-", "1", ")", "sb", ".", "append", "(", "(", "char", ")", "read", ")", ";", "}", "finally", "{", "br", ".", "close", "(", ")", ";", "}", "return", "sb", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
5,919
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "tests", ";", "import", "groovy", ".", "lang", ".", "Binding", ";", "import", "groovy", ".", "lang", ".", "Closure", ";", "import", "groovy", ".", "lang", ".", "GroovyCodeSource", ";", "import", "groovy", ".", "lang", ".", "GroovyShell", ";", "import", "groovy", ".", "lang", ".", "Script", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Collection", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Map", ".", "Entry", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "GroovyLogManager", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "TraceCategory", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "pointcuts", ".", "IPointcut", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "script", ".", "PointcutClosure", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "dsl", ".", "script", ".", "PointcutFactory", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "public", "class", "PointcutScriptExecutor", "{", "private", "final", "class", "RegisterClosure", "extends", "Closure", "{", "private", "static", "final", "long", "serialVersionUID", "=", "1162731585734041055L", ";", "public", "RegisterClosure", "(", "Object", "owner", ")", "{", "super", "(", "owner", ")", ";", "}", "@", "Override", "public", "Object", "call", "(", "Object", "arguments", ")", "{", "return", "tryRegister", "(", "arguments", ")", ";", "}", "@", "Override", "public", "Object", "call", "(", "Object", "...", "arguments", ")", "{", "return", "tryRegister", "(", "arguments", ")", ";", "}", "}", "private", "final", "class", "PoincutBinding", "extends", "Binding", "{", "@", "Override", "public", "Object", "invokeMethod", "(", "String", "name", ",", "Object", "args", ")", "{", "if", "(", "name", ".", "equals", "(", "\"\"", ")", ")", "{", "return", "tryRegister", "(", "args", ")", ";", "}", "IPointcut", "pc", "=", "factory", ".", "createPointcut", "(", "name", ")", ";", "if", "(", "pc", "!=", "null", ")", "{", "configure", "(", "pc", ",", "args", ")", ";", "return", "pc", ";", "}", "else", "{", "return", "super", ".", "invokeMethod", "(", "name", ",", "args", ")", ";", "}", "}", "@", "Override", "public", "Object", "getVariable", "(", "String", "name", ")", "{", "if", "(", "name", ".", "equals", "(", "\"\"", ")", ")", "{", "return", "new", "RegisterClosure", "(", "this", ")", ";", "}", "IPointcut", "pc", "=", "factory", ".", "createPointcut", "(", "name", ")", ";", "if", "(", "pc", "!=", "null", ")", "{", "return", "new", "PointcutClosure", "(", "this", ",", "pc", ")", ";", "}", "else", "{", "return", "super", ".", "getVariable", "(", "name", ")", ";", "}", "}", "private", "void", "configure", "(", "IPointcut", "pointcut", ",", "Object", "arguments", ")", "{", "if", "(", "arguments", "instanceof", "Map", "<", "?", ",", "?", ">", ")", "{", "for", "(", "Entry", "<", "Object", ",", "Object", ">", "entry", ":", "(", "(", "Map", "<", "Object", ",", "Object", ">", ")", "arguments", ")", ".", "entrySet", "(", ")", ")", "{", "Object", "key", "=", "entry", ".", "getKey", "(", ")", ";", "pointcut", ".", "addArgument", "(", "key", "==", "null", "?", "null", ":", "key", ".", "toString", "(", ")", ",", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "else", "if", "(", "arguments", "instanceof", "Collection", "<", "?", ">", ")", "{", "for", "(", "Object", "arg", ":", "(", "Collection", "<", "Object", ">", ")", "arguments", ")", "{", "pointcut", ".", "addArgument", "(", "arg", ")", ";", "}", "}", "else", "if", "(", "arguments", "instanceof", "Object", "[", "]", ")", "{", "for", "(", "Object", "arg", ":", "(", "Object", "[", "]", ")", "arguments", ")", "{", "pointcut", ".", "addArgument", "(", "arg", ")", ";", "}", "}", "else", "if", "(", "arguments", "!=", "null", ")", "{", "pointcut", ".", "addArgument", "(", "arguments", ")", ";", "}", "}", "}", "private", "final", "static", "String", "DEFAULT_SCRIPT_NAME", "=", "\"\"", ";", "private", "final", "PointcutFactory", "factory", "=", "new", "PointcutFactory", "(", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getProject", "(", "\"Project\"", ")", ".", "getFile", "(", "\".project\"", ")", ",", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getProject", "(", "\"Project\"", ")", ")", ";", "public", "IPointcut", "createPointcut", "(", "String", "expression", ")", "{", "GroovyCodeSource", "source", "=", "new", "GroovyCodeSource", "(", "expression", ",", "DEFAULT_SCRIPT_NAME", ",", "GroovyShell", ".", "DEFAULT_CODE_BASE", ")", ";", "Script", "script", "=", "new", "GroovyShell", "(", "this", ".", "getClass", "(", ")", ".", "getClassLoader", "(", ")", ")", ".", "parse", "(", "source", ")", ";", "script", ".", "setBinding", "(", "new", "PoincutBinding", "(", ")", ")", ";", "Object", "res", "=", "script", ".", "run", "(", ")", ";", "return", "res", "instanceof", "IPointcut", "?", "(", "IPointcut", ")", "res", ":", "null", ";", "}", "@", "SuppressWarnings", "(", "\"rawtypes\"", ")", "protected", "Object", "tryRegister", "(", "Object", "args", ")", "{", "Object", "[", "]", "nameAndClass", "=", "extractArgsForRegister", "(", "args", ")", ";", "if", "(", "nameAndClass", "!=", "null", ")", "{", "factory", ".", "registerLocalPointcut", "(", "(", "String", ")", "nameAndClass", "[", "0", "]", ",", "(", "Closure", ")", "nameAndClass", "[", "1", "]", ")", ";", "return", "nameAndClass", "[", "1", "]", ";", "}", "else", "{", "GroovyLogManager", ".", "manager", ".", "log", "(", "TraceCategory", ".", "DSL", ",", "\"\"", "+", "(", "args", "instanceof", "Object", "[", "]", "?", "Arrays", ".", "toString", "(", "(", "Object", "[", "]", ")", "args", ")", ":", "args", ")", ")", ";", "return", "null", ";", "}", "}", "protected", "Object", "[", "]", "extractArgsForRegister", "(", "Object", "args", ")", "{", "if", "(", "args", "instanceof", "Object", "[", "]", ")", "{", "Object", "[", "]", "arr", "=", "(", "Object", "[", "]", ")", "args", ";", "if", "(", "arr", ".", "length", "==", "2", "&&", "arr", "[", "0", "]", "instanceof", "String", "&&", "arr", "[", "1", "]", "instanceof", "Closure", ")", "{", "return", "arr", ";", "}", "}", "else", "if", "(", "args", "instanceof", "Collection", "<", "?", ">", ")", "{", "Collection", "<", "Object", ">", "coll", "=", "(", "Collection", "<", "Object", ">", ")", "args", ";", "Object", "[", "]", "arr", "=", "new", "Object", "[", "2", "]", ";", "Iterator", "<", "Object", ">", "iter", "=", "coll", ".", "iterator", "(", ")", ";", "if", "(", "iter", ".", "hasNext", "(", ")", "&&", "(", "arr", "[", "0", "]", "=", "iter", ".", "next", "(", ")", ")", "instanceof", "String", "&&", "iter", ".", "hasNext", "(", ")", "&&", "(", "arr", "[", "1", "]", "=", "iter", ".", "next", "(", ")", ")", "instanceof", "Closure", "&&", "!", "iter", ".", "hasNext", "(", ")", ")", "{", "return", "arr", ";", "}", "}", "else", "if", "(", "args", "instanceof", "Map", "<", "?", ",", "?", ">", ")", "{", "return", "extractArgsForRegister", "(", "(", "(", "Map", "<", "Object", ",", "Object", ">", ")", "args", ")", ".", "values", "(", ")", ")", ";", "}", "return", "null", ";", "}", "}", "</s>" ]
5,920
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "util", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "public", "class", "AllTests", "{", "public", "static", "Test", "suite", "(", ")", "{", "final", "TestSuite", "suite", "=", "new", "TestSuite", "(", "\"Test", "for", "\"", "+", "AllTests", ".", "class", ".", "getPackage", "(", ")", ".", "getName", "(", ")", ")", ";", "suite", ".", "addTestSuite", "(", "TokenStreamTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "ExpressionFinderTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "ArrayUtilsTests", ".", "class", ")", ";", "return", "suite", ";", "}", "}", "</s>" ]
5,921
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "util", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "impl", ".", "StringSourceBuffer", ";", "public", "class", "ExpressionFinderTests", "extends", "TestCase", "{", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"Starting:", "\"", "+", "getName", "(", ")", ")", ";", "super", ".", "setUp", "(", ")", ";", "}", "private", "void", "doFind", "(", "String", "test", ")", "{", "ExpressionFinder", "finder", "=", "new", "ExpressionFinder", "(", ")", ";", "StringSourceBuffer", "sb", "=", "new", "StringSourceBuffer", "(", "test", ")", ";", "try", "{", "assertEquals", "(", "test", ",", "finder", ".", "findForCompletions", "(", "sb", ",", "test", ".", "length", "(", ")", "-", "1", ")", ")", ";", "}", "catch", "(", "ParseException", "e", ")", "{", "fail", "(", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "private", "void", "doFind", "(", "String", "test", ",", "String", "expected", ",", "int", "offset", ")", "{", "ExpressionFinder", "finder", "=", "new", "ExpressionFinder", "(", ")", ";", "StringSourceBuffer", "sb", "=", "new", "StringSourceBuffer", "(", "test", ")", ";", "try", "{", "assertEquals", "(", "expected", ",", "finder", ".", "findForCompletions", "(", "sb", ",", "offset", ")", ")", ";", "}", "catch", "(", "ParseException", "e", ")", "{", "fail", "(", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "void", "doSplit", "(", "String", "test", ",", "String", "expr", ",", "String", "prefix", ")", "{", "ExpressionFinder", "finder", "=", "new", "ExpressionFinder", "(", ")", ";", "StringSourceBuffer", "sb", "=", "new", "StringSourceBuffer", "(", "test", ")", ";", "String", "foundExpr", ";", "try", "{", "foundExpr", "=", "finder", ".", "findForCompletions", "(", "sb", ",", "test", ".", "length", "(", ")", "-", "1", ")", ";", "String", "[", "]", "split", "=", "finder", ".", "splitForCompletion", "(", "foundExpr", ")", ";", "assertEquals", "(", "expr", ",", "split", "[", "0", "]", ")", ";", "assertEquals", "(", "prefix", ",", "split", "[", "1", "]", ")", ";", "}", "catch", "(", "ParseException", "e", ")", "{", "fail", "(", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "void", "failSplit", "(", "String", "test", ")", "{", "ExpressionFinder", "finder", "=", "new", "ExpressionFinder", "(", ")", ";", "String", "[", "]", "split", "=", "finder", ".", "splitForCompletion", "(", "test", ")", ";", "assertEquals", "(", "2", ",", "split", ".", "length", ")", ";", "assertEquals", "(", "\"\"", ",", "split", "[", "0", "]", ")", ";", "assertEquals", "(", "null", ",", "split", "[", "1", "]", ")", ";", "}", "public", "void", "testSimple1", "(", ")", "{", "doFind", "(", "\"hello\"", ")", ";", "}", "public", "void", "testSimple2", "(", ")", "{", "doFind", "(", "\"hello.name\"", ")", ";", "}", "public", "void", "testSimple3", "(", ")", "{", "doFind", "(", "\"\"", ")", ";", "}", "public", "void", "testMultiple1", "(", ")", "{", "doFind", "(", "\"\"", ")", ";", "}", "public", "void", "testMultiple2", "(", ")", "{", "doFind", "(", "\"\"", ")", ";", "}", "public", "void", "testMultiple3", "(", ")", "{", "doFind", "(", "\"\"", ")", ";", "}", "public", "void", "testDotted1", "(", ")", "{", "doFind", "(", "\"hello.\"", ")", ";", "}", "public", "void", "testDotted2", "(", ")", "{", "doFind", "(", "\"\"", ")", ";", "}", "public", "void", "testComplex1", "(", ")", "{", "doFind", "(", "\"\"", ")", ";", "}", "public", "void", "testComplex2", "(", ")", "{", "doFind", "(", "\"a[20].\"", ")", ";", "}", "public", "void", "testComplex3", "(", ")", "{", "doFind", "(", "\"a[20].thing\"", ")", ";", "}", "public", "void", "testComplex5", "(", ")", "{", "doFind", "(", "\"\"", ")", ";", "}", "public", "void", "testComplex6", "(", ")", "{", "doFind", "(", "\"\"", ")", ";", "}", "public", "void", "testInString1", "(", ")", "{", "doFind", "(", "\"\"", ",", "\"10.tim\"", ",", "21", ")", ";", "}", "public", "void", "testInString2", "(", ")", "{", "doFind", "(", "\"\"", ",", "\"\"", ",", "44", ")", ";", "}", "public", "void", "testInString3", "(", ")", "{", "doFind", "(", "\"\"", ",", "\"\"", ",", "46", ")", ";", "}", "public", "void", "testSplit1", "(", ")", "{", "doSplit", "(", "\"hello\"", ",", "\"hello\"", ",", "null", ")", ";", "}", "public", "void", "testSplit2", "(", ")", "{", "doSplit", "(", "\"hello.\"", ",", "\"hello\"", ",", "\"\"", ")", ";", "}", "public", "void", "testSplit3", "(", ")", "{", "doSplit", "(", "\"hello.name\"", ",", "\"hello\"", ",", "\"name\"", ")", ";", "}", "public", "void", "testSplit4", "(", ")", "{", "doSplit", "(", "\"greet().name\"", ",", "\"greet()\"", ",", "\"name\"", ")", ";", "}", "public", "void", "testSplit5", "(", ")", "{", "doSplit", "(", "\"list[10].do\"", ",", "\"list[10]\"", ",", "\"do\"", ")", ";", "}", "public", "void", "testSplit6", "(", ")", "{", "doSplit", "(", "\"\"", ",", "\"\"", ",", "\"\"", ")", ";", "}", "public", "void", "testSplit7", "(", ")", "{", "doSplit", "(", "\"\"", ",", "\"\"", ",", "\"class\"", ")", ";", "}", "public", "void", "testSplit8", "(", ")", "{", "doSplit", "(", "\"[].do\"", ",", "\"[]\"", ",", "\"do\"", ")", ";", "}", "public", "void", "testSplit9", "(", ")", "{", "doSplit", "(", "\"nnt[].do\"", ",", "\"[]\"", ",", "\"do\"", ")", ";", "}", "public", "void", "testSplit10", "(", ")", "{", "doSplit", "(", "\"nnt[10].do\"", ",", "\"[10]\"", ",", "\"do\"", ")", ";", "}", "public", "void", "testSplit11", "(", ")", "{", "doSplit", "(", "\"nnt[[]].do\"", ",", "\"[[]]\"", ",", "\"do\"", ")", ";", "}", "public", "void", "testSplit12", "(", ")", "{", "doSplit", "(", "\"nnt[1:1].do\"", ",", "\"[1:1]\"", ",", "\"do\"", ")", ";", "}", "public", "void", "testSplit13", "(", ")", "{", "doSplit", "(", "\"\"", ",", "\"\"", ",", "\"g\"", ")", ";", "}", "public", "void", "testSplit14", "(", ")", "{", "doSplit", "(", "\"\"", ",", "\"\"", ",", "\"g\"", ")", ";", "}", "public", "void", "testSplit15", "(", ")", "{", "doSplit", "(", "\"\"", ",", "\"\"", ",", "\"g\"", ")", ";", "}", "public", "void", "testFailSplit1", "(", ")", "{", "failSplit", "(", "\"boo()\"", ")", ";", "}", "public", "void", "testFailSplit2", "(", ")", "{", "failSplit", "(", "\"boo[]\"", ")", ";", "}", "public", "void", "testFailSplit3", "(", ")", "{", "failSplit", "(", "\"boo{}\"", ")", ";", "}", "public", "void", "testFailSplit4", "(", ")", "{", "failSplit", "(", "\"'boo'\"", ")", ";", "}", "public", "void", "testFailSplit5", "(", ")", "{", "failSplit", "(", "\"//n\"", ")", ";", "}", "public", "void", "testFailSplit6", "(", ")", "{", "failSplit", "(", "\"\"", ")", ";", "}", "public", "void", "testFailSplit7", "(", ")", "{", "failSplit", "(", "\"\"", ")", ";", "}", "public", "void", "testFailSplit8", "(", ")", "{", "failSplit", "(", "\"\"", ")", ";", "}", "public", "void", "testFailSplit9", "(", ")", "{", "failSplit", "(", "\"\"", ")", ";", "}", "public", "void", "testParenEOF", "(", ")", "{", "String", "test", "=", "\"\"", ";", "doFind", "(", "test", ",", "\"a.\"", ",", "test", ".", "length", "(", ")", "-", "1", ")", ";", "}", "public", "void", "testBraceEOF", "(", ")", "{", "String", "test", "=", "\"\"", ";", "doFind", "(", "test", ",", "\"a.\"", ",", "test", ".", "length", "(", ")", "-", "1", ")", ";", "}", "public", "void", "testBraceEOFNoSpace", "(", ")", "{", "String", "test", "=", "\"\"", ";", "doFind", "(", "test", ",", "\"a.\"", ",", "test", ".", "length", "(", ")", "-", "1", ")", ";", "}", "public", "void", "testWithLineComment", "(", ")", "{", "String", "test", "=", "\"\"", ";", "doFind", "(", "test", ",", "\"a.\"", ",", "test", ".", "length", "(", ")", "-", "1", ")", ";", "}", "public", "void", "testWithLineComment2", "(", ")", "{", "String", "test", "=", "\"\"", ";", "doFind", "(", "test", ",", "\"a.\"", ",", "test", ".", "length", "(", ")", "-", "1", ")", ";", "}", "public", "void", "testWithLineComment3", "(", ")", "{", "String", "test", "=", "\"\"", ";", "doFind", "(", "test", ",", "\"a.\"", ",", "test", ".", "length", "(", ")", "-", "1", ")", ";", "}", "public", "void", "testWithBlockComment", "(", ")", "{", "String", "test", "=", "\"\"", ";", "doFind", "(", "test", ",", "\"a.\"", ",", "test", ".", "length", "(", ")", "-", "1", ")", ";", "}", "public", "void", "testNewExpression", "(", ")", "{", "doFind", "(", "\"\"", ")", ";", "doFind", "(", "\"\"", ")", ";", "}", "public", "void", "testProblem", "(", ")", "throws", "Exception", "{", "ExpressionFinder", "finder", "=", "new", "ExpressionFinder", "(", ")", ";", "String", "test", "=", "\".\"", ";", "StringSourceBuffer", "sb", "=", "new", "StringSourceBuffer", "(", "test", ")", ";", "assertNull", "(", "finder", ".", "findForCompletions", "(", "sb", ",", "test", ".", "length", "(", ")", "-", "1", ")", ")", ";", "}", "}", "</s>" ]
5,922
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "util", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "impl", ".", "StringSourceBuffer", ";", "public", "class", "TokenStreamTests", "extends", "TestCase", "{", "static", "int", "EOF", "=", "Token", ".", "EOF", ";", "static", "int", "IDENT", "=", "Token", ".", "IDENT", ";", "static", "int", "DOT", "=", "Token", ".", "DOT", ";", "static", "int", "SEMI", "=", "Token", ".", "SEMI", ";", "static", "int", "QUOTED_STRING", "=", "Token", ".", "QUOTED_STRING", ";", "static", "int", "PAREN_BLOCK", "=", "Token", ".", "PAREN_BLOCK", ";", "static", "int", "BRACE_BLOCK", "=", "Token", ".", "BRACE_BLOCK", ";", "static", "int", "BRACK_BLOCK", "=", "Token", ".", "BRACK_BLOCK", ";", "static", "int", "LINE_COMMENT", "=", "Token", ".", "LINE_COMMENT", ";", "static", "int", "BLOCK_COMMENT", "=", "Token", ".", "BLOCK_COMMENT", ";", "static", "int", "LINE_BREAK", "=", "Token", ".", "LINE_BREAK", ";", "static", "int", "SAFE_DEREF", "=", "Token", ".", "SAFE_DEREF", ";", "static", "int", "SPREAD", "=", "Token", ".", "SPREAD", ";", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"Starting:", "\"", "+", "getName", "(", ")", ")", ";", "super", ".", "setUp", "(", ")", ";", "}", "void", "doTest", "(", "String", "sample", ",", "int", "off", ",", "int", "[", "]", "expected", ")", "throws", "TokenStreamException", "{", "int", "offset", "=", "off", ";", "if", "(", "offset", "==", "-", "1", ")", "{", "offset", "=", "sample", ".", "length", "(", ")", "-", "1", ";", "}", "StringSourceBuffer", "sb", "=", "new", "StringSourceBuffer", "(", "sample", ")", ";", "TokenStream", "stream", "=", "new", "TokenStream", "(", "sb", ",", "offset", ")", ";", "List", "<", "Token", ">", "list", "=", "new", "ArrayList", "<", "Token", ">", "(", ")", ";", "Token", "token", "=", "null", ";", "while", "(", "(", "token", "=", "stream", ".", "next", "(", ")", ")", ".", "type", "!=", "Token", ".", "EOF", ")", "{", "list", ".", "add", "(", "token", ")", ";", "}", "list", ".", "add", "(", "token", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "expected", ".", "length", ";", "++", "i", ")", "{", "assertEquals", "(", "new", "Token", "(", "expected", "[", "i", "]", ",", "-", "1", ",", "-", "1", ",", "null", ")", ",", "list", ".", "get", "(", "i", ")", ")", ";", "}", "}", "private", "void", "doTestOffsets", "(", "String", "sample", ",", "int", "[", "]", "offsetPairs", ")", "{", "int", "offset", "=", "sample", ".", "length", "(", ")", "-", "1", ";", "StringSourceBuffer", "sb", "=", "new", "StringSourceBuffer", "(", "sample", ")", ";", "TokenStream", "stream", "=", "new", "TokenStream", "(", "sb", ",", "offset", ")", ";", "List", "<", "Token", ">", "list", "=", "new", "ArrayList", "<", "Token", ">", "(", ")", ";", "Token", "token", "=", "null", ";", "try", "{", "while", "(", "(", "token", "=", "stream", ".", "next", "(", ")", ")", ".", "type", "!=", "Token", ".", "EOF", ")", "{", "list", ".", "add", "(", "token", ")", ";", "}", "}", "catch", "(", "TokenStreamException", "e", ")", "{", "fail", "(", "e", ".", "getMessage", "(", ")", ")", ";", "}", "list", ".", "add", "(", "token", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "offsetPairs", ".", "length", ";", "i", "+=", "2", ")", "{", "assertEquals", "(", "offsetPairs", "[", "i", "]", ",", "(", "(", "Token", ")", "list", ".", "get", "(", "i", ">>", "1", ")", ")", ".", "startOffset", ")", ";", "assertEquals", "(", "offsetPairs", "[", "i", "+", "1", "]", ",", "(", "(", "Token", ")", "list", ".", "get", "(", "i", ">>", "1", ")", ")", ".", "endOffset", ")", ";", "}", "}", "public", "void", "testWhite1", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"", "hello", "\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testWhite2", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"thellot\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testWhite3", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"rhellor\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "LINE_BREAK", ",", "IDENT", ",", "LINE_BREAK", ",", "EOF", "}", ")", ";", "}", "public", "void", "testWhite4", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"nhellon\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "LINE_BREAK", ",", "IDENT", ",", "LINE_BREAK", ",", "EOF", "}", ")", ";", "}", "public", "void", "testWhite5", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"rnhellorn\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "LINE_BREAK", ",", "IDENT", ",", "LINE_BREAK", ",", "EOF", "}", ")", ";", "}", "public", "void", "testSemi", "(", ")", "throws", "Exception", "{", "doTest", "(", "\";\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "SEMI", ",", "EOF", "}", ")", ";", "}", "public", "void", "testSimple1", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"hello\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testSimple2", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"hello.there\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "DOT", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testSimple3", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"10.times\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "DOT", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testSimple4", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"10.times\"", ",", "2", ",", "new", "int", "[", "]", "{", "DOT", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testComplex1", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "BRACE_BLOCK", ",", "IDENT", ",", "DOT", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testComplex2", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "BRACE_BLOCK", ",", "IDENT", ",", "DOT", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testComplex3", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "DOT", ",", "PAREN_BLOCK", ",", "IDENT", ",", "DOT", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testComplex4", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "DOT", ",", "BRACK_BLOCK", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testComplex5", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "DOT", ",", "BRACE_BLOCK", ",", "IDENT", ",", "DOT", ",", "BRACK_BLOCK", ",", "EOF", "}", ")", ";", "}", "public", "void", "testComplex6", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"a[20].\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "DOT", ",", "BRACK_BLOCK", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testOffsets1", "(", ")", "throws", "Exception", "{", "doTestOffsets", "(", "\"\"", ",", "new", "int", "[", "]", "{", "9", ",", "23", ",", "3", ",", "8", ",", "2", ",", "3", ",", "0", ",", "2", "}", ")", ";", "}", "public", "void", "testOffsets2", "(", ")", "throws", "Exception", "{", "doTestOffsets", "(", "\"\"", ",", "new", "int", "[", "]", "{", "15", ",", "19", ",", "14", ",", "15", ",", "4", ",", "14", ",", "0", ",", "4", "}", ")", ";", "}", "public", "void", "testQuote1", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\\\"hello\\\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "QUOTED_STRING", ",", "EOF", "}", ")", ";", "}", "public", "void", "testQuote2", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"'hello'\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "QUOTED_STRING", ",", "EOF", "}", ")", ";", "}", "public", "void", "testQuote3", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\\\"\\\"\\\"hello\\\"\\\"\\\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "QUOTED_STRING", ",", "EOF", "}", ")", ";", "}", "public", "void", "testQuote4", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"'''hello'''\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "QUOTED_STRING", ",", "EOF", "}", ")", ";", "}", "public", "void", "testQuote5", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "QUOTED_STRING", ",", "LINE_BREAK", ",", "QUOTED_STRING", ",", "EOF", "}", ")", ";", "}", "public", "void", "testLineComment1", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "QUOTED_STRING", ",", "LINE_BREAK", ",", "LINE_COMMENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testLineComment2", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "DOT", ",", "IDENT", ",", "LINE_BREAK", ",", "LINE_COMMENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testLineComment3", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "DOT", ",", "IDENT", ",", "LINE_BREAK", ",", "LINE_COMMENT", ",", "LINE_BREAK", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testBlockComment1", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "QUOTED_STRING", ",", "LINE_BREAK", ",", "BLOCK_COMMENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testBlockComment2", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "QUOTED_STRING", ",", "LINE_BREAK", ",", "BLOCK_COMMENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testSafeDeref", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"foo?.bar\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "SAFE_DEREF", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testSpread", "(", ")", "throws", "Exception", "{", "doTest", "(", "\"foo*.bar\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "SPREAD", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testError1", "(", ")", "throws", "Exception", "{", "StringSourceBuffer", "sb", "=", "new", "StringSourceBuffer", "(", "\"0..1]\"", ")", ";", "TokenStream", "stream", "=", "new", "TokenStream", "(", "sb", ",", "\"0..1]\"", ".", "length", "(", ")", "-", "1", ")", ";", "try", "{", "stream", ".", "next", "(", ")", ";", "fail", "(", "\"\"", ")", ";", "}", "catch", "(", "TokenStreamException", "e", ")", "{", "}", "}", "public", "void", "testPeek", "(", ")", "throws", "TokenStreamException", "{", "StringSourceBuffer", "sb", "=", "new", "StringSourceBuffer", "(", "\"hello\"", ")", ";", "TokenStream", "stream", "=", "new", "TokenStream", "(", "sb", ",", "\"hello\"", ".", "length", "(", ")", "-", "1", ")", ";", "assertTrue", "(", "stream", ".", "peek", "(", ")", ".", "type", "==", "Token", ".", "IDENT", ")", ";", "}", "public", "void", "testLast", "(", ")", "throws", "TokenStreamException", "{", "StringSourceBuffer", "sb", "=", "new", "StringSourceBuffer", "(", "\"hello.\"", ")", ";", "TokenStream", "stream", "=", "new", "TokenStream", "(", "sb", ",", "\"hello.\"", ".", "length", "(", ")", "-", "1", ")", ";", "Token", "next", "=", "stream", ".", "next", "(", ")", ";", "assertTrue", "(", "stream", ".", "last", "(", ")", "==", "next", ")", ";", "assertTrue", "(", "stream", ".", "peek", "(", ")", ".", "type", "==", "Token", ".", "IDENT", ")", ";", "assertTrue", "(", "stream", ".", "last", "(", ")", "==", "next", ")", ";", "}", "public", "void", "testArray1", "(", ")", "throws", "TokenStreamException", "{", "doTest", "(", "\"foo['foo'].x\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "DOT", ",", "BRACK_BLOCK", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testArray2", "(", ")", "throws", "TokenStreamException", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "DOT", ",", "BRACK_BLOCK", ",", "BRACK_BLOCK", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testArray3", "(", ")", "throws", "TokenStreamException", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "DOT", ",", "BRACK_BLOCK", ",", "BRACK_BLOCK", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testArray4", "(", ")", "throws", "TokenStreamException", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "IDENT", ",", "DOT", ",", "BRACK_BLOCK", ",", "BRACE_BLOCK", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "public", "void", "testArray5", "(", ")", "throws", "TokenStreamException", "{", "doTest", "(", "\"\"", ",", "-", "1", ",", "new", "int", "[", "]", "{", "BRACE_BLOCK", ",", "BRACK_BLOCK", ",", "IDENT", ",", "EOF", "}", ")", ";", "}", "}", "</s>" ]
5,923
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "util", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "public", "class", "ArrayUtilsTests", "extends", "TestCase", "{", "public", "void", "testArrayRemove1", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "remove", "(", "new", "String", "[", "]", "{", "\"\"", "}", ",", "0", ")", ";", "assertEquals", "(", "0", ",", "res", ".", "length", ")", ";", "}", "public", "void", "testArrayRemove2", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "remove", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", "}", ",", "0", ")", ";", "assertEquals", "(", "1", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"b\"", ",", "res", "[", "0", "]", ")", ";", "}", "public", "void", "testArrayRemove3", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "remove", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", "}", ",", "1", ")", ";", "assertEquals", "(", "1", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "}", "public", "void", "testArrayRemove4", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "remove", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", ",", "\"c\"", "}", ",", "1", ")", ";", "assertEquals", "(", "2", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "assertEquals", "(", "\"c\"", ",", "res", "[", "1", "]", ")", ";", "}", "public", "void", "testArrayRemoveElement1", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "removeElement", "(", "new", "String", "[", "]", "{", "}", ",", "\"\"", ")", ";", "assertEquals", "(", "0", ",", "res", ".", "length", ")", ";", "}", "public", "void", "testArrayRemoveElement2", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "removeElement", "(", "new", "String", "[", "]", "{", "\"a\"", "}", ",", "\"\"", ")", ";", "assertEquals", "(", "1", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "}", "public", "void", "testArrayRemoveElement3", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "removeElement", "(", "new", "String", "[", "]", "{", "\"a\"", "}", ",", "\"a\"", ")", ";", "assertEquals", "(", "0", ",", "res", ".", "length", ")", ";", "}", "public", "void", "testArrayRemoveElement4", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "removeElement", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", "}", ",", "\"a\"", ")", ";", "assertEquals", "(", "1", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"b\"", ",", "res", "[", "0", "]", ")", ";", "}", "public", "void", "testArrayRemoveElement5", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "removeElement", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", "}", ",", "\"b\"", ")", ";", "assertEquals", "(", "1", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "}", "public", "void", "testArrayRemoveElement6", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "removeElement", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", ",", "\"c\"", "}", ",", "\"b\"", ")", ";", "assertEquals", "(", "2", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "assertEquals", "(", "\"c\"", ",", "res", "[", "1", "]", ")", ";", "}", "public", "void", "testArrayRemoveElement7", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "removeElement", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", ",", "\"c\"", "}", ",", "\"c\"", ")", ";", "assertEquals", "(", "2", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "assertEquals", "(", "\"b\"", ",", "res", "[", "1", "]", ")", ";", "}", "public", "void", "testArrayRemoveElement8", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "removeElement", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", ",", "\"c\"", "}", ",", "\"a\"", ")", ";", "assertEquals", "(", "2", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"b\"", ",", "res", "[", "0", "]", ")", ";", "assertEquals", "(", "\"c\"", ",", "res", "[", "1", "]", ")", ";", "}", "public", "void", "testArrayAdd1", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "add", "(", "new", "String", "[", "0", "]", ",", "\"a\"", ")", ";", "assertEquals", "(", "1", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "}", "public", "void", "testArrayAdd2", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "add", "(", "new", "String", "[", "]", "{", "\"a\"", "}", ",", "\"b\"", ")", ";", "assertEquals", "(", "2", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "assertEquals", "(", "\"b\"", ",", "res", "[", "1", "]", ")", ";", "}", "public", "void", "testArrayAdd3", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "add", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", "}", ",", "\"c\"", ")", ";", "assertEquals", "(", "3", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "assertEquals", "(", "\"b\"", ",", "res", "[", "1", "]", ")", ";", "assertEquals", "(", "\"c\"", ",", "res", "[", "2", "]", ")", ";", "}", "public", "void", "testArrayAdd4", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "add", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", "}", ",", "0", ",", "\"c\"", ")", ";", "assertEquals", "(", "3", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"c\"", ",", "res", "[", "0", "]", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "1", "]", ")", ";", "assertEquals", "(", "\"b\"", ",", "res", "[", "2", "]", ")", ";", "}", "public", "void", "testArrayAdd5", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "add", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", "}", ",", "1", ",", "\"c\"", ")", ";", "assertEquals", "(", "3", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "assertEquals", "(", "\"c\"", ",", "res", "[", "1", "]", ")", ";", "assertEquals", "(", "\"b\"", ",", "res", "[", "2", "]", ")", ";", "}", "public", "void", "testArrayAdd6", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "add", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", "}", ",", "2", ",", "\"c\"", ")", ";", "assertEquals", "(", "3", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "assertEquals", "(", "\"b\"", ",", "res", "[", "1", "]", ")", ";", "assertEquals", "(", "\"c\"", ",", "res", "[", "2", "]", ")", ";", "}", "public", "void", "testArrayAdd7", "(", ")", "throws", "Exception", "{", "String", "[", "]", "res", "=", "(", "String", "[", "]", ")", "ArrayUtils", ".", "add", "(", "new", "String", "[", "]", "{", "\"a\"", ",", "\"b\"", ",", "\"d\"", "}", ",", "2", ",", "\"c\"", ")", ";", "assertEquals", "(", "4", ",", "res", ".", "length", ")", ";", "assertEquals", "(", "\"a\"", ",", "res", "[", "0", "]", ")", ";", "assertEquals", "(", "\"b\"", ",", "res", "[", "1", "]", ")", ";", "assertEquals", "(", "\"c\"", ",", "res", "[", "2", "]", ")", ";", "assertEquals", "(", "\"d\"", ",", "res", "[", "3", "]", ")", ";", "}", "}", "</s>" ]
5,924
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "impl", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "public", "class", "AllTests", "{", "public", "static", "Test", "suite", "(", ")", "{", "final", "TestSuite", "suite", "=", "new", "TestSuite", "(", "\"Test", "for", "\"", "+", "AllTests", ".", "class", ".", "getPackage", "(", ")", ".", "getName", "(", ")", ")", ";", "suite", ".", "addTestSuite", "(", "StringSourceBufferTests", ".", "class", ")", ";", "return", "suite", ";", "}", "}", "</s>" ]
5,925
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "impl", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "public", "class", "StringSourceBufferTests", "extends", "TestCase", "{", "static", "String", "testString", "=", "\"\"", ";", "static", "StringSourceBuffer", "buffer", ";", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"Starting:", "\"", "+", "getName", "(", ")", ")", ";", "super", ".", "setUp", "(", ")", ";", "buffer", "=", "new", "StringSourceBuffer", "(", "testString", ")", ";", "}", "public", "void", "testLength", "(", ")", "{", "assertEquals", "(", "testString", ".", "length", "(", ")", ",", "buffer", ".", "length", "(", ")", ")", ";", "}", "public", "void", "testGetChar", "(", ")", "{", "assertEquals", "(", "'H'", ",", "buffer", ".", "charAt", "(", "0", ")", ")", ";", "assertEquals", "(", "'!'", ",", "buffer", ".", "charAt", "(", "testString", ".", "length", "(", ")", "-", "1", ")", ")", ";", "}", "public", "void", "testGetText", "(", ")", "{", "assertEquals", "(", "\"Hello\"", ",", "buffer", ".", "subSequence", "(", "0", ",", "\"Hello\"", ".", "length", "(", ")", ")", ")", ";", "int", "start", "=", "\"\"", ".", "length", "(", ")", ";", "int", "end", "=", "start", "+", "\"World!\"", ".", "length", "(", ")", ";", "assertEquals", "(", "\"World!\"", ",", "buffer", ".", "subSequence", "(", "start", ",", "end", ")", ")", ";", "}", "public", "void", "testToAndFrom", "(", ")", "{", "int", "[", "]", "lineCol", "=", "buffer", ".", "toLineColumn", "(", "0", ")", ";", "assertEquals", "(", "0", ",", "buffer", ".", "toOffset", "(", "lineCol", "[", "0", "]", ",", "lineCol", "[", "1", "]", ")", ")", ";", "}", "public", "void", "testToLineColumn", "(", ")", "{", "int", "[", "]", "lineCol", "=", "buffer", ".", "toLineColumn", "(", "0", ")", ";", "assertEquals", "(", "1", ",", "lineCol", "[", "0", "]", ")", ";", "assertEquals", "(", "1", ",", "lineCol", "[", "1", "]", ")", ";", "lineCol", "=", "buffer", ".", "toLineColumn", "(", "\"Hellon\"", ".", "length", "(", ")", ")", ";", "assertEquals", "(", "2", ",", "lineCol", "[", "0", "]", ")", ";", "assertEquals", "(", "1", ",", "lineCol", "[", "1", "]", ")", ";", "lineCol", "=", "buffer", ".", "toLineColumn", "(", "testString", ".", "length", "(", ")", "-", "1", ")", ";", "assertEquals", "(", "3", ",", "lineCol", "[", "0", "]", ")", ";", "assertEquals", "(", "\"World!\"", ".", "length", "(", ")", ",", "lineCol", "[", "1", "]", ")", ";", "}", "public", "void", "testToOffset", "(", ")", "{", "assertEquals", "(", "0", ",", "buffer", ".", "toOffset", "(", "1", ",", "1", ")", ")", ";", "assertEquals", "(", "\"Hellon\"", ".", "length", "(", ")", ",", "buffer", ".", "toOffset", "(", "2", ",", "1", ")", ")", ";", "assertEquals", "(", "\"\"", ".", "length", "(", ")", ",", "buffer", ".", "toOffset", "(", "3", ",", "1", ")", ")", ";", "assertEquals", "(", "testString", ".", "length", "(", ")", "-", "1", ",", "buffer", ".", "toOffset", "(", "3", ",", "\"World!\"", ".", "length", "(", ")", ")", ")", ";", "}", "public", "void", "testWhite", "(", ")", "{", "new", "StringSourceBuffer", "(", "\"hellorn\"", ")", ";", "new", "StringSourceBuffer", "(", "\"hellor\"", ")", ";", "}", "}", "</s>" ]
5,926
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "search", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ModuleNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "model", ".", "GroovyRuntime", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "EclipseTestCase", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchMatch", ";", "public", "class", "SyntheticMemberSearchTests", "extends", "EclipseTestCase", "{", "private", "IType", "gType", ";", "class", "TestSearchRequestor", "implements", "ISearchRequestor", "{", "List", "<", "SearchMatch", ">", "matches", "=", "new", "ArrayList", "<", "SearchMatch", ">", "(", ")", ";", "public", "void", "acceptMatch", "(", "SearchMatch", "match", ")", "{", "matches", ".", "add", "(", "match", ")", ";", "}", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "GroovyRuntime", ".", "addGroovyNature", "(", "testProject", ".", "getProject", "(", ")", ")", ";", "GroovyRuntime", ".", "addGroovyClasspathContainer", "(", "testProject", ".", "getJavaProject", "(", ")", ")", ";", "gType", "=", "testProject", ".", "createUnit", "(", "\"p\"", ",", "\"G.groovy\"", ",", "\"package", "pn\"", "+", "\"class", "G", "{n\"", "+", "\"", "def", "propn\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ".", "getType", "(", "\"G\"", ")", ";", "}", "public", "void", "testSearchInGroovy1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "testProject", ".", "createUnit", "(", "\"\"", ",", "\"\"", ",", "contents", ")", ";", "List", "<", "SearchMatch", ">", "matches", "=", "performSearch", "(", "\"prop\"", ")", ";", "assertNumMatch", "(", "3", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"getProp\"", ",", "contents", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"setProp\"", ",", "contents", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"isProp\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"prop\"", ",", "contents", ",", "matches", ")", ";", "}", "public", "void", "testSearchInGroovy2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "testProject", ".", "createUnit", "(", "\"\"", ",", "\"\"", ",", "contents", ")", ";", "List", "<", "SearchMatch", ">", "matches", "=", "performSearch", "(", "\"\"", ")", ";", "assertNumMatch", "(", "1", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "}", "public", "void", "testSearchInGroovy3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "testProject", ".", "createUnit", "(", "\"\"", ",", "\"\"", ",", "contents", ")", ";", "List", "<", "SearchMatch", ">", "matches", "=", "performSearch", "(", "\"\"", ")", ";", "assertNumMatch", "(", "1", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "}", "public", "void", "testSearchInGroovy4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "testProject", ".", "createUnit", "(", "\"\"", ",", "\"\"", ",", "contents", ")", ";", "List", "<", "SearchMatch", ">", "matches", "=", "performSearch", "(", "\"\"", ")", ";", "assertNumMatch", "(", "1", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "}", "public", "void", "testSearchInJava1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}", "}n\"", ";", "testProject", ".", "createUnit", "(", "\"\"", ",", "\"AClass.java\"", ",", "contents", ")", ";", "List", "<", "SearchMatch", ">", "matches", "=", "performSearch", "(", "\"prop\"", ")", ";", "assertNumMatch", "(", "3", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"getProp()\"", ",", "contents", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"isProp()\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"prop\"", ",", "contents", ",", "matches", ")", ";", "}", "public", "void", "testSearchInJava2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}", "}n\"", ";", "testProject", ".", "createUnit", "(", "\"\"", ",", "\"AClass.java\"", ",", "contents", ")", ";", "List", "<", "SearchMatch", ">", "matches", "=", "performSearch", "(", "\"\"", ")", ";", "assertNumMatch", "(", "1", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "}", "public", "void", "testSearchInJava3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}", "}n\"", ";", "testProject", ".", "createUnit", "(", "\"\"", ",", "\"AClass.java\"", ",", "contents", ")", ";", "List", "<", "SearchMatch", ">", "matches", "=", "performSearch", "(", "\"\"", ")", ";", "assertNumMatch", "(", "1", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "}", "public", "void", "testSearchInJava4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}", "}n\"", ";", "testProject", ".", "createUnit", "(", "\"\"", ",", "\"AClass.java\"", ",", "contents", ")", ";", "List", "<", "SearchMatch", ">", "matches", "=", "performSearch", "(", "\"\"", ")", ";", "assertNumMatch", "(", "1", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertNoMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "assertMatch", "(", "\"run\"", ",", "\"\"", ",", "contents", ",", "matches", ")", ";", "}", "public", "void", "testSearchInJava5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"", "int", "hhh;n\"", "+", "\"\"", "+", "\"\"", "+", "\"", "}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "}n\"", "+", "\"}\"", ";", "IType", "type", "=", "testProject", ".", "createUnit", "(", "\"\"", ",", "\"AClass.java\"", ",", "contents", ")", ".", "getType", "(", "\"AClass\"", ")", ";", "IField", "toSearch", "=", "type", ".", "getField", "(", "\"hhh\"", ")", ";", "SyntheticAccessorSearchRequestor", "synthRequestor", "=", "new", "SyntheticAccessorSearchRequestor", "(", ")", ";", "TestSearchRequestor", "requestor", "=", "new", "TestSearchRequestor", "(", ")", ";", "synthRequestor", ".", "findSyntheticMatches", "(", "toSearch", ",", "requestor", ",", "null", ")", ";", "List", "<", "SearchMatch", ">", "matches", "=", "requestor", ".", "matches", ";", "assertNumMatch", "(", "0", ",", "matches", ")", ";", "}", "private", "IJavaElement", "findSearchTarget", "(", "String", "name", ")", "throws", "JavaModelException", "{", "for", "(", "IJavaElement", "child", ":", "gType", ".", "getChildren", "(", ")", ")", "{", "if", "(", "child", ".", "getElementName", "(", ")", ".", "equals", "(", "name", ")", ")", "{", "return", "child", ";", "}", "}", "fail", "(", "\"\"", "+", "name", ")", ";", "return", "null", ";", "}", "private", "List", "<", "SearchMatch", ">", "performSearch", "(", "String", "searchName", ")", "throws", "CoreException", "{", "IJavaElement", "toSearch", "=", "findSearchTarget", "(", "searchName", ")", ";", "SyntheticAccessorSearchRequestor", "synthRequestor", "=", "new", "SyntheticAccessorSearchRequestor", "(", ")", ";", "TestSearchRequestor", "requestor", "=", "new", "TestSearchRequestor", "(", ")", ";", "synthRequestor", ".", "findSyntheticMatches", "(", "toSearch", ",", "requestor", ",", "null", ")", ";", "return", "requestor", ".", "matches", ";", "}", "private", "String", "printMatches", "(", "List", "<", "SearchMatch", ">", "matches", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "Iterator", "<", "SearchMatch", ">", "matchIter", "=", "matches", ".", "iterator", "(", ")", ";", "matchIter", ".", "hasNext", "(", ")", ";", ")", "{", "SearchMatch", "match", "=", "(", "SearchMatch", ")", "matchIter", ".", "next", "(", ")", ";", "sb", ".", "append", "(", "\"nn\"", "+", "match", ")", ";", "}", "return", "sb", ".", "toString", "(", ")", ";", "}", "private", "void", "assertMatch", "(", "String", "enclosingName", ",", "String", "matchName", ",", "String", "contents", ",", "List", "<", "SearchMatch", ">", "matches", ")", "{", "int", "matchStart", "=", "0", ";", "int", "matchIndex", "=", "0", ";", "boolean", "matchFound", "=", "false", ";", "for", "(", "SearchMatch", "match", ":", "matches", ")", "{", "if", "(", "(", "(", "IJavaElement", ")", "match", ".", "getElement", "(", ")", ")", ".", "getElementName", "(", ")", ".", "equals", "(", "enclosingName", ")", "&&", "contents", ".", "indexOf", "(", "matchName", ",", "matchStart", ")", "==", "match", ".", "getOffset", "(", ")", "&&", "matchName", ".", "length", "(", ")", "==", "match", ".", "getLength", "(", ")", ")", "{", "matchFound", "=", "true", ";", "break", ";", "}", "matchIndex", "++", ";", "}", "if", "(", "!", "matchFound", ")", "{", "fail", "(", "\"Match", "name", "\"", "+", "matchName", "+", "\"\"", "+", "printMatches", "(", "matches", ")", ")", ";", "}", "SearchMatch", "match", "=", "matches", ".", "remove", "(", "matchIndex", ")", ";", "assertTrue", "(", "\"\"", ",", "(", "(", "IJavaElement", ")", "match", ".", "getElement", "(", ")", ")", ".", "exists", "(", ")", ")", ";", "}", "private", "void", "assertNumMatch", "(", "int", "expected", ",", "List", "<", "SearchMatch", ">", "matches", ")", "{", "assertEquals", "(", "\"\"", "+", "printMatches", "(", "matches", ")", ",", "expected", ",", "matches", ".", "size", "(", ")", ")", ";", "}", "private", "void", "assertNoMatch", "(", "String", "enclosingName", ",", "String", "matchName", ",", "String", "contents", ",", "List", "<", "SearchMatch", ">", "matches", ")", "{", "boolean", "matchFound", "=", "false", ";", "for", "(", "SearchMatch", "match", ":", "matches", ")", "{", "if", "(", "(", "(", "IJavaElement", ")", "match", ".", "getElement", "(", ")", ")", ".", "getElementName", "(", ")", ".", "equals", "(", "enclosingName", ")", "&&", "contents", ".", "indexOf", "(", "matchName", ")", "==", "match", ".", "getOffset", "(", ")", "&&", "matchName", ".", "length", "(", ")", "==", "match", ".", "getLength", "(", ")", ")", "{", "matchFound", "=", "true", ";", "break", ";", "}", "}", "if", "(", "matchFound", ")", "{", "fail", "(", "\"Match", "name", "\"", "+", "matchName", "+", "\"\"", "+", "printMatches", "(", "matches", ")", ")", ";", "}", "}", "}", "</s>" ]
5,927
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ";", "import", "org", ".", "eclipse", ".", "ui", ".", "plugin", ".", "AbstractUIPlugin", ";", "import", "org", ".", "osgi", ".", "framework", ".", "Bundle", ";", "import", "org", ".", "osgi", ".", "framework", ".", "BundleContext", ";", "public", "class", "CoreTestsActivator", "extends", "AbstractUIPlugin", "{", "public", "static", "final", "String", "PLUGIN_ID", "=", "\"\"", ";", "private", "static", "CoreTestsActivator", "plugin", ";", "public", "CoreTestsActivator", "(", ")", "{", "plugin", "=", "this", ";", "}", "@", "Override", "public", "void", "start", "(", "BundleContext", "context", ")", "throws", "Exception", "{", "super", ".", "start", "(", "context", ")", ";", "}", "@", "Override", "public", "void", "stop", "(", "BundleContext", "context", ")", "throws", "Exception", "{", "plugin", "=", "null", ";", "super", ".", "stop", "(", "context", ")", ";", "}", "public", "static", "CoreTestsActivator", "getDefault", "(", ")", "{", "return", "plugin", ";", "}", "public", "static", "Bundle", "bundle", "(", ")", "{", "return", "getDefault", "(", ")", ".", "getBundle", "(", ")", ";", "}", "}", "</s>" ]
5,928
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "EclipseTestCase", ";", "public", "class", "CompilerSwitchTests", "extends", "EclipseTestCase", "{", "public", "void", "testname", "(", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "}", "</s>" ]
5,929
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "search", ".", "SyntheticMemberSearchTests", ";", "public", "class", "AllCoreTests", "{", "public", "static", "Test", "suite", "(", ")", "{", "final", "TestSuite", "suite", "=", "new", "TestSuite", "(", "AllCoreTests", ".", "class", ".", "getPackage", "(", ")", ".", "getName", "(", ")", ")", ";", "suite", ".", "addTestSuite", "(", "ClasspathContainerTest", ".", "class", ")", ";", "suite", ".", "addTest", "(", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "compiler", ".", "AllTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "impl", ".", "AllTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "util", ".", "AllTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTestSuite", "(", "SyntheticMemberSearchTests", ".", "class", ")", ";", "return", "suite", ";", "}", "}", "</s>" ]
5,930
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "builder", ".", "GroovyClasspathContainer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "preferences", ".", "PreferenceConstants", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "EclipseTestCase", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathContainer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ";", "public", "class", "ClasspathContainerTest", "extends", "EclipseTestCase", "{", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "GroovyCoreActivator", ".", "getDefault", "(", ")", ".", "setPreference", "(", "PreferenceConstants", ".", "GROOVY_CLASSPATH_USE_GROOVY_LIB_GLOBAL", ",", "false", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "GroovyCoreActivator", ".", "getDefault", "(", ")", ".", "setPreference", "(", "PreferenceConstants", ".", "GROOVY_CLASSPATH_USE_GROOVY_LIB_GLOBAL", ",", "true", ")", ";", "}", "public", "void", "testClassPathContainerContents", "(", ")", "throws", "JavaModelException", "{", "JavaModelManager", "javaModelManager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "IPath", "containerPath", "=", "new", "Path", "(", "\"\"", ")", ";", "IClasspathContainer", "container", "=", "javaModelManager", ".", "getClasspathContainer", "(", "containerPath", ",", "testProject", ".", "getJavaProject", "(", ")", ")", ";", "IClasspathEntry", "[", "]", "entries", "=", "container", ".", "getClasspathEntries", "(", ")", ";", "List", "<", "IClasspathEntry", ">", "groovyAllEntries", "=", "getGroovyAllEntries", "(", "entries", ")", ";", "List", "<", "IClasspathEntry", ">", "nonPluginEntries", "=", "getNonPluginEntries", "(", "entries", ")", ";", "assertEquals", "(", "\"\"", ",", "GroovyClasspathContainer", ".", "class", ",", "container", ".", "getClass", "(", ")", ")", ";", "assertEquals", "(", "\"\"", "+", "groovyAllEntries", ",", "1", ",", "groovyAllEntries", ".", "size", "(", ")", ")", ";", "assertEquals", "(", "\"\"", "+", "nonPluginEntries", ",", "0", ",", "nonPluginEntries", ".", "size", "(", ")", ")", ";", "}", "private", "List", "<", "IClasspathEntry", ">", "getGroovyAllEntries", "(", "IClasspathEntry", "[", "]", "entries", ")", "{", "List", "<", "IClasspathEntry", ">", "groovyAllEntries", "=", "new", "ArrayList", "<", "IClasspathEntry", ">", "(", ")", ";", "for", "(", "IClasspathEntry", "entry", ":", "entries", ")", "{", "if", "(", "entry", ".", "getPath", "(", ")", ".", "toPortableString", "(", ")", ".", "contains", "(", "\"groovy-all\"", ")", ")", "{", "groovyAllEntries", ".", "add", "(", "entry", ")", ";", "}", "}", "return", "groovyAllEntries", ";", "}", "private", "List", "<", "IClasspathEntry", ">", "getNonPluginEntries", "(", "IClasspathEntry", "[", "]", "entries", ")", "{", "List", "<", "IClasspathEntry", ">", "nonPluginEntries", "=", "new", "ArrayList", "<", "IClasspathEntry", ">", "(", ")", ";", "for", "(", "IClasspathEntry", "entry", ":", "entries", ")", "{", "if", "(", "!", "entry", ".", "getPath", "(", ")", ".", "toPortableString", "(", ")", ".", "contains", "(", "\"\"", ")", ")", "{", "nonPluginEntries", ".", "add", "(", "entry", ")", ";", "}", "}", "return", "nonPluginEntries", ";", "}", "}", "</s>" ]
5,931
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "compiler", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ModuleNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "model", ".", "GroovyRuntime", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "EclipseTestCase", ";", "public", "class", "UnrecoverableErrorTests", "extends", "EclipseTestCase", "{", "private", "GroovySnippetCompiler", "compiler", ";", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "GroovyRuntime", ".", "addGroovyRuntime", "(", "testProject", ".", "getProject", "(", ")", ")", ";", "compiler", "=", "new", "GroovySnippetCompiler", "(", "testProject", ".", "getGroovyProjectFacade", "(", ")", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "compiler", ".", "cleanup", "(", ")", ";", "}", "public", "ModuleNode", "compileScript", "(", "String", "script", ")", "{", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "ModuleNode", "result", "=", "compiler", ".", "compile", "(", "script", ",", "\"Test\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "start", ")", "+", "\"", "ms\"", ")", ";", "return", "result", ";", "}", "public", "void", "testGRE926", "(", ")", "throws", "Exception", "{", "ModuleNode", "result", "=", "compileScript", "(", "\"package", "an\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "}n\"", "+", "\"", "}", "\"", ")", ";", "assertTrue", "(", "result", ".", "encounteredUnrecoverableError", "(", ")", ")", ";", "}", "}", "</s>" ]
5,932
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "compiler", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "public", "class", "AllTests", "{", "public", "static", "Test", "suite", "(", ")", "{", "final", "TestSuite", "suite", "=", "new", "TestSuite", "(", "\"Test", "for", "\"", "+", "AllTests", ".", "class", ".", "getPackage", "(", ")", ".", "getName", "(", ")", ")", ";", "suite", ".", "addTestSuite", "(", "ErrorRecoveryTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "AstPositionTests", ".", "class", ")", ";", "return", "suite", ";", "}", "}", "</s>" ]
5,933
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "compiler", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "model", ".", "GroovyRuntime", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "EclipseTestCase", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "CompilationResult", ";", "public", "class", "ErrorRecoveryTests", "extends", "EclipseTestCase", "{", "private", "GroovySnippetCompiler", "compiler", ";", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "GroovyRuntime", ".", "addGroovyRuntime", "(", "testProject", ".", "getProject", "(", ")", ")", ";", "compiler", "=", "new", "GroovySnippetCompiler", "(", "testProject", ".", "getGroovyProjectFacade", "(", ")", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "compiler", ".", "cleanup", "(", ")", ";", "}", "public", "CompilationResult", "compileScript", "(", "String", "script", ")", "{", "long", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "CompilationResult", "result", "=", "compiler", ".", "compileForErrors", "(", "script", ",", "\"Test\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "start", ")", "+", "\"", "ms\"", ")", ";", "return", "result", ";", "}", "public", "void", "testDotNothing1", "(", ")", "{", "CompilationResult", "result", "=", "compileScript", "(", "\"s.\"", ")", ";", "assertEquals", "(", "1", ",", "result", ".", "getAllProblems", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testDotNothing2", "(", ")", "{", "CompilationResult", "result", "=", "compileScript", "(", "\"s.a.\"", ")", ";", "assertEquals", "(", "1", ",", "result", ".", "getAllProblems", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testDotNothing3", "(", ")", "{", "CompilationResult", "result", "=", "compileScript", "(", "\"s[10].\"", ")", ";", "assertEquals", "(", "1", ",", "result", ".", "getAllProblems", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testDotNothing4", "(", ")", "{", "CompilationResult", "result", "=", "compileScript", "(", "\"s().\"", ")", ";", "assertEquals", "(", "1", ",", "result", ".", "getAllProblems", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testDotNothing5", "(", ")", "{", "CompilationResult", "result", "=", "compileScript", "(", "\"s", "{", "it", "}.\"", ")", ";", "assertEquals", "(", "1", ",", "result", ".", "getAllProblems", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testDotNothing6", "(", ")", "{", "CompilationResult", "result", "=", "compileScript", "(", "\"\"", ")", ";", "assertEquals", "(", "1", ",", "result", ".", "getAllProblems", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testSpreadDotNothing", "(", ")", "{", "CompilationResult", "result", "=", "compileScript", "(", "\"s*.\"", ")", ";", "assertEquals", "(", "1", ",", "result", ".", "getAllProblems", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testOptionalDotNothing", "(", ")", "{", "CompilationResult", "result", "=", "compileScript", "(", "\"s?.\"", ")", ";", "assertEquals", "(", "1", ",", "result", ".", "getAllProblems", "(", ")", ".", "length", ")", ";", "}", "public", "void", "testDotLBrace", "(", ")", "{", "CompilationResult", "result", "=", "compileScript", "(", "\"\"", ")", ";", "assertEquals", "(", "1", ",", "result", ".", "getAllProblems", "(", ")", ".", "length", ")", ";", "}", "}", "</s>" ]
5,934
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "compiler", ";", "import", "java", ".", "util", ".", "List", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ModuleNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "BlockStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadLocationException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Document", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IDocument", ";", "public", "class", "AstPositionTests", "extends", "TestCase", "{", "public", "void", "testASTPositionForBlock", "(", ")", "throws", "Exception", "{", "String", "text", "=", "\"def", "foo()", "{n\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "GroovySnippetParser", "sp", "=", "new", "GroovySnippetParser", "(", ")", ";", "IDocument", "doc", "=", "new", "Document", "(", "text", ")", ";", "ModuleNode", "module", "=", "sp", ".", "parse", "(", "doc", ".", "get", "(", ")", ")", ";", "assertEquals", "(", "text", ",", "getTextOfNode", "(", "module", ",", "doc", ")", ")", ";", "ClassNode", "classNode", "=", "(", "ClassNode", ")", "module", ".", "getClasses", "(", ")", ".", "get", "(", "0", ")", ";", "MethodNode", "fooMethod", "=", "(", "MethodNode", ")", "classNode", ".", "getMethods", "(", "\"foo\"", ")", ".", "get", "(", "0", ")", ";", "assertEquals", "(", "text", ",", "getTextOfNode", "(", "fooMethod", ",", "doc", ")", ")", ";", "BlockStatement", "bodyNode", "=", "(", "BlockStatement", ")", "fooMethod", ".", "getCode", "(", ")", ";", "String", "body", "=", "getTextOfNode", "(", "bodyNode", ",", "doc", ")", ";", "assertEquals", "(", "\"{n\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ",", "body", ".", "trim", "(", ")", ")", ";", "List", "<", "Statement", ">", "statements", "=", "bodyNode", ".", "getStatements", "(", ")", ";", "assertEquals", "(", "2", ",", "statements", ".", "size", "(", ")", ")", ";", "int", "startLine", "=", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "statements", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Statement", "stmNode", "=", "statements", ".", "get", "(", "i", ")", ";", "String", "stm", "=", "getTextOfNode", "(", "stmNode", ",", "doc", ")", ";", "int", "line", "=", "startLine", "+", "i", ";", "String", "lineStr", "=", "doc", ".", "get", "(", "doc", ".", "getLineOffset", "(", "line", ")", ",", "doc", ".", "getLineLength", "(", "line", ")", ")", ";", "assertEquals", "(", "lineStr", ".", "trim", "(", ")", ",", "stm", ".", "trim", "(", ")", ")", ";", "}", "}", "private", "String", "getTextOfNode", "(", "ASTNode", "node", ",", "IDocument", "doc", ")", "throws", "BadLocationException", "{", "return", "doc", ".", "get", "(", "node", ".", "getStart", "(", ")", ",", "node", ".", "getLength", "(", ")", ")", ";", "}", "}", "</s>" ]
5,935
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completion", ".", "mock", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "processors", ".", "IProposalFilter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "proposals", ".", "IGroovyProposal", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "ContentAssistContext", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "ui", ".", "text", ".", "java", ".", "JavaContentAssistInvocationContext", ";", "public", "class", "MockProposalFilter1", "implements", "IProposalFilter", "{", "private", "static", "boolean", "filterCalled", "=", "false", ";", "public", "List", "<", "IGroovyProposal", ">", "filterProposals", "(", "List", "<", "IGroovyProposal", ">", "proposals", ",", "ContentAssistContext", "context", ",", "JavaContentAssistInvocationContext", "javaContext", ")", "{", "filterCalled", "=", "true", ";", "return", "proposals", ";", "}", "public", "static", "boolean", "wasFilterCalled", "(", ")", "{", "return", "filterCalled", ";", "}", "public", "static", "void", "reset", "(", ")", "{", "filterCalled", "=", "false", ";", "}", "}", "</s>" ]
5,936
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completion", ".", "mock", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "processors", ".", "IProposalFilter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "proposals", ".", "IGroovyProposal", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "ContentAssistContext", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "ui", ".", "text", ".", "java", ".", "JavaContentAssistInvocationContext", ";", "public", "class", "MockProposalFilter2", "implements", "IProposalFilter", "{", "private", "static", "boolean", "filterCalled", "=", "false", ";", "public", "List", "<", "IGroovyProposal", ">", "filterProposals", "(", "List", "<", "IGroovyProposal", ">", "proposals", ",", "ContentAssistContext", "context", ",", "JavaContentAssistInvocationContext", "javaContext", ")", "{", "filterCalled", "=", "true", ";", "return", "proposals", ";", "}", "public", "static", "boolean", "wasFilterCalled", "(", ")", "{", "return", "filterCalled", ";", "}", "public", "static", "void", "reset", "(", ")", "{", "filterCalled", "=", "false", ";", "}", "}", "</s>" ]
5,937
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completion", ".", "mock", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "processors", ".", "IProposalProvider", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "proposals", ".", "IGroovyProposal", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "ContentAssistContext", ";", "public", "class", "MockProposalProvider2", "implements", "IProposalProvider", "{", "private", "static", "boolean", "providerCalled", "=", "false", ";", "public", "static", "boolean", "wasProviderCalled", "(", ")", "{", "return", "providerCalled", ";", "}", "public", "static", "void", "reset", "(", ")", "{", "providerCalled", "=", "false", ";", "}", "public", "List", "<", "IGroovyProposal", ">", "getStatementAndExpressionProposals", "(", "ContentAssistContext", "context", ",", "ClassNode", "completionType", ",", "boolean", "isStatic", ",", "Set", "<", "ClassNode", ">", "categories", ")", "{", "providerCalled", "=", "true", ";", "return", "null", ";", "}", "public", "List", "<", "MethodNode", ">", "getNewMethodProposals", "(", "ContentAssistContext", "context", ")", "{", "providerCalled", "=", "true", ";", "return", "null", ";", "}", "public", "List", "<", "String", ">", "getNewFieldProposals", "(", "ContentAssistContext", "context", ")", "{", "providerCalled", "=", "true", ";", "return", "null", ";", "}", "}", "</s>" ]
5,938
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completion", ".", "mock", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "processors", ".", "IProposalProvider", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "proposals", ".", "IGroovyProposal", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "ContentAssistContext", ";", "public", "class", "MockProposalProvider1", "implements", "IProposalProvider", "{", "private", "static", "boolean", "providerCalled", "=", "false", ";", "public", "static", "boolean", "wasProviderCalled", "(", ")", "{", "return", "providerCalled", ";", "}", "public", "static", "void", "reset", "(", ")", "{", "providerCalled", "=", "false", ";", "}", "public", "List", "<", "IGroovyProposal", ">", "getStatementAndExpressionProposals", "(", "ContentAssistContext", "context", ",", "ClassNode", "completionType", ",", "boolean", "isStatic", ",", "Set", "<", "ClassNode", ">", "categories", ")", "{", "providerCalled", "=", "true", ";", "return", "null", ";", "}", "public", "List", "<", "MethodNode", ">", "getNewMethodProposals", "(", "ContentAssistContext", "context", ")", "{", "providerCalled", "=", "true", ";", "return", "null", ";", "}", "public", "List", "<", "String", ">", "getNewFieldProposals", "(", "ContentAssistContext", "context", ")", "{", "providerCalled", "=", "true", ";", "return", "null", ";", "}", "}", "</s>" ]
5,939
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "TypeCompletionTests", "extends", "CompletionTestCase", "{", "private", "static", "final", "String", "A_TEST", "=", "\"ATest\"", ";", "private", "static", "final", "String", "RUN_WITH", "=", "\"RunWith\"", ";", "private", "static", "final", "String", "HTML", "=", "\"HTML\"", ";", "private", "static", "final", "String", "HTML_PROPOSAL", "=", "\"\"", ";", "private", "static", "final", "String", "HTML_ANCHOR", "=", "\"\"", ";", "private", "static", "final", "String", "HTML_ANCHOR_PROPOSAL", "=", "\"\"", ";", "public", "TypeCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testCompletionTypesInScript", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "HTML", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInScript2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"new", "HTML()\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInMethod", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInMethod2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInParameter", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInParameter2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInParameter3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInParameter4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInClassBody", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInExtends", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInImplements", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML_ANCHOR", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_ANCHOR_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionTypesInAnnotation1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "RUN_WITH", ")", ")", ";", "proposalExists", "(", "proposals", ",", "RUN_WITH", ",", "1", ",", "true", ")", ";", "}", "public", "void", "testCompletionTypesInAnnotation2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "A_TEST", ")", ")", ";", "proposalExists", "(", "proposals", ",", "A_TEST", ",", "1", ",", "true", ")", ";", "}", "public", "void", "testCompletionTypesInAnnotation3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", ";", "String", "javaContents", "=", "\"enum", "Foo", "{n\"", "+", "\"FOO1,", "FOO2n\"", "+", "\"}", "n\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "javaContents", ",", "getIndexOf", "(", "contents", ",", "\"FOO\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"FOO1\"", ",", "1", ")", ";", "}", "public", "void", "testCompleteFullyQualifiedTypeInScript", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"HTMLDocume\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"HTMLDocument\"", ",", "1", ",", "true", ")", ";", "}", "public", "void", "testCompleteFullyQualifiedTypeInClass", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"HTMLDocume\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"HTMLDocument\"", ",", "1", ",", "true", ")", ";", "}", "public", "void", "testCompleteFullyQualifiedTypeInMethod", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"HTMLDocume\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"HTMLDocument\"", ",", "1", ",", "true", ")", ";", "}", "public", "void", "testCompleteFullyQualifiedTypeInMethodParams", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"HTMLDocume\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"HTMLDocument\"", ",", "1", ",", "true", ")", ";", "}", "public", "void", "testCompleteFullyQualifiedTypeInImports", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"HTMLDocume\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"HTMLDocument\"", ",", "1", ",", "true", ")", ";", "}", "public", "void", "testCompletePackageInClass", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\".p\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ",", "true", ")", ";", "proposalExists", "(", "proposals", ",", "\"Icons\"", ",", "0", ",", "true", ")", ";", "}", "public", "void", "testCompletePackageInMethod", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\".p\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ",", "true", ")", ";", "proposalExists", "(", "proposals", ",", "\"Icons\"", ",", "0", ",", "true", ")", ";", "}", "public", "void", "testCompletePackageInMethodParams", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\".p\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ",", "true", ")", ";", "proposalExists", "(", "proposals", ",", "\"Icons\"", ",", "0", ",", "true", ")", ";", "}", "public", "void", "testCompletePackageInImports", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\".p\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ",", "true", ")", ";", "proposalExists", "(", "proposals", ",", "\"Icons\"", ",", "0", ",", "true", ")", ";", "}", "public", "void", "testCompleteClass1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\".clas\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"class\"", ",", "1", ",", "true", ")", ";", "}", "public", "void", "testCompleteClass2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ",", "true", ")", ";", "}", "public", "void", "testCompleteClass3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ",", "true", ")", ";", "}", "public", "void", "testGRECLIPSE673", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"MPE\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "2", ",", "true", ")", ";", "}", "public", "void", "testAnnotation1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"@Single\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"Singleton\"", ",", "1", ",", "true", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "0", ",", "true", ")", ";", "}", "public", "void", "testAnnotation2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"@Single\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"Singleton\"", ",", "1", ",", "true", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "0", ",", "true", ")", ";", "}", "public", "void", "testAnnotation3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"@Single\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"Singleton\"", ",", "1", ",", "true", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "0", ",", "true", ")", ";", "}", "public", "void", "testAnnotation4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"@Single\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"Singleton\"", ",", "1", ",", "true", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "0", ",", "true", ")", ";", "}", "}", "</s>" ]
5,940
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "tests", ".", "util", ".", "GroovyUtils", ";", "public", "class", "TypeCompletionTests2", "extends", "CompletionTestCase", "{", "private", "static", "final", "String", "HTML", "=", "\"HTML\"", ";", "private", "static", "final", "String", "HTMLT", "=", "\"HTMLT\"", ";", "private", "static", "final", "String", "HTML_PROPOSAL", "=", "\"\"", ";", "private", "static", "final", "String", "HTMLTableCaptionElement_PROPOSAL", "=", "\"\"", ";", "public", "TypeCompletionTests2", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testSimpleCompletionTypesInScript1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "HTML", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testSimpleCompletionTypesInScript2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenScript1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"def", "x(HTML\"", ";", "String", "expected", "=", "\"\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "protected", "void", "tryInLoop", "(", "String", "contents", ",", "String", "expected", ",", "String", "target", ",", "String", "proposal", ")", "throws", "Exception", "{", "int", "MAX_TRIES", "=", "5", ";", "Exception", "last", "=", "null", ";", "int", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "MAX_TRIES", ";", "i", "++", ")", "{", "try", "{", "checkProposalApplicationType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "target", ")", ",", "proposal", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "last", "=", "e", ";", "}", "}", "if", "(", "last", "!=", "null", "&&", "i", ">=", "MAX_TRIES", ")", "{", "throw", "last", ";", "}", "}", "public", "void", "testBrokenScript2", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenScript3", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenScript4", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenScript5", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenScript6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"package", "fn\"", "+", "\"HTML\"", ";", "String", "expected", "=", "\"\"", "+", "\"package", "fn\"", "+", "\"n\"", "+", "\"\"", "+", "\"n\"", "+", "\"HTML\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenScript7", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "\"\"", "+", "\"package", "fn\"", "+", "\"n\"", "+", "\"\"", "+", "\"n\"", "+", "\"def", "x(HTMLn\"", "+", "\"\"", ";", "String", "expected", "=", "\"\"", "+", "\"package", "fn\"", "+", "\"n\"", "+", "\"\"", "+", "\"n\"", "+", "\"n\"", "+", "\"def", "x(HTMLn\"", "+", "\"\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenScript8", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"package", "fn\"", "+", "\"n\"", "+", "\"\"", "+", "\"n\"", "+", "\"def", "x(HTML\"", ";", "String", "expected", "=", "\"\"", "+", "\"package", "fn\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"n\"", "+", "\"def", "x(HTML\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenScript9", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"package", "fn\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"n\"", "+", "\"def", "x(HTML\"", ";", "String", "expected", "=", "\"\"", "+", "\"package", "fn\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"n\"", "+", "\"\"", "+", "\"n\"", "+", "\"def", "x(HTML\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenScript10", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"n\"", "+", "\"def", "x(HTML\"", ";", "String", "expected", "=", "\"\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"n\"", "+", "\"\"", "+", "\"n\"", "+", "\"def", "x(HTML\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenScript11", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "\"package", "fn\"", "+", "\"n\"", "+", "\"\"", "+", "\"n\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "}n\"", "+", "\"", "}\"", ";", "String", "expected", "=", "\"package", "fn\"", "+", "\"n\"", "+", "\"\"", "+", "\"n\"", "+", "\"\"", "+", "\"n\"", "+", "\"n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "}n\"", "+", "\"", "}\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTMLT", ",", "HTMLTableCaptionElement_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenClass1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "public", "void", "testBrokenClass2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "tryInLoop", "(", "contents", ",", "expected", ",", "HTML", ",", "HTML_PROPOSAL", ")", ";", "}", "}", "</s>" ]
5,941
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "GroovyPlugin", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "preferences", ".", "PreferenceConstants", ";", "import", "org", ".", "eclipse", ".", "core", ".", "internal", ".", "resources", ".", "PreferenceInitializer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "jobs", ".", "Job", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "GroovyLikeCompletionTests", "extends", "CompletionTestCase", "{", "private", "static", "final", "String", "SCRIPTCONTENTS", "=", "\"anyn\"", "+", "\"clonen\"", "+", "\"findIndexOfn\"", "+", "\"injectn\"", "+", "\"class", "Foo", "{n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"new", "Foo()\"", ";", "public", "GroovyLikeCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "new", "PreferenceInitializer", "(", ")", ".", "initializeDefaultPreferences", "(", ")", ";", "new", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "preferences", ".", "PreferenceInitializer", "(", ")", ".", "initializeDefaultPreferences", "(", ")", ";", "new", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "preferences", ".", "PreferenceInitializer", "(", ")", ".", "reset", "(", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_PARAMETER_GUESSING", ",", "false", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "new", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "preferences", ".", "PreferenceInitializer", "(", ")", ".", "reset", "(", ")", ";", "}", "public", "void", "testMethodWithClosure", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "true", ")", ";", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"any\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"any", "{", "}\"", ",", "1", ")", ";", "}", "public", "void", "testMethodWithNoArgs", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"clone\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"clone()\"", ",", "1", ")", ";", "}", "public", "void", "testMethodWith2Args", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "true", ")", ";", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"findIndexOf\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testMethodWithClosureNotGroovyLike", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "false", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "false", ")", ";", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"any\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"any(arg1)\"", ",", "1", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "true", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "true", ")", ";", "}", "public", "void", "testMethodWith2ArgsNotGroovyLike", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "false", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "false", ")", ";", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"findIndexOf\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "true", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "true", ")", ";", "}", "public", "void", "testClosureApplication1a", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "true", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "true", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method1\"", ")", ";", "}", "public", "void", "testClosureApplication1b", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "true", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "false", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method1\"", ")", ";", "}", "public", "void", "testClosureApplication1c", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "false", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "true", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method1\"", ")", ";", "}", "public", "void", "testClosureApplication1d", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "false", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "false", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method1\"", ")", ";", "}", "public", "void", "testClosureApplication2a", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "true", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "true", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method2\"", ")", ";", "}", "public", "void", "testClosureApplication2b", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "true", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "false", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method2\"", ")", ";", "}", "public", "void", "testClosureApplication2c", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "false", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "true", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method2\"", ")", ";", "}", "public", "void", "testClosureApplication2d", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "false", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "false", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method2\"", ")", ";", "}", "public", "void", "testClosureApplication3a", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "true", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "true", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method3\"", ")", ";", "}", "public", "void", "testClosureApplication3b", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "true", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "false", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method3\"", ")", ";", "}", "public", "void", "testClosureApplication3c", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "false", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "true", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method3\"", ")", ";", "}", "public", "void", "testClosureApplication3d", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_BRACKETS", ",", "false", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "false", ")", ";", "createGroovy", "(", ")", ";", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "contents", ".", "length", "(", ")", ",", "\"method3\"", ")", ";", "}", "public", "void", "_testNamedArguments1", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_NAMED_ARGUMENTS", ",", "true", ")", ";", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "doWait", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"new", "Foo\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_NAMED_ARGUMENTS", ",", "false", ")", ";", "}", "public", "void", "_testNamedArguments2", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_NAMED_ARGUMENTS", ",", "true", ")", ";", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "doWait", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"new", "Foo\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_NAMED_ARGUMENTS", ",", "false", ")", ";", "}", "private", "final", "static", "String", "CLOSURE_CONTENTS", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"", "n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "}n\"", "+", "\"", "}n\"", "+", "\"}\"", ";", "private", "final", "static", "String", "CLOSURE_CONTENTS2", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "}n\"", "+", "\"", "}n\"", "+", "\"}\"", ";", "public", "void", "testClosureCompletion1", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS", ",", "\"", "substring\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testClosureCompletion2", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS", ",", "\"", "first\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"first\"", ",", "1", ")", ";", "}", "public", "void", "testClosureCompletion3", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS", ",", "\"", "second2\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"second2()\"", ",", "1", ")", ";", "}", "public", "void", "testClosureCompletion4", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testClosureCompletion5", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"first\"", ",", "0", ")", ";", "}", "public", "void", "testClosureCompletion6", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"second2\"", ",", "0", ")", ";", "}", "public", "void", "testClosureCompletion7", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"substring\"", ",", "0", ")", ";", "}", "public", "void", "testClosureCompletion8", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS", ",", "\"this.first\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"first\"", ",", "1", ")", ";", "}", "public", "void", "testClosureCompletion9", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS", ",", "\"this.second2\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"second2()\"", ",", "1", ")", ";", "}", "public", "void", "testClosureCompletion10", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS", ",", "\"wait\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"wait()\"", ",", "1", ")", ";", "}", "public", "void", "testClosureCompletion11", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "groovyUnit", "=", "create", "(", "CLOSURE_CONTENTS2", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "CLOSURE_CONTENTS2", ",", "\"first\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"first\"", ",", "1", ")", ";", "}", "protected", "void", "doWait", "(", ")", "{", "int", "x", "=", "0", ";", "while", "(", "!", "Job", ".", "getJobManager", "(", ")", ".", "isIdle", "(", ")", "&&", "x", "<", "20", ")", "{", "synchronized", "(", "this", ")", "{", "try", "{", "wait", "(", "1000", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "}", "x", "++", ";", "}", "}", "}", "public", "void", "testNamedArguments3", "(", ")", "throws", "Exception", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_NAMED_ARGUMENTS", ",", "true", ")", ";", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "performDummySearch", "(", "unit", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"clone\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"clone()\"", ",", "1", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_NAMED_ARGUMENTS", ",", "false", ")", ";", "}", "private", "ICompilationUnit", "createGroovy", "(", ")", "throws", "Exception", "{", "return", "createGroovy", "(", "\"\"", ",", "SCRIPTCONTENTS", ")", ";", "}", "private", "ICompilationUnit", "createGroovy", "(", "String", "cuName", ",", "String", "cuContents", ")", "throws", "Exception", "{", "IPath", "projectPath", "=", "createGenericProject", "(", ")", ";", "IPath", "src", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "IPath", "pathToJavaClass", "=", "env", ".", "addGroovyClass", "(", "src", ",", "cuName", ",", "cuContents", ")", ";", "incrementalBuild", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToJavaClass", ")", ";", "return", "unit", ";", "}", "}", "</s>" ]
5,942
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completions", ".", "GroovyExtendedCompletionContext", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ";", "public", "class", "ExtendedCompletionContextTests", "extends", "CompletionTestCase", "{", "private", "static", "final", "String", "STRING_SIG", "=", "\"\"", ";", "private", "static", "final", "String", "STRING_ARR_SIG", "=", "\"\"", ";", "private", "static", "final", "String", "INTEGER_SIG", "=", "\"\"", ";", "private", "static", "final", "String", "INTEGER_ARR_SIG", "=", "\"\"", ";", "private", "static", "final", "String", "LIST_SIG", "=", "\"\"", ";", "private", "static", "final", "String", "LIST_ARR_SIG", "=", "\"\"", ";", "public", "ExtendedCompletionContextTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "ICompilationUnit", "[", "]", "workingCopies", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getWorkingCopies", "(", "null", ",", "true", ")", ";", "if", "(", "workingCopies", "!=", "null", ")", "{", "for", "(", "ICompilationUnit", "unit", ":", "workingCopies", ")", "{", "try", "{", "unit", ".", "discardWorkingCopy", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "}", "}", "public", "void", "testExtendedContextInScript1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "GroovyExtendedCompletionContext", "context", "=", "getExtendedCoreContext", "(", "create", "(", "contents", ")", ",", "contents", ".", "lastIndexOf", "(", "'z'", ")", "+", "1", ")", ";", "IJavaElement", "enclosing", "=", "context", ".", "getEnclosingElement", "(", ")", ";", "assertEquals", "(", "\"run\"", ",", "enclosing", ".", "getElementName", "(", ")", ")", ";", "assertExtendedContextElements", "(", "context", ",", "INTEGER_SIG", ",", "\"x\"", ",", "\"a\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "STRING_SIG", ",", "\"y\"", ",", "\"b\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "LIST_SIG", ",", "\"z\"", ",", "\"c\"", ")", ";", "}", "public", "void", "testExtendedContextInScript2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "GroovyExtendedCompletionContext", "context", "=", "getExtendedCoreContext", "(", "create", "(", "contents", ")", ",", "contents", ".", "lastIndexOf", "(", "'z'", ")", "+", "1", ")", ";", "IJavaElement", "enclosing", "=", "context", ".", "getEnclosingElement", "(", ")", ";", "assertEquals", "(", "\"run\"", ",", "enclosing", ".", "getElementName", "(", ")", ")", ";", "assertExtendedContextElements", "(", "context", ",", "INTEGER_ARR_SIG", ",", "\"x\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "STRING_ARR_SIG", ",", "\"y\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "LIST_ARR_SIG", ",", "\"z\"", ")", ";", "}", "public", "void", "testExtendedContextInScript3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "GroovyExtendedCompletionContext", "context", "=", "getExtendedCoreContext", "(", "create", "(", "contents", ")", ",", "contents", ".", "lastIndexOf", "(", "'z'", ")", "+", "1", ")", ";", "IJavaElement", "enclosing", "=", "context", ".", "getEnclosingElement", "(", ")", ";", "assertEquals", "(", "\"run\"", ",", "enclosing", ".", "getElementName", "(", ")", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"LSuper;\"", ",", "\"x\"", ",", "\"y\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"LSub;\"", ",", "\"y\"", ")", ";", "}", "public", "void", "testExtendedContextInScript4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "GroovyExtendedCompletionContext", "context", "=", "getExtendedCoreContext", "(", "create", "(", "contents", ")", ",", "contents", ".", "lastIndexOf", "(", "'z'", ")", "+", "1", ")", ";", "IJavaElement", "enclosing", "=", "context", ".", "getEnclosingElement", "(", ")", ";", "assertEquals", "(", "\"run\"", ",", "enclosing", ".", "getElementName", "(", ")", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"[LSuper;\"", ",", "\"x\"", ",", "\"y\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"[LSub;\"", ",", "\"y\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"LSuper;\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"LSub;\"", ")", ";", "}", "public", "void", "testExtendedContextInClass1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "GroovyExtendedCompletionContext", "context", "=", "getExtendedCoreContext", "(", "create", "(", "contents", ")", ",", "contents", ".", "lastIndexOf", "(", "'z'", ")", "+", "1", ")", ";", "IJavaElement", "enclosing", "=", "context", ".", "getEnclosingElement", "(", ")", ";", "assertEquals", "(", "\"foo\"", ",", "enclosing", ".", "getElementName", "(", ")", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"[LSuper;\"", ",", "\"x\"", ",", "\"y\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"[LSub;\"", ",", "\"y\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"LSuper;\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"LSub;\"", ")", ";", "}", "public", "void", "testExtendedContextInClass2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "GroovyExtendedCompletionContext", "context", "=", "getExtendedCoreContext", "(", "create", "(", "contents", ")", ",", "contents", ".", "lastIndexOf", "(", "'z'", ")", "+", "1", ")", ";", "IJavaElement", "enclosing", "=", "context", ".", "getEnclosingElement", "(", ")", ";", "assertEquals", "(", "\"foo\"", ",", "enclosing", ".", "getElementName", "(", ")", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"LSuper;\"", ",", "\"x\"", ",", "\"y\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"LSub;\"", ",", "\"y\"", ")", ";", "}", "public", "void", "testExtendedContextInClass3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "GroovyExtendedCompletionContext", "context", "=", "getExtendedCoreContext", "(", "create", "(", "contents", ")", ",", "contents", ".", "lastIndexOf", "(", "'z'", ")", "+", "1", ")", ";", "IJavaElement", "enclosing", "=", "context", ".", "getEnclosingElement", "(", ")", ";", "assertEquals", "(", "\"foo\"", ",", "enclosing", ".", "getElementName", "(", ")", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"LSub;\"", ",", "\"y\"", ",", "\"b\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"LSuper;\"", ",", "\"x\"", ",", "\"y\"", ",", "\"a\"", ",", "\"b\"", ",", "\"z\"", ")", ";", "}", "public", "void", "testExtendedContextWithGenerics", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"z\"", ";", "GroovyExtendedCompletionContext", "context", "=", "getExtendedCoreContext", "(", "create", "(", "contents", ")", ",", "contents", ".", "lastIndexOf", "(", "'z'", ")", "+", "1", ")", ";", "IJavaElement", "enclosing", "=", "context", ".", "getEnclosingElement", "(", ")", ";", "assertEquals", "(", "\"run\"", ",", "enclosing", ".", "getElementName", "(", ")", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"\"", ",", "\"y\"", ",", "\"x\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"\"", ",", "\"y\"", ")", ";", "}", "public", "void", "testExtendedContextWithBoxing", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"int", "xn\"", "+", "\"Integer", "yn\"", "+", "\"boolean", "an\"", "+", "\"Boolean", "bn\"", "+", "\"z\"", ";", "GroovyExtendedCompletionContext", "context", "=", "getExtendedCoreContext", "(", "create", "(", "contents", ")", ",", "contents", ".", "lastIndexOf", "(", "'z'", ")", "+", "1", ")", ";", "IJavaElement", "enclosing", "=", "context", ".", "getEnclosingElement", "(", ")", ";", "assertEquals", "(", "\"run\"", ",", "enclosing", ".", "getElementName", "(", ")", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"\"", ",", "\"y\"", ",", "\"x\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"I\"", ",", "\"y\"", ",", "\"x\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"\"", ",", "\"a\"", ",", "\"b\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"Z\"", ",", "\"a\"", ",", "\"b\"", ")", ";", "}", "public", "void", "testExtendedContextWithBoxingAndArrays", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"int", "xn\"", "+", "\"Integer", "yn\"", "+", "\"boolean", "an\"", "+", "\"Boolean", "bn\"", "+", "\"int[]", "x1n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"int[][]", "x2n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"z\"", ";", "GroovyExtendedCompletionContext", "context", "=", "getExtendedCoreContext", "(", "create", "(", "contents", ")", ",", "contents", ".", "lastIndexOf", "(", "'z'", ")", "+", "1", ")", ";", "IJavaElement", "enclosing", "=", "context", ".", "getEnclosingElement", "(", ")", ";", "assertEquals", "(", "\"run\"", ",", "enclosing", ".", "getElementName", "(", ")", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"\"", ",", "\"y\"", ",", "\"x\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"I\"", ",", "\"y\"", ",", "\"x\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"\"", ",", "\"a\"", ",", "\"b\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"Z\"", ",", "\"a\"", ",", "\"b\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"\"", ",", "\"y1\"", ",", "\"x1\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"[I\"", ",", "\"y1\"", ",", "\"x1\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"\"", ",", "\"a1\"", ",", "\"b1\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"[Z\"", ",", "\"a1\"", ",", "\"b1\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"\"", ",", "\"y2\"", ",", "\"x2\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"[[I\"", ",", "\"y2\"", ",", "\"x2\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"\"", ",", "\"a2\"", ",", "\"b2\"", ")", ";", "assertExtendedContextElements", "(", "context", ",", "\"[[Z\"", ",", "\"a2\"", ",", "\"b2\"", ")", ";", "}", "}", "</s>" ]
5,943
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "public", "class", "AllCompletionTests", "{", "public", "static", "Test", "suite", "(", ")", "throws", "Exception", "{", "TestSuite", "suite", "=", "new", "TestSuite", "(", "\"\"", ")", ";", "suite", ".", "addTestSuite", "(", "DefaultGroovyMethodCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "LocalVariableCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "InferencingCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "FieldCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "MethodCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "TypeCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "TypeCompletionTests2", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "GroovyLikeCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "InnerTypeCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "OtherCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "FindImportsRegionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "RelevanceTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "ProposalProviderAndFilterTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "ConstructorCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "StaticImportsCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "GenericCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "ExtendedCompletionContextTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "ContentAssistLocationTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "ContextInformationTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "GuessingCompletionTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "DefaultMethodContentAssistTests", ".", "class", ")", ";", "suite", ".", "addTestSuite", "(", "CommandChainCompletionTests", ".", "class", ")", ";", "return", "suite", ";", "}", "}", "</s>" ]
5,944
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completions", ".", "GroovyExtendedCompletionContext", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completions", ".", "GroovyJavaGuessingCompletionProposal", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completions", ".", "NamedParameterProposal", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "ContentAssistContext", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "SynchronizationUtils", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyCompilationUnit", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFolder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "CompletionProposal", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "AST", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "IJavaSearchConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchEngine", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchPattern", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "TypeNameRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "tests", ".", "builder", ".", "BuilderTests", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "tests", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "groovy", ".", "search", ".", "ITypeRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "groovy", ".", "search", ".", "TypeInferencingVisitorFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "groovy", ".", "search", ".", "TypeInferencingVisitorWithRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "groovy", ".", "search", ".", "TypeLookupResult", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "groovy", ".", "search", ".", "VariableScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "javaeditor", ".", "EditorUtility", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "javaeditor", ".", "JavaEditor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "javaeditor", ".", "JavaSourceViewer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "text", ".", "java", ".", "AbstractJavaCompletionProposal", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "text", ".", "java", ".", "LazyGenericTypeProposal", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "ui", ".", "text", ".", "java", ".", "IJavaCompletionProposal", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "ui", ".", "text", ".", "java", ".", "IJavaCompletionProposalComputer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "ui", ".", "text", ".", "java", ".", "JavaContentAssistInvocationContext", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Document", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IDocument", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "import", "org", ".", "eclipse", ".", "ui", ".", "ide", ".", "IDE", ";", "import", "org", ".", "eclipse", ".", "ui", ".", "internal", ".", "UIPlugin", ";", "public", "abstract", "class", "CompletionTestCase", "extends", "BuilderTests", "{", "protected", "String", "defaultFileExtension", ";", "public", "CompletionTestCase", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "UIPlugin", ".", "getDefault", "(", ")", ".", "getWorkbench", "(", ")", ".", "getActiveWorkbenchWindow", "(", ")", ".", "getActivePage", "(", ")", ".", "closeAllEditors", "(", "false", ")", ";", "super", ".", "tearDown", "(", ")", ";", "}", "protected", "IPath", "createGenericProject", "(", ")", "throws", "Exception", "{", "if", "(", "genericProjectExists", "(", ")", ")", "{", "return", "env", ".", "getProject", "(", "\"Project\"", ")", ".", "getFullPath", "(", ")", ";", "}", "IPath", "projectPath", "=", "env", ".", "addProject", "(", "\"Project\"", ",", "\"1.5\"", ")", ";", "env", ".", "removePackageFragmentRoot", "(", "projectPath", ",", "\"\"", ")", ";", "env", ".", "addExternalJars", "(", "projectPath", ",", "Util", ".", "getJavaClassLibs", "(", ")", ")", ";", "env", ".", "addGroovyNature", "(", "\"Project\"", ")", ";", "env", ".", "addGroovyJars", "(", "projectPath", ")", ";", "fullBuild", "(", "projectPath", ")", ";", "env", ".", "addPackageFragmentRoot", "(", "projectPath", ",", "\"src\"", ")", ";", "env", ".", "setOutputFolder", "(", "projectPath", ",", "\"bin\"", ")", ";", "return", "projectPath", ";", "}", "protected", "boolean", "genericProjectExists", "(", ")", "{", "return", "env", ".", "getProject", "(", "\"Project\"", ")", "!=", "null", "&&", "env", ".", "getProject", "(", "\"Project\"", ")", ".", "exists", "(", ")", ";", "}", "protected", "IFile", "getFile", "(", "IPath", "projectPath", ",", "String", "fileName", ")", "{", "return", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getFile", "(", "projectPath", ".", "append", "(", "fileName", ")", ")", ";", "}", "protected", "IFolder", "getolder", "(", "IPath", "projectPath", ",", "String", "folderName", ")", "{", "return", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getFolder", "(", "projectPath", ".", "append", "(", "folderName", ")", ")", ";", "}", "protected", "IProject", "getProject", "(", "IPath", "projectPath", ")", "{", "return", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getProject", "(", "projectPath", ".", "segment", "(", "0", ")", ")", ";", "}", "public", "ICompilationUnit", "getJavaCompilationUnit", "(", "IPath", "sourceRootPath", ",", "String", "qualifiedNameWithSlashesDotJava", ")", "{", "IFile", "file", "=", "getFile", "(", "sourceRootPath", ",", "qualifiedNameWithSlashesDotJava", ")", ";", "return", "JavaCore", ".", "createCompilationUnitFrom", "(", "file", ")", ";", "}", "public", "ICompilationUnit", "getCompilationUnit", "(", "IPath", "fullPathName", ")", "{", "IFile", "file", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getFile", "(", "fullPathName", ")", ";", "return", "JavaCore", ".", "createCompilationUnitFrom", "(", "file", ")", ";", "}", "public", "GroovyCompilationUnit", "getGroovyCompilationUnit", "(", "IPath", "sourceRootPath", ",", "String", "qualifiedNameWithSlashesDotGroovy", ")", "{", "IFile", "file", "=", "getFile", "(", "sourceRootPath", ",", "qualifiedNameWithSlashesDotGroovy", ")", ";", "return", "(", "GroovyCompilationUnit", ")", "JavaCore", ".", "createCompilationUnitFrom", "(", "file", ")", ";", "}", "protected", "ICompletionProposal", "[", "]", "performContentAssist", "(", "ICompilationUnit", "unit", ",", "int", "offset", ",", "Class", "<", "?", "extends", "IJavaCompletionProposalComputer", ">", "computerClass", ")", "throws", "Exception", "{", "if", "(", "unit", "instanceof", "GroovyCompilationUnit", ")", "{", "unit", ".", "getResource", "(", ")", ".", "setPersistentProperty", "(", "IDE", ".", "EDITOR_KEY", ",", "\"\"", ")", ";", "}", "JavaEditor", "editor", "=", "(", "JavaEditor", ")", "EditorUtility", ".", "openInEditor", "(", "unit", ")", ";", "JavaSourceViewer", "viewer", "=", "(", "JavaSourceViewer", ")", "editor", ".", "getViewer", "(", ")", ";", "JavaContentAssistInvocationContext", "context", "=", "new", "JavaContentAssistInvocationContext", "(", "viewer", ",", "offset", ",", "editor", ")", ";", "IJavaCompletionProposalComputer", "computer", "=", "computerClass", ".", "newInstance", "(", ")", ";", "List", "<", "ICompletionProposal", ">", "proposals", "=", "computer", ".", "computeCompletionProposals", "(", "context", ",", "null", ")", ";", "return", "proposals", ".", "toArray", "(", "new", "ICompletionProposal", "[", "proposals", ".", "size", "(", ")", "]", ")", ";", "}", "protected", "void", "proposalExists", "(", "ICompletionProposal", "[", "]", "proposals", ",", "String", "name", ",", "int", "expectedCount", ")", "{", "boolean", "isType", "=", "name", ".", "contains", "(", "\"", "-", "\"", ")", ";", "proposalExists", "(", "proposals", ",", "name", ",", "expectedCount", ",", "isType", ")", ";", "}", "protected", "void", "proposalExists", "(", "ICompletionProposal", "[", "]", "proposals", ",", "String", "name", ",", "int", "expectedCount", ",", "boolean", "isType", ")", "{", "int", "foundCount", "=", "0", ";", "for", "(", "ICompletionProposal", "proposal", ":", "proposals", ")", "{", "String", "propName", "=", "proposal", ".", "getDisplayString", "(", ")", ";", "if", "(", "propName", ".", "startsWith", "(", "name", "+", "\"", "\"", ")", ")", "{", "foundCount", "++", ";", "}", "else", "if", "(", "propName", ".", "startsWith", "(", "name", "+", "\"(\"", ")", ")", "{", "foundCount", "++", ";", "}", "else", "if", "(", "isType", "&&", "propName", ".", "startsWith", "(", "name", ")", ")", "{", "foundCount", "++", ";", "}", "}", "if", "(", "foundCount", "!=", "expectedCount", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "ICompletionProposal", "proposal", ":", "proposals", ")", "{", "sb", ".", "append", "(", "\"n\"", "+", "proposal", ".", "toString", "(", ")", ")", ";", "}", "fail", "(", "\"\"", "+", "name", "+", "\"'", "\"", "+", "expectedCount", "+", "\"\"", "+", "foundCount", "+", "\"\"", "+", "sb", ")", ";", "}", "}", "protected", "int", "findProposal", "(", "ICompletionProposal", "[", "]", "proposals", ",", "String", "name", ",", "boolean", "isType", ",", "int", "startFrom", ")", "{", "for", "(", "int", "i", "=", "startFrom", ";", "i", "<", "proposals", ".", "length", ";", "i", "++", ")", "{", "ICompletionProposal", "proposal", "=", "proposals", "[", "i", "]", ";", "String", "propName", "=", "proposal", ".", "getDisplayString", "(", ")", ";", "if", "(", "propName", ".", "startsWith", "(", "name", "+", "\"", "\"", ")", ")", "{", "return", "i", ";", "}", "else", "if", "(", "propName", ".", "startsWith", "(", "name", "+", "\"(\"", ")", ")", "{", "return", "i", ";", "}", "else", "if", "(", "isType", "&&", "propName", ".", "startsWith", "(", "name", ")", ")", "{", "return", "i", ";", "}", "else", "if", "(", "name", ".", "equals", "(", "proposal", ".", "getDisplayString", "(", ")", ")", ")", "{", "return", "i", ";", "}", "}", "return", "-", "1", ";", "}", "protected", "ICompletionProposal", "findFirstProposal", "(", "ICompletionProposal", "[", "]", "proposals", ",", "String", "name", ",", "boolean", "isType", ")", "{", "for", "(", "ICompletionProposal", "proposal", ":", "proposals", ")", "{", "String", "propName", "=", "proposal", ".", "getDisplayString", "(", ")", ";", "if", "(", "propName", ".", "startsWith", "(", "name", "+", "\"", "\"", ")", "&&", "!", "(", "proposal", "instanceof", "LazyGenericTypeProposal", ")", ")", "{", "return", "proposal", ";", "}", "else", "if", "(", "propName", ".", "startsWith", "(", "name", "+", "\"(\"", ")", ")", "{", "return", "proposal", ";", "}", "else", "if", "(", "isType", "&&", "propName", ".", "startsWith", "(", "name", ")", ")", "{", "return", "proposal", ";", "}", "}", "return", "null", ";", "}", "protected", "void", "applyProposalAndCheck", "(", "IDocument", "document", ",", "ICompletionProposal", "proposal", ",", "String", "expected", ")", "{", "proposal", ".", "apply", "(", "document", ")", ";", "assertEquals", "(", "\"\"", ",", "expected", ",", "document", ".", "get", "(", ")", ")", ";", "}", "protected", "void", "checkReplacementString", "(", "ICompletionProposal", "[", "]", "proposals", ",", "String", "expectedReplacement", ",", "int", "expectedCount", ")", "{", "int", "foundCount", "=", "0", ";", "for", "(", "ICompletionProposal", "proposal", ":", "proposals", ")", "{", "AbstractJavaCompletionProposal", "javaProposal", "=", "(", "AbstractJavaCompletionProposal", ")", "proposal", ";", "String", "replacement", "=", "javaProposal", ".", "getReplacementString", "(", ")", ";", "if", "(", "replacement", ".", "equals", "(", "expectedReplacement", ")", ")", "{", "foundCount", "++", ";", "}", "}", "if", "(", "foundCount", "!=", "expectedCount", ")", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "ICompletionProposal", "proposal", ":", "proposals", ")", "{", "AbstractJavaCompletionProposal", "javaProposal", "=", "(", "AbstractJavaCompletionProposal", ")", "proposal", ";", "sb", ".", "append", "(", "\"n\"", "+", "javaProposal", ".", "getReplacementString", "(", ")", ")", ";", "}", "fail", "(", "\"\"", "+", "expectedReplacement", "+", "\"'", "\"", "+", "expectedCount", "+", "\"\"", "+", "foundCount", "+", "\"\"", "+", "sb", ")", ";", "}", "}", "protected", "void", "validateProposal", "(", "CompletionProposal", "proposal", ",", "String", "name", ")", "{", "assertEquals", "(", "proposal", ".", "getName", "(", ")", ",", "name", ")", ";", "}", "protected", "int", "getIndexOf", "(", "String", "contents", ",", "String", "lookFor", ")", "{", "return", "contents", ".", "indexOf", "(", "lookFor", ")", "+", "lookFor", ".", "length", "(", ")", ";", "}", "protected", "int", "getLastIndexOf", "(", "String", "contents", ",", "String", "lookFor", ")", "{", "return", "contents", ".", "lastIndexOf", "(", "lookFor", ")", "+", "lookFor", ".", "length", "(", ")", ";", "}", "protected", "ICompletionProposal", "[", "]", "createProposalsAtOffset", "(", "String", "contents", ",", "int", "completionOffset", ")", "throws", "Exception", "{", "return", "createProposalsAtOffset", "(", "contents", ",", "null", ",", "completionOffset", ")", ";", "}", "protected", "ICompletionProposal", "[", "]", "createProposalsAtOffset", "(", "String", "contents", ",", "String", "javaContents", ",", "int", "completionOffset", ")", "throws", "Exception", "{", "IPath", "projectPath", "=", "createGenericProject", "(", ")", ";", "IPath", "pack", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "if", "(", "javaContents", "!=", "null", ")", "{", "IPath", "pathToJavaClass", "=", "env", ".", "addClass", "(", "pack", ",", "\"JavaClass\"", ",", "\"\"", "+", "javaContents", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToJavaClass", ")", ";", "unit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "}", "IPath", "pathToGroovyClass", "=", "env", ".", "addGroovyClass", "(", "pack", ",", "\"\"", ",", "contents", ")", ";", "fullBuild", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToGroovyClass", ")", ";", "unit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "return", "createProposalsAtOffset", "(", "unit", ",", "completionOffset", ")", ";", "}", "protected", "ICompletionProposal", "[", "]", "createProposalsAtOffset", "(", "ICompilationUnit", "unit", ",", "int", "completionOffset", ")", "throws", "Exception", "{", "int", "count", "=", "0", ";", "int", "maxCount", "=", "15", ";", "ICompletionProposal", "[", "]", "proposals", ";", "do", "{", "if", "(", "count", ">", "0", ")", "{", "performDummySearch", "(", "unit", ".", "getJavaProject", "(", ")", ")", ";", "unit", ".", "reconcile", "(", "AST", ".", "JLS3", ",", "true", ",", "null", ",", "null", ")", ";", "env", ".", "fullBuild", "(", ")", ";", "SynchronizationUtils", ".", "joinBackgroudActivities", "(", ")", ";", "SynchronizationUtils", ".", "waitForIndexingToComplete", "(", ")", ";", "}", "System", ".", "out", ".", "println", "(", "\"\"", "+", "unit", ".", "getElementName", "(", ")", ")", ";", "proposals", "=", "performContentAssist", "(", "unit", ",", "completionOffset", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "if", "(", "proposals", "==", "null", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "else", "{", "System", ".", "out", ".", "println", "(", "\"Found", ":", "\"", "+", "Arrays", ".", "toString", "(", "proposals", ")", ")", ";", "}", "count", "++", ";", "}", "while", "(", "(", "proposals", "==", "null", "||", "proposals", ".", "length", "==", "0", ")", "&&", "count", "<", "maxCount", ")", ";", "return", "proposals", ";", "}", "protected", "ICompletionProposal", "[", "]", "orderByRelevance", "(", "ICompletionProposal", "[", "]", "proposals", ")", "{", "Arrays", ".", "sort", "(", "proposals", ",", "0", ",", "proposals", ".", "length", ",", "new", "Comparator", "<", "ICompletionProposal", ">", "(", ")", "{", "public", "int", "compare", "(", "ICompletionProposal", "left", ",", "ICompletionProposal", "right", ")", "{", "int", "initial", "=", "(", "(", "IJavaCompletionProposal", ")", "right", ")", ".", "getRelevance", "(", ")", "-", "(", "(", "IJavaCompletionProposal", ")", "left", ")", ".", "getRelevance", "(", ")", ";", "if", "(", "initial", "!=", "0", ")", "{", "return", "initial", ";", "}", "else", "{", "return", "left", ".", "toString", "(", ")", ".", "compareTo", "(", "right", ".", "toString", "(", ")", ")", ";", "}", "}", "}", ")", ";", "return", "proposals", ";", "}", "protected", "ICompilationUnit", "create", "(", "String", "contents", ")", "throws", "Exception", "{", "return", "create", "(", "\"GroovyClass\"", ",", "contents", ")", ";", "}", "protected", "ICompilationUnit", "create", "(", "String", "cuName", ",", "String", "contents", ")", "throws", "Exception", "{", "return", "create", "(", "null", ",", "cuName", ",", "contents", ")", ";", "}", "protected", "ICompilationUnit", "create", "(", "String", "pkg", ",", "String", "cuName", ",", "String", "contents", ")", "throws", "Exception", "{", "IPath", "projectPath", ";", "if", "(", "genericProjectExists", "(", ")", ")", "{", "projectPath", "=", "env", ".", "getProject", "(", "\"Project\"", ")", ".", "getFullPath", "(", ")", ";", "}", "else", "{", "projectPath", "=", "createGenericProject", "(", ")", ";", "}", "IPath", "pkgPath", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "if", "(", "pkg", "!=", "null", ")", "{", "pkgPath", "=", "env", ".", "addPackage", "(", "pkgPath", ",", "pkg", ")", ";", "}", "IPath", "pathToJavaClass", "=", "env", ".", "addGroovyClassExtension", "(", "pkgPath", ",", "cuName", ",", "contents", ",", "defaultFileExtension", ")", ";", "incrementalBuild", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToJavaClass", ")", ";", "return", "unit", ";", "}", "protected", "void", "createJava", "(", "String", "cuName", ",", "String", "contents", ")", "throws", "Exception", "{", "IPath", "projectPath", ";", "if", "(", "genericProjectExists", "(", ")", ")", "{", "projectPath", "=", "env", ".", "getProject", "(", "\"Project\"", ")", ".", "getFullPath", "(", ")", ";", "}", "else", "{", "projectPath", "=", "createGenericProject", "(", ")", ";", "}", "IPath", "src", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "env", ".", "addClass", "(", "src", ",", "cuName", ",", "contents", ")", ";", "}", "protected", "String", "printProposals", "(", "ICompletionProposal", "[", "]", "proposals", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "\"\"", ")", ";", "for", "(", "ICompletionProposal", "proposal", ":", "proposals", ")", "{", "sb", ".", "append", "(", "proposal", ".", "getDisplayString", "(", ")", "+", "\"n\"", ")", ";", "}", "return", "sb", ".", "toString", "(", ")", ";", "}", "protected", "void", "checkProposalApplicationType", "(", "String", "contents", ",", "String", "expected", ",", "int", "proposalLocation", ",", "String", "proposalName", ")", "throws", "Exception", "{", "checkProposalApplication", "(", "contents", ",", "expected", ",", "proposalLocation", ",", "proposalName", ",", "true", ")", ";", "}", "protected", "void", "checkProposalApplicationNonType", "(", "String", "contents", ",", "String", "expected", ",", "int", "proposalLocation", ",", "String", "proposalName", ")", "throws", "Exception", "{", "checkProposalApplication", "(", "contents", ",", "expected", ",", "proposalLocation", ",", "proposalName", ",", "false", ")", ";", "}", "protected", "void", "checkProposalApplication", "(", "String", "contents", ",", "String", "expected", ",", "int", "proposalLocation", ",", "String", "proposalName", ",", "boolean", "isType", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "proposalLocation", ")", ";", "ICompletionProposal", "firstProposal", "=", "findFirstProposal", "(", "proposals", ",", "proposalName", ",", "isType", ")", ";", "if", "(", "firstProposal", "==", "null", ")", "{", "fail", "(", "\"\"", ")", ";", "}", "applyProposalAndCheck", "(", "new", "Document", "(", "contents", ")", ",", "firstProposal", ",", "expected", ")", ";", "}", "protected", "void", "checkProposalApplication", "(", "String", "contents", ",", "int", "proposalLocation", ",", "String", "[", "]", "expecteds", ",", "String", "[", "]", "proposalNames", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "proposalLocation", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "expecteds", ".", "length", ";", "i", "++", ")", "{", "ICompletionProposal", "firstProposal", "=", "findFirstProposal", "(", "proposals", ",", "proposalNames", "[", "i", "]", ",", "false", ")", ";", "if", "(", "firstProposal", "==", "null", ")", "{", "fail", "(", "\"\"", ")", ";", "}", "applyProposalAndCheck", "(", "new", "Document", "(", "contents", ")", ",", "firstProposal", ",", "expecteds", "[", "i", "]", ")", ";", "}", "}", "protected", "void", "assertProposalOrdering", "(", "ICompletionProposal", "[", "]", "proposals", ",", "String", "...", "order", ")", "{", "int", "startFrom", "=", "0", ";", "for", "(", "String", "propName", ":", "order", ")", "{", "startFrom", "=", "findProposal", "(", "proposals", ",", "propName", ",", "false", ",", "startFrom", ")", "+", "1", ";", "if", "(", "startFrom", "==", "0", ")", "{", "fail", "(", "\"\"", "+", "propName", "+", "\"\"", "+", "printProposals", "(", "proposals", ")", ")", ";", "}", "}", "}", "protected", "void", "assertExtendedContextElements", "(", "GroovyExtendedCompletionContext", "context", ",", "String", "signature", ",", "String", "...", "expectedNames", ")", "{", "IJavaElement", "[", "]", "visibleElements", "=", "context", ".", "getVisibleElements", "(", "signature", ")", ";", "assertEquals", "(", "\"\"", "+", "Arrays", ".", "toString", "(", "expectedNames", ")", "+", "\"nfound:", "\"", "+", "elementsToNames", "(", "visibleElements", ")", ",", "expectedNames", ".", "length", ",", "visibleElements", ".", "length", ")", ";", "for", "(", "String", "name", ":", "expectedNames", ")", "{", "boolean", "found", "=", "false", ";", "for", "(", "IJavaElement", "element", ":", "visibleElements", ")", "{", "if", "(", "element", ".", "getElementName", "(", ")", ".", "equals", "(", "name", ")", ")", "{", "found", "=", "true", ";", "break", ";", "}", "}", "if", "(", "!", "found", ")", "{", "fail", "(", "\"\"", "+", "name", "+", "\"", "in", "\"", "+", "elementsToNames", "(", "visibleElements", ")", ")", ";", "}", "}", "}", "private", "String", "elementsToNames", "(", "IJavaElement", "[", "]", "visibleElements", ")", "{", "String", "[", "]", "names", "=", "new", "String", "[", "visibleElements", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "names", ".", "length", ";", "i", "++", ")", "{", "names", "[", "i", "]", "=", "visibleElements", "[", "i", "]", ".", "getElementName", "(", ")", ";", "}", "return", "Arrays", ".", "toString", "(", "names", ")", ";", "}", "protected", "GroovyExtendedCompletionContext", "getExtendedCoreContext", "(", "ICompilationUnit", "unit", ",", "int", "invocationOffset", ")", "throws", "JavaModelException", "{", "GroovyCompilationUnit", "gunit", "=", "(", "GroovyCompilationUnit", ")", "unit", ";", "gunit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "GroovyCompletionProposalComputer", "computer", "=", "new", "GroovyCompletionProposalComputer", "(", ")", ";", "ContentAssistContext", "context", "=", "computer", ".", "createContentAssistContext", "(", "gunit", ",", "invocationOffset", ",", "new", "Document", "(", "String", ".", "valueOf", "(", "gunit", ".", "getContents", "(", ")", ")", ")", ")", ";", "TypeInferencingVisitorWithRequestor", "visitor", "=", "new", "TypeInferencingVisitorFactory", "(", ")", ".", "createVisitor", "(", "gunit", ")", ";", "SearchRequestor", "requestor", "=", "new", "SearchRequestor", "(", "context", ".", "completionNode", ")", ";", "visitor", ".", "visitCompilationUnit", "(", "requestor", ")", ";", "return", "new", "GroovyExtendedCompletionContext", "(", "context", ",", "requestor", ".", "currentScope", ")", ";", "}", "public", "class", "SearchRequestor", "implements", "ITypeRequestor", "{", "public", "VariableScope", "currentScope", ";", "public", "ASTNode", "node", ";", "public", "SearchRequestor", "(", "ASTNode", "node", ")", "{", "this", ".", "node", "=", "node", ";", "}", "public", "VisitStatus", "acceptASTNode", "(", "ASTNode", "visitorNode", ",", "TypeLookupResult", "visitorResult", ",", "IJavaElement", "enclosingElement", ")", "{", "if", "(", "node", "==", "visitorNode", ")", "{", "this", ".", "currentScope", "=", "visitorResult", ".", "scope", ";", "return", "VisitStatus", ".", "STOP_VISIT", ";", "}", "return", "VisitStatus", ".", "CONTINUE", ";", "}", "}", "protected", "void", "checkProposalChoices", "(", "String", "contents", ",", "String", "toFind", ",", "String", "lookFor", ",", "String", "replacementString", ",", "String", "[", "]", "expectedChoices", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "toFind", ")", ")", ";", "checkReplacementString", "(", "proposals", ",", "replacementString", ",", "1", ")", ";", "ICompletionProposal", "proposal", "=", "findFirstProposal", "(", "proposals", ",", "lookFor", ",", "false", ")", ";", "NamedParameterProposal", "guessingProposal", "=", "(", "NamedParameterProposal", ")", "proposal", ";", "ICompletionProposal", "[", "]", "choices", "=", "guessingProposal", ".", "getChoices", "(", ")", ";", "assertEquals", "(", "expectedChoices", ".", "length", ",", "choices", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "expectedChoices", ".", "length", ";", "i", "++", ")", "{", "assertEquals", "(", "\"\"", ",", "expectedChoices", "[", "i", "]", ",", "choices", "[", "i", "]", ".", "getDisplayString", "(", ")", ")", ";", "}", "}", "protected", "void", "checkProposalChoices", "(", "String", "contents", ",", "String", "lookFor", ",", "String", "replacementString", ",", "String", "[", "]", "[", "]", "expectedChoices", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "lookFor", ")", ")", ";", "checkReplacementString", "(", "proposals", ",", "replacementString", ",", "1", ")", ";", "ICompletionProposal", "proposal", "=", "findFirstProposal", "(", "proposals", ",", "lookFor", ",", "false", ")", ";", "GroovyJavaGuessingCompletionProposal", "guessingProposal", "=", "(", "GroovyJavaGuessingCompletionProposal", ")", "proposal", ";", "guessingProposal", ".", "getReplacementString", "(", ")", ";", "ICompletionProposal", "[", "]", "[", "]", "choices", "=", "guessingProposal", ".", "getChoices", "(", ")", ";", "assertEquals", "(", "expectedChoices", ".", "length", ",", "choices", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "expectedChoices", ".", "length", ";", "i", "++", ")", "{", "assertEquals", "(", "expectedChoices", "[", "i", "]", ".", "length", ",", "choices", "[", "i", "]", ".", "length", ")", ";", "Comparator", "<", "ICompletionProposal", ">", "c", "=", "new", "Comparator", "<", "ICompletionProposal", ">", "(", ")", "{", "public", "int", "compare", "(", "ICompletionProposal", "c1", ",", "ICompletionProposal", "c2", ")", "{", "return", "c1", ".", "getDisplayString", "(", ")", ".", "compareTo", "(", "c2", ".", "getDisplayString", "(", ")", ")", ";", "}", "}", ";", "Arrays", ".", "sort", "(", "choices", "[", "i", "]", ",", "0", ",", "choices", "[", "i", "]", ".", "length", ",", "c", ")", ";", "Arrays", ".", "sort", "(", "expectedChoices", "[", "i", "]", ",", "0", ",", "expectedChoices", "[", "i", "]", ".", "length", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "expectedChoices", "[", "i", "]", ".", "length", ";", "j", "++", ")", "{", "assertEquals", "(", "\"\"", ",", "expectedChoices", "[", "i", "]", "[", "j", "]", ",", "choices", "[", "i", "]", "[", "j", "]", ".", "getDisplayString", "(", ")", ")", ";", "}", "}", "}", "public", "void", "performDummySearch", "(", "IJavaElement", "element", ")", "throws", "Exception", "{", "JavaModelManager", ".", "getIndexManager", "(", ")", ".", "indexAll", "(", "element", ".", "getJavaProject", "(", ")", ".", "getProject", "(", ")", ")", ";", "new", "SearchEngine", "(", ")", ".", "searchAllTypeNames", "(", "null", ",", "SearchPattern", ".", "R_EXACT_MATCH", ",", "\"XXXXXXXXX\"", ".", "toCharArray", "(", ")", ",", "SearchPattern", ".", "R_EXACT_MATCH", ",", "IJavaSearchConstants", ".", "CLASS", ",", "SearchEngine", ".", "createJavaSearchScope", "(", "new", "IJavaElement", "[", "]", "{", "element", "}", ")", ",", "new", "Requestor", "(", ")", ",", "IJavaSearchConstants", ".", "WAIT_UNTIL_READY_TO_SEARCH", ",", "null", ")", ";", "}", "private", "static", "class", "Requestor", "extends", "TypeNameRequestor", "{", "}", "}", "</s>" ]
5,945
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "junit", ".", "framework", ".", "ComparisonFailure", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "GroovyPlugin", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "preferences", ".", "PreferenceConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "tests", ".", "util", ".", "GroovyUtils", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "OtherCompletionTests", "extends", "CompletionTestCase", "{", "public", "OtherCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "boolean", "orig", ";", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "orig", "=", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "getBoolean", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "false", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_PARAMETER_GUESSING", ",", "false", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "try", "{", "super", ".", "tearDown", "(", ")", ";", "}", "finally", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "orig", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_PARAMETER_GUESSING", ",", "true", ")", ";", "}", "}", "public", "void", "testGreclipse414", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"int", "in\"", "+", "\"Test()", "{n\"", "+", "\"this.i", "=", "42n\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"}\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"this.\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"i\"", ",", "1", ")", ";", "}", "public", "void", "testGreclipse422", "(", ")", "throws", "Exception", "{", "String", "javaClass", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"}n\"", ";", "String", "groovyClass", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"foo.bar()n\"", "+", "\"}n\"", "+", "\"\"", "+", "\"}n\"", "+", "\"}\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "env", ".", "addClass", "(", "groovyUnit", ".", "getParent", "(", ")", ".", "getResource", "(", ")", ".", "getFullPath", "(", ")", ",", "\"\"", ",", "javaClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\"foo.ba\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"bar\"", ",", "1", ")", ";", "assertEquals", "(", "\"\"", ",", "proposals", "[", "0", "]", ".", "getDisplayString", "(", ")", ")", ";", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\"this.collect\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "Arrays", ".", "sort", "(", "proposals", ",", "new", "Comparator", "<", "ICompletionProposal", ">", "(", ")", "{", "public", "int", "compare", "(", "ICompletionProposal", "o1", ",", "ICompletionProposal", "o2", ")", "{", "return", "-", "o1", ".", "getDisplayString", "(", ")", ".", "compareTo", "(", "o2", ".", "getDisplayString", "(", ")", ")", ";", "}", "}", ")", ";", "proposalExists", "(", "proposals", ",", "\"collect\"", ",", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", "?", "2", ":", "3", ")", ";", "assertEquals", "(", "printProposals", "(", "proposals", ")", ",", "\"\"", ",", "proposals", "[", "0", "]", ".", "getDisplayString", "(", ")", ".", "toString", "(", ")", ")", ";", "try", "{", "}", "catch", "(", "ComparisonFailure", "e", ")", "{", "}", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", ">=", "18", ")", "{", "assertEquals", "(", "printProposals", "(", "proposals", ")", ",", "\"\"", ",", "proposals", "[", "1", "]", ".", "getDisplayString", "(", ")", ".", "toString", "(", ")", ")", ";", "assertEquals", "(", "printProposals", "(", "proposals", ")", ",", "\"\"", ",", "proposals", "[", "2", "]", ".", "getDisplayString", "(", ")", ".", "toString", "(", ")", ")", ";", "}", "else", "{", "assertEquals", "(", "printProposals", "(", "proposals", ")", ",", "\"\"", ",", "proposals", "[", "1", "]", ".", "getDisplayString", "(", ")", ".", "toString", "(", ")", ")", ";", "}", "}", "public", "void", "testVisibility", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"class", "B", "{", "}n\"", "+", "\"class", "C", "{n\"", "+", "\"B", "theBn\"", "+", "\"}n\"", "+", "\"new", "C().thn\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\"().th\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"theB\"", ",", "1", ")", ";", "assertEquals", "(", "\"\"", ",", "proposals", "[", "0", "]", ".", "getDisplayString", "(", ")", ")", ";", "}", "public", "void", "testGString1", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\".c\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"center\"", ",", "2", ")", ";", "}", "public", "void", "testContentAssistInInitializers1", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\"aa\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaaa\"", ",", "1", ")", ";", "}", "public", "void", "testContentAssistInInitializers2", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\"{", "{", "\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaaa\"", ",", "1", ")", ";", "}", "public", "void", "testContentAssistInStaticInitializers1", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\"aa\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaaa\"", ",", "1", ")", ";", "}", "public", "void", "testContentAssistInStaticInitializers2", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\"static", "{", "\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaaa\"", ",", "1", ")", ";", "}", "public", "void", "testMethodWithSpaces", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\"{", "ff\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\\\"ff", "f\\\"()\"", ",", "1", ")", ";", "}", "public", "void", "testMethodWithSpaces2", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\"{", "fff\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"fff()\"", ",", "1", ")", ";", "}", "public", "void", "testAfterStaticCall", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "groovyClass", ",", "\"oth\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"other\"", ",", "1", ")", ";", "}", "public", "void", "testArrayCompletion1", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\"x\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"xx\"", ",", "1", ")", ";", "}", "public", "void", "testArrayCompletion2", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\"getX\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"getXx()\"", ",", "1", ")", ";", "}", "public", "void", "testArrayCompletion3", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\"setX\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"setXx(value)\"", ",", "1", ")", ";", "}", "public", "void", "testArrayCompletion4", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\"x\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"xx\"", ",", "1", ")", ";", "}", "public", "void", "testListCompletion1", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"[].\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testListCompletion2", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"[].re\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".re\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion1", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"value\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion2", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".va\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"value\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion3", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"getKey()\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion4", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".get\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"getKey()\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion5", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion6", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".to\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion7", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"intValue()\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion8", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".int\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"intValue()\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion9", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"value\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion10", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".val\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"value\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion11", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"value\"", ",", "1", ")", ";", "}", "public", "void", "testSpreadCompletion12", "(", ")", "throws", "Exception", "{", "String", "groovyClass", "=", "\"\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "groovyClass", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getLastIndexOf", "(", "groovyClass", ",", "\".val\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "checkReplacementString", "(", "proposals", ",", "\"value\"", ",", "1", ")", ";", "}", "public", "void", "testBeforeScript", "(", ")", "throws", "Exception", "{", "String", "script", "=", "\"nndef", "x", "=", "9\"", ";", "ICompilationUnit", "groovyUnit", "=", "create", "(", "script", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "groovyUnit", ",", "getIndexOf", "(", "script", ",", "\"n\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"binding\"", ")", ";", "}", "}", "</s>" ]
5,946
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "FieldCompletionTests", "extends", "CompletionTestCase", "{", "public", "FieldCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testSafeDeferencing", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"?.\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"abs\"", ",", "1", ")", ";", "}", "public", "void", "testSpaces1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"someProperty\"", ",", "1", ")", ";", "}", "public", "void", "testSpaces2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".", "\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"someProperty\"", ",", "1", ")", ";", "}", "public", "void", "testSpaces3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".", "\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"someProperty\"", ",", "1", ")", ";", "}", "public", "void", "testProperties1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "env", ".", "addClass", "(", "env", ".", "getProject", "(", "\"Project\"", ")", ".", "getFolder", "(", "\"src\"", ")", ".", "getFullPath", "(", ")", ",", "\"Other\"", ",", "\"\"", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties1a", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties2a", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties3a", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties4a", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties5a", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "env", ".", "addClass", "(", "env", ".", "getProject", "(", "\"Project\"", ")", ".", "getFolder", "(", "\"src\"", ")", ".", "getFullPath", "(", ")", ",", "\"Other\"", ",", "\"\"", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getX\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"setX\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"isX\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties6a", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getXx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"setXx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"isXx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"xx\"", ",", "1", ")", ";", "}", "public", "void", "testProperties7", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"isX\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"x\"", ",", "1", ")", ";", "}", "public", "void", "testProperties7a", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"isXx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"xx\"", ",", "1", ")", ";", "}", "public", "void", "testProperties8", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"isxx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"xx\"", ",", "0", ")", ";", "}", "public", "void", "testProperties9", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getxx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"xx\"", ",", "0", ")", ";", "}", "public", "void", "testClosure1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "2", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testClosure2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "2", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testClosure3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "2", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx()\"", ",", "1", ")", ";", "}", "public", "void", "testClosure4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"b\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"binding\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"bot\"", ",", "1", ")", ";", "}", "public", "void", "testClosure5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"", "xxn\"", "+", "\"}\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"xx\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "1", ")", ";", "}", "public", "void", "testClosuret6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "xxn\"", "+", "\"", "}n\"", "+", "\"}\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"xx\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "1", ")", ";", "}", "public", "void", "testClosuret7", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"", "def", "xxxn\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "xxn\"", "+", "\"", "}n\"", "+", "\"}\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"xx\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "1", ")", ";", "}", "public", "void", "testInitializer1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"}\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\".\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"forName\"", ",", "2", ")", ";", "}", "}", "</s>" ]
5,947
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "GroovyPlugin", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "preferences", ".", "PreferenceConstants", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "ConstructorCompletionTests", "extends", "CompletionTestCase", "{", "public", "ConstructorCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "boolean", "orig", ";", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "orig", "=", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "getBoolean", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ")", ";", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "false", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "try", "{", "super", ".", "tearDown", "(", ")", ";", "}", "finally", "{", "GroovyPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_CONTENT_ASSIST_NOPARENS", ",", "orig", ")", ";", "}", "}", "public", "void", "_testConstructorCompletion1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"new", "Y\"", ")", ",", "\"YY\"", ")", ";", "}", "public", "void", "_testConstructorCompletion2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"new", "Y\"", ")", ",", "\"YY\"", ")", ";", "}", "public", "void", "_testConstructorCompletion3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"new", "Y\"", ")", ",", "\"YY\"", ")", ";", "}", "public", "void", "testNoNamedArgs1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", "+", "\"new", "Flar()\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"Flar\"", ",", "1", ")", ";", "}", "public", "void", "testNoNamedArgs2", "(", ")", "throws", "Exception", "{", "create", "(", "\"Flar\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"new", "Flar()\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"Flar\"", ",", "2", ")", ";", "}", "public", "void", "testNoNamedArgs3", "(", ")", "throws", "Exception", "{", "create", "(", "\"p\"", ",", "\"Flar\"", ",", "\"package", "pn\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"new", "Flar()\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"Flar\"", ",", "2", ")", ";", "}", "public", "void", "testNamedArgs1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", "+", "\"new", "Flar()\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"Flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs2", "(", ")", "throws", "Exception", "{", "create", "(", "\"Flar\"", ",", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"new", "Flar()\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"Flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs3", "(", ")", "throws", "Exception", "{", "create", "(", "\"p\"", ",", "\"Flar\"", ",", "\"package", "pn\"", "+", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"new", "Flar()\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"Flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs4", "(", ")", "throws", "Exception", "{", "create", "(", "\"Flar\"", ",", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"Flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs5", "(", ")", "throws", "Exception", "{", "create", "(", "\"Flar\"", ",", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"Flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs6", "(", ")", "throws", "Exception", "{", "create", "(", "\"Flar\"", ",", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"Flar\"", ",", "1", ")", ";", "}", "public", "void", "testNamedArgs7", "(", ")", "throws", "Exception", "{", "create", "(", "\"Flar\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"new", "Flar()\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getLastIndexOf", "(", "contents", ",", "\"(\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"aaa", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"bbb", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"ccc", ":", "__\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"Flar\"", ",", "1", ")", ";", "}", "public", "void", "testParamGuessing1", "(", ")", "throws", "Exception", "{", "create", "(", "\"p\"", ",", "\"Flar\"", ",", "\"package", "pn\"", "+", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"String", "xxxn\"", "+", "\"int", "yyyn\"", "+", "\"boolean", "zzzn\"", "+", "\"new", "Flar()\"", ";", "String", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "{", "\"yyy\"", ",", "\"0\"", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"Flar(\"", ",", "\"bbb\"", ",", "\"bbb:", "__,", "\"", ",", "expectedChoices", ")", ";", "}", "public", "void", "testParamGuessing2", "(", ")", "throws", "Exception", "{", "create", "(", "\"p\"", ",", "\"Flar\"", ",", "\"package", "pn\"", "+", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"String", "xxxn\"", "+", "\"int", "yyyn\"", "+", "\"boolean", "zzzn\"", "+", "\"new", "p.Flar()\"", ";", "String", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "{", "\"yyy\"", ",", "\"0\"", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"Flar(\"", ",", "\"bbb\"", ",", "\"bbb:", "__,", "\"", ",", "expectedChoices", ")", ";", "}", "public", "void", "testParamGuessing3", "(", ")", "throws", "Exception", "{", "create", "(", "\"p\"", ",", "\"Flar\"", ",", "\"package", "pn\"", "+", "\"\"", "+", "\"\"", "+", "\"", "int", "bbbn\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"String", "xxxn\"", "+", "\"Integer", "yyyn\"", "+", "\"boolean", "zzzn\"", "+", "\"new", "Flar()\"", ";", "String", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "{", "\"yyy\"", ",", "\"0\"", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"Flar(\"", ",", "\"bbb\"", ",", "\"bbb:", "__,", "\"", ",", "expectedChoices", ")", ";", "}", "public", "void", "testParamGuessing4", "(", ")", "throws", "Exception", "{", "create", "(", "\"p\"", ",", "\"Flar\"", ",", "\"package", "pn\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"String", "xxxn\"", "+", "\"Integer", "yyyn\"", "+", "\"boolean", "zzzn\"", "+", "\"new", "Flar()\"", ";", "String", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "{", "\"yyy\"", ",", "\"0\"", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"Flar(\"", ",", "\"bbb\"", ",", "\"bbb:", "__,", "\"", ",", "expectedChoices", ")", ";", "}", "public", "void", "testParamGuessing5", "(", ")", "throws", "Exception", "{", "create", "(", "\"p\"", ",", "\"Flar\"", ",", "\"package", "pn\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"String", "xxxn\"", "+", "\"int", "yyyn\"", "+", "\"boolean", "zzzn\"", "+", "\"new", "Flar()\"", ";", "String", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "{", "\"yyy\"", ",", "\"0\"", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"Flar(\"", ",", "\"bbb\"", ",", "\"bbb:", "__,", "\"", ",", "expectedChoices", ")", ";", "}", "public", "void", "testParamGuessing6", "(", ")", "throws", "Exception", "{", "create", "(", "\"p\"", ",", "\"Flar\"", ",", "\"package", "pn\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"String", "xxxn\"", "+", "\"int", "yyyn\"", "+", "\"boolean", "zzzn\"", "+", "\"new", "Flar()\"", ";", "String", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "{", "\"xxx\"", ",", "\"\\\"\\\"\"", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"Flar(\"", ",", "\"aaa\"", ",", "\"aaa:", "__,", "\"", ",", "expectedChoices", ")", ";", "}", "public", "void", "testParamGuessing7", "(", ")", "throws", "Exception", "{", "create", "(", "\"p\"", ",", "\"Flar\"", ",", "\"package", "pn\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"", "Date", "cccn\"", "+", "\"}n\"", ")", ";", "String", "contents", "=", "\"\"", "+", "\"Closure", "xxxn\"", "+", "\"int", "yyyn\"", "+", "\"boolean", "zzzn\"", "+", "\"new", "Flar()\"", ";", "String", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "{", "\"xxx\"", ",", "\"{", "}\"", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"Flar(\"", ",", "\"aaa\"", ",", "\"aaa:", "__,", "\"", ",", "expectedChoices", ")", ";", "}", "}", "</s>" ]
5,948
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "InnerTypeCompletionTests", "extends", "CompletionTestCase", "{", "private", "static", "final", "String", "XXX", "=", "\"xxx\"", ";", "private", "static", "final", "String", "HTML", "=", "\"HTML\"", ";", "private", "static", "final", "String", "HTML_PROPOSAL", "=", "\"\"", ";", "public", "InnerTypeCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testCompletionInInnerClass1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionInInnerClass2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionInInnerClass3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionInInnerClass4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "HTML", ")", ")", ";", "proposalExists", "(", "proposals", ",", "HTML_PROPOSAL", ",", "1", ")", ";", "}", "public", "void", "testCompletionOfInnerClass1", "(", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "public", "void", "testCompletionOfInnerClass2", "(", ")", "throws", "Exception", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "public", "void", "testCompletionOFInnerMember1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "XXX", ")", ")", ";", "proposalExists", "(", "proposals", ",", "XXX", ",", "1", ")", ";", "}", "public", "void", "testCompletionOFInnerMember2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "XXX", ")", ")", ";", "proposalExists", "(", "proposals", ",", "XXX", ",", "1", ")", ";", "}", "public", "void", "testCompletionOFInnerMember3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "XXX", ")", ")", ";", "proposalExists", "(", "proposals", ",", "XXX", ",", "1", ")", ";", "}", "public", "void", "testCompletionOFInnerMember4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "XXX", ")", ")", ";", "proposalExists", "(", "proposals", ",", "XXX", ",", "1", ")", ";", "}", "public", "void", "testCompletionOFInnerMember5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "XXX", ")", ")", ";", "proposalExists", "(", "proposals", ",", "XXX", ",", "1", ")", ";", "}", "public", "void", "testCompletionOFInnerMember6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "XXX", ")", ")", ";", "proposalExists", "(", "proposals", ",", "XXX", ",", "1", ")", ";", "}", "}", "</s>" ]
5,949
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "public", "class", "GenericCompletionTests", "extends", "CompletionTestCase", "{", "public", "GenericCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testAfterArrayAccesses1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"['foo'].c\"", ")", ",", "\"clear()\"", ")", ";", "}", "public", "void", "testAfterArrayAccesses2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"['foo'].\"", ")", ",", "\"clear()\"", ")", ";", "}", "public", "void", "testAfterMultipleArrayAccesses1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "\"time\"", ")", ";", "}", "public", "void", "testAfterMultipleArrayAccesses2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "\"time\"", ")", ";", "}", "}", "</s>" ]
5,950
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "NewFieldCompletionTests", "extends", "CompletionTestCase", "{", "public", "NewFieldCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testNewFieldSimple", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"str\"", ")", ",", "\"\"", ")", ";", "}", "public", "void", "testNewField1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", ";", "checkProposalApplication", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "new", "String", "[", "]", "{", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", "}", ",", "new", "String", "[", "]", "{", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", "}", ")", ";", "}", "public", "void", "testNewField2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "checkProposalApplication", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "new", "String", "[", "]", "{", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", "}", ",", "new", "String", "[", "]", "{", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", "}", ")", ";", "}", "public", "void", "testNewField3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "checkProposalApplication", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "new", "String", "[", "]", "{", "\"\"", ",", "}", ",", "new", "String", "[", "]", "{", "\"\"", ",", "}", ")", ";", "}", "public", "void", "testNewField4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", ";", "checkProposalApplication", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "new", "String", "[", "]", "{", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", "}", ",", "new", "String", "[", "]", "{", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", "}", ")", ";", "}", "public", "void", "testNewField5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "checkProposalApplication", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "new", "String", "[", "]", "{", "\"\"", ",", "}", ",", "new", "String", "[", "]", "{", "\"\"", ",", "}", ")", ";", "}", "public", "void", "testNewField6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", ";", "checkProposalApplication", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "new", "String", "[", "]", "{", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", "}", ",", "new", "String", "[", "]", "{", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", "}", ")", ";", "}", "public", "void", "testNewField7", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", ";", "checkProposalApplication", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "new", "String", "[", "]", "{", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", ",", "\"\"", "+", "\"\"", "}", ",", "new", "String", "[", "]", "{", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", "}", ")", ";", "}", "public", "void", "testNoNewField1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"nht\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "0", ")", ";", "}", "public", "void", "testNoNewField2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"n", "\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "0", ")", ";", "}", "}", "</s>" ]
5,951
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "eclipse", ".", "ui", ".", "plugin", ".", "AbstractUIPlugin", ";", "import", "org", ".", "osgi", ".", "framework", ".", "BundleContext", ";", "public", "class", "CompletionTestsPlugin", "extends", "AbstractUIPlugin", "{", "public", "CompletionTestsPlugin", "(", ")", "{", "}", "@", "Override", "public", "void", "start", "(", "BundleContext", "context", ")", "throws", "Exception", "{", "super", ".", "start", "(", "context", ")", ";", "}", "@", "Override", "public", "void", "stop", "(", "BundleContext", "context", ")", "throws", "Exception", "{", "super", ".", "stop", "(", "context", ")", ";", "}", "}", "</s>" ]
5,952
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "InferencingCompletionTests", "extends", "CompletionTestCase", "{", "public", "InferencingCompletionTests", "(", ")", "{", "super", "(", "\"\"", ")", ";", "}", "private", "static", "final", "String", "CONTENTS", "=", "\"\"", ";", "private", "static", "final", "String", "CONTENTS_SCRIPT", "=", "\"\"", "+", "\"s.stn\"", "+", "\"\"", "+", "\"\"", "+", "\"", "def", "g()", "{n\"", "+", "\"", "def", "tn\"", "+", "\"", "t", "=", "\\\"\\\"n\"", "+", "\"", "t.stn\"", "+", "\"", "}\"", "+", "\"}\"", ";", "private", "static", "final", "String", "CONTENTS_GETAT1", "=", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"n\"", "+", "\"\"", "+", "\"GetAt", "gn\"", "+", "\"g[0].star\"", ";", "private", "static", "final", "String", "CONTENTS_GETAT2", "=", "\"\"", "+", "\"}n\"", "+", "\"n\"", "+", "\"\"", "+", "\"GetAt", "gn\"", "+", "\"g[0].star\"", ";", "private", "static", "final", "String", "CONTENTS_CLOSURE", "=", "\"\"", ";", "public", "void", "testInferenceOfLocalStringInMethod", "(", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "CONTENTS", ",", "getIndexOf", "(", "CONTENTS", ",", "\"s.st\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"startsWith\"", ",", "2", ")", ";", "}", "public", "void", "testInferenceOfLocalString", "(", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "CONTENTS_SCRIPT", ",", "getIndexOf", "(", "CONTENTS_SCRIPT", ",", "\"s.st\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"startsWith\"", ",", "2", ")", ";", "}", "public", "void", "testInferenceOfLocalString2", "(", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "CONTENTS_SCRIPT", ",", "getIndexOf", "(", "CONTENTS_SCRIPT", ",", "\"0).sub\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"substring\"", ",", "2", ")", ";", "}", "public", "void", "testInferenceOfStringInClass", "(", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "CONTENTS_SCRIPT", ",", "getIndexOf", "(", "CONTENTS_SCRIPT", ",", "\"t.st\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"startsWith\"", ",", "2", ")", ";", "}", "public", "void", "testInferenceInClosure", "(", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "CONTENTS_CLOSURE", ",", "getIndexOf", "(", "CONTENTS_CLOSURE", ",", "\"writer.clos\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"close\"", ",", "1", ")", ";", "}", "public", "void", "testGetAt1", "(", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "CONTENTS_GETAT1", ",", "getIndexOf", "(", "CONTENTS_GETAT1", ",", "\")[0].star\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"startsWith\"", ",", "2", ")", ";", "}", "public", "void", "testGetAt2", "(", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "CONTENTS_GETAT1", ",", "getIndexOf", "(", "CONTENTS_GETAT1", ",", "\"g[0].star\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"startsWith\"", ",", "2", ")", ";", "}", "public", "void", "testGetAt3", "(", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "CONTENTS_GETAT2", ",", "getIndexOf", "(", "CONTENTS_GETAT2", ",", "\")[0].star\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"startsWith\"", ",", "0", ")", ";", "}", "public", "void", "testGetAt4", "(", ")", "throws", "Exception", "{", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "CONTENTS_GETAT2", ",", "getIndexOf", "(", "CONTENTS_GETAT2", ",", "\"g[0].star\"", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"startsWith\"", ",", "0", ")", ";", "}", "}", "</s>" ]
5,953
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "ContentAssistLocation", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Document", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IDocument", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "ContextInformationTests", "extends", "CompletionTestCase", "{", "public", "ContextInformationTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testMethodContext1", "(", ")", "throws", "Exception", "{", "create", "(", "\"Other\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"meth(\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertContextInformation", "(", "\"meth\"", ",", "2", ",", "proposals", ",", "contents", ")", ";", "}", "public", "void", "testMethodContext2", "(", ")", "throws", "Exception", "{", "create", "(", "\"Other\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"meth(\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertContextInformation", "(", "\"meth\"", ",", "3", ",", "proposals", ",", "contents", ")", ";", "}", "public", "void", "testMethodContext3", "(", ")", "throws", "Exception", "{", "create", "(", "\"Other\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"meth(\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertContextInformation", "(", "\"meth\"", ",", "3", ",", "proposals", ",", "contents", ")", ";", "}", "public", "void", "testMethodContext4", "(", ")", "throws", "Exception", "{", "create", "(", "\"Other\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "unit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"meth(a,\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertContextInformation", "(", "\"meth\"", ",", "3", ",", "proposals", ",", "contents", ")", ";", "}", "public", "void", "testConstructorContext1", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "create", "(", "\"Other\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "performDummySearch", "(", "unit", ")", ";", "String", "contents", "=", "\"new", "Other()\"", ";", "unit", "=", "create", "(", "contents", ")", ";", "performDummySearch", "(", "unit", ")", ";", "unit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"Other(\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertContextInformation", "(", "\"Other\"", ",", "2", ",", "proposals", ",", "contents", ")", ";", "}", "public", "void", "testConstructorContext1a", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "create", "(", "\"p\"", ",", "\"Other\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "performDummySearch", "(", "unit", ")", ";", "String", "contents", "=", "\"\"", ";", "unit", "=", "create", "(", "contents", ")", ";", "performDummySearch", "(", "unit", ")", ";", "unit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"Other(\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertContextInformation", "(", "\"Other\"", ",", "2", ",", "proposals", ",", "contents", ")", ";", "}", "public", "void", "testConstructorContext1b", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "create", "(", "\"p\"", ",", "\"Other\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "performDummySearch", "(", "unit", ")", ";", "String", "contents", "=", "\"\"", ";", "unit", "=", "create", "(", "contents", ")", ";", "performDummySearch", "(", "unit", ")", ";", "unit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"Other(\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertContextInformation", "(", "\"Other\"", ",", "2", ",", "proposals", ",", "contents", ")", ";", "}", "public", "void", "testConstructorContext2", "(", ")", "throws", "Exception", "{", "create", "(", "\"Other\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"new", "Other(a)\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "unit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"Other(\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertContextInformation", "(", "\"Other\"", ",", "2", ",", "proposals", ",", "contents", ")", ";", "}", "public", "void", "testConstructorContext3", "(", ")", "throws", "Exception", "{", "create", "(", "\"Other\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "unit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"Other(a,\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertContextInformation", "(", "\"Other\"", ",", "2", ",", "proposals", ",", "contents", ")", ";", "}", "public", "void", "testConstructorContext4", "(", ")", "throws", "Exception", "{", "create", "(", "\"Other\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"new", "Super()\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "performDummySearch", "(", "unit", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"Super(\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertContextInformation", "(", "\"Super\"", ",", "2", ",", "proposals", ",", "contents", ")", ";", "}", "private", "void", "assertContextInformation", "(", "String", "proposalName", ",", "int", "cnt", ",", "ICompletionProposal", "[", "]", "proposals", ",", "String", "contents", ")", "{", "if", "(", "cnt", "!=", "proposals", ".", "length", ")", "{", "fail", "(", "\"Expected", "\"", "+", "cnt", "+", "\"\"", "+", "proposals", ".", "length", "+", "\"nin:n\"", "+", "printProposals", "(", "proposals", ")", ")", ";", "}", "IDocument", "doc", "=", "new", "Document", "(", "contents", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "proposals", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "proposals", "[", "i", "]", ".", "getDisplayString", "(", ")", ".", "startsWith", "(", "proposalName", ")", ")", "{", "fail", "(", "\"\"", "+", "cnt", "+", "\"\"", "+", "printProposals", "(", "proposals", ")", ")", ";", "}", "if", "(", "proposals", "[", "i", "]", ".", "getContextInformation", "(", ")", "==", "null", ")", "{", "fail", "(", "\"\"", "+", "cnt", "+", "\"\"", "+", "printProposals", "(", "proposals", ")", ")", ";", "}", "proposals", "[", "i", "]", ".", "apply", "(", "doc", ")", ";", "assertEquals", "(", "\"\"", ",", "contents", ",", "doc", ".", "get", "(", ")", ")", ";", "}", "}", "}", "</s>" ]
5,954
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completion", ".", "mock", ".", "MockProposalFilter1", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completion", ".", "mock", ".", "MockProposalFilter2", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completion", ".", "mock", ".", "MockProposalProvider1", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completion", ".", "mock", ".", "MockProposalProvider2", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "processors", ".", "IProposalFilter", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "processors", ".", "IProposalProvider", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "ui", ".", "Extender1", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "ui", ".", "Extender2", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "public", "class", "ProposalProviderAndFilterTests", "extends", "CompletionTestCase", "{", "public", "ProposalProviderAndFilterTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "createGenericProject", "(", ")", ";", "env", ".", "addNature", "(", "\"Project\"", ",", "Extender2", ".", "NATURE2", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "MockProposalFilter1", ".", "reset", "(", ")", ";", "MockProposalFilter2", ".", "reset", "(", ")", ";", "MockProposalProvider1", ".", "reset", "(", ")", ";", "MockProposalProvider2", ".", "reset", "(", ")", ";", "}", "public", "void", "testProvidersAndFilters1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"println", "th\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "fullBuild", "(", ")", ";", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"", "th\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertFalse", "(", "\"\"", ",", "MockProposalProvider1", ".", "wasProviderCalled", "(", ")", ")", ";", "assertFalse", "(", "\"\"", ",", "MockProposalFilter1", ".", "wasFilterCalled", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "MockProposalProvider2", ".", "wasProviderCalled", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "MockProposalFilter2", ".", "wasFilterCalled", "(", ")", ")", ";", "}", "public", "void", "testProvidersAndFilters2", "(", ")", "throws", "Exception", "{", "env", ".", "addNature", "(", "\"Project\"", ",", "Extender1", ".", "NATURE1", ")", ";", "String", "contents", "=", "\"println", "th\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "fullBuild", "(", ")", ";", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"", "th\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "assertTrue", "(", "\"\"", ",", "MockProposalProvider1", ".", "wasProviderCalled", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "MockProposalFilter1", ".", "wasFilterCalled", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "MockProposalProvider2", ".", "wasProviderCalled", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "MockProposalFilter2", ".", "wasFilterCalled", "(", ")", ")", ";", "}", "}", "</s>" ]
5,955
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "StaticImportsCompletionTests", "extends", "CompletionTestCase", "{", "public", "StaticImportsCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testStaticImportField", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "fullBuild", "(", ")", ";", "expectingNoProblems", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testStaticImportMethod", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "fullBuild", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testStaticStarImportField", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "fullBuild", "(", ")", ";", "expectingNoProblems", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "public", "void", "testStaticStarImportMethod", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "fullBuild", "(", ")", ";", "expectingNoProblems", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"\"", ",", "1", ")", ";", "}", "}", "</s>" ]
5,956
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyCompilationUnit", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "LocalVariableCompletionTests", "extends", "CompletionTestCase", "{", "private", "static", "final", "String", "CONTENTS", "=", "\"\"", ";", "private", "static", "final", "String", "SCRIPTCONTENTS", "=", "\"\"", ";", "private", "static", "final", "String", "SCRIPTCONTENTS2", "=", "\"\"", ";", "private", "static", "final", "String", "SELFREFERENCINGSCRIPT", "=", "\"\"", ";", "public", "LocalVariableCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testLocalVarsInJavaFile", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createJava", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\"yn\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"xx\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"y\"", ",", "0", ")", ";", "}", "public", "void", "testLocalVarsInGroovyFile", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\"yn\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"xx\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"y\"", ",", "0", ")", ";", "}", "public", "void", "testLocalVarsInScript", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovyForScript", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"}n\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"xx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"y\"", ",", "1", ")", ";", "}", "public", "void", "testLocalVarsInClosureInScript", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovyForScript", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"print", "tn\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"xx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"y\"", ",", "1", ")", ";", "}", "public", "void", "testLocalVarsInClosureInScript2", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovyForScript2", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS2", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"xx\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"y\"", ",", "0", ")", ";", "}", "public", "void", "testLocalVarsInClosureInMethod", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\"print", "tn\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"xxx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"xx\"", ",", "1", ")", ";", "proposalExists", "(", "proposals", ",", "\"y\"", ",", "1", ")", ";", "}", "public", "void", "testSelfReferencingLocalVar", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovyForSelfReferencingScript", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "SELFREFERENCINGSCRIPT", ",", "\"xx.\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"abs\"", ",", "1", ")", ";", "}", "public", "void", "testClsoureVar1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"{", "o\"", ")", ",", "\"owner\"", ")", ";", "}", "public", "void", "testClsoureVar2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"{", "d\"", ")", ",", "\"delegate\"", ")", ";", "}", "public", "void", "testClsoureVar3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"{", "getO\"", ")", ",", "\"getOwner\"", ")", ";", "}", "public", "void", "testClsoureVar4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"{", "getD\"", ")", ",", "\"getDelegate\"", ")", ";", "}", "public", "void", "testClsoureVar4a", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "String", "expected", "=", "\"\"", ";", "checkProposalApplicationNonType", "(", "contents", ",", "expected", ",", "getIndexOf", "(", "contents", ",", "\"{", "thisO\"", ")", ",", "\"thisObject\"", ")", ";", "}", "public", "void", "testClsoureVar5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"ondnge\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"o\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"owner\"", ",", "0", ")", ";", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"d\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"delegate\"", ",", "0", ")", ";", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"ge\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"getDelegate\"", ",", "0", ")", ";", "proposalExists", "(", "proposals", ",", "\"getOwner\"", ",", "0", ")", ";", "}", "private", "ICompilationUnit", "createJava", "(", ")", "throws", "Exception", "{", "IPath", "projectPath", "=", "createGenericProject", "(", ")", ";", "IPath", "src", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "IPath", "pathToJavaClass", "=", "env", ".", "addClass", "(", "src", ",", "\"LocalsClass\"", ",", "CONTENTS", ")", ";", "incrementalBuild", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToJavaClass", ")", ";", "return", "unit", ";", "}", "private", "ICompilationUnit", "createGroovy", "(", ")", "throws", "Exception", "{", "IPath", "projectPath", "=", "createGenericProject", "(", ")", ";", "IPath", "src", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "IPath", "pathToJavaClass", "=", "env", ".", "addGroovyClass", "(", "src", ",", "\"LocalsClass\"", ",", "CONTENTS", ")", ";", "incrementalBuild", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToJavaClass", ")", ";", "return", "unit", ";", "}", "private", "ICompilationUnit", "createGroovyForScript", "(", ")", "throws", "Exception", "{", "IPath", "projectPath", "=", "createGenericProject", "(", ")", ";", "IPath", "src", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "IPath", "pathToJavaClass", "=", "env", ".", "addGroovyClass", "(", "src", ",", "\"LocalsScript\"", ",", "SCRIPTCONTENTS", ")", ";", "incrementalBuild", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToJavaClass", ")", ";", "return", "unit", ";", "}", "private", "ICompilationUnit", "createGroovyForScript2", "(", ")", "throws", "Exception", "{", "IPath", "projectPath", "=", "createGenericProject", "(", ")", ";", "IPath", "src", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "IPath", "pathToJavaClass", "=", "env", ".", "addGroovyClass", "(", "src", ",", "\"\"", ",", "SCRIPTCONTENTS2", ")", ";", "incrementalBuild", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToJavaClass", ")", ";", "return", "unit", ";", "}", "private", "ICompilationUnit", "createGroovyForSelfReferencingScript", "(", ")", "throws", "Exception", "{", "IPath", "projectPath", "=", "createGenericProject", "(", ")", ";", "IPath", "src", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "IPath", "pathToJavaClass", "=", "env", ".", "addGroovyClass", "(", "src", ",", "\"\"", ",", "SELFREFERENCINGSCRIPT", ")", ";", "incrementalBuild", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToJavaClass", ")", ";", "return", "unit", ";", "}", "}", "</s>" ]
5,957
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "DefaultMethodContentAssistTests", "extends", "CompletionTestCase", "{", "public", "DefaultMethodContentAssistTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testDefaultMethods1", "(", ")", "throws", "Exception", "{", "create", "(", "\"Default\"", ",", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "contents", ".", "lastIndexOf", "(", "'e'", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"meth\"", ",", "3", ")", ";", "}", "public", "void", "testDefaultMethods2", "(", ")", "throws", "Exception", "{", "create", "(", "\"Default\"", ",", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}\"", ")", ";", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "createProposalsAtOffset", "(", "contents", ",", "contents", ".", "lastIndexOf", "(", "'e'", ")", ")", ";", "proposalExists", "(", "proposals", ",", "\"meth\"", ",", "4", ")", ";", "}", "}", "</s>" ]
5,958
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "ContentAssistContext", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "ContentAssistLocation", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyCompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Document", ";", "public", "class", "ContentAssistLocationTests", "extends", "CompletionTestCase", "{", "public", "ContentAssistLocationTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testStatement1", "(", ")", "throws", "Exception", "{", "assertLocation", "(", "\"\"", ",", "0", ",", "ContentAssistLocation", ".", "SCRIPT", ")", ";", "}", "public", "void", "testStatement2", "(", ")", "throws", "Exception", "{", "assertLocation", "(", "\"a\"", ",", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"a.g()\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\")\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\")\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement5", "(", ")", "throws", "Exception", "{", "assertLocation", "(", "\"an\"", ",", "2", ",", "ContentAssistLocation", ".", "SCRIPT", ")", ";", "}", "public", "void", "testStatement6", "(", ")", "throws", "Exception", "{", "assertLocation", "(", "\"ana\"", ",", "3", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement7", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"def", "x", "=", "{", "}\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"{\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement8", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"def", "x()", "{", "}\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"{\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement9", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"}\"", ")", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement10", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"}\"", ")", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement11", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"c\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement12", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"b\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement13", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"a.g", "a,", "b\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"b\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement14", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"a()\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"a\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement15", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"b", "a()\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"a\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement16", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\")\"", ")", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testStatement17", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\")\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testExpression", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"a.g", "a,", "a.b\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"b\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "EXPRESSION", ")", ";", "}", "public", "void", "testMethodContext1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"a.g()\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"(\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"(\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"(\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\",\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\",\"", ")", "+", "2", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext7", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"a.g", "a,", "a.b\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"g\"", ")", "+", "2", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext8", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"a.g", "a,", "a.b\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\",\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext9", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"a.g", "a,", "a.b\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\",\"", ")", "+", "2", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext10", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"(\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext11", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"(\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext12", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\",\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext13", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"(\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext14", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"(\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext15", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\",\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext16", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"foo", "nh\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"foo", "\"", ")", "+", "4", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext17", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"foo", "a,", "nh\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\",", "\"", ")", "+", "2", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext18", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"foo", "a,", "b", "nh\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"b", "\"", ")", "+", "2", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext19", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"b", "\"", ")", "+", "2", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testMethodContext20", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"foo", "(a,", ")nh\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\",", "\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "METHOD_CONTEXT", ")", ";", "}", "public", "void", "testExpression1", "(", ")", "throws", "Exception", "{", "assertLocation", "(", "\"a.a\"", ",", "3", ",", "ContentAssistLocation", ".", "EXPRESSION", ")", ";", "}", "public", "void", "testExpression2", "(", ")", "throws", "Exception", "{", "assertLocation", "(", "\"a.\"", ",", "2", ",", "ContentAssistLocation", ".", "EXPRESSION", ")", ";", "}", "public", "void", "testExpression3", "(", ")", "throws", "Exception", "{", "assertLocation", "(", "\"a.n\"", ",", "3", ",", "ContentAssistLocation", ".", "EXPRESSION", ")", ";", "}", "public", "void", "testExpression4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"a.//", "n\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "length", "(", ")", ",", "ContentAssistLocation", ".", "EXPRESSION", ")", ";", "}", "public", "void", "testExpression5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"a.g(b.)//", "n\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"b.\"", ")", "+", "2", ",", "ContentAssistLocation", ".", "EXPRESSION", ")", ";", "}", "public", "void", "testExpression6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"c\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "EXPRESSION", ")", ";", "}", "public", "void", "testExpression7", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "assertLocation", "(", "contents", ",", "contents", ".", "indexOf", "(", "\"b\"", ")", "+", "1", ",", "ContentAssistLocation", ".", "EXPRESSION", ")", ";", "}", "public", "void", "_testImport1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"import", "\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"import", "\"", ")", "+", "\"import", "\"", ".", "length", "(", ")", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "IMPORT", ")", ";", "}", "public", "void", "testImport2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"import", "T\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"import", "T\"", ")", "+", "\"import", "T\"", ".", "length", "(", ")", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "IMPORT", ")", ";", "}", "public", "void", "_testImport3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"package", "\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"package", "\"", ")", "+", "\"package", "\"", ".", "length", "(", ")", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "IMPORT", ")", ";", "}", "public", "void", "testImport4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"package", "T\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"package", "T\"", ")", "+", "\"package", "T\"", ".", "length", "(", ")", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "PACKAGE", ")", ";", "}", "public", "void", "testClassBody1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"class", "A", "{", "}\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"{\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "CLASS_BODY", ")", ";", "}", "public", "void", "testClassBody2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"t\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "CLASS_BODY", ")", ";", "}", "public", "void", "testClassBody3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"t\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "CLASS_BODY", ")", ";", "}", "public", "void", "testClassBody4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"ds\"", ")", "+", "4", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "EXTENDS", ")", ";", "}", "public", "void", "testClassBody5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"Arr\"", ")", "+", "3", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "EXTENDS", ")", ";", "}", "public", "void", "testClassBody6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"ents", "\"", ")", "+", "6", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "IMPLEMENTS", ")", ";", "}", "public", "void", "testClassBody7", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"", "Li\"", ")", "+", "3", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "IMPLEMENTS", ")", ";", "}", "public", "void", "testClassBody8", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"", "Li\"", ")", "+", "3", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "IMPLEMENTS", ")", ";", "}", "public", "void", "testClassBody9", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"n\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "CLASS_BODY", ")", ";", "}", "public", "void", "testParameters1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"(\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "PARAMETER", ")", ";", "}", "public", "void", "testParameters2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"(v\"", ")", "+", "2", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "PARAMETER", ")", ";", "}", "public", "void", "testParameters3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"(v", "y\"", ")", "+", "4", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "PARAMETER", ")", ";", "}", "public", "void", "testParameters4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"=\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testParameters5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"hh\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "STATEMENT", ")", ";", "}", "public", "void", "testParameters6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"v\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "PARAMETER", ")", ";", "}", "public", "void", "testParameters7", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"v\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "PARAMETER", ")", ";", "}", "public", "void", "testParameters8", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"y\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "PARAMETER", ")", ";", "}", "public", "void", "testExceptions1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"Ex\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "EXCEPTIONS", ")", ";", "}", "public", "void", "testExceptions2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"ws", "\"", ")", "+", "4", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "EXCEPTIONS", ")", ";", "}", "public", "void", "testExceptions3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\",", "\"", ")", "+", "3", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "EXCEPTIONS", ")", ";", "}", "public", "void", "testExceptions4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"Th\"", ")", "+", "2", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "EXCEPTIONS", ")", ";", "}", "public", "void", "_testAnnotation1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"@\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "ANNOTATION", ")", ";", "}", "public", "void", "testAnnotation2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"@A\"", ")", "+", "2", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "ANNOTATION", ")", ";", "}", "public", "void", "testAnnotation2a", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"@A\"", ")", "+", "2", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "ANNOTATION", ")", ";", "}", "public", "void", "testAnnotation2b", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"@A\"", ")", "+", "2", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "ANNOTATION", ")", ";", "}", "public", "void", "_testAnnotation2d", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"@\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "ANNOTATION", ")", ";", "}", "public", "void", "_testAnnotation3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"@\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "ANNOTATION", ")", ";", "}", "public", "void", "testAnnotation4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"@A\"", ")", "+", "2", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "ANNOTATION", ")", ";", "}", "public", "void", "_testAnnotation5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"@\"", ")", "+", "1", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "ANNOTATION", ")", ";", "}", "public", "void", "testAnnotation6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"@A\"", ")", "+", "2", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "ANNOTATION", ")", ";", "}", "public", "void", "testAnnotation7", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "int", "loc", "=", "contents", ".", "indexOf", "(", "\"@A\"", ")", "+", "2", ";", "assertLocation", "(", "contents", ",", "loc", ",", "ContentAssistLocation", ".", "ANNOTATION", ")", ";", "}", "void", "assertLocation", "(", "String", "contents", ",", "int", "offset", ",", "ContentAssistLocation", "location", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "GroovyCompletionProposalComputer", "computer", "=", "new", "GroovyCompletionProposalComputer", "(", ")", ";", "ContentAssistContext", "context", "=", "computer", ".", "createContentAssistContext", "(", "(", "GroovyCompilationUnit", ")", "unit", ",", "offset", ",", "new", "Document", "(", "unit", ".", "getBuffer", "(", ")", ".", "getContents", "(", ")", ")", ")", ";", "assertEquals", "(", "\"\"", "+", "offset", "+", "\"", "in", "text:n\"", "+", "contents", ",", "location", ",", "context", ".", "location", ")", ";", "}", "}", "</s>" ]
5,959
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ClassNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "MethodNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "expr", ".", "Expression", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ExpressionStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "ReturnStatement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "stmt", ".", "Statement", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "proposals", ".", "GroovyMethodProposal", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "SynchronizationUtils", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyCompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "MethodCompletionTests", "extends", "CompletionTestCase", "{", "private", "class", "MockGroovyMethodProposal", "extends", "GroovyMethodProposal", "{", "public", "MockGroovyMethodProposal", "(", "MethodNode", "method", ")", "{", "super", "(", "method", ")", ";", "}", "@", "Override", "protected", "char", "[", "]", "[", "]", "createAllParameterNames", "(", "ICompilationUnit", "unit", ")", "{", "return", "super", ".", "createAllParameterNames", "(", "unit", ")", ";", "}", "}", "public", "MethodCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "env", ".", "setAutoBuilding", "(", "true", ")", ";", "}", "public", "void", "testAfterParens1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"f().\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"cause\"", ",", "1", ")", ";", "}", "public", "void", "testAfterParens2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"f().\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"cause\"", ",", "1", ")", ";", "}", "public", "void", "testAfterParens3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"f().\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"cause\"", ",", "1", ")", ";", "}", "public", "void", "testAfterParens4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"f().\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"cause\"", ",", "1", ")", ";", "}", "public", "void", "testAfterParens5", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"f(null).\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"cause\"", ",", "1", ")", ";", "}", "public", "void", "testAfterParens6", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"f().\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"cause\"", ",", "1", ")", ";", "}", "public", "void", "testParameterNames1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ClassNode", "clazz", "=", "extract", "(", "(", "GroovyCompilationUnit", ")", "unit", ")", ";", "List", "<", "MethodNode", ">", "methods", "=", "clazz", ".", "getMethods", "(", "\"is\"", ")", ";", "for", "(", "MethodNode", "method", ":", "methods", ")", "{", "if", "(", "method", ".", "getParameters", "(", ")", ".", "length", "==", "2", ")", "{", "MockGroovyMethodProposal", "proposal", "=", "new", "MockGroovyMethodProposal", "(", "method", ")", ";", "char", "[", "]", "[", "]", "names", "=", "proposal", ".", "createAllParameterNames", "(", "unit", ")", ";", "checkNames", "(", "new", "char", "[", "]", "[", "]", "{", "\"self\"", ".", "toCharArray", "(", ")", ",", "\"other\"", ".", "toCharArray", "(", ")", "}", ",", "names", ")", ";", "}", "}", "if", "(", "methods", ".", "size", "(", ")", "!=", "1", ")", "{", "fail", "(", "\"\"", "+", "methods", ".", "size", "(", ")", "+", "\":n\"", "+", "methods", ")", ";", "}", "}", "public", "void", "testParameterNames2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ClassNode", "clazz", "=", "extract", "(", "(", "GroovyCompilationUnit", ")", "unit", ")", ";", "List", "<", "MethodNode", ">", "methods", "=", "clazz", ".", "getMethods", "(", "\"m\"", ")", ";", "for", "(", "MethodNode", "method", ":", "methods", ")", "{", "if", "(", "method", ".", "getParameters", "(", ")", ".", "length", "==", "1", ")", "{", "MockGroovyMethodProposal", "proposal", "=", "new", "MockGroovyMethodProposal", "(", "method", ")", ";", "char", "[", "]", "[", "]", "names", "=", "proposal", ".", "createAllParameterNames", "(", "unit", ")", ";", "checkNames", "(", "new", "char", "[", "]", "[", "]", "{", "\"x\"", ".", "toCharArray", "(", ")", "}", ",", "names", ")", ";", "}", "if", "(", "method", ".", "getParameters", "(", ")", ".", "length", "==", "2", ")", "{", "MockGroovyMethodProposal", "proposal", "=", "new", "MockGroovyMethodProposal", "(", "method", ")", ";", "char", "[", "]", "[", "]", "names", "=", "proposal", ".", "createAllParameterNames", "(", "unit", ")", ";", "checkNames", "(", "new", "char", "[", "]", "[", "]", "{", "\"x\"", ".", "toCharArray", "(", ")", ",", "\"y\"", ".", "toCharArray", "(", ")", "}", ",", "names", ")", ";", "}", "}", "if", "(", "methods", ".", "size", "(", ")", "!=", "2", ")", "{", "fail", "(", "\"\"", "+", "methods", ".", "size", "(", ")", "+", "\":n\"", "+", "methods", ")", ";", "}", "}", "public", "void", "testParameterNames3", "(", ")", "throws", "Exception", "{", "env", ".", "setAutoBuilding", "(", "false", ")", ";", "String", "contents", "=", "\"\"", ";", "create", "(", "contents", ")", ";", "GroovyCompilationUnit", "unit", "=", "(", "GroovyCompilationUnit", ")", "create", "(", "\"Other\"", ",", "\"\"", ")", ";", "env", ".", "fullBuild", "(", ")", ";", "expectingNoProblems", "(", ")", ";", "List", "<", "MethodNode", ">", "methods", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "5", ";", "i", "++", ")", "{", "methods", "=", "delegateTestParameterNames", "(", "unit", ")", ";", "if", "(", "methods", ".", "size", "(", ")", "==", "2", ")", "{", "return", ";", "}", "}", "fail", "(", "\"\"", "+", "methods", ".", "size", "(", ")", "+", "\":n\"", "+", "methods", ")", ";", "}", "public", "void", "testParameterNames4", "(", ")", "throws", "Exception", "{", "env", ".", "setAutoBuilding", "(", "false", ")", ";", "ICompilationUnit", "unit", "=", "create", "(", "\"Other\"", ",", "\"\"", ")", ";", "String", "contents", "=", "\"\"", ";", "createJava", "(", "\"MyJavaClass\"", ",", "contents", ")", ";", "env", ".", "fullBuild", "(", ")", ";", "List", "<", "MethodNode", ">", "methods", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "5", ";", "i", "++", ")", "{", "methods", "=", "delegateTestParameterNames", "(", "(", "GroovyCompilationUnit", ")", "unit", ")", ";", "if", "(", "methods", ".", "size", "(", ")", "==", "2", ")", "{", "return", ";", "}", "}", "fail", "(", "\"\"", "+", "methods", ".", "size", "(", ")", "+", "\":n\"", "+", "methods", ")", ";", "}", "public", "void", "testParensExprs1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"(1).ndef", "u\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"(1).\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"abs\"", ",", "1", ")", ";", "}", "public", "void", "testParensExprs2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"(((1))).\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"abs\"", ",", "1", ")", ";", "}", "public", "void", "testParensExprs3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"(((1))).a\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"abs\"", ",", "1", ")", ";", "}", "private", "List", "<", "MethodNode", ">", "delegateTestParameterNames", "(", "GroovyCompilationUnit", "unit", ")", "throws", "Exception", "{", "SynchronizationUtils", ".", "waitForIndexingToComplete", "(", ")", ";", "ClassNode", "clazz", "=", "extract", "(", "unit", ")", ";", "List", "<", "MethodNode", ">", "methods", "=", "clazz", ".", "getMethods", "(", "\"m\"", ")", ";", "for", "(", "MethodNode", "method", ":", "methods", ")", "{", "if", "(", "method", ".", "getParameters", "(", ")", ".", "length", "==", "1", ")", "{", "MockGroovyMethodProposal", "proposal", "=", "new", "MockGroovyMethodProposal", "(", "method", ")", ";", "char", "[", "]", "[", "]", "names", "=", "proposal", ".", "createAllParameterNames", "(", "unit", ")", ";", "checkNames", "(", "new", "char", "[", "]", "[", "]", "{", "\"x\"", ".", "toCharArray", "(", ")", "}", ",", "names", ")", ";", "}", "if", "(", "method", ".", "getParameters", "(", ")", ".", "length", "==", "2", ")", "{", "MockGroovyMethodProposal", "proposal", "=", "new", "MockGroovyMethodProposal", "(", "method", ")", ";", "char", "[", "]", "[", "]", "names", "=", "proposal", ".", "createAllParameterNames", "(", "unit", ")", ";", "checkNames", "(", "new", "char", "[", "]", "[", "]", "{", "\"x\"", ".", "toCharArray", "(", ")", ",", "\"y\"", ".", "toCharArray", "(", ")", "}", ",", "names", ")", ";", "}", "}", "return", "methods", ";", "}", "private", "void", "checkNames", "(", "char", "[", "]", "[", "]", "expected", ",", "char", "[", "]", "[", "]", "names", ")", "{", "if", "(", "!", "CharOperation", ".", "equals", "(", "expected", ",", "names", ")", ")", "{", "fail", "(", "\"\"", "+", "CharOperation", ".", "toString", "(", "expected", ")", "+", "\"\"", "+", "CharOperation", ".", "toString", "(", "names", ")", ")", ";", "}", "}", "private", "ClassNode", "extract", "(", "GroovyCompilationUnit", "unit", ")", "{", "Statement", "state", "=", "(", "Statement", ")", "unit", ".", "getModuleNode", "(", ")", ".", "getStatementBlock", "(", ")", ".", "getStatements", "(", ")", ".", "get", "(", "0", ")", ";", "if", "(", "state", "instanceof", "ReturnStatement", ")", "{", "ReturnStatement", "ret", "=", "(", "ReturnStatement", ")", "state", ";", "return", "(", "(", "Expression", ")", "ret", ".", "getExpression", "(", ")", ")", ".", "getType", "(", ")", ";", "}", "else", "if", "(", "state", "instanceof", "ExpressionStatement", ")", "{", "ExpressionStatement", "expr", "=", "(", "ExpressionStatement", ")", "state", ";", "return", "(", "(", "Expression", ")", "expr", ".", "getExpression", "(", ")", ")", ".", "getType", "(", ")", ";", "}", "else", "{", "fail", "(", "\"\"", "+", "state", "+", "\"\"", ")", ";", "return", "null", ";", "}", "}", "}", "</s>" ]
5,960
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "public", "class", "GuessingCompletionTests", "extends", "CompletionTestCase", "{", "public", "GuessingCompletionTests", "(", ")", "{", "super", "(", "\"\"", ")", ";", "}", "public", "void", "testParamGuessing1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"String", "yyyn\"", "+", "\"\"", "+", "\"xxx\"", ";", "String", "[", "]", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "[", "]", "{", "new", "String", "[", "]", "{", "\"yyy\"", ",", "\"\\\"\\\"\"", "}", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"xxx\"", ",", "\"xxx(yyy)\"", ",", "expectedChoices", ")", ";", "}", "public", "void", "testParamGuessing2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"String", "yyyn\"", "+", "\"int", "zzzn\"", "+", "\"\"", "+", "\"xxx\"", ";", "String", "[", "]", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "[", "]", "{", "new", "String", "[", "]", "{", "\"yyy\"", ",", "\"\\\"\\\"\"", "}", ",", "new", "String", "[", "]", "{", "\"zzz\"", ",", "\"0\"", "}", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"xxx\"", ",", "\"\"", ",", "expectedChoices", ")", ";", "}", "public", "void", "testParamGuessing3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"String", "yyyn\"", "+", "\"Integer", "zzzn\"", "+", "\"boolean", "aaan\"", "+", "\"\"", "+", "\"xxx\"", ";", "String", "[", "]", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "[", "]", "{", "new", "String", "[", "]", "{", "\"yyy\"", ",", "\"\\\"\\\"\"", "}", ",", "new", "String", "[", "]", "{", "\"zzz\"", ",", "\"0\"", "}", ",", "new", "String", "[", "]", "{", "\"aaa\"", ",", "\"false\"", ",", "\"true\"", "}", "}", ";", "checkProposalChoices", "(", "contents", ",", "\"xxx\"", ",", "\"\"", ",", "expectedChoices", ")", ";", "}", "public", "void", "testParamGuessing4", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"Closure", "yyyn\"", "+", "\"\"", "+", "\"\"", "+", "\"xxx\"", ";", "String", "[", "]", "[", "]", "expectedChoices", "=", "new", "String", "[", "]", "[", "]", "{", "new", "String", "[", "]", "{", "\"zzz\"", ",", "\"yyy\"", ",", "\"{", "}\"", "}", "}", ";", "try", "{", "checkProposalChoices", "(", "contents", ",", "\"xxx\"", ",", "\"xxx", "{\"", ",", "expectedChoices", ")", ";", "}", "catch", "(", "AssertionError", "e", ")", "{", "try", "{", "checkProposalChoices", "(", "contents", ",", "\"xxx\"", ",", "\"xxx", "zzz\"", ",", "expectedChoices", ")", ";", "}", "catch", "(", "AssertionError", "e2", ")", "{", "checkProposalChoices", "(", "contents", ",", "\"xxx\"", ",", "\"xxx", "yyy\"", ",", "expectedChoices", ")", ";", "}", "}", "}", "}", "</s>" ]
5,961
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "tests", ".", "util", ".", "GroovyUtils", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "CommandChainCompletionTests", "extends", "CompletionTestCase", "{", "public", "CommandChainCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "private", "final", "String", "INITIAL_CONTENTS", "=", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"\"", "+", "\"}n\"", "+", "\"\"", ";", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "env", ".", "setAutoBuilding", "(", "true", ")", ";", "}", "public", "void", "testCommandChain1", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "INITIAL_CONTENTS", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"sec\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"second\"", ",", "1", ")", ";", "}", "public", "void", "testCommandChain2", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "INITIAL_CONTENTS", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"sec\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"second\"", ",", "1", ")", ";", "}", "public", "void", "testCommandChain3", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "INITIAL_CONTENTS", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"aFi\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"aField\"", ",", "1", ")", ";", "}", "public", "void", "testCommandChain4", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "INITIAL_CONTENTS", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"sec\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"second\"", ",", "1", ")", ";", "}", "public", "void", "testCommandChain5", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "INITIAL_CONTENTS", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"sec\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"second\"", ",", "1", ")", ";", "}", "public", "void", "testCommandChain6", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "INITIAL_CONTENTS", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"sec\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"second\"", ",", "1", ")", ";", "}", "public", "void", "testNoCommandChain1", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "INITIAL_CONTENTS", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"sec\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"second\"", ",", "0", ")", ";", "}", "public", "void", "testNoCommandChain2", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "INITIAL_CONTENTS", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"sec\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"second\"", ",", "0", ")", ";", "}", "public", "void", "testNoCommandChain3", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "INITIAL_CONTENTS", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"sec\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"second\"", ",", "0", ")", ";", "}", "public", "void", "testNoCommandChain4", "(", ")", "throws", "Exception", "{", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", "<", "18", ")", "{", "return", ";", "}", "String", "contents", "=", "INITIAL_CONTENTS", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "create", "(", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getLastIndexOf", "(", "contents", ",", "\"sec\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"second\"", ",", "0", ")", ";", "}", "}", "</s>" ]
5,962
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "GroovyContentAssistActivator", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "completions", ".", "GroovyJavaMethodCompletionProposal", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "requestor", ".", "GroovyCompletionProposalComputer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "tests", ".", "util", ".", "GroovyUtils", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "DefaultGroovyMethodCompletionTests", "extends", "CompletionTestCase", "{", "private", "static", "final", "String", "CONTENTS", "=", "\"\"", ";", "private", "static", "final", "String", "SCRIPTCONTENTS", "=", "\"\"", ";", "private", "static", "final", "String", "CLOSURECONTENTS", "=", "\"\"", ";", "private", "static", "final", "String", "LISTCONTENTS", "=", "\"[].findA\"", ";", "public", "DefaultGroovyMethodCompletionTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "void", "testDGMInJavaFile", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createJava", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\"this.\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "0", ")", ";", "}", "public", "void", "testDGMInMethodScope", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\"this.\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "1", ")", ";", "}", "public", "void", "testDGMInMethodScopeFromOther", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "1", ")", ";", "}", "public", "void", "testDGMInConstructorScope", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\"Class()", "{n\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "1", ")", ";", "}", "public", "void", "testDGMInScriptScope", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovyForScript", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"n\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "1", ")", ";", "}", "public", "void", "testDGMInScriptOtherClassScope", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovyForScript", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "1", ")", ";", "}", "public", "void", "testDGMInClassScope", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\"Class()", "{", "}\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "0", ")", ";", "}", "public", "void", "testDGMInMethodParamScope", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "0", ")", ";", "}", "public", "void", "testDGMInConstructorParamScope", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\"Class(\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "0", ")", ";", "}", "public", "void", "testDGMInModuleScope", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovy", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CONTENTS", ",", "\";", "}", "}\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "0", ")", ";", "}", "public", "void", "testDGMInClosure", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovyForClosure", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "CLOSURECONTENTS", ",", "\"", "t", "->", "\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"identity\"", ",", "1", ")", ";", "}", "public", "void", "testDGSM", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovyForScript", "(", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "SCRIPTCONTENTS", ",", "\"\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"startDaemon\"", ",", "2", ")", ";", "}", "public", "void", "testPopertyVariantOfDGM", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "createGroovyWithContents", "(", "\"Script\"", ",", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"toURL().t\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"text\"", ",", "1", ")", ";", "}", "public", "void", "testDateGM", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompilationUnit", "unit", "=", "createGroovyWithContents", "(", "\"Script\"", ",", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"toCal\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"toCalendar\"", ",", "1", ")", ";", "}", "public", "void", "testProcessGM", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"Process", "pn\"", "+", "\"p.get\"", ";", "ICompilationUnit", "unit", "=", "createGroovyWithContents", "(", "\"Script\"", ",", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"get\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", ">=", "18", ")", "{", "proposalExists", "(", "proposals", ",", "\"getIn\"", ",", "1", ")", ";", "}", "else", "{", "proposalExists", "(", "proposals", ",", "\"getIn\"", ",", "2", ")", ";", "}", "}", "public", "void", "testXmlGM", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"byte[]", "pn\"", "+", "\"\"", ";", "ICompilationUnit", "unit", "=", "createGroovyWithContents", "(", "\"Script\"", ",", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"encodeBase64\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", ">=", "18", ")", "{", "proposalExists", "(", "proposals", ",", "\"encodeBase64\"", ",", "2", ")", ";", "}", "else", "{", "proposalExists", "(", "proposals", ",", "\"encodeBase64\"", ",", "4", ")", ";", "}", "}", "public", "void", "testEncodingGM", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", "+", "\"p.iterator\"", ";", "ICompilationUnit", "unit", "=", "createGroovyWithContents", "(", "\"Script\"", ",", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"iterator\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "if", "(", "GroovyUtils", ".", "GROOVY_LEVEL", ">=", "18", ")", "{", "proposalExists", "(", "proposals", ",", "\"iterator\"", ",", "1", ")", ";", "}", "else", "{", "proposalExists", "(", "proposals", ",", "\"iterator\"", ",", "2", ")", ";", "}", "}", "public", "void", "testDGMFilter1", "(", ")", "throws", "Exception", "{", "try", "{", "setDGMFilter", "(", "\"inspect\"", ")", ";", "String", "contents", "=", "\"this.insp\"", ";", "ICompilationUnit", "unit", "=", "createGroovyWithContents", "(", "\"Script\"", ",", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"insp\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"inspect\"", ",", "0", ")", ";", "setDGMFilter", "(", ")", ";", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"insp\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"inspect\"", ",", "1", ")", ";", "}", "finally", "{", "setDGMFilter", "(", ")", ";", "}", "}", "public", "void", "testDGMFilter2", "(", ")", "throws", "Exception", "{", "try", "{", "setDGMFilter", "(", "\"inspect\"", ",", "\"each\"", ",", "\"\"", ")", ";", "String", "contents", "=", "\"this.insp\"", ";", "ICompilationUnit", "unit", "=", "createGroovyWithContents", "(", "\"Script\"", ",", "contents", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"insp\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"inspect\"", ",", "0", ")", ";", "setDGMFilter", "(", ")", ";", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "contents", ",", "\"insp\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"inspect\"", ",", "1", ")", ";", "}", "finally", "{", "setDGMFilter", "(", ")", ";", "}", "}", "public", "void", "testNoDups", "(", ")", "throws", "Exception", "{", "ICompilationUnit", "unit", "=", "createGroovyWithContents", "(", "\"Script\"", ",", "LISTCONTENTS", ")", ";", "ICompletionProposal", "[", "]", "proposals", "=", "performContentAssist", "(", "unit", ",", "getIndexOf", "(", "LISTCONTENTS", ",", "\"findA\"", ")", ",", "GroovyCompletionProposalComputer", ".", "class", ")", ";", "proposalExists", "(", "proposals", ",", "\"findAll\"", ",", "2", ")", ";", "}", "private", "void", "setDGMFilter", "(", "String", "...", "filter", ")", "{", "GroovyContentAssistActivator", ".", "getDefault", "(", ")", ".", "setFilteredDGMs", "(", "new", "HashSet", "<", "String", ">", "(", "Arrays", ".", "asList", "(", "filter", ")", ")", ")", ";", "}", "private", "ICompilationUnit", "createJava", "(", ")", "throws", "Exception", "{", "IPath", "projectPath", "=", "createGenericProject", "(", ")", ";", "IPath", "src", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "IPath", "pathToJavaClass", "=", "env", ".", "addClass", "(", "src", ",", "\"Class\"", ",", "CONTENTS", ")", ";", "incrementalBuild", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToJavaClass", ")", ";", "return", "unit", ";", "}", "private", "ICompilationUnit", "createGroovy", "(", ")", "throws", "Exception", "{", "return", "createGroovyWithContents", "(", "\"Class\"", ",", "CONTENTS", ")", ";", "}", "private", "ICompilationUnit", "createGroovyForScript", "(", ")", "throws", "Exception", "{", "return", "createGroovyWithContents", "(", "\"Script\"", ",", "SCRIPTCONTENTS", ")", ";", "}", "private", "ICompilationUnit", "createGroovyForClosure", "(", ")", "throws", "Exception", "{", "return", "createGroovyWithContents", "(", "\"Closure\"", ",", "CLOSURECONTENTS", ")", ";", "}", "private", "ICompilationUnit", "createGroovyWithContents", "(", "String", "name", ",", "String", "contents", ")", "throws", "Exception", "{", "IPath", "projectPath", "=", "createGenericProject", "(", ")", ";", "IPath", "src", "=", "projectPath", ".", "append", "(", "\"src\"", ")", ";", "IPath", "pathToJavaClass", "=", "env", ".", "addGroovyClass", "(", "src", ",", "name", ",", "contents", ")", ";", "incrementalBuild", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", "pathToJavaClass", ")", ";", "return", "unit", ";", "}", "}", "</s>" ]
5,963
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codeassist", ".", "tests", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "contentassist", ".", "ICompletionProposal", ";", "public", "class", "RelevanceTests", "extends", "CompletionTestCase", "{", "public", "RelevanceTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "private", "static", "String", "NEWLINE", "=", "\"n", "\"", ";", "private", "static", "String", "THIS_TO", "=", "\"this.to\"", ";", "private", "static", "String", "PU", "=", "\"pu\"", ";", "public", "void", "testParamThenFieldThenMethodThenDGM", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "NEWLINE", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"p\"", ",", "\"f\"", ",", "\"getF\"", ",", "\"m\"", ",", "\"find\"", ")", ";", "}", "public", "void", "testLocalVarThenFieldThenMethodThenDGM", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "NEWLINE", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"p\"", ",", "\"f\"", ",", "\"getF\"", ",", "\"m\"", ",", "\"find\"", ")", ";", "}", "public", "void", "testObjectMethods", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "THIS_TO", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"toZZZ\"", ",", "\"toString\"", ")", ";", "}", "public", "void", "testOverriddenObjectMethods", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "THIS_TO", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"toString\"", ",", "\"toZZZ\"", ")", ";", "}", "public", "void", "testNewMethodThenModifier", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "PU", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"pub\"", ",", "\"public\"", ")", ";", "}", "public", "void", "testFieldOfAssignedType1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "=", "a\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"aa\"", ",", "\"az\"", ")", ";", "}", "public", "void", "testFieldOfAssignedType2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "=", "a\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"az\"", ",", "\"aa\"", ")", ";", "}", "public", "void", "testFieldOfAssignedType3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "=", "a\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"az\"", ",", "\"aa\"", ")", ";", "}", "public", "void", "testMethodOfAssignedType1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "=", "a\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"aa\"", ",", "\"az\"", ")", ";", "}", "public", "void", "testMethodOfAssignedType2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "=", "a\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"az\"", ",", "\"aa\"", ")", ";", "}", "public", "void", "testMethodOfAssignedType3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "=", "a\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"az\"", ",", "\"aa\"", ")", ";", "}", "public", "void", "testMethodAndFieldOfAssignedType1", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "=", "a\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"aa\"", ",", "\"az\"", ")", ";", "}", "public", "void", "testMethodAndFieldOfAssignedType2", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "=", "a\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"az\"", ",", "\"aa\"", ")", ";", "}", "public", "void", "testMethodAndFieldOfAssignedType3", "(", ")", "throws", "Exception", "{", "String", "contents", "=", "\"\"", ";", "ICompletionProposal", "[", "]", "proposals", "=", "orderByRelevance", "(", "createProposalsAtOffset", "(", "contents", ",", "getIndexOf", "(", "contents", ",", "\"", "=", "a\"", ")", ")", ")", ";", "assertProposalOrdering", "(", "proposals", ",", "\"az\"", ",", "\"aa\"", ")", ";", "}", "}", "</s>" ]
5,964
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Field", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "activator", ".", "GroovyActivator", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "compiler", ".", "CompilerUtils", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "RefactoringTestPlugin", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyNature", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IContainer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFolder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProjectDescription", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IWorkspaceRoot", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IWorkspaceRunnable", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "FileLocator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Status", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "IJavaSearchConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchEngine", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchPattern", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "TypeNameRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "tests", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "JavaPlugin", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "util", ".", "CoreUtility", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Display", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Synchronizer", ";", "import", "org", ".", "eclipse", ".", "ui", ".", "dialogs", ".", "IOverwriteQuery", ";", "import", "org", ".", "osgi", ".", "framework", ".", "Bundle", ";", "public", "class", "JavaProjectHelper", "{", "public", "static", "final", "IPath", "RT_STUBS_13", "=", "new", "Path", "(", "\"\"", ")", ";", "public", "static", "final", "IPath", "JUNIT_SRC", "=", "new", "Path", "(", "\"\"", ")", ";", "public", "static", "final", "IPath", "RT_STUBS_15", "=", "new", "Path", "(", "\"\"", ")", ";", "public", "static", "final", "IPath", "RT_STUBS_16", "=", "new", "Path", "(", "\"\"", ")", ";", "public", "static", "final", "IPath", "JUNIT_SRC_381", "=", "new", "Path", "(", "\"\"", ")", ";", "public", "static", "final", "String", "JUNIT_SRC_ENCODING", "=", "\"ISO-8859-1\"", ";", "public", "static", "final", "IPath", "MYLIB", "=", "new", "Path", "(", "\"\"", ")", ";", "public", "static", "final", "IPath", "MYLIB_STDOUT", "=", "new", "Path", "(", "\"\"", ")", ";", "public", "static", "final", "IPath", "MYLIB_SIG", "=", "new", "Path", "(", "\"\"", ")", ";", "public", "static", "final", "IPath", "NLS_LIB", "=", "new", "Path", "(", "\"\"", ")", ";", "private", "static", "final", "int", "MAX_RETRY", "=", "5", ";", "public", "static", "final", "int", "COUNT_CLASSES_RT_STUBS_15", "=", "661", ";", "public", "static", "final", "int", "COUNT_INTERFACES_RT_STUBS_15", "=", "135", ";", "public", "static", "final", "int", "COUNT_CLASSES_JUNIT_SRC_381", "=", "76", ";", "public", "static", "final", "int", "COUNT_INTERFACES_JUNIT_SRC_381", "=", "8", ";", "public", "static", "final", "int", "COUNT_CLASSES_MYLIB", "=", "3", ";", "private", "static", "final", "boolean", "ASSERT_NO_MIXED_LINE_DELIMIERS", "=", "false", ";", "public", "static", "IJavaProject", "createJavaProject", "(", "String", "projectName", ",", "String", "binFolderName", ")", "throws", "CoreException", "{", "IWorkspaceRoot", "root", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ";", "IProject", "project", "=", "root", ".", "getProject", "(", "projectName", ")", ";", "if", "(", "!", "project", ".", "exists", "(", ")", ")", "{", "project", ".", "create", "(", "null", ")", ";", "}", "else", "{", "project", ".", "refreshLocal", "(", "IResource", ".", "DEPTH_INFINITE", ",", "null", ")", ";", "}", "if", "(", "!", "project", ".", "isOpen", "(", ")", ")", "{", "project", ".", "open", "(", "null", ")", ";", "}", "IPath", "outputLocation", ";", "if", "(", "binFolderName", "!=", "null", "&&", "binFolderName", ".", "length", "(", ")", ">", "0", ")", "{", "IFolder", "binFolder", "=", "project", ".", "getFolder", "(", "binFolderName", ")", ";", "if", "(", "!", "binFolder", ".", "exists", "(", ")", ")", "{", "CoreUtility", ".", "createFolder", "(", "binFolder", ",", "false", ",", "true", ",", "null", ")", ";", "}", "outputLocation", "=", "binFolder", ".", "getFullPath", "(", ")", ";", "}", "else", "{", "outputLocation", "=", "project", ".", "getFullPath", "(", ")", ";", "}", "if", "(", "!", "project", ".", "hasNature", "(", "JavaCore", ".", "NATURE_ID", ")", ")", "{", "addNatureToProject", "(", "project", ",", "JavaCore", ".", "NATURE_ID", ",", "null", ")", ";", "}", "IJavaProject", "jproject", "=", "JavaCore", ".", "create", "(", "project", ")", ";", "jproject", ".", "setOutputLocation", "(", "outputLocation", ",", "null", ")", ";", "jproject", ".", "setRawClasspath", "(", "new", "IClasspathEntry", "[", "0", "]", ",", "null", ")", ";", "return", "jproject", ";", "}", "public", "static", "IJavaProject", "createGroovyProject", "(", "String", "projectName", ",", "String", "binFolderName", ")", "throws", "CoreException", "{", "IWorkspaceRoot", "root", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ";", "IProject", "project", "=", "root", ".", "getProject", "(", "projectName", ")", ";", "if", "(", "!", "project", ".", "exists", "(", ")", ")", "{", "project", ".", "create", "(", "null", ")", ";", "}", "else", "{", "project", ".", "refreshLocal", "(", "IResource", ".", "DEPTH_INFINITE", ",", "null", ")", ";", "}", "if", "(", "!", "project", ".", "isOpen", "(", ")", ")", "{", "project", ".", "open", "(", "null", ")", ";", "}", "IPath", "outputLocation", ";", "if", "(", "binFolderName", "!=", "null", "&&", "binFolderName", ".", "length", "(", ")", ">", "0", ")", "{", "IFolder", "binFolder", "=", "project", ".", "getFolder", "(", "binFolderName", ")", ";", "if", "(", "!", "binFolder", ".", "exists", "(", ")", ")", "{", "CoreUtility", ".", "createFolder", "(", "binFolder", ",", "false", ",", "true", ",", "null", ")", ";", "}", "outputLocation", "=", "binFolder", ".", "getFullPath", "(", ")", ";", "}", "else", "{", "outputLocation", "=", "project", ".", "getFullPath", "(", ")", ";", "}", "if", "(", "!", "project", ".", "hasNature", "(", "JavaCore", ".", "NATURE_ID", ")", ")", "{", "addNatureToProject", "(", "project", ",", "JavaCore", ".", "NATURE_ID", ",", "null", ")", ";", "}", "if", "(", "!", "project", ".", "hasNature", "(", "GroovyNature", ".", "GROOVY_NATURE", ")", ")", "{", "addNatureToProject", "(", "project", ",", "GroovyNature", ".", "GROOVY_NATURE", ",", "null", ")", ";", "}", "IJavaProject", "jproject", "=", "JavaCore", ".", "create", "(", "project", ")", ";", "jproject", ".", "setOutputLocation", "(", "outputLocation", ",", "null", ")", ";", "jproject", ".", "setRawClasspath", "(", "new", "IClasspathEntry", "[", "0", "]", ",", "null", ")", ";", "return", "jproject", ";", "}", "public", "static", "void", "set15CompilerOptions", "(", "IJavaProject", "project", ")", "{", "Map", "options", "=", "project", ".", "getOptions", "(", "false", ")", ";", "JavaProjectHelper", ".", "set15CompilerOptions", "(", "options", ")", ";", "project", ".", "setOptions", "(", "options", ")", ";", "}", "public", "static", "void", "set14CompilerOptions", "(", "IJavaProject", "project", ")", "{", "Map", "options", "=", "project", ".", "getOptions", "(", "false", ")", ";", "JavaProjectHelper", ".", "set14CompilerOptions", "(", "options", ")", ";", "project", ".", "setOptions", "(", "options", ")", ";", "}", "public", "static", "void", "set16CompilerOptions", "(", "Map", "options", ")", "{", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "JavaCore", ".", "VERSION_1_6", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_ASSERT_IDENTIFIER", ",", "JavaCore", ".", "ERROR", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_ENUM_IDENTIFIER", ",", "JavaCore", ".", "ERROR", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "JavaCore", ".", "VERSION_1_6", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_CODEGEN_TARGET_PLATFORM", ",", "JavaCore", ".", "VERSION_1_6", ")", ";", "}", "public", "static", "void", "set15CompilerOptions", "(", "Map", "options", ")", "{", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "JavaCore", ".", "VERSION_1_5", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_ASSERT_IDENTIFIER", ",", "JavaCore", ".", "ERROR", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_ENUM_IDENTIFIER", ",", "JavaCore", ".", "ERROR", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "JavaCore", ".", "VERSION_1_5", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_CODEGEN_TARGET_PLATFORM", ",", "JavaCore", ".", "VERSION_1_5", ")", ";", "}", "public", "static", "void", "set14CompilerOptions", "(", "Map", "options", ")", "{", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "JavaCore", ".", "VERSION_1_4", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_ASSERT_IDENTIFIER", ",", "JavaCore", ".", "ERROR", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_ENUM_IDENTIFIER", ",", "JavaCore", ".", "WARNING", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "JavaCore", ".", "VERSION_1_3", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_CODEGEN_TARGET_PLATFORM", ",", "JavaCore", ".", "VERSION_1_2", ")", ";", "}", "public", "static", "void", "set13CompilerOptions", "(", "Map", "options", ")", "{", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "JavaCore", ".", "VERSION_1_3", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_ASSERT_IDENTIFIER", ",", "JavaCore", ".", "WARNING", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_ENUM_IDENTIFIER", ",", "JavaCore", ".", "WARNING", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "JavaCore", ".", "VERSION_1_3", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_CODEGEN_TARGET_PLATFORM", ",", "JavaCore", ".", "VERSION_1_2", ")", ";", "}", "public", "static", "void", "delete", "(", "final", "IJavaElement", "elem", ")", "throws", "CoreException", "{", "if", "(", "ASSERT_NO_MIXED_LINE_DELIMIERS", ")", "MixedLineDelimiterDetector", ".", "assertNoMixedLineDelimiters", "(", "elem", ")", ";", "IWorkspaceRunnable", "runnable", "=", "new", "IWorkspaceRunnable", "(", ")", "{", "public", "void", "run", "(", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "performDummySearch", "(", ")", ";", "if", "(", "elem", "instanceof", "IJavaProject", ")", "{", "IJavaProject", "jproject", "=", "(", "IJavaProject", ")", "elem", ";", "jproject", ".", "setRawClasspath", "(", "new", "IClasspathEntry", "[", "0", "]", ",", "jproject", ".", "getProject", "(", ")", ".", "getFullPath", "(", ")", ",", "null", ")", ";", "}", "delete", "(", "elem", ".", "getResource", "(", ")", ")", ";", "}", "}", ";", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "run", "(", "runnable", ",", "null", ")", ";", "emptyDisplayLoop", "(", ")", ";", "}", "public", "static", "void", "delete", "(", "IResource", "resource", ")", "throws", "CoreException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "MAX_RETRY", ";", "i", "++", ")", "{", "try", "{", "resource", ".", "delete", "(", "true", ",", "null", ")", ";", "i", "=", "MAX_RETRY", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "i", "==", "MAX_RETRY", "-", "1", ")", "{", "JavaPlugin", ".", "log", "(", "e", ")", ";", "throw", "e", ";", "}", "try", "{", "Thread", ".", "sleep", "(", "1000", ")", ";", "}", "catch", "(", "InterruptedException", "e1", ")", "{", "}", "}", "}", "}", "public", "static", "void", "clear", "(", "final", "IJavaProject", "jproject", ",", "final", "IClasspathEntry", "[", "]", "entries", ")", "throws", "Exception", "{", "performDummySearch", "(", ")", ";", "IWorkspaceRunnable", "runnable", "=", "new", "IWorkspaceRunnable", "(", ")", "{", "public", "void", "run", "(", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "jproject", ".", "setRawClasspath", "(", "entries", ",", "null", ")", ";", "IResource", "[", "]", "resources", "=", "jproject", ".", "getProject", "(", ")", ".", "members", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "resources", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "resources", "[", "i", "]", ".", "getName", "(", ")", ".", "startsWith", "(", "\".\"", ")", ")", "{", "delete", "(", "resources", "[", "i", "]", ")", ";", "}", "}", "}", "}", ";", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "run", "(", "runnable", ",", "null", ")", ";", "JavaProjectHelper", ".", "emptyDisplayLoop", "(", ")", ";", "}", "public", "static", "void", "performDummySearch", "(", ")", "throws", "JavaModelException", "{", "new", "SearchEngine", "(", ")", ".", "searchAllTypeNames", "(", "null", ",", "SearchPattern", ".", "R_EXACT_MATCH", ",", "\"XXXXXXXXX\"", ".", "toCharArray", "(", ")", ",", "SearchPattern", ".", "R_EXACT_MATCH", "|", "SearchPattern", ".", "R_CASE_SENSITIVE", ",", "IJavaSearchConstants", ".", "CLASS", ",", "SearchEngine", ".", "createJavaSearchScope", "(", "new", "IJavaElement", "[", "0", "]", ")", ",", "new", "Requestor", "(", ")", ",", "IJavaSearchConstants", ".", "WAIT_UNTIL_READY_TO_SEARCH", ",", "null", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addSourceContainer", "(", "IJavaProject", "jproject", ",", "String", "containerName", ")", "throws", "CoreException", "{", "return", "addSourceContainer", "(", "jproject", ",", "containerName", ",", "new", "Path", "[", "0", "]", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addSourceContainer", "(", "IJavaProject", "jproject", ",", "String", "containerName", ",", "IPath", "[", "]", "exclusionFilters", ")", "throws", "CoreException", "{", "return", "addSourceContainer", "(", "jproject", ",", "containerName", ",", "new", "Path", "[", "0", "]", ",", "exclusionFilters", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addSourceContainer", "(", "IJavaProject", "jproject", ",", "String", "containerName", ",", "IPath", "[", "]", "inclusionFilters", ",", "IPath", "[", "]", "exclusionFilters", ")", "throws", "CoreException", "{", "return", "addSourceContainer", "(", "jproject", ",", "containerName", ",", "inclusionFilters", ",", "exclusionFilters", ",", "null", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addSourceContainer", "(", "IJavaProject", "jproject", ",", "String", "containerName", ",", "IPath", "[", "]", "inclusionFilters", ",", "IPath", "[", "]", "exclusionFilters", ",", "String", "outputLocation", ")", "throws", "CoreException", "{", "IProject", "project", "=", "jproject", ".", "getProject", "(", ")", ";", "IContainer", "container", "=", "null", ";", "if", "(", "containerName", "==", "null", "||", "containerName", ".", "length", "(", ")", "==", "0", ")", "{", "container", "=", "project", ";", "}", "else", "{", "IFolder", "folder", "=", "project", ".", "getFolder", "(", "containerName", ")", ";", "if", "(", "!", "folder", ".", "exists", "(", ")", ")", "{", "CoreUtility", ".", "createFolder", "(", "folder", ",", "false", ",", "true", ",", "null", ")", ";", "}", "container", "=", "folder", ";", "}", "IPackageFragmentRoot", "root", "=", "jproject", ".", "getPackageFragmentRoot", "(", "container", ")", ";", "IPath", "outputPath", "=", "null", ";", "if", "(", "outputLocation", "!=", "null", ")", "{", "IFolder", "folder", "=", "project", ".", "getFolder", "(", "outputLocation", ")", ";", "if", "(", "!", "folder", ".", "exists", "(", ")", ")", "{", "CoreUtility", ".", "createFolder", "(", "folder", ",", "false", ",", "true", ",", "null", ")", ";", "}", "outputPath", "=", "folder", ".", "getFullPath", "(", ")", ";", "}", "IClasspathEntry", "cpe", "=", "JavaCore", ".", "newSourceEntry", "(", "root", ".", "getPath", "(", ")", ",", "inclusionFilters", ",", "exclusionFilters", ",", "outputPath", ")", ";", "addToClasspath", "(", "jproject", ",", "cpe", ")", ";", "return", "root", ";", "}", "public", "static", "void", "removeSourceContainer", "(", "IJavaProject", "jproject", ",", "String", "containerName", ")", "throws", "CoreException", "{", "IFolder", "folder", "=", "jproject", ".", "getProject", "(", ")", ".", "getFolder", "(", "containerName", ")", ";", "removeFromClasspath", "(", "jproject", ",", "folder", ".", "getFullPath", "(", ")", ")", ";", "folder", ".", "delete", "(", "true", ",", "null", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addLibrary", "(", "IJavaProject", "jproject", ",", "IPath", "path", ")", "throws", "JavaModelException", "{", "return", "addLibrary", "(", "jproject", ",", "path", ",", "null", ",", "null", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addLibrary", "(", "IJavaProject", "jproject", ",", "IPath", "path", ",", "IPath", "sourceAttachPath", ",", "IPath", "sourceAttachRoot", ")", "throws", "JavaModelException", "{", "IClasspathEntry", "cpe", "=", "JavaCore", ".", "newLibraryEntry", "(", "path", ",", "sourceAttachPath", ",", "sourceAttachRoot", ")", ";", "addToClasspath", "(", "jproject", ",", "cpe", ")", ";", "IResource", "workspaceResource", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "findMember", "(", "path", ")", ";", "if", "(", "workspaceResource", "!=", "null", ")", "{", "return", "jproject", ".", "getPackageFragmentRoot", "(", "workspaceResource", ")", ";", "}", "return", "jproject", ".", "getPackageFragmentRoot", "(", "path", ".", "toString", "(", ")", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addLibraryWithImport", "(", "IJavaProject", "jproject", ",", "IPath", "jarPath", ",", "IPath", "sourceAttachPath", ",", "IPath", "sourceAttachRoot", ")", "throws", "IOException", ",", "CoreException", "{", "IProject", "project", "=", "jproject", ".", "getProject", "(", ")", ";", "IFile", "newFile", "=", "project", ".", "getFile", "(", "jarPath", ".", "lastSegment", "(", ")", ")", ";", "InputStream", "inputStream", "=", "null", ";", "try", "{", "inputStream", "=", "new", "FileInputStream", "(", "jarPath", ".", "toFile", "(", ")", ")", ";", "newFile", ".", "create", "(", "inputStream", ",", "true", ",", "null", ")", ";", "}", "finally", "{", "if", "(", "inputStream", "!=", "null", ")", "{", "try", "{", "inputStream", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "return", "addLibrary", "(", "jproject", ",", "newFile", ".", "getFullPath", "(", ")", ",", "sourceAttachPath", ",", "sourceAttachRoot", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addClassFolder", "(", "IJavaProject", "jproject", ",", "String", "containerName", ",", "IPath", "sourceAttachPath", ",", "IPath", "sourceAttachRoot", ")", "throws", "CoreException", "{", "IProject", "project", "=", "jproject", ".", "getProject", "(", ")", ";", "IContainer", "container", "=", "null", ";", "if", "(", "containerName", "==", "null", "||", "containerName", ".", "length", "(", ")", "==", "0", ")", "{", "container", "=", "project", ";", "}", "else", "{", "IFolder", "folder", "=", "project", ".", "getFolder", "(", "containerName", ")", ";", "if", "(", "!", "folder", ".", "exists", "(", ")", ")", "{", "CoreUtility", ".", "createFolder", "(", "folder", ",", "false", ",", "true", ",", "null", ")", ";", "}", "container", "=", "folder", ";", "}", "IClasspathEntry", "cpe", "=", "JavaCore", ".", "newLibraryEntry", "(", "container", ".", "getFullPath", "(", ")", ",", "sourceAttachPath", ",", "sourceAttachRoot", ")", ";", "addToClasspath", "(", "jproject", ",", "cpe", ")", ";", "return", "jproject", ".", "getPackageFragmentRoot", "(", "container", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addRTJar", "(", "IJavaProject", "jproject", ")", "throws", "CoreException", "{", "return", "addRTJar15", "(", "jproject", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addGroovyJar", "(", "IJavaProject", "jproject", ")", "throws", "CoreException", "{", "IPath", "[", "]", "groovyJarPath", "=", "findGroovyJar", "(", ")", ";", "return", "addLibrary", "(", "jproject", ",", "groovyJarPath", "[", "0", "]", ",", "groovyJarPath", "[", "1", "]", ",", "groovyJarPath", "[", "2", "]", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addRTJar13", "(", "IJavaProject", "jproject", ")", "throws", "CoreException", "{", "IPath", "[", "]", "rtJarPath", "=", "findRtJar", "(", "RT_STUBS_13", ")", ";", "Map", "options", "=", "jproject", ".", "getOptions", "(", "false", ")", ";", "JavaProjectHelper", ".", "set13CompilerOptions", "(", "options", ")", ";", "jproject", ".", "setOptions", "(", "options", ")", ";", "return", "addLibrary", "(", "jproject", ",", "rtJarPath", "[", "0", "]", ",", "rtJarPath", "[", "1", "]", ",", "rtJarPath", "[", "2", "]", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addRTJar15", "(", "IJavaProject", "jproject", ")", "throws", "CoreException", ",", "JavaModelException", "{", "IPath", "[", "]", "rtJarPath", "=", "findRtJar", "(", "RT_STUBS_15", ")", ";", "set15CompilerOptions", "(", "jproject", ")", ";", "return", "addLibrary", "(", "jproject", ",", "rtJarPath", "[", "0", "]", ",", "rtJarPath", "[", "1", "]", ",", "rtJarPath", "[", "2", "]", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addRTJar16", "(", "IJavaProject", "jproject", ")", "throws", "CoreException", "{", "IPath", "[", "]", "rtJarPath", "=", "findRtJar", "(", "RT_STUBS_16", ")", ";", "Map", "options", "=", "jproject", ".", "getOptions", "(", "false", ")", ";", "JavaProjectHelper", ".", "set16CompilerOptions", "(", "options", ")", ";", "jproject", ".", "setOptions", "(", "options", ")", ";", "return", "addLibrary", "(", "jproject", ",", "rtJarPath", "[", "0", "]", ",", "rtJarPath", "[", "1", "]", ",", "rtJarPath", "[", "2", "]", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addVariableEntry", "(", "IJavaProject", "jproject", ",", "IPath", "path", ",", "IPath", "sourceAttachPath", ",", "IPath", "sourceAttachRoot", ")", "throws", "JavaModelException", "{", "IClasspathEntry", "cpe", "=", "JavaCore", ".", "newVariableEntry", "(", "path", ",", "sourceAttachPath", ",", "sourceAttachRoot", ")", ";", "addToClasspath", "(", "jproject", ",", "cpe", ")", ";", "IPath", "resolvedPath", "=", "JavaCore", ".", "getResolvedVariablePath", "(", "path", ")", ";", "if", "(", "resolvedPath", "!=", "null", ")", "{", "return", "jproject", ".", "getPackageFragmentRoot", "(", "resolvedPath", ".", "toString", "(", ")", ")", ";", "}", "return", "null", ";", "}", "public", "static", "IPackageFragmentRoot", "addVariableRTJar13", "(", "IJavaProject", "jproject", ",", "String", "libVarName", ",", "String", "srcVarName", ",", "String", "srcrootVarName", ")", "throws", "CoreException", "{", "return", "addVariableRTJar", "(", "jproject", ",", "RT_STUBS_13", ",", "libVarName", ",", "srcVarName", ",", "srcrootVarName", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "addVariableRTJar", "(", "IJavaProject", "jproject", ",", "String", "libVarName", ",", "String", "srcVarName", ",", "String", "srcrootVarName", ")", "throws", "CoreException", "{", "return", "addVariableRTJar", "(", "jproject", ",", "RT_STUBS_15", ",", "libVarName", ",", "srcVarName", ",", "srcrootVarName", ")", ";", "}", "private", "static", "IPackageFragmentRoot", "addVariableRTJar", "(", "IJavaProject", "jproject", ",", "IPath", "rtStubsPath", ",", "String", "libVarName", ",", "String", "srcVarName", ",", "String", "srcrootVarName", ")", "throws", "CoreException", "{", "IPath", "[", "]", "rtJarPaths", "=", "findRtJar", "(", "rtStubsPath", ")", ";", "IPath", "libVarPath", "=", "new", "Path", "(", "libVarName", ")", ";", "IPath", "srcVarPath", "=", "null", ";", "IPath", "srcrootVarPath", "=", "null", ";", "JavaCore", ".", "setClasspathVariable", "(", "libVarName", ",", "rtJarPaths", "[", "0", "]", ",", "null", ")", ";", "if", "(", "srcVarName", "!=", "null", ")", "{", "IPath", "varValue", "=", "rtJarPaths", "[", "1", "]", "!=", "null", "?", "rtJarPaths", "[", "1", "]", ":", "Path", ".", "EMPTY", ";", "JavaCore", ".", "setClasspathVariable", "(", "srcVarName", ",", "varValue", ",", "null", ")", ";", "srcVarPath", "=", "new", "Path", "(", "srcVarName", ")", ";", "}", "if", "(", "srcrootVarName", "!=", "null", ")", "{", "IPath", "varValue", "=", "rtJarPaths", "[", "2", "]", "!=", "null", "?", "rtJarPaths", "[", "2", "]", ":", "Path", ".", "EMPTY", ";", "JavaCore", ".", "setClasspathVariable", "(", "srcrootVarName", ",", "varValue", ",", "null", ")", ";", "srcrootVarPath", "=", "new", "Path", "(", "srcrootVarName", ")", ";", "}", "return", "addVariableEntry", "(", "jproject", ",", "libVarPath", ",", "srcVarPath", ",", "srcrootVarPath", ")", ";", "}", "public", "static", "void", "addRequiredProject", "(", "IJavaProject", "jproject", ",", "IJavaProject", "required", ")", "throws", "JavaModelException", "{", "IClasspathEntry", "cpe", "=", "JavaCore", ".", "newProjectEntry", "(", "required", ".", "getProject", "(", ")", ".", "getFullPath", "(", ")", ")", ";", "addToClasspath", "(", "jproject", ",", "cpe", ")", ";", "}", "public", "static", "void", "removeFromClasspath", "(", "IJavaProject", "jproject", ",", "IPath", "path", ")", "throws", "JavaModelException", "{", "IClasspathEntry", "[", "]", "oldEntries", "=", "jproject", ".", "getRawClasspath", "(", ")", ";", "int", "nEntries", "=", "oldEntries", ".", "length", ";", "ArrayList", "list", "=", "new", "ArrayList", "(", "nEntries", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nEntries", ";", "i", "++", ")", "{", "IClasspathEntry", "curr", "=", "oldEntries", "[", "i", "]", ";", "if", "(", "!", "path", ".", "equals", "(", "curr", ".", "getPath", "(", ")", ")", ")", "{", "list", ".", "add", "(", "curr", ")", ";", "}", "}", "IClasspathEntry", "[", "]", "newEntries", "=", "(", "IClasspathEntry", "[", "]", ")", "list", ".", "toArray", "(", "new", "IClasspathEntry", "[", "list", ".", "size", "(", ")", "]", ")", ";", "jproject", ".", "setRawClasspath", "(", "newEntries", ",", "null", ")", ";", "}", "public", "static", "void", "addToClasspath", "(", "IJavaProject", "jproject", ",", "IClasspathEntry", "cpe", ")", "throws", "JavaModelException", "{", "IClasspathEntry", "[", "]", "oldEntries", "=", "jproject", ".", "getRawClasspath", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "oldEntries", ".", "length", ";", "i", "++", ")", "{", "if", "(", "oldEntries", "[", "i", "]", ".", "equals", "(", "cpe", ")", ")", "{", "return", ";", "}", "}", "int", "nEntries", "=", "oldEntries", ".", "length", ";", "IClasspathEntry", "[", "]", "newEntries", "=", "new", "IClasspathEntry", "[", "nEntries", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "oldEntries", ",", "0", ",", "newEntries", ",", "0", ",", "nEntries", ")", ";", "newEntries", "[", "nEntries", "]", "=", "cpe", ";", "jproject", ".", "setRawClasspath", "(", "newEntries", ",", "null", ")", ";", "}", "public", "static", "IPath", "[", "]", "findRtJar", "(", "IPath", "rtStubsPath", ")", "throws", "CoreException", "{", "File", "rtStubs", "=", "RefactoringTestPlugin", ".", "getDefault", "(", ")", ".", "getFileInPlugin", "(", "rtStubsPath", ")", ";", "Assert", ".", "assertNotNull", "(", "rtStubs", ")", ";", "Assert", ".", "assertTrue", "(", "rtStubs", ".", "exists", "(", ")", ")", ";", "return", "new", "IPath", "[", "]", "{", "Path", ".", "fromOSString", "(", "rtStubs", ".", "getPath", "(", ")", ")", ",", "null", ",", "null", "}", ";", "}", "public", "static", "IPath", "[", "]", "findGroovyJar", "(", ")", "throws", "CoreException", "{", "URL", "installURL", "=", "CompilerUtils", ".", "getExportedGroovyAllJar", "(", ")", ";", "URL", "localURL", ";", "try", "{", "localURL", "=", "FileLocator", ".", "toFileURL", "(", "installURL", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "CoreException", "(", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "RefactoringTestPlugin", ".", "getPluginId", "(", ")", ",", "\"\"", ",", "e", ")", ")", ";", "}", "File", "groovyJarFile", "=", "new", "File", "(", "localURL", ".", "getFile", "(", ")", ")", ";", "Assert", ".", "assertNotNull", "(", "groovyJarFile", ")", ";", "Assert", ".", "assertTrue", "(", "groovyJarFile", ".", "exists", "(", ")", ")", ";", "return", "new", "IPath", "[", "]", "{", "Path", ".", "fromOSString", "(", "groovyJarFile", ".", "getPath", "(", ")", ")", ",", "null", ",", "null", "}", ";", "}", "private", "static", "void", "addNatureToProject", "(", "IProject", "proj", ",", "String", "natureId", ",", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "IProjectDescription", "description", "=", "proj", ".", "getDescription", "(", ")", ";", "String", "[", "]", "prevNatures", "=", "description", ".", "getNatureIds", "(", ")", ";", "String", "[", "]", "newNatures", "=", "new", "String", "[", "prevNatures", ".", "length", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "prevNatures", ",", "0", ",", "newNatures", ",", "0", ",", "prevNatures", ".", "length", ")", ";", "newNatures", "[", "prevNatures", ".", "length", "]", "=", "natureId", ";", "description", ".", "setNatureIds", "(", "newNatures", ")", ";", "proj", ".", "setDescription", "(", "description", ",", "monitor", ")", ";", "}", "public", "static", "void", "importResources", "(", "IContainer", "importTarget", ",", "Bundle", "bundle", ",", "String", "bundleSourcePath", ")", "throws", "CoreException", ",", "IOException", "{", "Enumeration", "entryPaths", "=", "bundle", ".", "getEntryPaths", "(", "bundleSourcePath", ")", ";", "while", "(", "entryPaths", ".", "hasMoreElements", "(", ")", ")", "{", "String", "path", "=", "(", "String", ")", "entryPaths", ".", "nextElement", "(", ")", ";", "IPath", "name", "=", "new", "Path", "(", "path", ".", "substring", "(", "bundleSourcePath", ".", "length", "(", ")", ")", ")", ";", "if", "(", "path", ".", "endsWith", "(", "\"/\"", ")", ")", "{", "IFolder", "folder", "=", "importTarget", ".", "getFolder", "(", "name", ")", ";", "folder", ".", "create", "(", "false", ",", "true", ",", "null", ")", ";", "importResources", "(", "folder", ",", "bundle", ",", "path", ")", ";", "}", "else", "{", "URL", "url", "=", "bundle", ".", "getEntry", "(", "path", ")", ";", "IFile", "file", "=", "importTarget", ".", "getFile", "(", "name", ")", ";", "file", ".", "create", "(", "url", ".", "openStream", "(", ")", ",", "true", ",", "null", ")", ";", "}", "}", "}", "private", "static", "class", "ImportOverwriteQuery", "implements", "IOverwriteQuery", "{", "public", "String", "queryOverwrite", "(", "String", "file", ")", "{", "return", "ALL", ";", "}", "}", "private", "static", "class", "Requestor", "extends", "TypeNameRequestor", "{", "}", "public", "static", "void", "emptyDisplayLoop", "(", ")", "{", "boolean", "showDebugInfo", "=", "false", ";", "Display", "display", "=", "Display", ".", "getCurrent", "(", ")", ";", "if", "(", "display", "!=", "null", ")", "{", "if", "(", "showDebugInfo", ")", "{", "try", "{", "Synchronizer", "synchronizer", "=", "display", ".", "getSynchronizer", "(", ")", ";", "Field", "field", "=", "Synchronizer", ".", "class", ".", "getDeclaredField", "(", "\"messageCount\"", ")", ";", "field", ".", "setAccessible", "(", "true", ")", ";", "System", ".", "out", ".", "println", "(", "\"Processing", "\"", "+", "field", ".", "getInt", "(", "synchronizer", ")", "+", "\"\"", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "System", ".", "out", ".", "println", "(", "e", ")", ";", "}", "}", "while", "(", "display", ".", "readAndDispatch", "(", ")", ")", "{", "}", "}", "}", "public", "static", "IPackageFragmentRoot", "[", "]", "addRTJars", "(", "IJavaProject", "project", ")", "throws", "CoreException", "{", "String", "[", "]", "javaClassLibs", "=", "Util", ".", "getJavaClassLibs", "(", ")", ";", "IPackageFragmentRoot", "[", "]", "roots", "=", "new", "IPackageFragmentRoot", "[", "javaClassLibs", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "javaClassLibs", ".", "length", ";", "i", "++", ")", "{", "roots", "[", "i", "]", "=", "addLibrary", "(", "project", ",", "Path", ".", "fromOSString", "(", "javaClassLibs", "[", "i", "]", ")", ",", "null", ",", "null", ")", ";", "}", "return", "roots", ";", "}", "}", "</s>" ]
5,965
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Hashtable", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "preference", ".", "IPreferenceStore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "DefaultCodeFormatterConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "align", ".", "Alignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "ui", ".", "PreferenceConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "JavaPlugin", ";", "public", "class", "TestOptions", "{", "public", "static", "Hashtable", "getDefaultOptions", "(", ")", "{", "Hashtable", "result", "=", "JavaCore", ".", "getDefaultOptions", "(", ")", ";", "result", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_LOCAL_VARIABLE_HIDING", ",", "JavaCore", ".", "IGNORE", ")", ";", "result", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_FIELD_HIDING", ",", "JavaCore", ".", "IGNORE", ")", ";", "result", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_UNUSED_PRIVATE_MEMBER", ",", "JavaCore", ".", "IGNORE", ")", ";", "result", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_UNUSED_LOCAL", ",", "JavaCore", ".", "IGNORE", ")", ";", "result", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_RAW_TYPE_REFERENCE", ",", "JavaCore", ".", "IGNORE", ")", ";", "result", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_UNUSED_WARNING_TOKEN", ",", "JavaCore", ".", "IGNORE", ")", ";", "result", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_DEAD_CODE", ",", "JavaCore", ".", "IGNORE", ")", ";", "result", ".", "putAll", "(", "TestFormatterOptions", ".", "getSettings", "(", ")", ")", ";", "return", "result", ";", "}", "public", "static", "void", "initializeCodeGenerationOptions", "(", ")", "{", "IPreferenceStore", "store", "=", "JavaPlugin", ".", "getDefault", "(", ")", ".", "getPreferenceStore", "(", ")", ";", "store", ".", "setValue", "(", "PreferenceConstants", ".", "CODEGEN_KEYWORD_THIS", ",", "false", ")", ";", "store", ".", "setValue", "(", "PreferenceConstants", ".", "CODEGEN_IS_FOR_GETTERS", ",", "true", ")", ";", "store", ".", "setValue", "(", "PreferenceConstants", ".", "CODEGEN_EXCEPTION_VAR_NAME", ",", "\"e\"", ")", ";", "store", ".", "setValue", "(", "PreferenceConstants", ".", "CODEGEN_ADD_COMMENTS", ",", "true", ")", ";", "store", ".", "setValue", "(", "PreferenceConstants", ".", "ORGIMPORTS_IMPORTORDER", ",", "\"\"", ")", ";", "store", ".", "setValue", "(", "PreferenceConstants", ".", "ORGIMPORTS_ONDEMANDTHRESHOLD", ",", "99", ")", ";", "store", ".", "setValue", "(", "PreferenceConstants", ".", "ORGIMPORTS_IGNORELOWERCASE", ",", "true", ")", ";", "}", "public", "static", "void", "initializeProjectOptions", "(", "IJavaProject", "project", ")", "{", "Map", "options", "=", "new", "HashMap", "(", ")", ";", "JavaProjectHelper", ".", "set15CompilerOptions", "(", "options", ")", ";", "project", ".", "setOptions", "(", "options", ")", ";", "}", "}", "class", "TestFormatterOptions", "{", "public", "static", "Hashtable", "getSettings", "(", ")", "{", "TestFormatterOptions", "options", "=", "new", "TestFormatterOptions", "(", ")", ";", "options", ".", "setDefaultSettings", "(", ")", ";", "return", "options", ".", "getMap", "(", ")", ";", "}", "public", "int", "alignment_for_arguments_in_allocation_expression", ";", "public", "int", "alignment_for_arguments_in_explicit_constructor_call", ";", "public", "int", "alignment_for_arguments_in_method_invocation", ";", "public", "int", "alignment_for_arguments_in_qualified_allocation_expression", ";", "public", "int", "alignment_for_binary_expression", ";", "public", "int", "alignment_for_compact_if", ";", "public", "int", "alignment_for_conditional_expression", ";", "public", "int", "alignment_for_expressions_in_array_initializer", ";", "public", "int", "alignment_for_multiple_fields", ";", "public", "int", "alignment_for_parameters_in_constructor_declaration", ";", "public", "int", "alignment_for_parameters_in_method_declaration", ";", "public", "int", "alignment_for_selector_in_method_invocation", ";", "public", "int", "alignment_for_superclass_in_type_declaration", ";", "public", "int", "alignment_for_superinterfaces_in_type_declaration", ";", "public", "int", "alignment_for_throws_clause_in_constructor_declaration", ";", "public", "int", "alignment_for_throws_clause_in_method_declaration", ";", "public", "boolean", "align_type_members_on_columns", ";", "public", "String", "brace_position_for_anonymous_type_declaration", ";", "public", "String", "brace_position_for_array_initializer", ";", "public", "String", "brace_position_for_block", ";", "public", "String", "brace_position_for_block_in_case", ";", "public", "String", "brace_position_for_constructor_declaration", ";", "public", "String", "brace_position_for_method_declaration", ";", "public", "String", "brace_position_for_type_declaration", ";", "public", "String", "brace_position_for_switch", ";", "public", "int", "continuation_indentation", ";", "public", "int", "continuation_indentation_for_array_initializer", ";", "public", "int", "blank_lines_after_imports", ";", "public", "int", "blank_lines_after_package", ";", "public", "int", "blank_lines_before_field", ";", "public", "int", "blank_lines_before_first_class_body_declaration", ";", "public", "int", "blank_lines_before_imports", ";", "public", "int", "blank_lines_before_member_type", ";", "public", "int", "blank_lines_before_method", ";", "public", "int", "blank_lines_before_new_chunk", ";", "public", "int", "blank_lines_before_package", ";", "public", "int", "blank_lines_between_type_declarations", ";", "public", "int", "blank_lines_at_beginning_of_method_body", ";", "public", "boolean", "indent_statements_compare_to_block", ";", "public", "boolean", "indent_statements_compare_to_body", ";", "public", "boolean", "indent_body_declarations_compare_to_type_header", ";", "public", "boolean", "indent_breaks_compare_to_cases", ";", "public", "boolean", "indent_switchstatements_compare_to_cases", ";", "public", "boolean", "indent_switchstatements_compare_to_switch", ";", "public", "boolean", "insert_new_line_after_opening_brace_in_array_initializer", ";", "public", "boolean", "insert_new_line_after_annotation_on_member", ";", "public", "boolean", "insert_new_line_after_annotation_on_parameter", ";", "public", "boolean", "insert_new_line_after_annotation_on_local_variable", ";", "public", "boolean", "insert_new_line_at_end_of_file_if_missing", ";", "public", "boolean", "insert_new_line_before_catch_in_try_statement", ";", "public", "boolean", "insert_new_line_before_closing_brace_in_array_initializer", ";", "public", "boolean", "insert_new_line_before_else_in_if_statement", ";", "public", "boolean", "insert_new_line_before_finally_in_try_statement", ";", "public", "boolean", "insert_new_line_before_while_in_do_statement", ";", "public", "boolean", "insert_new_line_in_empty_anonymous_type_declaration", ";", "public", "boolean", "insert_new_line_in_empty_block", ";", "public", "boolean", "insert_new_line_in_empty_method_body", ";", "public", "boolean", "insert_new_line_in_empty_type_declaration", ";", "public", "boolean", "insert_space_after_assignment_operator", ";", "public", "boolean", "insert_space_after_binary_operator", ";", "public", "boolean", "insert_space_after_closing_paren_in_cast", ";", "public", "boolean", "insert_space_after_closing_brace_in_block", ";", "public", "boolean", "insert_space_after_colon_in_assert", ";", "public", "boolean", "insert_space_after_colon_in_case", ";", "public", "boolean", "insert_space_after_colon_in_conditional", ";", "public", "boolean", "insert_space_after_colon_in_labeled_statement", ";", "public", "boolean", "insert_space_after_comma_in_allocation_expression", ";", "public", "boolean", "insert_space_after_comma_in_array_initializer", ";", "public", "boolean", "insert_space_after_comma_in_constructor_declaration_parameters", ";", "public", "boolean", "insert_space_after_comma_in_constructor_declaration_throws", ";", "public", "boolean", "insert_space_after_comma_in_explicit_constructor_call_arguments", ";", "public", "boolean", "insert_space_after_comma_in_for_increments", ";", "public", "boolean", "insert_space_after_comma_in_for_inits", ";", "public", "boolean", "insert_space_after_comma_in_method_invocation_arguments", ";", "public", "boolean", "insert_space_after_comma_in_method_declaration_parameters", ";", "public", "boolean", "insert_space_after_comma_in_method_declaration_throws", ";", "public", "boolean", "insert_space_after_comma_in_multiple_field_declarations", ";", "public", "boolean", "insert_space_after_comma_in_multiple_local_declarations", ";", "public", "boolean", "insert_space_after_comma_in_superinterfaces", ";", "public", "boolean", "insert_space_after_opening_bracket_in_array_allocation_expression", ";", "public", "boolean", "insert_space_after_opening_bracket_in_array_reference", ";", "public", "boolean", "insert_space_after_opening_brace_in_array_initializer", ";", "public", "boolean", "insert_space_after_opening_paren_in_cast", ";", "public", "boolean", "insert_space_after_opening_paren_in_catch", ";", "public", "boolean", "insert_space_after_opening_paren_in_constructor_declaration", ";", "public", "boolean", "insert_space_after_opening_paren_in_for", ";", "public", "boolean", "insert_space_after_opening_paren_in_if", ";", "public", "boolean", "insert_space_after_opening_paren_in_method_declaration", ";", "public", "boolean", "insert_space_after_opening_paren_in_method_invocation", ";", "public", "boolean", "insert_space_after_opening_paren_in_parenthesized_expression", ";", "public", "boolean", "insert_space_after_opening_paren_in_switch", ";", "public", "boolean", "insert_space_after_opening_paren_in_synchronized", ";", "public", "boolean", "insert_space_after_opening_paren_in_while", ";", "public", "boolean", "insert_space_after_postfix_operator", ";", "public", "boolean", "insert_space_after_prefix_operator", ";", "public", "boolean", "insert_space_after_question_in_conditional", ";", "public", "boolean", "insert_space_after_semicolon_in_for", ";", "public", "boolean", "insert_space_after_unary_operator", ";", "public", "boolean", "insert_space_before_assignment_operator", ";", "public", "boolean", "insert_space_before_binary_operator", ";", "public", "boolean", "insert_space_before_closing_brace_in_array_initializer", ";", "public", "boolean", "insert_space_before_closing_bracket_in_array_allocation_expression", ";", "public", "boolean", "insert_space_before_closing_bracket_in_array_reference", ";", "public", "boolean", "insert_space_before_closing_paren_in_cast", ";", "public", "boolean", "insert_space_before_closing_paren_in_catch", ";", "public", "boolean", "insert_space_before_closing_paren_in_constructor_declaration", ";", "public", "boolean", "insert_space_before_closing_paren_in_for", ";", "public", "boolean", "insert_space_before_closing_paren_in_if", ";", "public", "boolean", "insert_space_before_closing_paren_in_method_declaration", ";", "public", "boolean", "insert_space_before_closing_paren_in_method_invocation", ";", "public", "boolean", "insert_space_before_closing_paren_in_parenthesized_expression", ";", "public", "boolean", "insert_space_before_closing_paren_in_switch", ";", "public", "boolean", "insert_space_before_closing_paren_in_synchronized", ";", "public", "boolean", "insert_space_before_closing_paren_in_while", ";", "public", "boolean", "insert_space_before_colon_in_assert", ";", "public", "boolean", "insert_space_before_colon_in_case", ";", "public", "boolean", "insert_space_before_colon_in_conditional", ";", "public", "boolean", "insert_space_before_colon_in_default", ";", "public", "boolean", "insert_space_before_colon_in_labeled_statement", ";", "public", "boolean", "insert_space_before_comma_in_allocation_expression", ";", "public", "boolean", "insert_space_before_comma_in_array_initializer", ";", "public", "boolean", "insert_space_before_comma_in_constructor_declaration_parameters", ";", "public", "boolean", "insert_space_before_comma_in_constructor_declaration_throws", ";", "public", "boolean", "insert_space_before_comma_in_explicit_constructor_call_arguments", ";", "public", "boolean", "insert_space_before_comma_in_for_increments", ";", "public", "boolean", "insert_space_before_comma_in_for_inits", ";", "public", "boolean", "insert_space_before_comma_in_method_invocation_arguments", ";", "public", "boolean", "insert_space_before_comma_in_method_declaration_parameters", ";", "public", "boolean", "insert_space_before_comma_in_method_declaration_throws", ";", "public", "boolean", "insert_space_before_comma_in_multiple_field_declarations", ";", "public", "boolean", "insert_space_before_comma_in_multiple_local_declarations", ";", "public", "boolean", "insert_space_before_comma_in_superinterfaces", ";", "public", "boolean", "insert_space_before_opening_brace_in_anonymous_type_declaration", ";", "public", "boolean", "insert_space_before_opening_brace_in_array_initializer", ";", "public", "boolean", "insert_space_before_opening_brace_in_block", ";", "public", "boolean", "insert_space_before_opening_brace_in_constructor_declaration", ";", "public", "boolean", "insert_space_before_opening_brace_in_method_declaration", ";", "public", "boolean", "insert_space_before_opening_brace_in_type_declaration", ";", "public", "boolean", "insert_space_before_opening_bracket_in_array_allocation_expression", ";", "public", "boolean", "insert_space_before_opening_bracket_in_array_reference", ";", "public", "boolean", "insert_space_before_opening_bracket_in_array_type_reference", ";", "public", "boolean", "insert_space_before_opening_paren_in_catch", ";", "public", "boolean", "insert_space_before_opening_paren_in_constructor_declaration", ";", "public", "boolean", "insert_space_before_opening_paren_in_for", ";", "public", "boolean", "insert_space_before_opening_paren_in_if", ";", "public", "boolean", "insert_space_before_opening_paren_in_method_invocation", ";", "public", "boolean", "insert_space_before_opening_paren_in_method_declaration", ";", "public", "boolean", "insert_space_before_opening_paren_in_switch", ";", "public", "boolean", "insert_space_before_opening_brace_in_switch", ";", "public", "boolean", "insert_space_before_opening_paren_in_synchronized", ";", "public", "boolean", "insert_space_before_opening_paren_in_parenthesized_expression", ";", "public", "boolean", "insert_space_before_opening_paren_in_while", ";", "public", "boolean", "insert_space_before_postfix_operator", ";", "public", "boolean", "insert_space_before_prefix_operator", ";", "public", "boolean", "insert_space_before_question_in_conditional", ";", "public", "boolean", "insert_space_before_semicolon", ";", "public", "boolean", "insert_space_before_semicolon_in_for", ";", "public", "boolean", "insert_space_before_unary_operator", ";", "public", "boolean", "insert_space_between_brackets_in_array_type_reference", ";", "public", "boolean", "insert_space_between_empty_braces_in_array_initializer", ";", "public", "boolean", "insert_space_between_empty_brackets_in_array_allocation_expression", ";", "public", "boolean", "insert_space_between_empty_parens_in_constructor_declaration", ";", "public", "boolean", "insert_space_between_empty_parens_in_method_declaration", ";", "public", "boolean", "insert_space_between_empty_parens_in_method_invocation", ";", "public", "boolean", "compact_else_if", ";", "public", "boolean", "keep_guardian_clause_on_one_line", ";", "public", "boolean", "keep_else_statement_on_same_line", ";", "public", "boolean", "keep_empty_array_initializer_on_one_line", ";", "public", "boolean", "keep_simple_if_on_one_line", ";", "public", "boolean", "keep_then_statement_on_same_line", ";", "public", "boolean", "never_indent_block_comments_on_first_column", ";", "public", "boolean", "never_indent_line_comments_on_first_column", ";", "public", "int", "number_of_empty_lines_to_preserve", ";", "public", "boolean", "put_empty_statement_on_new_line", ";", "public", "int", "tab_size", ";", "public", "final", "char", "filling_space", "=", "'", "'", ";", "public", "int", "page_width", ";", "public", "boolean", "use_tab", ";", "public", "boolean", "wrapBeforeBinaryOperator", ";", "public", "int", "initial_indentation_level", ";", "public", "String", "line_separator", ";", "private", "TestFormatterOptions", "(", ")", "{", "}", "private", "String", "getAlignment", "(", "int", "alignment", ")", "{", "return", "Integer", ".", "toString", "(", "alignment", ")", ";", "}", "private", "Hashtable", "getMap", "(", ")", "{", "Hashtable", "options", "=", "new", "Hashtable", "(", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION", ",", "getAlignment", "(", "this", ".", "alignment_for_arguments_in_allocation_expression", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL", ",", "getAlignment", "(", "this", ".", "alignment_for_arguments_in_explicit_constructor_call", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION", ",", "getAlignment", "(", "this", ".", "alignment_for_arguments_in_method_invocation", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION", ",", "getAlignment", "(", "this", ".", "alignment_for_arguments_in_qualified_allocation_expression", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION", ",", "getAlignment", "(", "this", ".", "alignment_for_binary_expression", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_COMPACT_IF", ",", "getAlignment", "(", "this", ".", "alignment_for_compact_if", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION", ",", "getAlignment", "(", "this", ".", "alignment_for_conditional_expression", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER", ",", "getAlignment", "(", "this", ".", "alignment_for_expressions_in_array_initializer", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS", ",", "getAlignment", "(", "this", ".", "alignment_for_multiple_fields", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION", ",", "getAlignment", "(", "this", ".", "alignment_for_parameters_in_constructor_declaration", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION", ",", "getAlignment", "(", "this", ".", "alignment_for_parameters_in_method_declaration", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION", ",", "getAlignment", "(", "this", ".", "alignment_for_selector_in_method_invocation", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION", ",", "getAlignment", "(", "this", ".", "alignment_for_superclass_in_type_declaration", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION", ",", "getAlignment", "(", "this", ".", "alignment_for_superinterfaces_in_type_declaration", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION", ",", "getAlignment", "(", "this", ".", "alignment_for_throws_clause_in_constructor_declaration", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION", ",", "getAlignment", "(", "this", ".", "alignment_for_throws_clause_in_method_declaration", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS", ",", "this", ".", "align_type_members_on_columns", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION", ",", "this", ".", "brace_position_for_anonymous_type_declaration", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER", ",", "this", ".", "brace_position_for_array_initializer", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_BLOCK", ",", "this", ".", "brace_position_for_block", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE", ",", "this", ".", "brace_position_for_block_in_case", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION", ",", "this", ".", "brace_position_for_constructor_declaration", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION", ",", "this", ".", "brace_position_for_method_declaration", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION", ",", "this", ".", "brace_position_for_type_declaration", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_SWITCH", ",", "this", ".", "brace_position_for_switch", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_CONTINUATION_INDENTATION", ",", "Integer", ".", "toString", "(", "this", ".", "continuation_indentation", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER", ",", "Integer", ".", "toString", "(", "this", ".", "continuation_indentation_for_array_initializer", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_AFTER_IMPORTS", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_after_imports", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_AFTER_PACKAGE", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_after_package", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_FIELD", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_before_field", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_before_first_class_body_declaration", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_IMPORTS", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_before_imports", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_before_member_type", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_METHOD", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_before_method", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_before_new_chunk", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_PACKAGE", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_before_package", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_between_type_declarations", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_at_beginning_of_method_body", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK", ",", "this", ".", "indent_statements_compare_to_block", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY", ",", "this", ".", "indent_statements_compare_to_body", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER", ",", "this", ".", "indent_body_declarations_compare_to_type_header", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES", ",", "this", ".", "indent_breaks_compare_to_cases", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES", ",", "this", ".", "indent_switchstatements_compare_to_cases", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH", ",", "this", ".", "indent_switchstatements_compare_to_switch", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER", ",", "this", ".", "insert_new_line_after_opening_brace_in_array_initializer", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER", ",", "this", ".", "insert_new_line_after_annotation_on_member", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER", ",", "this", ".", "insert_new_line_after_annotation_on_parameter", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE", ",", "this", ".", "insert_new_line_after_annotation_on_local_variable", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING", ",", "this", ".", "insert_new_line_at_end_of_file_if_missing", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT", ",", "this", ".", "insert_new_line_before_catch_in_try_statement", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER", ",", "this", ".", "insert_new_line_before_closing_brace_in_array_initializer", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT", ",", "this", ".", "insert_new_line_before_else_in_if_statement", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT", ",", "this", ".", "insert_new_line_before_finally_in_try_statement", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT", ",", "this", ".", "insert_new_line_before_while_in_do_statement", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION", ",", "this", ".", "insert_new_line_in_empty_anonymous_type_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK", ",", "this", ".", "insert_new_line_in_empty_block", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY", ",", "this", ".", "insert_new_line_in_empty_method_body", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION", ",", "this", ".", "insert_new_line_in_empty_type_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR", ",", "this", ".", "insert_space_after_assignment_operator", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR", ",", "this", ".", "insert_space_after_binary_operator", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST", ",", "this", ".", "insert_space_after_closing_paren_in_cast", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK", ",", "this", ".", "insert_space_after_closing_brace_in_block", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT", ",", "this", ".", "insert_space_after_colon_in_assert", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE", ",", "this", ".", "insert_space_after_colon_in_case", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL", ",", "this", ".", "insert_space_after_colon_in_conditional", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT", ",", "this", ".", "insert_space_after_colon_in_labeled_statement", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION", ",", "this", ".", "insert_space_after_comma_in_allocation_expression", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER", ",", "this", ".", "insert_space_after_comma_in_array_initializer", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS", ",", "this", ".", "insert_space_after_comma_in_constructor_declaration_parameters", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS", ",", "this", ".", "insert_space_after_comma_in_constructor_declaration_throws", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS", ",", "this", ".", "insert_space_after_comma_in_explicit_constructor_call_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS", ",", "this", ".", "insert_space_after_comma_in_for_increments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS", ",", "this", ".", "insert_space_after_comma_in_for_inits", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS", ",", "this", ".", "insert_space_after_comma_in_method_invocation_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS", ",", "this", ".", "insert_space_after_comma_in_method_declaration_parameters", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS", ",", "this", ".", "insert_space_after_comma_in_method_declaration_throws", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS", ",", "this", ".", "insert_space_after_comma_in_multiple_field_declarations", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS", ",", "this", ".", "insert_space_after_comma_in_multiple_local_declarations", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES", ",", "this", ".", "insert_space_after_comma_in_superinterfaces", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION", ",", "this", ".", "insert_space_after_opening_bracket_in_array_allocation_expression", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE", ",", "this", ".", "insert_space_after_opening_bracket_in_array_reference", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER", ",", "this", ".", "insert_space_after_opening_brace_in_array_initializer", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST", ",", "this", ".", "insert_space_after_opening_paren_in_cast", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH", ",", "this", ".", "insert_space_after_opening_paren_in_catch", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION", ",", "this", ".", "insert_space_after_opening_paren_in_constructor_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR", ",", "this", ".", "insert_space_after_opening_paren_in_for", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF", ",", "this", ".", "insert_space_after_opening_paren_in_if", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION", ",", "this", ".", "insert_space_after_opening_paren_in_method_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION", ",", "this", ".", "insert_space_after_opening_paren_in_method_invocation", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION", ",", "this", ".", "insert_space_after_opening_paren_in_parenthesized_expression", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH", ",", "this", ".", "insert_space_after_opening_paren_in_switch", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED", ",", "this", ".", "insert_space_after_opening_paren_in_synchronized", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE", ",", "this", ".", "insert_space_after_opening_paren_in_while", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR", ",", "this", ".", "insert_space_after_postfix_operator", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR", ",", "this", ".", "insert_space_after_prefix_operator", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL", ",", "this", ".", "insert_space_after_question_in_conditional", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR", ",", "this", ".", "insert_space_after_semicolon_in_for", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR", ",", "this", ".", "insert_space_after_unary_operator", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR", ",", "this", ".", "insert_space_before_assignment_operator", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR", ",", "this", ".", "insert_space_before_binary_operator", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER", ",", "this", ".", "insert_space_before_closing_brace_in_array_initializer", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION", ",", "this", ".", "insert_space_before_closing_bracket_in_array_allocation_expression", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE", ",", "this", ".", "insert_space_before_closing_bracket_in_array_reference", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST", ",", "this", ".", "insert_space_before_closing_paren_in_cast", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH", ",", "this", ".", "insert_space_before_closing_paren_in_catch", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION", ",", "this", ".", "insert_space_before_closing_paren_in_constructor_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR", ",", "this", ".", "insert_space_before_closing_paren_in_for", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF", ",", "this", ".", "insert_space_before_closing_paren_in_if", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION", ",", "this", ".", "insert_space_before_closing_paren_in_method_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION", ",", "this", ".", "insert_space_before_closing_paren_in_method_invocation", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION", ",", "this", ".", "insert_space_before_closing_paren_in_parenthesized_expression", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH", ",", "this", ".", "insert_space_before_closing_paren_in_switch", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED", ",", "this", ".", "insert_space_before_closing_paren_in_synchronized", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE", ",", "this", ".", "insert_space_before_closing_paren_in_while", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT", ",", "this", ".", "insert_space_before_colon_in_assert", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE", ",", "this", ".", "insert_space_before_colon_in_case", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL", ",", "this", ".", "insert_space_before_colon_in_conditional", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT", ",", "this", ".", "insert_space_before_colon_in_default", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT", ",", "this", ".", "insert_space_before_colon_in_labeled_statement", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION", ",", "this", ".", "insert_space_before_comma_in_allocation_expression", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER", ",", "this", ".", "insert_space_before_comma_in_array_initializer", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS", ",", "this", ".", "insert_space_before_comma_in_constructor_declaration_parameters", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS", ",", "this", ".", "insert_space_before_comma_in_constructor_declaration_throws", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS", ",", "this", ".", "insert_space_before_comma_in_explicit_constructor_call_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS", ",", "this", ".", "insert_space_before_comma_in_for_increments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS", ",", "this", ".", "insert_space_before_comma_in_for_inits", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS", ",", "this", ".", "insert_space_before_comma_in_method_invocation_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS", ",", "this", ".", "insert_space_before_comma_in_method_declaration_parameters", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS", ",", "this", ".", "insert_space_before_comma_in_method_declaration_throws", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS", ",", "this", ".", "insert_space_before_comma_in_multiple_field_declarations", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS", ",", "this", ".", "insert_space_before_comma_in_multiple_local_declarations", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES", ",", "this", ".", "insert_space_before_comma_in_superinterfaces", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANONYMOUS_TYPE_DECLARATION", ",", "this", ".", "insert_space_before_opening_brace_in_anonymous_type_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER", ",", "this", ".", "insert_space_before_opening_brace_in_array_initializer", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK", ",", "this", ".", "insert_space_before_opening_brace_in_block", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION", ",", "this", ".", "insert_space_before_opening_brace_in_constructor_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION", ",", "this", ".", "insert_space_before_opening_brace_in_method_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION", ",", "this", ".", "insert_space_before_opening_brace_in_type_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION", ",", "this", ".", "insert_space_before_opening_bracket_in_array_allocation_expression", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE", ",", "this", ".", "insert_space_before_opening_bracket_in_array_reference", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE", ",", "this", ".", "insert_space_before_opening_bracket_in_array_type_reference", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH", ",", "this", ".", "insert_space_before_opening_paren_in_catch", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION", ",", "this", ".", "insert_space_before_opening_paren_in_constructor_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR", ",", "this", ".", "insert_space_before_opening_paren_in_for", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF", ",", "this", ".", "insert_space_before_opening_paren_in_if", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION", ",", "this", ".", "insert_space_before_opening_paren_in_method_invocation", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION", ",", "this", ".", "insert_space_before_opening_paren_in_method_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH", ",", "this", ".", "insert_space_before_opening_paren_in_switch", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH", ",", "this", ".", "insert_space_before_opening_brace_in_switch", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED", ",", "this", ".", "insert_space_before_opening_paren_in_synchronized", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION", ",", "this", ".", "insert_space_before_opening_paren_in_parenthesized_expression", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE", ",", "this", ".", "insert_space_before_opening_paren_in_while", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR", ",", "this", ".", "insert_space_before_postfix_operator", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR", ",", "this", ".", "insert_space_before_prefix_operator", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL", ",", "this", ".", "insert_space_before_question_in_conditional", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON", ",", "this", ".", "insert_space_before_semicolon", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR", ",", "this", ".", "insert_space_before_semicolon_in_for", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR", ",", "this", ".", "insert_space_before_unary_operator", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE", ",", "this", ".", "insert_space_between_brackets_in_array_type_reference", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER", ",", "this", ".", "insert_space_between_empty_braces_in_array_initializer", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION", ",", "this", ".", "insert_space_between_empty_brackets_in_array_allocation_expression", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION", ",", "this", ".", "insert_space_between_empty_parens_in_constructor_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION", ",", "this", ".", "insert_space_between_empty_parens_in_method_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION", ",", "this", ".", "insert_space_between_empty_parens_in_method_invocation", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMPACT_ELSE_IF", ",", "this", ".", "compact_else_if", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE", ",", "this", ".", "keep_guardian_clause_on_one_line", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE", ",", "this", ".", "keep_else_statement_on_same_line", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE", ",", "this", ".", "keep_empty_array_initializer_on_one_line", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE", ",", "this", ".", "keep_simple_if_on_one_line", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE", ",", "this", ".", "keep_then_statement_on_same_line", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE", ",", "Integer", ".", "toString", "(", "this", ".", "number_of_empty_lines_to_preserve", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE", ",", "this", ".", "put_empty_statement_on_new_line", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_LINE_SPLIT", ",", "Integer", ".", "toString", "(", "this", ".", "page_width", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_CHAR", ",", "this", ".", "use_tab", "?", "JavaCore", ".", "TAB", ":", "JavaCore", ".", "SPACE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_SIZE", ",", "Integer", ".", "toString", "(", "this", ".", "tab_size", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_WRAP_BEFORE_BINARY_OPERATOR", ",", "this", ".", "wrapBeforeBinaryOperator", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN", ",", "this", ".", "never_indent_block_comments_on_first_column", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN", ",", "this", ".", "never_indent_line_comments_on_first_column", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "return", "options", ";", "}", "private", "void", "setDefaultSettings", "(", ")", "{", "this", ".", "alignment_for_arguments_in_allocation_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_arguments_in_explicit_constructor_call", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_arguments_in_method_invocation", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_arguments_in_qualified_allocation_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_binary_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_compact_if", "=", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", "|", "Alignment", ".", "M_INDENT_BY_ONE", ";", "this", ".", "alignment_for_conditional_expression", "=", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ";", "this", ".", "alignment_for_expressions_in_array_initializer", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_multiple_fields", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_parameters_in_constructor_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_parameters_in_method_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_selector_in_method_invocation", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_superclass_in_type_declaration", "=", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ";", "this", ".", "alignment_for_superinterfaces_in_type_declaration", "=", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ";", "this", ".", "alignment_for_throws_clause_in_constructor_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_throws_clause_in_method_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "align_type_members_on_columns", "=", "false", ";", "this", ".", "brace_position_for_anonymous_type_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "this", ".", "brace_position_for_array_initializer", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "this", ".", "brace_position_for_block", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "this", ".", "brace_position_for_block_in_case", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "this", ".", "brace_position_for_constructor_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "this", ".", "brace_position_for_method_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "this", ".", "brace_position_for_type_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "this", ".", "brace_position_for_switch", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "this", ".", "continuation_indentation", "=", "2", ";", "this", ".", "continuation_indentation_for_array_initializer", "=", "2", ";", "this", ".", "blank_lines_after_imports", "=", "0", ";", "this", ".", "blank_lines_after_package", "=", "0", ";", "this", ".", "blank_lines_before_field", "=", "0", ";", "this", ".", "blank_lines_before_first_class_body_declaration", "=", "0", ";", "this", ".", "blank_lines_before_imports", "=", "0", ";", "this", ".", "blank_lines_before_member_type", "=", "0", ";", "this", ".", "blank_lines_before_method", "=", "0", ";", "this", ".", "blank_lines_before_new_chunk", "=", "0", ";", "this", ".", "blank_lines_before_package", "=", "0", ";", "this", ".", "blank_lines_between_type_declarations", "=", "0", ";", "this", ".", "blank_lines_at_beginning_of_method_body", "=", "0", ";", "this", ".", "indent_statements_compare_to_block", "=", "true", ";", "this", ".", "indent_statements_compare_to_body", "=", "true", ";", "this", ".", "indent_body_declarations_compare_to_type_header", "=", "true", ";", "this", ".", "indent_breaks_compare_to_cases", "=", "true", ";", "this", ".", "indent_switchstatements_compare_to_cases", "=", "true", ";", "this", ".", "indent_switchstatements_compare_to_switch", "=", "true", ";", "this", ".", "insert_new_line_after_annotation_on_member", "=", "true", ";", "this", ".", "insert_new_line_after_annotation_on_parameter", "=", "false", ";", "this", ".", "insert_new_line_after_annotation_on_local_variable", "=", "true", ";", "this", ".", "insert_new_line_at_end_of_file_if_missing", "=", "false", ";", "this", ".", "insert_new_line_after_opening_brace_in_array_initializer", "=", "false", ";", "this", ".", "insert_new_line_before_catch_in_try_statement", "=", "false", ";", "this", ".", "insert_new_line_before_closing_brace_in_array_initializer", "=", "false", ";", "this", ".", "insert_new_line_before_else_in_if_statement", "=", "false", ";", "this", ".", "insert_new_line_before_finally_in_try_statement", "=", "false", ";", "this", ".", "insert_new_line_before_while_in_do_statement", "=", "false", ";", "this", ".", "insert_new_line_in_empty_anonymous_type_declaration", "=", "true", ";", "this", ".", "insert_new_line_in_empty_block", "=", "true", ";", "this", ".", "insert_new_line_in_empty_method_body", "=", "true", ";", "this", ".", "insert_new_line_in_empty_type_declaration", "=", "true", ";", "this", ".", "insert_space_after_assignment_operator", "=", "true", ";", "this", ".", "insert_space_after_binary_operator", "=", "true", ";", "this", ".", "insert_space_after_closing_paren_in_cast", "=", "true", ";", "this", ".", "insert_space_after_closing_brace_in_block", "=", "true", ";", "this", ".", "insert_space_after_colon_in_assert", "=", "true", ";", "this", ".", "insert_space_after_colon_in_case", "=", "true", ";", "this", ".", "insert_space_after_colon_in_conditional", "=", "true", ";", "this", ".", "insert_space_after_colon_in_labeled_statement", "=", "true", ";", "this", ".", "insert_space_after_comma_in_allocation_expression", "=", "true", ";", "this", ".", "insert_space_after_comma_in_array_initializer", "=", "true", ";", "this", ".", "insert_space_after_comma_in_constructor_declaration_parameters", "=", "true", ";", "this", ".", "insert_space_after_comma_in_constructor_declaration_throws", "=", "true", ";", "this", ".", "insert_space_after_comma_in_explicit_constructor_call_arguments", "=", "true", ";", "this", ".", "insert_space_after_comma_in_for_increments", "=", "true", ";", "this", ".", "insert_space_after_comma_in_for_inits", "=", "true", ";", "this", ".", "insert_space_after_comma_in_method_invocation_arguments", "=", "true", ";", "this", ".", "insert_space_after_comma_in_method_declaration_parameters", "=", "true", ";", "this", ".", "insert_space_after_comma_in_method_declaration_throws", "=", "true", ";", "this", ".", "insert_space_after_comma_in_multiple_field_declarations", "=", "true", ";", "this", ".", "insert_space_after_comma_in_multiple_local_declarations", "=", "true", ";", "this", ".", "insert_space_after_comma_in_superinterfaces", "=", "true", ";", "this", ".", "insert_space_after_opening_bracket_in_array_allocation_expression", "=", "false", ";", "this", ".", "insert_space_after_opening_bracket_in_array_reference", "=", "false", ";", "this", ".", "insert_space_after_opening_brace_in_array_initializer", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_cast", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_catch", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_constructor_declaration", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_for", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_if", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_method_declaration", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_method_invocation", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_parenthesized_expression", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_switch", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_synchronized", "=", "false", ";", "this", ".", "insert_space_after_opening_paren_in_while", "=", "false", ";", "this", ".", "insert_space_after_postfix_operator", "=", "false", ";", "this", ".", "insert_space_after_prefix_operator", "=", "false", ";", "this", ".", "insert_space_after_question_in_conditional", "=", "true", ";", "this", ".", "insert_space_after_semicolon_in_for", "=", "true", ";", "this", ".", "insert_space_after_unary_operator", "=", "false", ";", "this", ".", "insert_space_before_assignment_operator", "=", "true", ";", "this", ".", "insert_space_before_binary_operator", "=", "true", ";", "this", ".", "insert_space_before_closing_brace_in_array_initializer", "=", "false", ";", "this", ".", "insert_space_before_closing_bracket_in_array_allocation_expression", "=", "false", ";", "this", ".", "insert_space_before_closing_bracket_in_array_reference", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_cast", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_catch", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_constructor_declaration", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_for", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_if", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_method_declaration", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_method_invocation", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_parenthesized_expression", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_switch", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_synchronized", "=", "false", ";", "this", ".", "insert_space_before_closing_paren_in_while", "=", "false", ";", "this", ".", "insert_space_before_colon_in_assert", "=", "true", ";", "this", ".", "insert_space_before_colon_in_case", "=", "true", ";", "this", ".", "insert_space_before_colon_in_conditional", "=", "true", ";", "this", ".", "insert_space_before_colon_in_default", "=", "true", ";", "this", ".", "insert_space_before_colon_in_labeled_statement", "=", "true", ";", "this", ".", "insert_space_before_comma_in_allocation_expression", "=", "false", ";", "this", ".", "insert_space_before_comma_in_array_initializer", "=", "false", ";", "this", ".", "insert_space_before_comma_in_constructor_declaration_parameters", "=", "false", ";", "this", ".", "insert_space_before_comma_in_constructor_declaration_throws", "=", "false", ";", "this", ".", "insert_space_before_comma_in_explicit_constructor_call_arguments", "=", "false", ";", "this", ".", "insert_space_before_comma_in_for_increments", "=", "false", ";", "this", ".", "insert_space_before_comma_in_for_inits", "=", "false", ";", "this", ".", "insert_space_before_comma_in_method_invocation_arguments", "=", "false", ";", "this", ".", "insert_space_before_comma_in_method_declaration_parameters", "=", "false", ";", "this", ".", "insert_space_before_comma_in_method_declaration_throws", "=", "false", ";", "this", ".", "insert_space_before_comma_in_multiple_field_declarations", "=", "false", ";", "this", ".", "insert_space_before_comma_in_multiple_local_declarations", "=", "false", ";", "this", ".", "insert_space_before_comma_in_superinterfaces", "=", "false", ";", "this", ".", "insert_space_before_opening_brace_in_anonymous_type_declaration", "=", "true", ";", "this", ".", "insert_space_before_opening_brace_in_array_initializer", "=", "false", ";", "this", ".", "insert_space_before_opening_brace_in_block", "=", "true", ";", "this", ".", "insert_space_before_opening_brace_in_constructor_declaration", "=", "true", ";", "this", ".", "insert_space_before_opening_brace_in_method_declaration", "=", "true", ";", "this", ".", "insert_space_before_opening_brace_in_switch", "=", "true", ";", "this", ".", "insert_space_before_opening_brace_in_type_declaration", "=", "true", ";", "this", ".", "insert_space_before_opening_bracket_in_array_allocation_expression", "=", "false", ";", "this", ".", "insert_space_before_opening_bracket_in_array_reference", "=", "false", ";", "this", ".", "insert_space_before_opening_bracket_in_array_type_reference", "=", "false", ";", "this", ".", "insert_space_before_opening_paren_in_catch", "=", "true", ";", "this", ".", "insert_space_before_opening_paren_in_constructor_declaration", "=", "false", ";", "this", ".", "insert_space_before_opening_paren_in_for", "=", "true", ";", "this", ".", "insert_space_before_opening_paren_in_if", "=", "true", ";", "this", ".", "insert_space_before_opening_paren_in_method_invocation", "=", "false", ";", "this", ".", "insert_space_before_opening_paren_in_method_declaration", "=", "false", ";", "this", ".", "insert_space_before_opening_paren_in_switch", "=", "true", ";", "this", ".", "insert_space_before_opening_paren_in_synchronized", "=", "true", ";", "this", ".", "insert_space_before_opening_paren_in_parenthesized_expression", "=", "false", ";", "this", ".", "insert_space_before_opening_paren_in_while", "=", "true", ";", "this", ".", "insert_space_before_postfix_operator", "=", "false", ";", "this", ".", "insert_space_before_prefix_operator", "=", "false", ";", "this", ".", "insert_space_before_question_in_conditional", "=", "true", ";", "this", ".", "insert_space_before_semicolon", "=", "false", ";", "this", ".", "insert_space_before_semicolon_in_for", "=", "false", ";", "this", ".", "insert_space_before_unary_operator", "=", "false", ";", "this", ".", "insert_space_between_brackets_in_array_type_reference", "=", "false", ";", "this", ".", "insert_space_between_empty_braces_in_array_initializer", "=", "false", ";", "this", ".", "insert_space_between_empty_brackets_in_array_allocation_expression", "=", "false", ";", "this", ".", "insert_space_between_empty_parens_in_constructor_declaration", "=", "false", ";", "this", ".", "insert_space_between_empty_parens_in_method_declaration", "=", "false", ";", "this", ".", "insert_space_between_empty_parens_in_method_invocation", "=", "false", ";", "this", ".", "compact_else_if", "=", "true", ";", "this", ".", "keep_guardian_clause_on_one_line", "=", "false", ";", "this", ".", "keep_else_statement_on_same_line", "=", "false", ";", "this", ".", "keep_empty_array_initializer_on_one_line", "=", "true", ";", "this", ".", "keep_simple_if_on_one_line", "=", "false", ";", "this", ".", "keep_then_statement_on_same_line", "=", "false", ";", "this", ".", "number_of_empty_lines_to_preserve", "=", "1", ";", "this", ".", "put_empty_statement_on_new_line", "=", "false", ";", "this", ".", "tab_size", "=", "4", ";", "this", ".", "page_width", "=", "80", ";", "this", ".", "use_tab", "=", "true", ";", "this", ".", "wrapBeforeBinaryOperator", "=", "true", ";", "this", ".", "never_indent_block_comments_on_first_column", "=", "false", ";", "this", ".", "never_indent_line_comments_on_first_column", "=", "false", ";", "}", "}", "</s>" ]
5,966
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Method", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "public", "class", "OrderedTestSuite", "extends", "TestSuite", "{", "public", "OrderedTestSuite", "(", "final", "Class", "testClass", ",", "String", "[", "]", "testMethods", ")", "{", "super", "(", "testClass", ".", "getName", "(", ")", ")", ";", "Set", "existingMethods", "=", "new", "HashSet", "(", ")", ";", "Method", "[", "]", "methods", "=", "testClass", ".", "getMethods", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "methods", ".", "length", ";", "i", "++", ")", "{", "Method", "method", "=", "methods", "[", "i", "]", ";", "existingMethods", ".", "add", "(", "method", ".", "getName", "(", ")", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "testMethods", ".", "length", ";", "i", "++", ")", "{", "final", "String", "testMethod", "=", "testMethods", "[", "i", "]", ";", "if", "(", "existingMethods", ".", "remove", "(", "testMethod", ")", ")", "{", "addTest", "(", "createTest", "(", "testClass", ",", "testMethod", ")", ")", ";", "}", "else", "{", "addTest", "(", "error", "(", "testMethod", ",", "new", "IllegalArgumentException", "(", "\"Class", "'\"", "+", "testClass", ".", "getName", "(", ")", "+", "\"\"", "+", "testMethod", "+", "\"'.\"", ")", ")", ")", ";", "}", "}", "for", "(", "Iterator", "iter", "=", "existingMethods", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "String", "existingMethod", "=", "(", "String", ")", "iter", ".", "next", "(", ")", ";", "if", "(", "existingMethod", ".", "startsWith", "(", "\"test\"", ")", ")", "{", "addTest", "(", "error", "(", "existingMethod", ",", "new", "IllegalArgumentException", "(", "\"\"", "+", "existingMethod", "+", "\"\"", "+", "testClass", ".", "getName", "(", ")", "+", "\"'.\"", ")", ")", ")", ";", "}", "}", "}", "public", "static", "Test", "error", "(", "String", "testMethod", ",", "Exception", "exception", ")", "{", "final", "Throwable", "e2", "=", "exception", ".", "fillInStackTrace", "(", ")", ";", "return", "new", "TestCase", "(", "testMethod", ")", "{", "protected", "void", "runTest", "(", ")", "throws", "Throwable", "{", "throw", "e2", ";", "}", "}", ";", "}", "}", "</s>" ]
5,967
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "util", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "SWT", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "layout", ".", "GridData", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Composite", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Control", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Label", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Shell", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Text", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "dialogs", ".", "Dialog", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "dialogs", ".", "IDialogConstants", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "resource", ".", "JFaceResources", ";", "public", "class", "FailureDialog", "extends", "Dialog", "{", "private", "Text", "_text", ";", "private", "String", "_log", ";", "private", "int", "SIZING_TEXT_WIDTH", "=", "400", ";", "private", "int", "SIZING_TEXT_HEIGHT", "=", "200", ";", "public", "FailureDialog", "(", "Shell", "parentShell", ")", "{", "super", "(", "parentShell", ")", ";", "}", "protected", "void", "configureShell", "(", "Shell", "newShell", ")", "{", "super", ".", "configureShell", "(", "newShell", ")", ";", "newShell", ".", "setText", "(", "\"\"", ")", ";", "}", "protected", "void", "createButtonsForButtonBar", "(", "Composite", "parent", ")", "{", "createButton", "(", "parent", ",", "IDialogConstants", ".", "OK_ID", ",", "\"&OK\"", ",", "true", ")", ";", "createButton", "(", "parent", ",", "IDialogConstants", ".", "CANCEL_ID", ",", "IDialogConstants", ".", "CANCEL_LABEL", ",", "false", ")", ";", "}", "protected", "Control", "createDialogArea", "(", "Composite", "parent", ")", "{", "Composite", "composite", "=", "(", "Composite", ")", "super", ".", "createDialogArea", "(", "parent", ")", ";", "composite", ".", "setSize", "(", "composite", ".", "computeSize", "(", "SWT", ".", "DEFAULT", ",", "SWT", ".", "DEFAULT", ")", ")", ";", "Label", "label", "=", "new", "Label", "(", "composite", ",", "SWT", ".", "WRAP", ")", ";", "label", ".", "setText", "(", "\"\"", ")", ";", "_text", "=", "new", "Text", "(", "composite", ",", "SWT", ".", "MULTI", "|", "SWT", ".", "BORDER", "|", "SWT", ".", "H_SCROLL", "|", "SWT", ".", "V_SCROLL", ")", ";", "_text", ".", "setFont", "(", "JFaceResources", ".", "getFontRegistry", "(", ")", ".", "get", "(", "JFaceResources", ".", "TEXT_FONT", ")", ")", ";", "GridData", "data", "=", "new", "GridData", "(", "GridData", ".", "FILL_BOTH", ")", ";", "data", ".", "widthHint", "=", "SIZING_TEXT_WIDTH", ";", "data", ".", "heightHint", "=", "SIZING_TEXT_HEIGHT", ";", "_text", ".", "setLayoutData", "(", "data", ")", ";", "return", "composite", ";", "}", "protected", "void", "okPressed", "(", ")", "{", "_log", "=", "_text", ".", "getText", "(", ")", ";", "super", ".", "okPressed", "(", ")", ";", "}", "String", "getText", "(", ")", "{", "if", "(", "_log", "==", "null", ")", "{", "return", "\"Empty", "entry.\"", ";", "}", "else", "{", "return", "_log", ";", "}", "}", "void", "setText", "(", "String", "text", ")", "{", "_text", ".", "setText", "(", "text", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "getText", "(", ")", ";", "}", "}", "</s>" ]
5,968
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "util", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "class", "SizingTestPass", "implements", "IDialogTestPass", "{", "private", "static", "final", "int", "CHECKLIST_SIZE", "=", "5", ";", "public", "String", "title", "(", ")", "{", "return", "\"\"", ";", "}", "public", "String", "description", "(", ")", "{", "return", "\"\"", ";", "}", "public", "String", "label", "(", ")", "{", "return", "\"\"", ";", "}", "public", "ArrayList", "checkListTexts", "(", ")", "{", "ArrayList", "list", "=", "new", "ArrayList", "(", "CHECKLIST_SIZE", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "return", "list", ";", "}", "public", "String", "[", "]", "failureTexts", "(", ")", "{", "String", "[", "]", "failureText", "=", "new", "String", "[", "CHECKLIST_SIZE", "]", ";", "failureText", "[", "0", "]", "=", "\"\"", ";", "failureText", "[", "1", "]", "=", "\"\"", ";", "failureText", "[", "2", "]", "=", "\"\"", ";", "failureText", "[", "3", "]", "=", "\"\"", ";", "failureText", "[", "4", "]", "=", "\"\"", ";", "return", "failureText", ";", "}", "public", "String", "queryText", "(", ")", "{", "return", "\"\"", ";", "}", "public", "int", "getID", "(", ")", "{", "return", "VerifyDialog", ".", "TEST_SIZING", ";", "}", "}", "</s>" ]
5,969
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "util", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "SWT", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "events", ".", "SelectionAdapter", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "events", ".", "SelectionEvent", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "events", ".", "ShellAdapter", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "events", ".", "ShellEvent", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "graphics", ".", "Point", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "layout", ".", "GridData", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "layout", ".", "GridLayout", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Button", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Composite", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Control", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Group", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Label", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Shell", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "dialogs", ".", "Dialog", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "dialogs", ".", "IDialogConstants", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "dialogs", ".", "TitleAreaDialog", ";", "public", "class", "VerifyDialog", "extends", "TitleAreaDialog", "{", "private", "int", "SIZING_WIDTH", "=", "400", ";", "private", "static", "int", "TEST_TYPE", ";", "public", "static", "final", "int", "TEST_SIZING", "=", "0", ";", "public", "static", "final", "int", "TEST_FOCUS", "=", "1", ";", "public", "static", "final", "int", "TEST_ACCESS", "=", "2", ";", "private", "IDialogTestPass", "_dialogTests", "[", "]", "=", "new", "IDialogTestPass", "[", "3", "]", ";", "private", "Dialog", "_testDialog", ";", "private", "Point", "_testDialogSize", ";", "private", "Label", "_queryLabel", ";", "private", "Button", "_yesButton", ";", "private", "Button", "_checkList", "[", "]", ";", "private", "String", "_failureText", ";", "public", "VerifyDialog", "(", "Shell", "parent", ")", "{", "super", "(", "parent", ")", ";", "if", "(", "!", "(", "TEST_TYPE", "<=", "2", ")", "&&", "!", "(", "TEST_TYPE", ">=", "0", ")", ")", "{", "TEST_TYPE", "=", "TEST_SIZING", ";", "}", "_failureText", "=", "\"\"", ";", "_dialogTests", "[", "0", "]", "=", "new", "SizingTestPass", "(", ")", ";", "_dialogTests", "[", "1", "]", "=", "new", "FocusTestPass", "(", ")", ";", "_dialogTests", "[", "2", "]", "=", "new", "AccessibilityTestPass", "(", ")", ";", "}", "protected", "void", "configureShell", "(", "Shell", "newShell", ")", "{", "super", ".", "configureShell", "(", "newShell", ")", ";", "newShell", ".", "setText", "(", "\"\"", ")", ";", "setShellStyle", "(", "SWT", ".", "NONE", ")", ";", "}", "protected", "void", "createButtonsForButtonBar", "(", "Composite", "parent", ")", "{", "_yesButton", "=", "createButton", "(", "parent", ",", "IDialogConstants", ".", "YES_ID", ",", "IDialogConstants", ".", "YES_LABEL", ",", "true", ")", ";", "createButton", "(", "parent", ",", "IDialogConstants", ".", "NO_ID", ",", "IDialogConstants", ".", "NO_LABEL", ",", "false", ")", ";", "}", "protected", "void", "buttonPressed", "(", "int", "buttonId", ")", "{", "if", "(", "IDialogConstants", ".", "YES_ID", "==", "buttonId", ")", "{", "setReturnCode", "(", "IDialogConstants", ".", "YES_ID", ")", ";", "if", "(", "_testDialog", ".", "getShell", "(", ")", "!=", "null", ")", "{", "_testDialog", ".", "close", "(", ")", ";", "}", "close", "(", ")", ";", "}", "else", "if", "(", "IDialogConstants", ".", "NO_ID", "==", "buttonId", ")", "{", "handleFailure", "(", ")", ";", "}", "}", "protected", "Control", "createDialogArea", "(", "Composite", "parent", ")", "{", "Composite", "parentComposite", "=", "(", "Composite", ")", "super", ".", "createDialogArea", "(", "parent", ")", ";", "Composite", "composite", "=", "new", "Composite", "(", "parentComposite", ",", "SWT", ".", "NONE", ")", ";", "composite", ".", "setSize", "(", "SIZING_WIDTH", ",", "SWT", ".", "DEFAULT", ")", ";", "GridLayout", "layout", "=", "new", "GridLayout", "(", ")", ";", "layout", ".", "marginHeight", "=", "convertVerticalDLUsToPixels", "(", "IDialogConstants", ".", "VERTICAL_MARGIN", ")", ";", "layout", ".", "marginWidth", "=", "convertHorizontalDLUsToPixels", "(", "IDialogConstants", ".", "HORIZONTAL_MARGIN", ")", ";", "layout", ".", "verticalSpacing", "=", "convertVerticalDLUsToPixels", "(", "IDialogConstants", ".", "VERTICAL_SPACING", ")", ";", "layout", ".", "horizontalSpacing", "=", "convertHorizontalDLUsToPixels", "(", "IDialogConstants", ".", "HORIZONTAL_SPACING", ")", ";", "composite", ".", "setLayout", "(", "layout", ")", ";", "composite", ".", "setLayoutData", "(", "new", "GridData", "(", "GridData", ".", "FILL_BOTH", ")", ")", ";", "createTestSelectionGroup", "(", "composite", ")", ";", "createCheckListGroup", "(", "composite", ")", ";", "_queryLabel", "=", "new", "Label", "(", "composite", ",", "SWT", ".", "NONE", ")", ";", "_queryLabel", ".", "setLayoutData", "(", "new", "GridData", "(", "GridData", ".", "FILL_HORIZONTAL", ")", ")", ";", "initializeTest", "(", ")", ";", "return", "composite", ";", "}", "private", "void", "createTestSelectionGroup", "(", "Composite", "parent", ")", "{", "Group", "group", "=", "new", "Group", "(", "parent", ",", "SWT", ".", "SHADOW_NONE", ")", ";", "group", ".", "setText", "(", "\"Testing:\"", ")", ";", "group", ".", "setLayout", "(", "new", "GridLayout", "(", ")", ")", ";", "GridData", "data", "=", "new", "GridData", "(", "GridData", ".", "FILL_HORIZONTAL", ")", ";", "group", ".", "setLayoutData", "(", "data", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "_dialogTests", ".", "length", ";", "i", "++", ")", "{", "Button", "radio", "=", "new", "Button", "(", "group", ",", "SWT", ".", "RADIO", ")", ";", "radio", ".", "setText", "(", "_dialogTests", "[", "i", "]", ".", "label", "(", ")", ")", ";", "final", "int", "testID", "=", "_dialogTests", "[", "i", "]", ".", "getID", "(", ")", ";", "radio", ".", "addSelectionListener", "(", "new", "SelectionAdapter", "(", ")", "{", "public", "void", "widgetSelected", "(", "SelectionEvent", "e", ")", "{", "TEST_TYPE", "=", "testID", ";", "initializeTest", "(", ")", ";", "_yesButton", ".", "setEnabled", "(", "true", ")", ";", "}", "}", ")", ";", "if", "(", "TEST_TYPE", "==", "_dialogTests", "[", "i", "]", ".", "getID", "(", ")", ")", "{", "radio", ".", "setSelection", "(", "true", ")", ";", "}", "}", "}", "private", "void", "createCheckListGroup", "(", "Composite", "parent", ")", "{", "Group", "group", "=", "new", "Group", "(", "parent", ",", "SWT", ".", "SHADOW_NONE", ")", ";", "group", ".", "setText", "(", "\"Verify", "that:\"", ")", ";", "group", ".", "setLayout", "(", "new", "GridLayout", "(", ")", ")", ";", "GridData", "data", "=", "new", "GridData", "(", "GridData", ".", "FILL_HORIZONTAL", ")", ";", "group", ".", "setLayoutData", "(", "data", ")", ";", "int", "checkListSize", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "_dialogTests", ".", "length", ";", "i", "++", ")", "{", "int", "size", "=", "_dialogTests", "[", "i", "]", ".", "checkListTexts", "(", ")", ".", "size", "(", ")", ";", "if", "(", "size", ">", "checkListSize", ")", "{", "checkListSize", "=", "size", ";", "}", "}", "_checkList", "=", "new", "Button", "[", "checkListSize", "]", ";", "SelectionAdapter", "selectionAdapter", "=", "new", "SelectionAdapter", "(", ")", "{", "public", "void", "widgetSelected", "(", "SelectionEvent", "e", ")", "{", "checkYesEnable", "(", ")", ";", "}", "}", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "checkListSize", ";", "i", "++", ")", "{", "_checkList", "[", "i", "]", "=", "new", "Button", "(", "group", ",", "SWT", ".", "CHECK", ")", ";", "_checkList", "[", "i", "]", ".", "addSelectionListener", "(", "selectionAdapter", ")", ";", "data", "=", "new", "GridData", "(", "GridData", ".", "HORIZONTAL_ALIGN_FILL", ")", ";", "data", ".", "grabExcessHorizontalSpace", "=", "true", ";", "_checkList", "[", "i", "]", ".", "setLayoutData", "(", "data", ")", ";", "}", "}", "private", "void", "checkYesEnable", "(", ")", "{", "boolean", "enable", "=", "true", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "_checkList", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "_checkList", "[", "i", "]", ".", "getSelection", "(", ")", ")", "{", "enable", "=", "false", ";", "}", "}", "_yesButton", ".", "setEnabled", "(", "enable", ")", ";", "}", "private", "void", "initializeTest", "(", ")", "{", "IDialogTestPass", "test", "=", "_dialogTests", "[", "TEST_TYPE", "]", ";", "setTitle", "(", "test", ".", "title", "(", ")", ")", ";", "setMessage", "(", "test", ".", "description", "(", ")", ")", ";", "Iterator", "iterator", "=", "test", ".", "checkListTexts", "(", ")", ".", "iterator", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "_checkList", ".", "length", ";", "i", "++", ")", "{", "if", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "_checkList", "[", "i", "]", ".", "setText", "(", "iterator", ".", "next", "(", ")", ".", "toString", "(", ")", ")", ";", "_checkList", "[", "i", "]", ".", "setVisible", "(", "true", ")", ";", "_checkList", "[", "i", "]", ".", "update", "(", ")", ";", "}", "else", "{", "_checkList", "[", "i", "]", ".", "setVisible", "(", "false", ")", ";", "_checkList", "[", "i", "]", ".", "update", "(", ")", ";", "}", "_checkList", "[", "i", "]", ".", "setSelection", "(", "true", ")", ";", "}", "_queryLabel", ".", "setText", "(", "test", ".", "queryText", "(", ")", ")", ";", "}", "public", "String", "getFailureText", "(", ")", "{", "return", "_failureText", ";", "}", "public", "int", "open", "(", ")", "{", "_failureText", "=", "\"\"", ";", "return", "IDialogConstants", ".", "NO_ID", ";", "}", "public", "int", "open", "(", "Dialog", "testDialog", ")", "{", "if", "(", "getShell", "(", ")", "==", "null", ")", "{", "create", "(", ")", ";", "}", "getShell", "(", ")", ".", "setLocation", "(", "0", ",", "0", ")", ";", "getShell", "(", ")", ".", "setSize", "(", "Math", ".", "max", "(", "SIZING_WIDTH", ",", "getShell", "(", ")", ".", "getSize", "(", ")", ".", "x", ")", ",", "getShell", "(", ")", ".", "getSize", "(", ")", ".", "y", ")", ";", "_testDialog", "=", "testDialog", ";", "if", "(", "_testDialog", ".", "getShell", "(", ")", "==", "null", ")", "{", "_testDialog", ".", "create", "(", ")", ";", "}", "_testDialogSize", "=", "_testDialog", ".", "getShell", "(", ")", ".", "getSize", "(", ")", ";", "openNewTestDialog", "(", ")", ";", "return", "super", ".", "open", "(", ")", ";", "}", "private", "void", "openNewTestDialog", "(", ")", "{", "if", "(", "_testDialog", ".", "getShell", "(", ")", "==", "null", ")", "{", "_testDialog", ".", "create", "(", ")", ";", "}", "_testDialog", ".", "setBlockOnOpen", "(", "false", ")", ";", "_testDialog", ".", "getShell", "(", ")", ".", "setLocation", "(", "getShell", "(", ")", ".", "getSize", "(", ")", ".", "x", "+", "1", ",", "0", ")", ";", "_testDialog", ".", "getShell", "(", ")", ".", "setSize", "(", "_testDialogSize", ")", ";", "_testDialog", ".", "getShell", "(", ")", ".", "addShellListener", "(", "new", "ShellAdapter", "(", ")", "{", "public", "void", "shellClosed", "(", "ShellEvent", "e", ")", "{", "e", ".", "doit", "=", "false", ";", "}", "}", ")", ";", "_testDialog", ".", "open", "(", ")", ";", "}", "private", "void", "handleFailure", "(", ")", "{", "IDialogTestPass", "test", "=", "_dialogTests", "[", "TEST_TYPE", "]", ";", "StringBuffer", "text", "=", "new", "StringBuffer", "(", ")", ";", "String", "label", "=", "test", ".", "label", "(", ")", ";", "label", "=", "label", ".", "substring", "(", "0", ",", "label", ".", "indexOf", "(", "\"&\"", ")", ")", "+", "label", ".", "substring", "(", "label", ".", "indexOf", "(", "\"&\"", ")", "+", "1", ")", ";", "text", ".", "append", "(", "label", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "SWT", ".", "getPlatform", "(", ")", ")", ".", "append", "(", "\"", "platform:n\"", ")", ";", "String", "failureMessages", "[", "]", "=", "test", ".", "failureTexts", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "test", ".", "checkListTexts", "(", ")", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "!", "_checkList", "[", "i", "]", ".", "getSelection", "(", ")", ")", "{", "text", ".", "append", "(", "\"-", "\"", ")", ".", "append", "(", "failureMessages", "[", "i", "]", ")", ".", "append", "(", "\"n\"", ")", ";", "}", "}", "FailureDialog", "dialog", "=", "new", "FailureDialog", "(", "getShell", "(", ")", ")", ";", "dialog", ".", "create", "(", ")", ";", "dialog", ".", "setText", "(", "text", ".", "toString", "(", ")", ")", ";", "if", "(", "dialog", ".", "open", "(", ")", "==", "IDialogConstants", ".", "OK_ID", ")", "{", "_failureText", "=", "dialog", ".", "toString", "(", ")", ";", "setReturnCode", "(", "IDialogConstants", ".", "NO_ID", ")", ";", "if", "(", "_testDialog", ".", "getShell", "(", ")", "!=", "null", ")", "{", "_testDialog", ".", "close", "(", ")", ";", "}", "close", "(", ")", ";", "}", "}", "protected", "void", "handleShellCloseEvent", "(", ")", "{", "handleFailure", "(", ")", ";", "}", "}", "</s>" ]
5,970
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "util", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "public", "class", "FocusTestPass", "implements", "IDialogTestPass", "{", "private", "static", "final", "int", "CHECKLIST_SIZE", "=", "1", ";", "public", "String", "title", "(", ")", "{", "return", "\"\"", ";", "}", "public", "String", "description", "(", ")", "{", "return", "\"\"", ";", "}", "public", "String", "label", "(", ")", "{", "return", "\"\"", ";", "}", "public", "ArrayList", "checkListTexts", "(", ")", "{", "ArrayList", "list", "=", "new", "ArrayList", "(", "CHECKLIST_SIZE", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "return", "list", ";", "}", "public", "String", "[", "]", "failureTexts", "(", ")", "{", "String", "[", "]", "failureText", "=", "new", "String", "[", "CHECKLIST_SIZE", "]", ";", "failureText", "[", "0", "]", "=", "\"\"", ";", "return", "failureText", ";", "}", "public", "String", "queryText", "(", ")", "{", "return", "\"\"", ";", "}", "public", "int", "getID", "(", ")", "{", "return", "VerifyDialog", ".", "TEST_FOCUS", ";", "}", "}", "</s>" ]
5,971
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "util", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "public", "class", "AccessibilityTestPass", "implements", "IDialogTestPass", "{", "private", "static", "final", "int", "CHECKLIST_SIZE", "=", "5", ";", "public", "String", "title", "(", ")", "{", "return", "\"\"", ";", "}", "public", "String", "description", "(", ")", "{", "return", "\"\"", ";", "}", "public", "String", "label", "(", ")", "{", "return", "\"\"", ";", "}", "public", "ArrayList", "checkListTexts", "(", ")", "{", "ArrayList", "list", "=", "new", "ArrayList", "(", "CHECKLIST_SIZE", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "list", ".", "add", "(", "\"\"", ")", ";", "return", "list", ";", "}", "public", "String", "[", "]", "failureTexts", "(", ")", "{", "String", "[", "]", "failureText", "=", "new", "String", "[", "CHECKLIST_SIZE", "]", ";", "failureText", "[", "0", "]", "=", "\"\"", ";", "failureText", "[", "1", "]", "=", "\"\"", ";", "failureText", "[", "2", "]", "=", "\"\"", ";", "failureText", "[", "3", "]", "=", "\"\"", ";", "failureText", "[", "4", "]", "=", "\"\"", ";", "return", "failureText", ";", "}", "public", "String", "queryText", "(", ")", "{", "return", "\"\"", ";", "}", "public", "int", "getID", "(", ")", "{", "return", "VerifyDialog", ".", "TEST_ACCESS", ";", "}", "}", "</s>" ]
5,972
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "util", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "SWT", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "graphics", ".", "Point", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Button", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Composite", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Control", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Label", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Shell", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "dialogs", ".", "Dialog", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "dialogs", ".", "IDialogConstants", ";", "import", "org", ".", "eclipse", ".", "ui", ".", "PlatformUI", ";", "public", "class", "DialogCheck", "{", "private", "DialogCheck", "(", ")", "{", "}", "private", "static", "VerifyDialog", "_verifyDialog", ";", "public", "static", "void", "assertDialog", "(", "Dialog", "dialog", ")", "{", "Assert", ".", "assertNotNull", "(", "dialog", ")", ";", "if", "(", "_verifyDialog", ".", "getShell", "(", ")", "==", "null", ")", "{", "getShell", "(", ")", ";", "}", "if", "(", "_verifyDialog", ".", "open", "(", "dialog", ")", "==", "IDialogConstants", ".", "NO_ID", ")", "{", "Assert", ".", "assertTrue", "(", "_verifyDialog", ".", "getFailureText", "(", ")", ",", "false", ")", ";", "}", "}", "public", "static", "void", "assertDialogTexts", "(", "Dialog", "dialog", ")", "{", "Assert", ".", "assertNotNull", "(", "dialog", ")", ";", "dialog", ".", "setBlockOnOpen", "(", "false", ")", ";", "dialog", ".", "open", "(", ")", ";", "Shell", "shell", "=", "dialog", ".", "getShell", "(", ")", ";", "verifyCompositeText", "(", "shell", ")", ";", "dialog", ".", "close", "(", ")", ";", "}", "public", "static", "Shell", "getShell", "(", ")", "{", "Shell", "shell", "=", "PlatformUI", ".", "getWorkbench", "(", ")", ".", "getActiveWorkbenchWindow", "(", ")", ".", "getShell", "(", ")", ";", "_verifyDialog", "=", "new", "VerifyDialog", "(", "shell", ")", ";", "_verifyDialog", ".", "create", "(", ")", ";", "return", "_verifyDialog", ".", "getShell", "(", ")", ";", "}", "private", "static", "void", "verifyCompositeText", "(", "Composite", "composite", ")", "{", "Control", "children", "[", "]", "=", "composite", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "try", "{", "verifyButtonText", "(", "(", "Button", ")", "children", "[", "i", "]", ")", ";", "}", "catch", "(", "ClassCastException", "exNotButton", ")", "{", "try", "{", "verifyLabelText", "(", "(", "Label", ")", "children", "[", "i", "]", ")", ";", "}", "catch", "(", "ClassCastException", "exNotLabel", ")", "{", "try", "{", "verifyCompositeText", "(", "(", "Composite", ")", "children", "[", "i", "]", ")", ";", "}", "catch", "(", "ClassCastException", "exNotComposite", ")", "{", "}", "}", "}", "}", "}", "private", "static", "void", "verifyButtonText", "(", "Button", "button", ")", "{", "String", "widget", "=", "button", ".", "toString", "(", ")", ";", "Point", "size", "=", "button", ".", "getSize", "(", ")", ";", "Point", "preferred", "=", "button", ".", "computeSize", "(", "SWT", ".", "DEFAULT", ",", "SWT", ".", "DEFAULT", ")", ";", "if", "(", "preferred", ".", "y", "*", "size", ".", "y", ">", "0", ")", "{", "preferred", ".", "y", "/=", "countLines", "(", "button", ".", "getText", "(", ")", ")", ";", "if", "(", "size", ".", "y", "/", "preferred", ".", "y", ">", "1", ")", "{", "preferred", ".", "x", "/=", "(", "size", ".", "y", "/", "preferred", ".", "y", ")", ";", "}", "}", "String", "message", "=", "new", "StringBuffer", "(", "\"Warning:", "\"", ")", ".", "append", "(", "widget", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "size", ".", "x", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "preferred", ".", "x", ")", ".", "toString", "(", ")", ";", "if", "(", "preferred", ".", "x", ">", "size", ".", "x", ")", "{", "button", ".", "getShell", "(", ")", ".", "dispose", "(", ")", ";", "Assert", ".", "assertTrue", "(", "message", ".", "toString", "(", ")", ",", "false", ")", ";", "}", "}", "private", "static", "void", "verifyLabelText", "(", "Label", "label", ")", "{", "String", "widget", "=", "label", ".", "toString", "(", ")", ";", "Point", "size", "=", "label", ".", "getSize", "(", ")", ";", "Point", "preferred", "=", "label", ".", "computeSize", "(", "SWT", ".", "DEFAULT", ",", "SWT", ".", "DEFAULT", ")", ";", "if", "(", "preferred", ".", "y", "*", "size", ".", "y", ">", "0", ")", "{", "preferred", ".", "y", "/=", "countLines", "(", "label", ".", "getText", "(", ")", ")", ";", "if", "(", "size", ".", "y", "/", "preferred", ".", "y", ">", "1", ")", "{", "preferred", ".", "x", "/=", "(", "size", ".", "y", "/", "preferred", ".", "y", ")", ";", "}", "}", "String", "message", "=", "new", "StringBuffer", "(", "\"Warning:", "\"", ")", ".", "append", "(", "widget", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "size", ".", "x", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "preferred", ".", "x", ")", ".", "toString", "(", ")", ";", "if", "(", "preferred", ".", "x", ">", "size", ".", "x", ")", "{", "label", ".", "getShell", "(", ")", ".", "dispose", "(", ")", ";", "Assert", ".", "assertTrue", "(", "message", ".", "toString", "(", ")", ",", "false", ")", ";", "}", "}", "private", "static", "int", "countLines", "(", "String", "text", ")", "{", "int", "newLines", "=", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "text", ".", "length", "(", ")", ";", "i", "++", ")", "{", "if", "(", "text", ".", "charAt", "(", "i", ")", "==", "'\\n'", ")", "{", "newLines", "++", ";", "}", "}", "return", "newLines", ";", "}", "}", "</s>" ]
5,973
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "util", ";", "import", "java", ".", "util", ".", "logging", ".", "Level", ";", "import", "java", ".", "util", ".", "logging", ".", "Logger", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "swt", ".", "widgets", ".", "Display", ";", "public", "abstract", "class", "DisplayHelper", "{", "private", "static", "final", "boolean", "DISABLE_TIMEOUT", "=", "false", ";", "protected", "DisplayHelper", "(", ")", "{", "}", "public", "final", "boolean", "waitForCondition", "(", "Display", "display", ",", "long", "timeout", ")", "{", "if", "(", "condition", "(", ")", ")", "return", "true", ";", "if", "(", "timeout", "<", "0", ")", "return", "false", ";", "driveEventQueue", "(", "display", ")", ";", "if", "(", "condition", "(", ")", ")", "return", "true", ";", "if", "(", "timeout", "==", "0", ")", "return", "false", ";", "DisplayWaiter", "waiter", "=", "new", "DisplayWaiter", "(", "display", ")", ";", "DisplayWaiter", ".", "Timeout", "timeoutState", "=", "waiter", ".", "start", "(", "timeout", ")", ";", "boolean", "condition", ";", "try", "{", "do", "{", "if", "(", "display", ".", "sleep", "(", ")", ")", "driveEventQueue", "(", "display", ")", ";", "condition", "=", "condition", "(", ")", ";", "}", "while", "(", "!", "condition", "&&", "!", "timeoutState", ".", "hasTimedOut", "(", ")", ")", ";", "}", "finally", "{", "waiter", ".", "stop", "(", ")", ";", "}", "return", "condition", ";", "}", "public", "static", "void", "sleep", "(", "Display", "display", ",", "long", "millis", ")", "{", "new", "DisplayHelper", "(", ")", "{", "public", "boolean", "condition", "(", ")", "{", "return", "false", ";", "}", "}", ".", "waitForCondition", "(", "display", ",", "millis", ")", ";", "}", "protected", "abstract", "boolean", "condition", "(", ")", ";", "private", "static", "boolean", "driveEventQueue", "(", "Display", "display", ")", "{", "boolean", "events", "=", "false", ";", "while", "(", "display", ".", "readAndDispatch", "(", ")", ")", "{", "events", "=", "true", ";", "}", "return", "events", ";", "}", "public", "final", "boolean", "waitForCondition", "(", "Display", "display", ",", "long", "timeout", ",", "long", "interval", ")", "{", "if", "(", "condition", "(", ")", ")", "return", "true", ";", "if", "(", "timeout", "<", "0", ")", "return", "false", ";", "driveEventQueue", "(", "display", ")", ";", "if", "(", "condition", "(", ")", ")", "return", "true", ";", "if", "(", "timeout", "==", "0", ")", "return", "false", ";", "DisplayWaiter", "waiter", "=", "new", "DisplayWaiter", "(", "display", ",", "true", ")", ";", "long", "currentTimeMillis", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "finalTimeout", "=", "timeout", "+", "currentTimeMillis", ";", "if", "(", "finalTimeout", "<", "currentTimeMillis", ")", "finalTimeout", "=", "Long", ".", "MAX_VALUE", ";", "boolean", "condition", ";", "try", "{", "do", "{", "waiter", ".", "restart", "(", "interval", ")", ";", "if", "(", "display", ".", "sleep", "(", ")", ")", "driveEventQueue", "(", "display", ")", ";", "condition", "=", "condition", "(", ")", ";", "}", "while", "(", "!", "condition", "&&", "(", "DISABLE_TIMEOUT", "||", "finalTimeout", ">", "System", ".", "currentTimeMillis", "(", ")", ")", ")", ";", "}", "finally", "{", "waiter", ".", "stop", "(", ")", ";", "}", "return", "condition", ";", "}", "}", "final", "class", "DisplayWaiter", "{", "public", "final", "class", "Timeout", "{", "private", "boolean", "fTimeoutState", "=", "false", ";", "public", "boolean", "hasTimedOut", "(", ")", "{", "synchronized", "(", "fMutex", ")", "{", "return", "fTimeoutState", ";", "}", "}", "void", "setTimedOut", "(", "boolean", "timedOut", ")", "{", "fTimeoutState", "=", "timedOut", ";", "}", "Timeout", "(", "boolean", "initialState", ")", "{", "fTimeoutState", "=", "initialState", ";", "}", "}", "private", "final", "Display", "fDisplay", ";", "private", "final", "Object", "fMutex", "=", "new", "Object", "(", ")", ";", "private", "final", "boolean", "fKeepRunningOnTimeout", ";", "private", "static", "final", "int", "RUNNING", "=", "1", "<<", "1", ";", "private", "static", "final", "int", "STOPPED", "=", "1", "<<", "2", ";", "private", "static", "final", "int", "IDLE", "=", "1", "<<", "3", ";", "private", "int", "fState", ";", "private", "long", "fNextTimeout", ";", "private", "Thread", "fCurrentThread", ";", "private", "Timeout", "fCurrentTimeoutState", ";", "public", "DisplayWaiter", "(", "Display", "display", ")", "{", "this", "(", "display", ",", "false", ")", ";", "}", "public", "DisplayWaiter", "(", "Display", "display", ",", "boolean", "keepRunning", ")", "{", "Assert", ".", "assertNotNull", "(", "display", ")", ";", "fDisplay", "=", "display", ";", "fState", "=", "STOPPED", ";", "fKeepRunningOnTimeout", "=", "keepRunning", ";", "}", "public", "Timeout", "start", "(", "long", "delay", ")", "{", "Assert", ".", "assertTrue", "(", "delay", ">", "0", ")", ";", "synchronized", "(", "fMutex", ")", "{", "switch", "(", "fState", ")", "{", "case", "STOPPED", ":", "startThread", "(", ")", ";", "setNextTimeout", "(", "delay", ")", ";", "break", ";", "case", "IDLE", ":", "unhold", "(", ")", ";", "setNextTimeout", "(", "delay", ")", ";", "break", ";", "}", "return", "fCurrentTimeoutState", ";", "}", "}", "private", "void", "setNextTimeout", "(", "long", "delay", ")", "{", "long", "currentTimeMillis", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "long", "next", "=", "currentTimeMillis", "+", "delay", ";", "if", "(", "next", ">", "currentTimeMillis", ")", "fNextTimeout", "=", "next", ";", "else", "fNextTimeout", "=", "Long", ".", "MAX_VALUE", ";", "}", "public", "Timeout", "restart", "(", "long", "delay", ")", "{", "Assert", ".", "assertTrue", "(", "delay", ">", "0", ")", ";", "synchronized", "(", "fMutex", ")", "{", "switch", "(", "fState", ")", "{", "case", "STOPPED", ":", "startThread", "(", ")", ";", "break", ";", "case", "IDLE", ":", "unhold", "(", ")", ";", "break", ";", "}", "setNextTimeout", "(", "delay", ")", ";", "return", "fCurrentTimeoutState", ";", "}", "}", "public", "void", "stop", "(", ")", "{", "synchronized", "(", "fMutex", ")", "{", "if", "(", "tryTransition", "(", "RUNNING", "|", "IDLE", ",", "STOPPED", ")", ")", "fMutex", ".", "notifyAll", "(", ")", ";", "}", "}", "public", "void", "hold", "(", ")", "{", "synchronized", "(", "fMutex", ")", "{", "if", "(", "tryTransition", "(", "RUNNING", ",", "IDLE", ")", ")", "fMutex", ".", "notifyAll", "(", ")", ";", "}", "}", "private", "void", "unhold", "(", ")", "{", "checkedTransition", "(", "IDLE", ",", "RUNNING", ")", ";", "fCurrentTimeoutState", "=", "new", "Timeout", "(", "false", ")", ";", "fMutex", ".", "notifyAll", "(", ")", ";", "}", "private", "void", "startThread", "(", ")", "{", "checkedTransition", "(", "STOPPED", ",", "RUNNING", ")", ";", "fCurrentTimeoutState", "=", "new", "Timeout", "(", "false", ")", ";", "fCurrentThread", "=", "new", "Thread", "(", ")", "{", "final", "class", "ThreadChangedException", "extends", "Exception", "{", "private", "static", "final", "long", "serialVersionUID", "=", "1L", ";", "}", "public", "void", "run", "(", ")", "{", "try", "{", "run2", "(", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "Logger", ".", "global", ".", "log", "(", "Level", ".", "FINE", ",", "\"\"", ",", "e", ")", ";", "}", "catch", "(", "ThreadChangedException", "e", ")", "{", "Logger", ".", "global", ".", "log", "(", "Level", ".", "FINE", ",", "\"\"", ",", "e", ")", ";", "synchronized", "(", "fMutex", ")", "{", "fMutex", ".", "notifyAll", "(", ")", ";", "}", "}", "}", "private", "void", "run2", "(", ")", "throws", "InterruptedException", ",", "ThreadChangedException", "{", "synchronized", "(", "fMutex", ")", "{", "checkThread", "(", ")", ";", "tryHold", "(", ")", ";", "assertStates", "(", "STOPPED", "|", "RUNNING", ")", ";", "while", "(", "isState", "(", "RUNNING", ")", ")", "{", "waitForTimeout", "(", ")", ";", "if", "(", "isState", "(", "RUNNING", ")", ")", "timedOut", "(", ")", ";", "assertStates", "(", "STOPPED", "|", "IDLE", ")", ";", "tryHold", "(", ")", ";", "assertStates", "(", "STOPPED", "|", "RUNNING", ")", ";", "}", "assertStates", "(", "STOPPED", ")", ";", "}", "}", "private", "void", "checkThread", "(", ")", "throws", "ThreadChangedException", "{", "if", "(", "fCurrentThread", "!=", "this", ")", "throw", "new", "ThreadChangedException", "(", ")", ";", "}", "private", "void", "waitForTimeout", "(", ")", "throws", "InterruptedException", ",", "ThreadChangedException", "{", "long", "delta", ";", "while", "(", "isState", "(", "RUNNING", ")", "&&", "(", "delta", "=", "fNextTimeout", "-", "System", ".", "currentTimeMillis", "(", ")", ")", ">", "0", ")", "{", "delta", "=", "Math", ".", "max", "(", "delta", ",", "50", ")", ";", "Logger", ".", "global", ".", "finest", "(", "\"\"", "+", "delta", "+", "\"ms\"", ")", ";", "fMutex", ".", "wait", "(", "delta", ")", ";", "checkThread", "(", ")", ";", "}", "}", "private", "void", "timedOut", "(", ")", "{", "Logger", ".", "global", ".", "finer", "(", "\"timed", "out\"", ")", ";", "fCurrentTimeoutState", ".", "setTimedOut", "(", "true", ")", ";", "fDisplay", ".", "wake", "(", ")", ";", "if", "(", "fKeepRunningOnTimeout", ")", "checkedTransition", "(", "RUNNING", ",", "IDLE", ")", ";", "else", "checkedTransition", "(", "RUNNING", ",", "STOPPED", ")", ";", "}", "private", "void", "tryHold", "(", ")", "throws", "InterruptedException", ",", "ThreadChangedException", "{", "while", "(", "isState", "(", "IDLE", ")", ")", "{", "fMutex", ".", "wait", "(", "0", ")", ";", "checkThread", "(", ")", ";", "}", "assertStates", "(", "STOPPED", "|", "RUNNING", ")", ";", "}", "}", ";", "fCurrentThread", ".", "start", "(", ")", ";", "}", "private", "boolean", "tryTransition", "(", "int", "possibleStates", ",", "int", "nextState", ")", "{", "if", "(", "isState", "(", "possibleStates", ")", ")", "{", "Logger", ".", "global", ".", "finer", "(", "name", "(", "fState", ")", "+", "\"", ">", "\"", "+", "name", "(", "nextState", ")", "+", "\"", "(\"", "+", "name", "(", "possibleStates", ")", "+", "\")\"", ")", ";", "fState", "=", "nextState", ";", "return", "true", ";", "}", "Logger", ".", "global", ".", "finest", "(", "\"noTransition\"", "+", "name", "(", "fState", ")", "+", "\"", "!>", "\"", "+", "name", "(", "nextState", ")", "+", "\"", "(\"", "+", "name", "(", "possibleStates", ")", "+", "\")\"", ")", ";", "return", "false", ";", "}", "private", "void", "checkedTransition", "(", "int", "possibleStates", ",", "int", "nextState", ")", "{", "assertStates", "(", "possibleStates", ")", ";", "Logger", ".", "global", ".", "finer", "(", "name", "(", "fState", ")", "+", "\"", ">", "\"", "+", "name", "(", "nextState", ")", ")", ";", "fState", "=", "nextState", ";", "}", "private", "void", "assertStates", "(", "int", "states", ")", "{", "Assert", ".", "assertTrue", "(", "\"\"", ",", "isState", "(", "states", ")", ")", ";", "}", "private", "boolean", "isState", "(", "int", "states", ")", "{", "return", "(", "states", "&", "fState", ")", "==", "fState", ";", "}", "private", "String", "name", "(", "int", "states", ")", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "boolean", "comma", "=", "false", ";", "if", "(", "(", "states", "&", "RUNNING", ")", "==", "RUNNING", ")", "{", "buf", ".", "append", "(", "\"RUNNING\"", ")", ";", "comma", "=", "true", ";", "}", "if", "(", "(", "states", "&", "STOPPED", ")", "==", "STOPPED", ")", "{", "if", "(", "comma", ")", "buf", ".", "append", "(", "\",\"", ")", ";", "buf", ".", "append", "(", "\"STOPPED\"", ")", ";", "comma", "=", "true", ";", "}", "if", "(", "(", "states", "&", "IDLE", ")", "==", "IDLE", ")", "{", "if", "(", "comma", ")", "buf", ".", "append", "(", "\",\"", ")", ";", "buf", ".", "append", "(", "\"IDLE\"", ")", ";", "}", "return", "buf", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
5,974
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "util", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "public", "interface", "IDialogTestPass", "{", "public", "String", "title", "(", ")", ";", "public", "String", "description", "(", ")", ";", "public", "String", "label", "(", ")", ";", "public", "ArrayList", "checkListTexts", "(", ")", ";", "public", "String", "[", "]", "failureTexts", "(", ")", ";", "public", "String", "queryText", "(", ")", ";", "public", "int", "getID", "(", ")", ";", "}", "</s>" ]
5,975
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "test", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "JavaProjectHelper", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "public", "class", "JavaTestCase", "extends", "TestCase", "{", "private", "IJavaProject", "fJavaProject", ";", "public", "JavaTestCase", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "static", "Test", "suite", "(", ")", "{", "TestSuite", "suite", "=", "new", "TestSuite", "(", ")", ";", "suite", ".", "addTest", "(", "new", "JavaTestCase", "(", "\"doTest1\"", ")", ")", ";", "return", "suite", ";", "}", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "fJavaProject", "=", "JavaProjectHelper", ".", "createJavaProject", "(", "\"\"", ",", "\"bin\"", ")", ";", "IPackageFragmentRoot", "root", "=", "JavaProjectHelper", ".", "addSourceContainer", "(", "fJavaProject", ",", "\"src\"", ")", ";", "IPackageFragment", "pack", "=", "root", ".", "createPackageFragment", "(", "\"ibm.util\"", ",", "true", ",", "null", ")", ";", "ICompilationUnit", "cu", "=", "pack", ".", "getCompilationUnit", "(", "\"A.java\"", ")", ";", "IType", "type", "=", "cu", ".", "createType", "(", "\"\"", ",", "null", ",", "true", ",", "null", ")", ";", "type", ".", "createMethod", "(", "\"\"", ",", "null", ",", "true", ",", "null", ")", ";", "type", ".", "createMethod", "(", "\"\"", ",", "null", ",", "true", ",", "null", ")", ";", "}", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "JavaProjectHelper", ".", "delete", "(", "fJavaProject", ")", ";", "}", "public", "void", "doTest1", "(", ")", "throws", "Exception", "{", "String", "name", "=", "\"\"", ";", "ICompilationUnit", "cu", "=", "(", "ICompilationUnit", ")", "fJavaProject", ".", "findElement", "(", "new", "Path", "(", "name", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "cu", "!=", "null", ")", ";", "IType", "type", "=", "cu", ".", "getType", "(", "\"A\"", ")", ";", "assertTrue", "(", "\"\"", ",", "type", "!=", "null", ")", ";", "System", ".", "out", ".", "println", "(", "\"methods", "of", "A\"", ")", ";", "IMethod", "[", "]", "methods", "=", "type", ".", "getMethods", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "methods", ".", "length", ";", "i", "++", ")", "{", "System", ".", "out", ".", "println", "(", "methods", "[", "i", "]", ".", "getElementName", "(", ")", ")", ";", "}", "assertTrue", "(", "\"\"", ",", "methods", ".", "length", "==", "2", ")", ";", "}", "}", "</s>" ]
5,976
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "test", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "JavaProjectHelper", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "public", "class", "HelloWorld", "extends", "TestCase", "{", "private", "IJavaProject", "fJProject", ";", "public", "static", "Test", "suite", "(", ")", "{", "TestSuite", "suite", "=", "new", "TestSuite", "(", ")", ";", "suite", ".", "addTest", "(", "new", "HelloWorld", "(", "\"test1\"", ")", ")", ";", "return", "suite", ";", "}", "public", "HelloWorld", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "fJProject", "=", "JavaProjectHelper", ".", "createJavaProject", "(", "\"TestProject1\"", ",", "\"bin\"", ")", ";", "}", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "JavaProjectHelper", ".", "delete", "(", "fJProject", ")", ";", "}", "public", "void", "test1", "(", ")", "throws", "Exception", "{", "if", "(", "JavaProjectHelper", ".", "addRTJar", "(", "fJProject", ")", "==", "null", ")", "{", "assertTrue", "(", "\"\"", ",", "false", ")", ";", "return", ";", "}", "String", "name", "=", "\"\"", ";", "IClassFile", "classfile", "=", "(", "IClassFile", ")", "fJProject", ".", "findElement", "(", "new", "Path", "(", "name", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "classfile", "!=", "null", ")", ";", "IType", "type", "=", "classfile", ".", "getType", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "IMethod", "[", "]", "methods", "=", "type", ".", "getMethods", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "methods", ".", "length", ";", "i", "++", ")", "{", "System", ".", "out", ".", "println", "(", "methods", "[", "i", "]", ".", "getElementName", "(", ")", ")", ";", "}", "}", "}", "</s>" ]
5,977
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "StringReader", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "public", "class", "StringAsserts", "{", "public", "StringAsserts", "(", ")", "{", "super", "(", ")", ";", "}", "private", "static", "int", "getDiffPos", "(", "String", "str1", ",", "String", "str2", ")", "{", "int", "len1", "=", "Math", ".", "min", "(", "str1", ".", "length", "(", ")", ",", "str2", ".", "length", "(", ")", ")", ";", "int", "diffPos", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "len1", ";", "i", "++", ")", "{", "if", "(", "str1", ".", "charAt", "(", "i", ")", "!=", "str2", ".", "charAt", "(", "i", ")", ")", "{", "diffPos", "=", "i", ";", "break", ";", "}", "}", "if", "(", "diffPos", "==", "-", "1", "&&", "str1", ".", "length", "(", ")", "!=", "str2", ".", "length", "(", ")", ")", "{", "diffPos", "=", "len1", ";", "}", "return", "diffPos", ";", "}", "private", "static", "final", "int", "printRange", "=", "6", ";", "public", "static", "void", "assertEqualString", "(", "String", "actual", ",", "String", "expected", ")", "{", "if", "(", "actual", "==", "null", "||", "expected", "==", "null", ")", "{", "if", "(", "actual", "==", "expected", ")", "{", "return", ";", "}", "if", "(", "actual", "==", "null", ")", "{", "Assert", ".", "assertTrue", "(", "\"\"", "+", "expected", ",", "false", ")", ";", "}", "else", "{", "Assert", ".", "assertTrue", "(", "\"\"", "+", "actual", ",", "false", ")", ";", "}", "}", "int", "diffPos", "=", "getDiffPos", "(", "actual", ",", "expected", ")", ";", "if", "(", "diffPos", "!=", "-", "1", ")", "{", "int", "diffAhead", "=", "Math", ".", "max", "(", "0", ",", "diffPos", "-", "printRange", ")", ";", "int", "diffAfter", "=", "Math", ".", "min", "(", "actual", ".", "length", "(", ")", ",", "diffPos", "+", "printRange", ")", ";", "String", "diffStr", "=", "actual", ".", "substring", "(", "diffAhead", ",", "diffPos", ")", "+", "'^'", "+", "actual", ".", "substring", "(", "diffPos", ",", "diffAfter", ")", ";", "String", "message", "=", "\"\"", "+", "actual", "+", "\"\"", "+", "diffPos", "+", "\":", "\"", "+", "diffStr", "+", "\"nexpected:n\"", "+", "expected", ";", "Assert", ".", "assertEquals", "(", "message", ",", "expected", ",", "actual", ")", ";", "}", "}", "public", "static", "void", "assertEqualStringIgnoreDelim", "(", "String", "actual", ",", "String", "expected", ")", "throws", "IOException", "{", "if", "(", "actual", "==", "null", "||", "expected", "==", "null", ")", "{", "if", "(", "actual", "==", "expected", ")", "{", "return", ";", "}", "if", "(", "actual", "==", "null", ")", "{", "Assert", ".", "assertTrue", "(", "\"\"", "+", "expected", ",", "false", ")", ";", "}", "else", "{", "Assert", ".", "assertTrue", "(", "\"\"", "+", "actual", ",", "false", ")", ";", "}", "}", "BufferedReader", "read1", "=", "new", "BufferedReader", "(", "new", "StringReader", "(", "actual", ")", ")", ";", "BufferedReader", "read2", "=", "new", "BufferedReader", "(", "new", "StringReader", "(", "expected", ")", ")", ";", "int", "line", "=", "1", ";", "do", "{", "String", "s1", "=", "read1", ".", "readLine", "(", ")", ";", "String", "s2", "=", "read2", ".", "readLine", "(", ")", ";", "if", "(", "s1", "==", "null", "||", "!", "s1", ".", "equals", "(", "s2", ")", ")", "{", "if", "(", "s1", "==", "null", "&&", "s2", "==", "null", ")", "{", "return", ";", "}", "String", "diffStr", "=", "(", "s1", "==", "null", ")", "?", "s2", ":", "s1", ";", "String", "message", "=", "\"\"", "+", "actual", "+", "\"\"", "+", "line", "+", "\":", "\"", "+", "diffStr", "+", "\"\"", "+", "expected", ";", "Assert", ".", "assertEquals", "(", "message", ",", "expected", ",", "actual", ")", ";", "}", "line", "++", ";", "}", "while", "(", "true", ")", ";", "}", "public", "static", "void", "assertEqualStringsIgnoreOrder", "(", "String", "[", "]", "actuals", ",", "String", "[", "]", "expecteds", ")", "{", "ArrayList", "list1", "=", "new", "ArrayList", "(", "Arrays", ".", "asList", "(", "actuals", ")", ")", ";", "ArrayList", "list2", "=", "new", "ArrayList", "(", "Arrays", ".", "asList", "(", "expecteds", ")", ")", ";", "for", "(", "int", "i", "=", "list1", ".", "size", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "if", "(", "list2", ".", "remove", "(", "list1", ".", "get", "(", "i", ")", ")", ")", "{", "list1", ".", "remove", "(", "i", ")", ";", "}", "}", "int", "n1", "=", "list1", ".", "size", "(", ")", ";", "int", "n2", "=", "list2", ".", "size", "(", ")", ";", "if", "(", "n1", "+", "n2", ">", "0", ")", "{", "if", "(", "n1", "==", "1", "&&", "n2", "==", "1", ")", "{", "assertEqualString", "(", "(", "String", ")", "list1", ".", "get", "(", "0", ")", ",", "(", "String", ")", "list2", ".", "get", "(", "0", ")", ")", ";", "}", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n1", ";", "i", "++", ")", "{", "String", "s1", "=", "(", "String", ")", "list1", ".", "get", "(", "i", ")", ";", "if", "(", "s1", "!=", "null", ")", "{", "buf", ".", "append", "(", "s1", ")", ";", "buf", ".", "append", "(", "\"n\"", ")", ";", "}", "}", "String", "actual", "=", "buf", ".", "toString", "(", ")", ";", "buf", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n2", ";", "i", "++", ")", "{", "String", "s2", "=", "(", "String", ")", "list2", ".", "get", "(", "i", ")", ";", "if", "(", "s2", "!=", "null", ")", "{", "buf", ".", "append", "(", "s2", ")", ";", "buf", ".", "append", "(", "\"n\"", ")", ";", "}", "}", "String", "expected", "=", "buf", ".", "toString", "(", ")", ";", "String", "message", "=", "\"\"", "+", "actual", "+", "\"\"", "+", "expected", ";", "Assert", ".", "assertEquals", "(", "message", ",", "expected", ",", "actual", ")", ";", "}", "}", "public", "static", "void", "assertExpectedExistInProposals", "(", "String", "[", "]", "actuals", ",", "String", "[", "]", "expecteds", ")", "{", "ArrayList", "list1", "=", "new", "ArrayList", "(", "Arrays", ".", "asList", "(", "actuals", ")", ")", ";", "ArrayList", "list2", "=", "new", "ArrayList", "(", "Arrays", ".", "asList", "(", "expecteds", ")", ")", ";", "for", "(", "int", "i", "=", "list1", ".", "size", "(", ")", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "if", "(", "list2", ".", "remove", "(", "list1", ".", "get", "(", "i", ")", ")", ")", "{", "list1", ".", "remove", "(", "i", ")", ";", "}", "}", "int", "n1", "=", "list1", ".", "size", "(", ")", ";", "int", "n2", "=", "list2", ".", "size", "(", ")", ";", "if", "(", "n2", ">", "0", ")", "{", "if", "(", "n1", "==", "1", "&&", "n2", "==", "1", ")", "{", "assertEqualString", "(", "(", "String", ")", "list1", ".", "get", "(", "0", ")", ",", "(", "String", ")", "list2", ".", "get", "(", "0", ")", ")", ";", "}", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n1", ";", "i", "++", ")", "{", "String", "s1", "=", "(", "String", ")", "list1", ".", "get", "(", "i", ")", ";", "if", "(", "s1", "!=", "null", ")", "{", "buf", ".", "append", "(", "s1", ")", ";", "buf", ".", "append", "(", "\"n\"", ")", ";", "}", "}", "String", "actual", "=", "buf", ".", "toString", "(", ")", ";", "buf", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n2", ";", "i", "++", ")", "{", "String", "s2", "=", "(", "String", ")", "list2", ".", "get", "(", "i", ")", ";", "if", "(", "s2", "!=", "null", ")", "{", "buf", ".", "append", "(", "s2", ")", ";", "buf", ".", "append", "(", "\"n\"", ")", ";", "}", "}", "String", "expected", "=", "buf", ".", "toString", "(", ")", ";", "String", "message", "=", "\"\"", "+", "actual", "+", "\"\"", "+", "expected", ";", "Assert", ".", "assertEquals", "(", "message", ",", "expected", ",", "actual", ")", ";", "}", "}", "}", "</s>" ]
5,978
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ";", "import", "junit", ".", "extensions", ".", "TestSetup", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "JavaPlugin", ";", "public", "class", "TestOptionsSetup", "extends", "TestSetup", "{", "public", "TestOptionsSetup", "(", "Test", "test", ")", "{", "super", "(", "test", ")", ";", "}", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "JavaCore", ".", "setOptions", "(", "TestOptions", ".", "getDefaultOptions", "(", ")", ")", ";", "TestOptions", ".", "initializeCodeGenerationOptions", "(", ")", ";", "JavaPlugin", ".", "getDefault", "(", ")", ".", "getCodeTemplateStore", "(", ")", ".", "load", "(", ")", ";", "}", "}", "</s>" ]
5,979
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "public", "class", "MixedLineDelimiterDetector", "{", "public", "static", "void", "assertNoMixedLineDelimiters", "(", "IJavaElement", "elem", ")", "{", "IResource", "resource", ";", "if", "(", "elem", "instanceof", "IJavaProject", ")", "resource", "=", "(", "(", "IJavaProject", ")", "elem", ")", ".", "getProject", "(", ")", ";", "else", "resource", "=", "elem", ".", "getResource", "(", ")", ";", "assertNoMixedLineDelimiters", "(", "resource", ")", ";", "}", "public", "static", "void", "assertNoMixedLineDelimiters", "(", "IResource", "resource", ")", "{", "IResource", "[", "]", "mixedResources", "=", "findFilesWithMixedLineDelimiters", "(", "resource", ")", ";", "Assert", ".", "assertTrue", "(", "mixedResources", "==", "null", "||", "mixedResources", ".", "length", "==", "0", ")", ";", "}", "private", "static", "IResource", "[", "]", "findFilesWithMixedLineDelimiters", "(", "final", "IResource", "resource", ")", "{", "Assert", ".", "fail", "(", "\"\"", ")", ";", "return", "new", "IResource", "[", "0", "]", ";", "}", "}", "</s>" ]
5,980
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "JavaPlugin", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "JavaProjectHelper", ";", "public", "class", "RefactoringTestSetup", "extends", "AbstractRefactoringTestSetup", "{", "public", "RefactoringTestSetup", "(", "Test", "test", ")", "{", "super", "(", "test", ")", ";", "}", "public", "static", "final", "String", "CONTAINER", "=", "\"src\"", ";", "private", "static", "IPackageFragmentRoot", "fgRoot", ";", "private", "static", "IPackageFragment", "fgPackageP", ";", "private", "static", "IJavaProject", "fgJavaTestProject", ";", "private", "static", "IPackageFragmentRoot", "[", "]", "fgJRELibraries", ";", "private", "static", "IPackageFragmentRoot", "fgGroovyLibrary", ";", "public", "static", "IPackageFragmentRoot", "getDefaultSourceFolder", "(", ")", "throws", "Exception", "{", "if", "(", "fgRoot", "!=", "null", ")", "return", "fgRoot", ";", "throw", "new", "Exception", "(", "RefactoringTestSetup", ".", "class", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "[", "]", "getJRELibraries", "(", ")", "throws", "Exception", "{", "if", "(", "fgJRELibraries", "!=", "null", ")", "return", "fgJRELibraries", ";", "throw", "new", "Exception", "(", "RefactoringTestSetup", ".", "class", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "public", "static", "IClasspathEntry", "[", "]", "getJRELibrariesAsRawClasspathEntry", "(", ")", "throws", "Exception", "{", "if", "(", "fgJRELibraries", "!=", "null", ")", "{", "IClasspathEntry", "[", "]", "entries", "=", "new", "IClasspathEntry", "[", "fgJRELibraries", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fgJRELibraries", ".", "length", ";", "i", "++", ")", "{", "entries", "[", "i", "]", "=", "fgJRELibraries", "[", "i", "]", ".", "getRawClasspathEntry", "(", ")", ";", "}", "return", "entries", ";", "}", "throw", "new", "Exception", "(", "RefactoringTestSetup", ".", "class", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "public", "static", "IJavaProject", "getProject", "(", ")", "throws", "Exception", "{", "if", "(", "fgJavaTestProject", "!=", "null", ")", "return", "fgJavaTestProject", ";", "throw", "new", "Exception", "(", "RefactoringTestSetup", ".", "class", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "public", "static", "IPackageFragment", "getPackageP", "(", ")", "throws", "Exception", "{", "if", "(", "fgPackageP", "!=", "null", ")", "return", "fgPackageP", ";", "throw", "new", "Exception", "(", "RefactoringTestSetup", ".", "class", ".", "getName", "(", ")", "+", "\"\"", ")", ";", "}", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "if", "(", "fgJavaTestProject", "!=", "null", "&&", "fgJavaTestProject", ".", "exists", "(", ")", ")", "{", "int", "breakpointTarget", "=", "0", ";", "breakpointTarget", "++", ";", "}", "fgJavaTestProject", "=", "JavaProjectHelper", ".", "createGroovyProject", "(", "\"TestProject\"", "+", "System", ".", "currentTimeMillis", "(", ")", ",", "\"bin\"", ")", ";", "fgJRELibraries", "=", "addRTJars", "(", "fgJavaTestProject", ")", ";", "fgGroovyLibrary", "=", "addGroovyJar", "(", "fgJavaTestProject", ")", ";", "JavaProjectHelper", ".", "removeFromClasspath", "(", "fgJavaTestProject", ",", "fgJavaTestProject", ".", "getProject", "(", ")", ".", "getFullPath", "(", ")", ")", ";", "fgRoot", "=", "JavaProjectHelper", ".", "addSourceContainer", "(", "fgJavaTestProject", ",", "CONTAINER", ")", ";", "fgPackageP", "=", "fgRoot", ".", "createPackageFragment", "(", "\"p\"", ",", "true", ",", "null", ")", ";", "}", "public", "IPackageFragmentRoot", "getGroovyLibrary", "(", ")", "{", "return", "fgGroovyLibrary", ";", "}", "protected", "IPackageFragmentRoot", "[", "]", "addRTJars", "(", "IJavaProject", "project", ")", "throws", "CoreException", "{", "return", "JavaProjectHelper", ".", "addRTJars", "(", "project", ")", ";", "}", "protected", "IPackageFragmentRoot", "addGroovyJar", "(", "IJavaProject", "project", ")", "throws", "CoreException", "{", "return", "JavaProjectHelper", ".", "addGroovyJar", "(", "project", ")", ";", "}", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "JavaProjectHelper", ".", "delete", "(", "fgJavaTestProject", ")", ";", "super", ".", "tearDown", "(", ")", ";", "}", "}", "</s>" ]
5,981
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extractMethod", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "model", ".", "GroovyRuntime", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "core", ".", "extract", ".", "ExtractGroovyMethodRefactoring", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "TestPrefInitializer", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "TestProject", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyCompilationUnit", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "Change", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatus", ";", "import", "org", ".", "objectweb", ".", "asm", ".", "Opcodes", ";", "public", "class", "ExtractMethodTestCase", "extends", "RefactoringTestCase", "{", "private", "ExtractGroovyMethodRefactoring", "refactoring", ";", "private", "TestProject", "testProject", ";", "private", "GroovyCompilationUnit", "unit", ";", "public", "ExtractMethodTestCase", "(", "String", "arg0", ",", "File", "arg1", ")", "{", "super", "(", "arg0", ",", "arg1", ")", ";", "}", "@", "Override", "public", "void", "preAction", "(", ")", "{", "try", "{", "testProject", "=", "new", "TestProject", "(", ")", ";", "GroovyRuntime", ".", "addGroovyRuntime", "(", "testProject", ".", "getProject", "(", ")", ")", ";", "unit", "=", "(", "GroovyCompilationUnit", ")", "JavaCore", ".", "createCompilationUnitFrom", "(", "testProject", ".", "createGroovyTypeAndPackage", "(", "\"\"", ",", "\"File.groovy\"", ",", "getOrigin", "(", ")", ".", "get", "(", ")", ")", ")", ";", "unit", ".", "becomeWorkingCopy", "(", "null", ")", ";", "RefactoringStatus", "status", "=", "new", "RefactoringStatus", "(", ")", ";", "refactoring", "=", "new", "ExtractGroovyMethodRefactoring", "(", "unit", ",", "getUserSelection", "(", ")", ".", "getOffset", "(", ")", ",", "getUserSelection", "(", ")", ".", "getLength", "(", ")", ",", "status", ")", ";", "refactoring", ".", "setPreferences", "(", "TestPrefInitializer", ".", "initializePreferences", "(", "getFileProperties", "(", ")", ")", ")", ";", "if", "(", "status", ".", "getSeverity", "(", ")", "!=", "RefactoringStatus", ".", "OK", ")", "{", "fail", "(", "\"\"", "+", "status", ")", ";", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "RuntimeException", "(", "e", ")", ";", "}", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "unit", ".", "discardWorkingCopy", "(", ")", ";", "testProject", ".", "dispose", "(", ")", ";", "}", "@", "Override", "public", "RefactoringStatus", "checkInitialCondition", "(", ")", "throws", "OperationCanceledException", ",", "CoreException", "{", "return", "refactoring", ".", "checkInitialConditions", "(", "new", "NullProgressMonitor", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "simulateUserInput", "(", ")", "{", "int", "modifier", "=", "0", ";", "String", "newMethodName", "=", "\"\"", ";", "try", "{", "newMethodName", "=", "properties", ".", "get", "(", "\"\"", ")", ";", "String", "mod", "=", "properties", ".", "get", "(", "\"modifier\"", ")", ";", "if", "(", "mod", ".", "equals", "(", "\"private\"", ")", ")", "modifier", "=", "Opcodes", ".", "ACC_PRIVATE", ";", "if", "(", "mod", ".", "equals", "(", "\"def\"", ")", ")", "modifier", "=", "Opcodes", ".", "ACC_PUBLIC", ";", "if", "(", "mod", ".", "equals", "(", "\"protected\"", ")", ")", "modifier", "=", "Opcodes", ".", "ACC_PROTECTED", ";", "}", "catch", "(", "Exception", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "fail", "(", "\"\"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "refactoring", ".", "setModifier", "(", "modifier", ")", ";", "refactoring", ".", "setNewMethodname", "(", "newMethodName", ")", ";", "setMoveParameter", "(", "refactoring", ")", ";", "setRenameParameter", "(", "refactoring", ")", ";", "}", "@", "Override", "public", "RefactoringStatus", "checkFinalCondition", "(", ")", "throws", "OperationCanceledException", ",", "CoreException", "{", "return", "refactoring", ".", "checkFinalConditions", "(", "new", "NullProgressMonitor", "(", ")", ")", ";", "}", "@", "Override", "public", "Change", "createChange", "(", ")", "throws", "OperationCanceledException", ",", "CoreException", "{", "return", "refactoring", ".", "createChange", "(", "new", "NullProgressMonitor", "(", ")", ")", ";", "}", "@", "Override", "public", "void", "finalAssert", "(", ")", "{", "getDocument", "(", ")", ".", "set", "(", "String", ".", "valueOf", "(", "unit", ".", "getContents", "(", ")", ")", ")", ";", "super", ".", "finalAssert", "(", ")", ";", "}", "private", "void", "setRenameParameter", "(", "ExtractGroovyMethodRefactoring", "provider", ")", "{", "String", "variableToRename", "=", "properties", ".", "get", "(", "\"\"", ")", ";", "Map", "<", "String", ",", "String", ">", "variablesToRename", "=", "null", ";", "if", "(", "variableToRename", "!=", "null", ")", "{", "variablesToRename", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "String", "[", "]", "renameMappings", "=", "variableToRename", ".", "split", "(", "\";\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "renameMappings", ".", "length", ";", "i", "++", ")", "{", "String", "[", "]", "singleRenames", "=", "renameMappings", "[", "i", "]", ".", "split", "(", "\":\"", ")", ";", "if", "(", "singleRenames", ".", "length", "==", "2", ")", "{", "variablesToRename", ".", "put", "(", "singleRenames", "[", "0", "]", ",", "singleRenames", "[", "1", "]", ")", ";", "}", "}", "provider", ".", "setParameterRename", "(", "variablesToRename", ")", ";", "}", "}", "private", "void", "setMoveParameter", "(", "ExtractGroovyMethodRefactoring", "provider", ")", "{", "String", "moveSettings", "=", "properties", ".", "get", "(", "\"moveVariable\"", ")", ";", "if", "(", "moveSettings", "!=", "null", ")", "{", "boolean", "upEvent", "=", "false", ";", "int", "sortOfMoveCharPosition", "=", "moveSettings", ".", "indexOf", "(", "'+'", ")", ";", "if", "(", "sortOfMoveCharPosition", "==", "-", "1", ")", "{", "upEvent", "=", "true", ";", "sortOfMoveCharPosition", "=", "moveSettings", ".", "indexOf", "(", "'-'", ")", ";", "}", "String", "varName", "=", "moveSettings", ".", "substring", "(", "0", ",", "sortOfMoveCharPosition", ")", ";", "int", "numberOfMoves", "=", "Integer", ".", "valueOf", "(", "moveSettings", ".", "substring", "(", "sortOfMoveCharPosition", "+", "1", ",", "moveSettings", ".", "length", "(", ")", ")", ")", ";", "provider", ".", "setMoveParameter", "(", "varName", ",", "upEvent", ",", "numberOfMoves", ")", ";", "}", "}", "}", "</s>" ]
5,982
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extractMethod", ";", "import", "java", ".", "io", ".", "File", ";", "import", "junit", ".", "framework", ".", "AssertionFailedError", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "BaseTestCase", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "Change", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatus", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatusEntry", ";", "public", "abstract", "class", "RefactoringTestCase", "extends", "BaseTestCase", "{", "public", "RefactoringTestCase", "(", "String", "name", ",", "File", "file", ")", "{", "super", "(", "name", ",", "file", ")", ";", "setName", "(", "\"\"", ")", ";", "}", "public", "void", "testRefactoring", "(", ")", "throws", "Throwable", "{", "try", "{", "preAction", "(", ")", ";", "RefactoringStatus", "rs", "=", "checkInitialCondition", "(", ")", ";", "simulateUserInput", "(", ")", ";", "rs", ".", "merge", "(", "checkFinalCondition", "(", ")", ")", ";", "if", "(", "analyseRefactoringStatus", "(", "rs", ")", ")", "{", "Change", "change", "=", "createChange", "(", ")", ";", "change", ".", "perform", "(", "new", "NullProgressMonitor", "(", ")", ")", ";", "}", "finalAssert", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "if", "(", "e", ".", "getCause", "(", ")", "instanceof", "AssertionFailedError", ")", "{", "throw", "e", ".", "getCause", "(", ")", ";", "}", "throw", "e", ";", "}", "}", "private", "boolean", "analyseRefactoringStatus", "(", "RefactoringStatus", "state", ")", "{", "RefactoringStatusEntry", "[", "]", "entries", "=", "state", ".", "getEntries", "(", ")", ";", "if", "(", "shouldFail", "&&", "(", "entries", ".", "length", "==", "0", ")", ")", "{", "fail", "(", "\"\"", "+", "properties", ".", "get", "(", "\"failMessage\"", ")", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entries", ".", "length", ";", "i", "++", ")", "{", "RefactoringStatusEntry", "entry", "=", "entries", "[", "i", "]", ";", "if", "(", "(", "entry", ".", "isError", "(", ")", "||", "entry", ".", "isFatalError", "(", ")", ")", "&&", "shouldFail", "==", "false", ")", "{", "fail", "(", "\"\"", "+", "entry", ".", "getMessage", "(", ")", ")", ";", "}", "else", "{", "if", "(", "shouldFail", "&&", "properties", ".", "get", "(", "\"failMessage\"", ")", "!=", "null", ")", "{", "assertEquals", "(", "properties", ".", "get", "(", "\"failMessage\"", ")", ",", "entry", ".", "getMessage", "(", ")", ")", ";", "}", "}", "if", "(", "entry", ".", "isFatalError", "(", ")", ")", "{", "return", "false", ";", "}", "}", "return", "true", ";", "}", "public", "abstract", "void", "preAction", "(", ")", ";", "public", "abstract", "RefactoringStatus", "checkInitialCondition", "(", ")", "throws", "OperationCanceledException", ",", "CoreException", ";", "public", "abstract", "void", "simulateUserInput", "(", ")", ";", "public", "abstract", "RefactoringStatus", "checkFinalCondition", "(", ")", "throws", "OperationCanceledException", ",", "CoreException", ";", "public", "abstract", "Change", "createChange", "(", ")", "throws", "OperationCanceledException", ",", "CoreException", ";", "}", "</s>" ]
5,983
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extractMethod", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "BaseTestSuite", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "public", "class", "ExtractMethodTestSuite", "extends", "BaseTestSuite", "{", "public", "static", "TestSuite", "suite", "(", ")", "{", "TestSuite", "ts", "=", "new", "TestSuite", "(", "\"\"", ")", ";", "List", "<", "File", ">", "files", "=", "getFileList", "(", "\"\"", ",", "\"\"", ")", ";", "for", "(", "File", "file", ":", "files", ")", "{", "ts", ".", "addTest", "(", "new", "ExtractMethodTestCase", "(", "file", ".", "getName", "(", ")", ",", "file", ")", ")", ";", "}", "return", "ts", ";", "}", "}", "</s>" ]
5,984
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extract", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "core", ".", "extract", ".", "ExtractGroovyLocalRefactoring", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "RefactoringTest", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "RefactoringTestSetup", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyCompilationUnit", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringCore", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatus", ";", "public", "class", "ExtractLocalTests", "extends", "RefactoringTest", "{", "private", "static", "final", "Class", "<", "ExtractLocalTests", ">", "clazz", "=", "ExtractLocalTests", ".", "class", ";", "private", "static", "final", "String", "REFACTORING_PATH", "=", "\"\"", ";", "public", "ExtractLocalTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "static", "Test", "suite", "(", ")", "{", "return", "new", "RefactoringTestSetup", "(", "new", "TestSuite", "(", "clazz", ")", ")", ";", "}", "public", "static", "Test", "setUpTest", "(", "Test", "test", ")", "{", "return", "new", "RefactoringTestSetup", "(", "test", ")", ";", "}", "@", "Override", "protected", "String", "getRefactoringPath", "(", ")", "{", "return", "REFACTORING_PATH", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "fIsPreDeltaTest", "=", "true", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "}", "public", "void", "test1", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest1In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest1Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"foo", "+", "bar\"", ",", "\"test1\"", ")", ",", "\"foo", "+", "bar\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test2", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest2In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest2Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"foo.bar\"", ",", "\"test2\"", ")", ",", "\"foo.bar\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test3", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest3In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest3Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"baz.foo.&bar\"", ",", "\"test3\"", ")", ",", "\"baz.foo.&bar\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test4", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest4In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest4Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"first", "+", "1\"", ",", "\"test4\"", ")", ",", "\"first", "+", "1\"", ".", "length", "(", ")", ",", "false", ")", ";", "}", "public", "void", "test5", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest5In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest5Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"foo", "+", "bar\"", ",", "\"test5\"", ")", ",", "\"foo", "+", "bar\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test6", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest6In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest6Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"foo", "+", "bar\"", ",", "\"test6\"", ")", ",", "\"foo", "+", "bar\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test7", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest7In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest7Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"foo", "+", "bar\"", ",", "\"test7\"", ")", ",", "\"foo", "+", "bar\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test8", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest8In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest8Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"foo+", "bar\"", ",", "\"test8\"", ")", ",", "\"foo+", "bar\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test9", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest9In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest9Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"map.one\"", ",", "\"test9\"", ")", ",", "\"map.one\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test10", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest10In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest10Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"\"", ",", "\"test10\"", ")", ",", "\"\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test10a", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest10In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest10Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"\"", ",", "\"test10\"", ")", ",", "\"\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test10b", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest10In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest10Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"\"", ",", "\"test10\"", ")", ",", "\"\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test11", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest11In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest11Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"\"", ",", "\"test11\"", ")", ",", "\"\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "public", "void", "test12", "(", ")", "throws", "Exception", "{", "helper", "(", "ExtractLocalTestsData", ".", "getTest12In", "(", ")", ",", "ExtractLocalTestsData", ".", "getTest12Out", "(", ")", ",", "ExtractLocalTestsData", ".", "findLocation", "(", "\"\"", ",", "\"test12\"", ")", ",", "\"\"", ".", "length", "(", ")", ",", "true", ")", ";", "}", "private", "void", "helper", "(", "String", "before", ",", "String", "expected", ",", "int", "offset", ",", "int", "length", ",", "boolean", "replaceAllOccurrences", ")", "throws", "Exception", "{", "GroovyCompilationUnit", "cu", "=", "(", "GroovyCompilationUnit", ")", "createCU", "(", "getPackageP", "(", ")", ",", "\"A.groovy\"", ",", "before", ")", ";", "try", "{", "ExtractGroovyLocalRefactoring", "refactoring", "=", "new", "ExtractGroovyLocalRefactoring", "(", "cu", ",", "offset", ",", "length", ")", ";", "refactoring", ".", "setReplaceAllOccurrences", "(", "replaceAllOccurrences", ")", ";", "refactoring", ".", "setLocalName", "(", "refactoring", ".", "guessLocalNames", "(", ")", "[", "0", "]", ")", ";", "RefactoringStatus", "result", "=", "performRefactoring", "(", "refactoring", ",", "false", ")", ";", "assertTrue", "(", "\"\"", ",", "result", "==", "null", "||", "result", ".", "isOK", "(", ")", ")", ";", "assertEqualLines", "(", "\"\"", ",", "expected", ",", "cu", ".", "getSource", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToUndo", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "!", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToRedo", "(", ")", ")", ";", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "performUndo", "(", "null", ",", "new", "NullProgressMonitor", "(", ")", ")", ";", "assertEqualLines", "(", "\"invalid", "undo\"", ",", "before", ",", "cu", ".", "getSource", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "!", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToUndo", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToRedo", "(", ")", ")", ";", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "performRedo", "(", "null", ",", "new", "NullProgressMonitor", "(", ")", ")", ";", "assertEqualLines", "(", "\"invalid", "redo\"", ",", "expected", ",", "cu", ".", "getSource", "(", ")", ")", ";", "}", "finally", "{", "performDummySearch", "(", ")", ";", "cu", ".", "delete", "(", "true", ",", "null", ")", ";", "}", "}", "}", "</s>" ]
5,985
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extract", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "core", ".", "extract", ".", "ExtractGroovyConstantRefactoring", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "RefactoringTest", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "RefactoringTestSetup", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyCompilationUnit", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringCore", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatus", ";", "public", "class", "ExtractConstantTests", "extends", "RefactoringTest", "{", "private", "static", "final", "String", "FOO_BAR", "=", "\"Foo", "+", "Bar\"", ";", "private", "static", "final", "String", "FOO_BAR_FRAX", "=", "\"\"", ";", "private", "static", "final", "Class", "<", "ExtractConstantTests", ">", "clazz", "=", "ExtractConstantTests", ".", "class", ";", "private", "static", "final", "String", "REFACTORING_PATH", "=", "\"\"", ";", "public", "ExtractConstantTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "static", "Test", "suite", "(", ")", "{", "return", "new", "RefactoringTestSetup", "(", "new", "TestSuite", "(", "clazz", ")", ")", ";", "}", "public", "static", "Test", "setUpTest", "(", "Test", "test", ")", "{", "return", "new", "RefactoringTestSetup", "(", "test", ")", ";", "}", "@", "Override", "protected", "String", "getRefactoringPath", "(", ")", "{", "return", "REFACTORING_PATH", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "fIsPreDeltaTest", "=", "true", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "}", "public", "void", "test1", "(", ")", "throws", "Exception", "{", "helper", "(", "indexOf", "(", "FOO_BAR", ")", ",", "FOO_BAR", ".", "length", "(", ")", ",", "true", ",", "false", ")", ";", "}", "public", "void", "test2", "(", ")", "throws", "Exception", "{", "helper", "(", "indexOf", "(", "FOO_BAR", ")", ",", "FOO_BAR", ".", "length", "(", ")", ",", "true", ",", "false", ")", ";", "}", "public", "void", "test3", "(", ")", "throws", "Exception", "{", "helper", "(", "indexOf", "(", "FOO_BAR_FRAX", ")", ",", "FOO_BAR_FRAX", ".", "length", "(", ")", ",", "true", ",", "false", ")", ";", "}", "public", "void", "test4", "(", ")", "throws", "Exception", "{", "helper", "(", "indexOf", "(", "FOO_BAR_FRAX", ")", ",", "FOO_BAR_FRAX", ".", "length", "(", ")", ",", "true", ",", "false", ")", ";", "}", "public", "void", "test5a", "(", ")", "throws", "Exception", "{", "helper", "(", "indexOf", "(", "FOO_BAR_FRAX", ")", ",", "FOO_BAR_FRAX", ".", "length", "(", ")", ",", "true", ",", "false", ")", ";", "}", "public", "void", "test6a", "(", ")", "throws", "Exception", "{", "helper", "(", "indexOf", "(", "FOO_BAR_FRAX", ")", ",", "FOO_BAR_FRAX", ".", "length", "(", ")", ",", "true", ",", "false", ")", ";", "}", "public", "void", "testNoReplaceOccurrences1", "(", ")", "throws", "Exception", "{", "helper", "(", "indexOf", "(", "FOO_BAR_FRAX", ")", ",", "FOO_BAR_FRAX", ".", "length", "(", ")", ",", "false", ",", "false", ")", ";", "}", "public", "void", "testQualifiedReplace1", "(", ")", "throws", "Exception", "{", "helper", "(", "indexOf", "(", "FOO_BAR_FRAX", ")", ",", "FOO_BAR_FRAX", ".", "length", "(", ")", ",", "true", ",", "true", ")", ";", "}", "private", "int", "indexOf", "(", "String", "str", ")", "throws", "IOException", "{", "return", "getFileContents", "(", "getInputTestFileName", "(", "\"A\"", ")", ")", ".", "indexOf", "(", "str", ")", ";", "}", "private", "void", "helper", "(", "int", "offset", ",", "int", "length", ",", "boolean", "replaceAllOccurrences", ",", "boolean", "useQualifiedReplace", ")", "throws", "Exception", "{", "GroovyCompilationUnit", "cu", "=", "(", "GroovyCompilationUnit", ")", "createCUfromTestFile", "(", "getPackageP", "(", ")", ",", "\"A\"", ")", ";", "try", "{", "ExtractGroovyConstantRefactoring", "refactoring", "=", "new", "ExtractGroovyConstantRefactoring", "(", "cu", ",", "offset", ",", "length", ")", ";", "refactoring", ".", "setReplaceAllOccurrences", "(", "replaceAllOccurrences", ")", ";", "refactoring", ".", "setQualifyReferencesWithDeclaringClassName", "(", "useQualifiedReplace", ")", ";", "refactoring", ".", "setConstantName", "(", "refactoring", ".", "guessConstantName", "(", ")", ")", ";", "RefactoringStatus", "result", "=", "performRefactoring", "(", "refactoring", ",", "false", ")", ";", "assertTrue", "(", "\"\"", ",", "result", "==", "null", "||", "result", ".", "isOK", "(", ")", ")", ";", "assertEqualLines", "(", "\"\"", ",", "getFileContents", "(", "getOutputTestFileName", "(", "\"A\"", ")", ")", ",", "cu", ".", "getSource", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToUndo", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "!", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToRedo", "(", ")", ")", ";", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "performUndo", "(", "null", ",", "new", "NullProgressMonitor", "(", ")", ")", ";", "assertEqualLines", "(", "\"invalid", "undo\"", ",", "getFileContents", "(", "getInputTestFileName", "(", "\"A\"", ")", ")", ",", "cu", ".", "getSource", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "!", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToUndo", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToRedo", "(", ")", ")", ";", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "performRedo", "(", "null", ",", "new", "NullProgressMonitor", "(", ")", ")", ";", "assertEqualLines", "(", "\"invalid", "redo\"", ",", "getFileContents", "(", "getOutputTestFileName", "(", "\"A\"", ")", ")", ",", "cu", ".", "getSource", "(", ")", ")", ";", "}", "finally", "{", "performDummySearch", "(", ")", ";", "cu", ".", "delete", "(", "true", ",", "null", ")", ";", "}", "}", "}", "</s>" ]
5,986
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extract", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ModuleNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codebrowsing", ".", "tests", ".", "AbstractCheckerTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "core", ".", "extract", ".", "StaticExpressionChecker", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "public", "class", "StaticFragmentCheckerTests", "extends", "AbstractCheckerTests", "{", "public", "StaticFragmentCheckerTests", "(", ")", "{", "super", "(", "StaticFragmentCheckerTests", ".", "class", ".", "getName", "(", ")", ")", ";", "}", "public", "void", "testStaticExpressionChecker1", "(", ")", "throws", "Exception", "{", "checkIsStatic", "(", "\"666\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker2", "(", ")", "throws", "Exception", "{", "checkIsNotStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker3", "(", ")", "throws", "Exception", "{", "checkIsNotStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker4", "(", ")", "throws", "Exception", "{", "checkIsStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker5", "(", ")", "throws", "Exception", "{", "checkIsStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker6", "(", ")", "throws", "Exception", "{", "checkIsNotStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker7", "(", ")", "throws", "Exception", "{", "checkIsStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker8", "(", ")", "throws", "Exception", "{", "checkIsNotStatic", "(", "\"\"", ")", ";", "}", "private", "void", "checkIsStatic", "(", "String", "text", ")", "throws", "CoreException", "{", "ModuleNode", "module", "=", "createModuleFromText", "(", "text", ")", ";", "StaticExpressionChecker", "checker", "=", "new", "StaticExpressionChecker", "(", ")", ";", "boolean", "result", "=", "checker", ".", "doVisit", "(", "getLastExpression", "(", "module", ")", ")", ";", "assertTrue", "(", "\"\"", "+", "text", "+", "\"\"", ",", "result", ")", ";", "}", "private", "void", "checkIsNotStatic", "(", "String", "text", ")", "throws", "CoreException", "{", "ModuleNode", "module", "=", "createModuleFromText", "(", "text", ")", ";", "StaticExpressionChecker", "checker", "=", "new", "StaticExpressionChecker", "(", ")", ";", "boolean", "result", "=", "checker", ".", "doVisit", "(", "getLastExpression", "(", "module", ")", ")", ";", "assertFalse", "(", "\"\"", "+", "text", "+", "\"\"", ",", "result", ")", ";", "}", "}", "</s>" ]
5,987
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extract", ";", "import", "java", ".", "util", ".", "List", ";", "import", "junit", ".", "framework", ".", "AssertionFailedError", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "core", ".", "extract", ".", "ConvertGroovyLocalToFieldRefactoring", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "RefactoringTest", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "RefactoringTestSetup", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyCompilationUnit", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringCore", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatus", ";", "public", "class", "ConvertLocalToFieldTests", "extends", "RefactoringTest", "{", "private", "static", "final", "Class", "<", "ConvertLocalToFieldTests", ">", "clazz", "=", "ConvertLocalToFieldTests", ".", "class", ";", "private", "static", "final", "String", "REFACTORING_PATH", "=", "\"\"", ";", "public", "ConvertLocalToFieldTests", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "public", "static", "Test", "suite", "(", ")", "{", "return", "new", "RefactoringTestSetup", "(", "new", "TestSuite", "(", "clazz", ")", ")", ";", "}", "public", "static", "Test", "setUpTest", "(", "Test", "test", ")", "{", "return", "new", "RefactoringTestSetup", "(", "test", ")", ";", "}", "@", "Override", "protected", "String", "getRefactoringPath", "(", ")", "{", "return", "REFACTORING_PATH", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "fIsPreDeltaTest", "=", "true", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "}", "public", "void", "testMethodToModule", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testClosureToModule", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testDeclarationWithDef", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testDeclarationWithType", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testReference", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testTupleDeclaration", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testRename", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"testRename\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testInitialization", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testVariableConflict", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testFieldConflict", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testFieldReference", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testException", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testForLoop", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"testForLoop\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testPostfix", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"testPostfix\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testPrefix", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"testPrefix\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testMethodInvocation", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testParameterList", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testArgumentList", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testInnerClass", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testInnerFieldConflict", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testFakeField", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testClosure", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"testClosure\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testClosureVariableConflict", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testClosureParameterList", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "public", "void", "testClosureImplicitIt", "(", ")", "throws", "Exception", "{", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", "=", "ConvertLocalToFieldTestsData", ".", "getTestCases", "(", ")", ".", "get", "(", "\"\"", ")", ";", "helper", "(", "testCase", ")", ";", "}", "private", "void", "helper", "(", "ConvertLocalToFieldTestsData", ".", "TestCase", "testCase", ")", "throws", "Exception", "{", "GroovyCompilationUnit", "cu", "=", "(", "GroovyCompilationUnit", ")", "createCU", "(", "getPackageP", "(", ")", ",", "\"Test.groovy\"", ",", "testCase", ".", "getInput", "(", ")", ")", ";", "try", "{", "ConvertGroovyLocalToFieldRefactoring", "refactoring", "=", "new", "ConvertGroovyLocalToFieldRefactoring", "(", "cu", ",", "testCase", ".", "getSelectionOffset", "(", ")", ",", "testCase", ".", "getSelectionLength", "(", ")", ")", ";", "refactoring", ".", "setFieldName", "(", "testCase", ".", "getFieldName", "(", ")", ")", ";", "RefactoringStatus", "result", "=", "null", ";", "try", "{", "result", "=", "performRefactoring", "(", "refactoring", ",", "false", ")", ";", "}", "catch", "(", "AssertionFailedError", "e", ")", "{", "if", "(", "testCase", ".", "getExpected", "(", ")", "==", "null", ")", "{", "return", ";", "}", "else", "{", "throw", "e", ";", "}", "}", "if", "(", "testCase", ".", "isExpectWarning", "(", ")", ")", "{", "assertTrue", "(", "\"\"", ",", "result", ".", "hasWarning", "(", ")", ")", ";", "}", "else", "{", "assertTrue", "(", "\"\"", ",", "result", ".", "isOK", "(", ")", ")", ";", "assertEqualLines", "(", "\"\"", ",", "testCase", ".", "getExpected", "(", ")", ",", "cu", ".", "getSource", "(", ")", ")", ";", "}", "assertTrue", "(", "\"\"", ",", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToUndo", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "!", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToRedo", "(", ")", ")", ";", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "performUndo", "(", "null", ",", "new", "NullProgressMonitor", "(", ")", ")", ";", "assertEqualLines", "(", "\"invalid", "undo\"", ",", "testCase", ".", "getInput", "(", ")", ",", "cu", ".", "getSource", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "!", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToUndo", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "anythingToRedo", "(", ")", ")", ";", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "performRedo", "(", "null", ",", "new", "NullProgressMonitor", "(", ")", ")", ";", "assertEqualLines", "(", "\"invalid", "redo\"", ",", "testCase", ".", "getExpected", "(", ")", ",", "cu", ".", "getSource", "(", ")", ")", ";", "}", "finally", "{", "performDummySearch", "(", ")", ";", "cu", ".", "delete", "(", "true", ",", "null", ")", ";", "}", "}", "}", "</s>" ]
5,988
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extract", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "ast", ".", "ModuleNode", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codebrowsing", ".", "tests", ".", "AbstractCheckerTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "core", ".", "extract", ".", "StaticFragmentChecker", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "public", "class", "StaticExpressionCheckerTests", "extends", "AbstractCheckerTests", "{", "public", "StaticExpressionCheckerTests", "(", ")", "{", "super", "(", "StaticExpressionCheckerTests", ".", "class", ".", "getName", "(", ")", ")", ";", "}", "public", "void", "testStaticExpressionChecker1", "(", ")", "throws", "Exception", "{", "checkIsStatic", "(", "\"666\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker2", "(", ")", "throws", "Exception", "{", "checkIsNotStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker3", "(", ")", "throws", "Exception", "{", "checkIsNotStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker4", "(", ")", "throws", "Exception", "{", "checkIsStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker5", "(", ")", "throws", "Exception", "{", "checkIsStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker6", "(", ")", "throws", "Exception", "{", "checkIsNotStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker7", "(", ")", "throws", "Exception", "{", "checkIsStatic", "(", "\"\"", ")", ";", "}", "public", "void", "testStaticExpressionChecker8", "(", ")", "throws", "Exception", "{", "checkIsNotStatic", "(", "\"\"", ")", ";", "}", "private", "void", "checkIsStatic", "(", "String", "text", ")", "throws", "CoreException", "{", "ModuleNode", "module", "=", "createModuleFromText", "(", "text", ")", ";", "StaticFragmentChecker", "checker", "=", "new", "StaticFragmentChecker", "(", ")", ";", "boolean", "result", "=", "checker", ".", "mayNotBeStatic", "(", "getLastFragment", "(", "module", ")", ")", ";", "assertTrue", "(", "\"\"", "+", "text", "+", "\"\"", ",", "result", ")", ";", "}", "private", "void", "checkIsNotStatic", "(", "String", "text", ")", "throws", "CoreException", "{", "ModuleNode", "module", "=", "createModuleFromText", "(", "text", ")", ";", "StaticFragmentChecker", "checker", "=", "new", "StaticFragmentChecker", "(", ")", ";", "boolean", "result", "=", "checker", ".", "mayNotBeStatic", "(", "getLastFragment", "(", "module", ")", ")", ";", "assertFalse", "(", "\"\"", "+", "text", "+", "\"\"", ",", "result", ")", ";", "}", "}", "</s>" ]
5,989
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FilenameFilter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "List", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "FileLocator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Platform", ";", "public", "class", "BaseTestSuite", "extends", "TestSuite", "{", "private", "static", "class", "PatternFilter", "implements", "FilenameFilter", "{", "public", "PatternFilter", "(", "final", "String", "findPattern", ")", "{", "this", ".", "findPattern", "=", "\"^\"", "+", "findPattern", "+", "\".*\"", ";", "}", "private", "String", "findPattern", ";", "public", "boolean", "accept", "(", "final", "File", "dir", ",", "final", "String", "name", ")", "{", "return", "name", ".", "matches", "(", "findPattern", ")", ";", "}", "}", "public", "static", "List", "<", "File", ">", "getFileList", "(", "final", "String", "search", ")", "{", "return", "createFileList", "(", "search", ",", "\"\"", ")", ";", "}", "public", "static", "List", "<", "File", ">", "getFileList", "(", "final", "String", "subFolder", ",", "final", "String", "search", ")", "{", "return", "createFileList", "(", "search", ",", "subFolder", ")", ";", "}", "private", "static", "List", "<", "File", ">", "createFileList", "(", "final", "String", "search", ",", "final", "String", "subFolder", ")", "{", "final", "String", "TEST_FILES", "=", "getPathToTestFiles", "(", ")", ";", "final", "File", "dir", "=", "new", "File", "(", "TEST_FILES", "+", "subFolder", ")", ";", "if", "(", "!", "dir", ".", "isDirectory", "(", ")", ")", "{", "throw", "new", "RuntimeException", "(", "\"The", "path:", "\"", "+", "dir", ".", "getAbsolutePath", "(", ")", "+", "\"", "is", "invalid\"", ")", ";", "}", "final", "ArrayList", "<", "File", ">", "fl", "=", "new", "ArrayList", "<", "File", ">", "(", ")", ";", "for", "(", "final", "File", "f", ":", "dir", ".", "listFiles", "(", "new", "PatternFilter", "(", "search", ")", ")", ")", "{", "fl", ".", "add", "(", "f", ")", ";", "}", "return", "fl", ";", "}", "private", "static", "String", "getPluginDirectoryPath", "(", ")", "{", "try", "{", "URL", "platformURL", "=", "Platform", ".", "getBundle", "(", "\"\"", ")", ".", "getEntry", "(", "\"/\"", ")", ";", "return", "new", "File", "(", "FileLocator", ".", "toFileURL", "(", "platformURL", ")", ".", "getFile", "(", ")", ")", ".", "getAbsolutePath", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "null", ";", "}", "public", "static", "String", "getPathToTestFiles", "(", ")", "{", "final", "String", "systemSeparator", "=", "String", ".", "valueOf", "(", "IPath", ".", "SEPARATOR", ")", ";", "String", "folders", "=", "\"/resources\"", ";", "folders", "=", "folders", ".", "replaceAll", "(", "\"/\"", ",", "systemSeparator", ")", ";", "return", "getPluginDirectoryPath", "(", ")", "+", "folders", ";", "}", "}", "</s>" ]
5,990
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "java", ".", "util", ".", "Collection", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IImportDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "public", "final", "class", "DebugUtils", "{", "private", "DebugUtils", "(", ")", "{", "}", "public", "static", "void", "dumpCharCharArray", "(", "String", "msg", ",", "char", "[", "]", "[", "]", "o", ")", "{", "dump", "(", "\"\"", "+", "msg", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "o", ".", "length", ";", "i", "++", ")", "{", "dump", "(", "new", "String", "(", "o", "[", "i", "]", ")", ")", ";", "}", "}", "public", "static", "void", "dumpArray", "(", "String", "msg", ",", "Object", "[", "]", "refs", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "msg", ")", ";", "if", "(", "refs", "==", "null", ")", "{", "System", ".", "out", ".", "println", "(", "\"null\"", ")", ";", "return", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "refs", ".", "length", ";", "i", "++", ")", "System", ".", "out", ".", "println", "(", "refs", "[", "i", "]", ".", "toString", "(", ")", ")", ";", "}", "public", "static", "void", "dumpCollectionCollection", "(", "String", "msg", ",", "Collection", "c", ")", "{", "for", "(", "Iterator", "iter", "=", "c", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "dumpCollection", "(", "\"\"", ",", "(", "List", ")", "iter", ".", "next", "(", ")", ")", ";", "}", "}", "public", "static", "void", "dumpCollection", "(", "String", "msg", ",", "Collection", "c", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "msg", ")", ";", "if", "(", "c", "==", "null", ")", "{", "System", ".", "out", ".", "println", "(", "\"null\"", ")", ";", "return", ";", "}", "for", "(", "Iterator", "iter", "=", "c", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "System", ".", "out", ".", "println", "(", "iter", ".", "next", "(", ")", ".", "toString", "(", ")", ")", ";", "}", "}", "public", "static", "void", "dumpIMethod", "(", "IMethod", "method", ")", "{", "try", "{", "if", "(", "method", "==", "null", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "return", ";", "}", "System", ".", "out", ".", "println", "(", "\"\"", "+", "method", ".", "getElementName", "(", ")", "+", "\"n", "\"", "+", "method", ".", "getSignature", "(", ")", "+", "\"\"", "+", "method", ".", "getDeclaringType", "(", ")", ".", "getFullyQualifiedName", "(", "'.'", ")", "+", "\"nreturnType:\"", "+", "method", ".", "getReturnType", "(", ")", ")", ";", "dumpArray", "(", "\"paramTypes:\"", ",", "method", ".", "getParameterTypes", "(", ")", ")", ";", "dumpArray", "(", "\"exceptions:\"", ",", "method", ".", "getExceptionTypes", "(", ")", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "public", "static", "void", "dumpIMethodList", "(", "String", "msg", ",", "List", "l", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "msg", ")", ";", "if", "(", "l", "==", "null", ")", "{", "System", ".", "out", ".", "println", "(", "\"null\"", ")", ";", "return", ";", "}", "Iterator", "iter", "=", "l", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "dumpIMethod", "(", "(", "IMethod", ")", "iter", ".", "next", "(", ")", ")", ";", "}", "}", "public", "static", "void", "dumpIType", "(", "String", "msg", ",", "IType", "type", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "msg", ")", ";", "System", ".", "out", ".", "println", "(", "\"exists:\"", "+", "type", ".", "exists", "(", ")", ")", ";", "try", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "type", ".", "getCorrespondingResource", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "type", ".", "getUnderlyingResource", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"source:n\"", "+", "type", ".", "getSource", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"cu:\"", "+", "type", ".", "getCompilationUnit", "(", ")", ".", "getSource", "(", ")", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "public", "static", "void", "dumpIResource", "(", "String", "msg", ",", "IResource", "res", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "msg", ")", ";", "System", ".", "out", ".", "println", "(", "\"name:\"", "+", "res", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"exists\"", "+", "res", ".", "exists", "(", ")", ")", ";", "}", "public", "static", "void", "dump", "(", "Object", "o", ")", "{", "if", "(", "o", "==", "null", ")", "dump", "(", "\"null\"", ")", ";", "else", "dump", "(", "o", ".", "toString", "(", ")", ")", ";", "}", "public", "static", "void", "dump", "(", "String", "msg", ")", "{", "System", ".", "out", ".", "println", "(", "\"DUMP:\"", "+", "msg", ")", ";", "}", "public", "static", "void", "dumpImports", "(", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", "{", "IImportDeclaration", "[", "]", "imports", "=", "cu", ".", "getImports", "(", ")", ";", "if", "(", "imports", "==", "null", ")", "return", ";", "DebugUtils", ".", "dump", "(", "\"\"", "+", "cu", ".", "getElementName", "(", ")", ")", ";", "for", "(", "int", "k", "=", "0", ";", "k", "<", "imports", ".", "length", ";", "k", "++", ")", "{", "DebugUtils", ".", "dump", "(", "\"import", "\"", "+", "imports", "[", "k", "]", ".", "getElementName", "(", ")", "+", "\"", "on", "demand:", "\"", "+", "imports", "[", "k", "]", ".", "isOnDemand", "(", ")", ")", ";", "}", "}", "public", "static", "void", "dumpImports", "(", "IPackageFragment", "pack", ")", "throws", "JavaModelException", "{", "ICompilationUnit", "[", "]", "cus", "=", "pack", ".", "getCompilationUnits", "(", ")", ";", "if", "(", "cus", "==", "null", ")", "return", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "cus", ".", "length", ";", "j", "++", ")", "{", "dumpImports", "(", "cus", "[", "j", "]", ")", ";", "}", "}", "public", "static", "void", "dumpImports", "(", "IJavaProject", "project", ")", "throws", "JavaModelException", "{", "IPackageFragment", "[", "]", "packages", "=", "project", ".", "getPackageFragments", "(", ")", ";", "if", "(", "packages", "==", "null", ")", "return", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "packages", ".", "length", ";", "i", "++", ")", "{", "dumpImports", "(", "packages", "[", "i", "]", ")", ";", "}", "}", "}", "</s>" ]
5,991
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "junit", ".", "framework", ".", "TestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codebrowsing", ".", "tests", ".", "FindAllOccurrencesVisitorTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "codebrowsing", ".", "tests", ".", "IsSameExpressionTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extract", ".", "ExtractConstantTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extract", ".", "ExtractLocalTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extract", ".", "StaticExpressionCheckerTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extract", ".", "StaticFragmentCheckerTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "extractMethod", ".", "ExtractMethodTestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "formatter", ".", "FormatterTestSuite", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "formatter", ".", "SemicolonRemoverTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "formatter", ".", "WhitespaceRemoverTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "rename", ".", "MoveCURefactoringTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "rename", ".", "RenameFieldTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "rename", ".", "RenameLocalTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "rename", ".", "RenameMethodTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "rename", ".", "RenameTypeTests", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ".", "rename", ".", "SyntheticAccessorRenamingTests", ";", "public", "class", "AllRefactoringTests", "{", "public", "static", "Test", "suite", "(", ")", "{", "final", "TestSuite", "suite", "=", "new", "TestSuite", "(", "\"Test", "for", "\"", "+", "AllRefactoringTests", ".", "class", ".", "getPackage", "(", ")", ".", "getName", "(", ")", ")", ";", "suite", ".", "addTest", "(", "RenameTypeTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "RenameMethodTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "RenameFieldTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "RenameLocalTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "new", "TestSuite", "(", "MoveCURefactoringTests", ".", "class", ")", ")", ";", "suite", ".", "addTest", "(", "new", "TestSuite", "(", "SyntheticAccessorRenamingTests", ".", "class", ")", ")", ";", "suite", ".", "addTest", "(", "new", "TestSuite", "(", "StaticExpressionCheckerTests", ".", "class", ")", ")", ";", "suite", ".", "addTest", "(", "new", "TestSuite", "(", "StaticFragmentCheckerTests", ".", "class", ")", ")", ";", "suite", ".", "addTest", "(", "new", "TestSuite", "(", "IsSameExpressionTests", ".", "class", ")", ")", ";", "suite", ".", "addTest", "(", "new", "TestSuite", "(", "FindAllOccurrencesVisitorTests", ".", "class", ")", ")", ";", "suite", ".", "addTest", "(", "ExtractConstantTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "ExtractLocalTests", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "ExtractMethodTestSuite", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "FormatterTestSuite", ".", "suite", "(", ")", ")", ";", "suite", ".", "addTest", "(", "new", "TestSuite", "(", "SemicolonRemoverTests", ".", "class", ")", ")", ";", "suite", ".", "addTest", "(", "new", "TestSuite", "(", "WhitespaceRemoverTests", ".", "class", ")", ")", ";", "return", "suite", ";", "}", "}", "</s>" ]
5,992
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "java", ".", "util", ".", "Hashtable", ";", "import", "junit", ".", "extensions", ".", "TestSetup", ";", "import", "junit", ".", "framework", ".", "Test", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "DefaultCodeFormatterConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "corext", ".", "codemanipulation", ".", "StubUtility", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "corext", ".", "template", ".", "java", ".", "CodeTemplateContextType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "JavaPlugin", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "ui", ".", "util", ".", "CoreUtility", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "TestOptions", ";", "public", "class", "AbstractRefactoringTestSetup", "extends", "TestSetup", "{", "private", "boolean", "fWasAutobuild", ";", "private", "Hashtable", "fWasOptions", ";", "public", "AbstractRefactoringTestSetup", "(", "Test", "test", ")", "{", "super", "(", "test", ")", ";", "}", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "fWasOptions", "=", "JavaCore", ".", "getOptions", "(", ")", ";", "fWasAutobuild", "=", "CoreUtility", ".", "setAutoBuilding", "(", "false", ")", ";", "Hashtable", "options", "=", "TestOptions", ".", "getDefaultOptions", "(", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_CHAR", ",", "JavaCore", ".", "TAB", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE", ",", "\"0\"", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_SIZE", ",", "\"4\"", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_LINE_SPLIT", ",", "String", ".", "valueOf", "(", "9999", ")", ")", ";", "JavaCore", ".", "setOptions", "(", "options", ")", ";", "TestOptions", ".", "initializeCodeGenerationOptions", "(", ")", ";", "JavaPlugin", ".", "getDefault", "(", ")", ".", "getCodeTemplateStore", "(", ")", ".", "load", "(", ")", ";", "StringBuffer", "comment", "=", "new", "StringBuffer", "(", ")", ";", "comment", ".", "append", "(", "\"/**n\"", ")", ";", "comment", ".", "append", "(", "\"", "*", "${tags}n\"", ")", ";", "comment", ".", "append", "(", "\"", "*/\"", ")", ";", "StubUtility", ".", "setCodeTemplate", "(", "CodeTemplateContextType", ".", "CONSTRUCTORCOMMENT_ID", ",", "comment", ".", "toString", "(", ")", ",", "null", ")", ";", "}", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "if", "(", "fWasOptions", "!=", "null", ")", "{", "JavaCore", ".", "setOptions", "(", "fWasOptions", ")", ";", "}", "CoreUtility", ".", "setAutoBuilding", "(", "fWasAutobuild", ")", ";", "super", ".", "tearDown", "(", ")", ";", "}", "}", "</s>" ]
5,993
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "FileLocator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Plugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Status", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IWorkspace", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "public", "class", "RefactoringTestPlugin", "extends", "Plugin", "{", "public", "static", "String", "PLUGIN_ID", "=", "\"\"", ";", "private", "static", "RefactoringTestPlugin", "fgDefault", ";", "public", "RefactoringTestPlugin", "(", ")", "{", "fgDefault", "=", "this", ";", "}", "public", "static", "RefactoringTestPlugin", "getDefault", "(", ")", "{", "return", "fgDefault", ";", "}", "public", "static", "IWorkspace", "getWorkspace", "(", ")", "{", "return", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "}", "public", "InputStream", "getTestResourceStream", "(", "String", "fileName", ")", "throws", "IOException", "{", "IPath", "path", "=", "new", "Path", "(", "\"resources\"", ")", ".", "append", "(", "fileName", ")", ";", "URL", "url", "=", "new", "URL", "(", "getBundle", "(", ")", ".", "getEntry", "(", "\"/\"", ")", ",", "path", ".", "toString", "(", ")", ")", ";", "return", "url", ".", "openStream", "(", ")", ";", "}", "public", "File", "getFileInPlugin", "(", "IPath", "path", ")", "throws", "CoreException", "{", "try", "{", "URL", "installURL", "=", "new", "URL", "(", "getBundle", "(", ")", ".", "getEntry", "(", "\"/\"", ")", ",", "path", ".", "toString", "(", ")", ")", ";", "URL", "localURL", "=", "FileLocator", ".", "toFileURL", "(", "installURL", ")", ";", "return", "new", "File", "(", "localURL", ".", "getFile", "(", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "CoreException", "(", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "getPluginId", "(", ")", ",", "IStatus", ".", "ERROR", ",", "e", ".", "getMessage", "(", ")", ",", "e", ")", ")", ";", "}", "}", "public", "static", "String", "getPluginId", "(", ")", "{", "return", "PLUGIN_ID", ";", "}", "}", "</s>" ]
5,994
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "List", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "Change", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatus", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "participants", ".", "CheckConditionsContext", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "participants", ".", "RenameArguments", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "participants", ".", "RenameParticipant", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "public", "class", "TestRenameParticipantSingle", "extends", "RenameParticipant", "{", "private", "static", "List", "fgInstances", "=", "new", "ArrayList", "(", ")", ";", "private", "Object", "fElement", ";", "private", "String", "fHandle", ";", "public", "boolean", "initialize", "(", "Object", "element", ")", "{", "fgInstances", ".", "add", "(", "this", ")", ";", "fElement", "=", "element", ";", "ref", "(", "fElement", ")", ";", "if", "(", "fElement", "instanceof", "IJavaElement", ")", "{", "fHandle", "=", "(", "(", "IJavaElement", ")", "fElement", ")", ".", "getHandleIdentifier", "(", ")", ";", "}", "else", "{", "fHandle", "=", "(", "(", "IResource", ")", "fElement", ")", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ";", "}", "return", "true", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "getClass", "(", ")", ".", "getName", "(", ")", ";", "}", "public", "RefactoringStatus", "checkConditions", "(", "IProgressMonitor", "pm", ",", "CheckConditionsContext", "context", ")", "{", "return", "new", "RefactoringStatus", "(", ")", ";", "}", "public", "Change", "createChange", "(", "IProgressMonitor", "pm", ")", "throws", "CoreException", "{", "return", "null", ";", "}", "public", "static", "void", "testNumberOfInstances", "(", "int", "instances", ")", "{", "Assert", ".", "assertEquals", "(", "instances", ",", "fgInstances", ".", "size", "(", ")", ")", ";", "}", "public", "static", "void", "testElements", "(", "String", "[", "]", "handles", ")", "{", "testNumberOfInstances", "(", "handles", ".", "length", ")", ";", "List", "l1", "=", "new", "ArrayList", "(", "Arrays", ".", "asList", "(", "handles", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "l1", ".", "size", "(", ")", ";", "i", "++", ")", "{", "Assert", ".", "assertTrue", "(", "l1", ".", "contains", "(", "getInstance", "(", "i", ")", ".", "fHandle", ")", ")", ";", "}", "}", "public", "static", "void", "testArguments", "(", "RenameArguments", "[", "]", "args", ")", "{", "testNumberOfInstances", "(", "args", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "args", ".", "length", ";", "i", "++", ")", "{", "RenameArguments", "expected", "=", "args", "[", "i", "]", ";", "RenameArguments", "actual", "=", "getInstance", "(", "i", ")", ".", "getArguments", "(", ")", ";", "Assert", ".", "assertEquals", "(", "expected", ".", "getNewName", "(", ")", ",", "actual", ".", "getNewName", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "expected", ".", "getUpdateReferences", "(", ")", ",", "actual", ".", "getUpdateReferences", "(", ")", ")", ";", "}", "}", "public", "static", "void", "reset", "(", ")", "{", "fgInstances", "=", "new", "ArrayList", "(", ")", ";", "}", "private", "static", "TestRenameParticipantSingle", "getInstance", "(", "int", "i", ")", "{", "return", "(", "(", "TestRenameParticipantSingle", ")", "fgInstances", ".", "get", "(", "i", ")", ")", ";", "}", "void", "ref", "(", "Object", "element", ")", "{", "}", "}", "</s>" ]
5,995
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "junit", ".", "framework", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "Change", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatus", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "participants", ".", "CheckConditionsContext", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "participants", ".", "ISharableParticipant", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "participants", ".", "RefactoringArguments", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "participants", ".", "RenameArguments", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "participants", ".", "RenameParticipant", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "refactoring", ".", "IJavaElementMapper", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "refactoring", ".", "RenameTypeArguments", ";", "public", "class", "TestRenameParticipantShared", "extends", "RenameParticipant", "implements", "ISharableParticipant", "{", "static", "TestRenameParticipantShared", "fgInstance", ";", "List", "fElements", "=", "new", "ArrayList", "(", "3", ")", ";", "List", "fHandles", "=", "new", "ArrayList", "(", "3", ")", ";", "List", "fArguments", "=", "new", "ArrayList", "(", "3", ")", ";", "Map", "fSimilarToHandle", "=", "new", "HashMap", "(", ")", ";", "Map", "fSimilarToNewName", "=", "new", "HashMap", "(", ")", ";", "public", "boolean", "initialize", "(", "Object", "element", ")", "{", "fgInstance", "=", "this", ";", "fElements", ".", "add", "(", "element", ")", ";", "fArguments", ".", "add", "(", "getArguments", "(", ")", ")", ";", "if", "(", "element", "instanceof", "IJavaElement", ")", "fHandles", ".", "add", "(", "(", "(", "IJavaElement", ")", "element", ")", ".", "getHandleIdentifier", "(", ")", ")", ";", "else", "fHandles", ".", "add", "(", "(", "(", "IResource", ")", "element", ")", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ")", ";", "IJavaElementMapper", "updating", "=", "(", "IJavaElementMapper", ")", "getProcessor", "(", ")", ".", "getAdapter", "(", "IJavaElementMapper", ".", "class", ")", ";", "if", "(", "(", "updating", "!=", "null", ")", "&&", "getArguments", "(", ")", "instanceof", "RenameTypeArguments", ")", "{", "RenameTypeArguments", "arguments", "=", "(", "RenameTypeArguments", ")", "getArguments", "(", ")", ";", "if", "(", "arguments", ".", "getUpdateSimilarDeclarations", "(", ")", ")", "{", "IJavaElement", "[", "]", "elements", "=", "arguments", ".", "getSimilarDeclarations", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "elements", ".", "length", ";", "i", "++", ")", "{", "IJavaElement", "updated", "=", "updating", ".", "getRefactoredJavaElement", "(", "elements", "[", "i", "]", ")", ";", "if", "(", "updated", "!=", "null", ")", "{", "fSimilarToHandle", ".", "put", "(", "elements", "[", "i", "]", ".", "getHandleIdentifier", "(", ")", ",", "getKey", "(", "updated", ")", ")", ";", "fSimilarToNewName", ".", "put", "(", "elements", "[", "i", "]", ".", "getHandleIdentifier", "(", ")", ",", "updated", ".", "getElementName", "(", ")", ")", ";", "}", "}", "}", "}", "return", "true", ";", "}", "private", "String", "getKey", "(", "IJavaElement", "updated", ")", "{", "if", "(", "updated", "instanceof", "IType", ")", "return", "(", "(", "IType", ")", "updated", ")", ".", "getKey", "(", ")", ";", "else", "if", "(", "updated", "instanceof", "IMethod", ")", "return", "(", "(", "IMethod", ")", "updated", ")", ".", "getKey", "(", ")", ";", "else", "if", "(", "updated", "instanceof", "IField", ")", "return", "(", "(", "IField", ")", "updated", ")", ".", "getKey", "(", ")", ";", "return", "\"\"", ";", "}", "public", "void", "addElement", "(", "Object", "element", ",", "RefactoringArguments", "args", ")", "{", "fElements", ".", "add", "(", "element", ")", ";", "fArguments", ".", "add", "(", "args", ")", ";", "if", "(", "element", "instanceof", "IJavaElement", ")", "fHandles", ".", "add", "(", "(", "(", "IJavaElement", ")", "element", ")", ".", "getHandleIdentifier", "(", ")", ")", ";", "else", "fHandles", ".", "add", "(", "(", "(", "IResource", ")", "element", ")", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ")", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "getClass", "(", ")", ".", "getName", "(", ")", ";", "}", "public", "RefactoringStatus", "checkConditions", "(", "IProgressMonitor", "pm", ",", "CheckConditionsContext", "context", ")", "{", "return", "new", "RefactoringStatus", "(", ")", ";", "}", "public", "Change", "createChange", "(", "IProgressMonitor", "pm", ")", "throws", "CoreException", "{", "return", "null", ";", "}", "public", "static", "void", "testNumberOfElements", "(", "int", "expected", ")", "{", "if", "(", "expected", "==", "0", ")", "{", "Assert", ".", "assertTrue", "(", "fgInstance", "==", "null", ")", ";", "}", "else", "{", "Assert", ".", "assertEquals", "(", "expected", ",", "fgInstance", ".", "fElements", ".", "size", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "expected", ",", "fgInstance", ".", "fArguments", ".", "size", "(", ")", ")", ";", "}", "}", "public", "static", "void", "testArguments", "(", "RenameArguments", "[", "]", "args", ")", "{", "testNumberOfElements", "(", "args", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "args", ".", "length", ";", "i", "++", ")", "{", "RenameArguments", "expected", "=", "args", "[", "i", "]", ";", "RenameArguments", "actual", "=", "(", "RenameArguments", ")", "fgInstance", ".", "fArguments", ".", "get", "(", "i", ")", ";", "Assert", ".", "assertEquals", "(", "expected", ".", "getNewName", "(", ")", ",", "actual", ".", "getNewName", "(", ")", ")", ";", "Assert", ".", "assertEquals", "(", "expected", ".", "getUpdateReferences", "(", ")", ",", "actual", ".", "getUpdateReferences", "(", ")", ")", ";", "}", "}", "public", "static", "void", "reset", "(", ")", "{", "fgInstance", "=", "null", ";", "}", "public", "static", "void", "testNumberOfSimilarElements", "(", "int", "expected", ")", "{", "if", "(", "expected", "==", "0", ")", "Assert", ".", "assertTrue", "(", "fgInstance", "==", "null", ")", ";", "else", "Assert", ".", "assertEquals", "(", "expected", ",", "fgInstance", ".", "fSimilarToHandle", ".", "size", "(", ")", ")", ";", "}", "public", "static", "void", "testSimilarElements", "(", "List", "similarList", ",", "List", "similarNewNameList", ",", "List", "similarNewHandleList", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "similarList", ".", "size", "(", ")", ";", "i", "++", ")", "{", "String", "handle", "=", "(", "String", ")", "similarList", ".", "get", "(", "i", ")", ";", "String", "newHandle", "=", "(", "String", ")", "similarNewHandleList", ".", "get", "(", "i", ")", ";", "String", "newName", "=", "(", "String", ")", "similarNewNameList", ".", "get", "(", "i", ")", ";", "String", "actualNewHandle", "=", "(", "String", ")", "fgInstance", ".", "fSimilarToHandle", ".", "get", "(", "handle", ")", ";", "String", "actualNewName", "=", "(", "String", ")", "fgInstance", ".", "fSimilarToNewName", ".", "get", "(", "handle", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "newHandle", ",", "actualNewHandle", ")", ";", "Assert", ".", "assertEquals", "(", "\"\"", ",", "newName", ",", "actualNewName", ")", ";", "}", "Assert", ".", "assertEquals", "(", "similarList", ".", "size", "(", ")", ",", "fgInstance", ".", "fSimilarToHandle", ".", "size", "(", ")", ")", ";", "}", "}", "</s>" ]
5,996
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileReader", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "regex", ".", "Matcher", ";", "import", "java", ".", "util", ".", "regex", ".", "Pattern", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "core", ".", "utils", ".", "ASTTools", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "core", ".", "utils", ".", "FilePartReader", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadLocationException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Document", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IDocument", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IRegion", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "TextSelection", ";", "public", "abstract", "class", "BaseTestCase", "extends", "TestCase", "{", "protected", "File", "file", ";", "private", "final", "String", "newLine", ";", "private", "final", "Pattern", "origRegExp", ",", "expRegExp", ",", "propertiesRegExp", ";", "private", "final", "String", "name", ";", "private", "final", "IDocument", "doc", ";", "protected", "boolean", "shouldFail", "=", "false", ";", "protected", "HashMap", "<", "String", ",", "String", ">", "properties", ";", "protected", "TextSelection", "selection", ";", "protected", "BaseTestCase", "(", "String", "name", ",", "File", "fileToTest", ")", "{", "setFile", "(", "fileToTest", ")", ";", "this", ".", "name", "=", "name", ";", "newLine", "=", "FilePartReader", ".", "getLineDelimiter", "(", "file", ")", ";", "origRegExp", "=", "Pattern", ".", "compile", "(", "\"###src\"", "+", "newLine", "+", "\"(.*)\"", "+", "newLine", "+", "\"###exp\"", ",", "Pattern", ".", "DOTALL", ")", ";", "expRegExp", "=", "Pattern", ".", "compile", "(", "\"###exp\"", "+", "newLine", "+", "\"(.*)\"", "+", "newLine", "+", "\"###end\"", ",", "Pattern", ".", "DOTALL", ")", ";", "propertiesRegExp", "=", "Pattern", ".", "compile", "(", "\"###prop\"", "+", "newLine", "+", "\"(.*)\"", "+", "newLine", "+", "\"###src\"", ",", "Pattern", ".", "DOTALL", ")", ";", "properties", "=", "getFileProperties", "(", ")", ";", "doc", "=", "getOrigin", "(", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"Starting:", "\"", "+", "getName", "(", ")", ")", ";", "selection", "=", "getUserSelection", "(", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "super", ".", "tearDown", "(", ")", ";", "}", "protected", "void", "setFile", "(", "File", "file", ")", "{", "this", ".", "file", "=", "file", ";", "}", "@", "Override", "public", "String", "getName", "(", ")", "{", "return", "name", ";", "}", "public", "IDocument", "getOrigin", "(", ")", "{", "return", "getArea", "(", "origRegExp", ")", ";", "}", "public", "IDocument", "getExpected", "(", ")", "{", "return", "getArea", "(", "expRegExp", ")", ";", "}", "public", "IDocument", "getArea", "(", "Pattern", "regExpression", ")", "{", "String", "filecontent", "=", "getContents", "(", "file", ")", ";", "Matcher", "match", "=", "regExpression", ".", "matcher", "(", "filecontent", ")", ";", "if", "(", "match", ".", "find", "(", ")", ")", "{", "String", "fileContent", "=", "match", ".", "group", "(", "1", ")", ";", "return", "ASTTools", ".", "getDocumentWithSystemLineBreak", "(", "fileContent", ")", ";", "}", "return", "new", "Document", "(", ")", ";", "}", "public", "TextSelection", "getUserSelection", "(", ")", "{", "try", "{", "selection", "=", "getSelection", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "fail", "(", "e", ".", "getMessage", "(", ")", ")", ";", "}", "return", "selection", ";", "}", "private", "TextSelection", "getSelection", "(", ")", "{", "try", "{", "int", "startLine", "=", "getInt", "(", "\"startLine\"", ")", ";", "int", "startColumn", "=", "getInt", "(", "\"startColumn\"", ")", ";", "int", "endLine", "=", "getInt", "(", "\"endLine\"", ")", ";", "int", "endColumn", "=", "getInt", "(", "\"endColumn\"", ")", ";", "IRegion", "startRegion", "=", "getDocument", "(", ")", ".", "getLineInformation", "(", "startLine", "-", "1", ")", ";", "int", "offset", "=", "startRegion", ".", "getOffset", "(", ")", "+", "startColumn", "-", "1", ";", "IRegion", "endRegion", "=", "getDocument", "(", ")", ".", "getLineInformation", "(", "endLine", "-", "1", ")", ";", "int", "end", "=", "endRegion", ".", "getOffset", "(", ")", "+", "endColumn", "-", "1", ";", "return", "new", "TextSelection", "(", "offset", ",", "end", "-", "offset", ")", ";", "}", "catch", "(", "BadLocationException", "e", ")", "{", "return", "new", "TextSelection", "(", "0", ",", "getDocument", "(", ")", ".", "getLength", "(", ")", ")", ";", "}", "}", "private", "int", "getInt", "(", "String", "startLine", ")", "{", "try", "{", "return", "Integer", ".", "valueOf", "(", "properties", ".", "get", "(", "startLine", ")", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "return", "-", "1", ";", "}", "}", "public", "HashMap", "<", "String", ",", "String", ">", "getFileProperties", "(", ")", "{", "HashMap", "<", "String", ",", "String", ">", "properties", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "Matcher", "propertiesSection", "=", "propertiesRegExp", ".", "matcher", "(", "getContents", "(", "file", ")", ")", ";", "if", "(", "propertiesSection", ".", "find", "(", ")", ")", "{", "String", "[", "]", "reults", "=", "propertiesSection", ".", "group", "(", "1", ")", ".", "split", "(", "FilePartReader", ".", "getLineDelimiter", "(", "file", ")", ")", ";", "for", "(", "String", "line", ":", "reults", ")", "{", "String", "[", "]", "prop", "=", "line", ".", "split", "(", "\"=\"", ")", ";", "if", "(", "prop", ".", "length", "!=", "2", ")", "fail", "(", "\"\"", ")", ";", "properties", ".", "put", "(", "prop", "[", "0", "]", ",", "prop", "[", "1", "]", ")", ";", "}", "try", "{", "if", "(", "properties", ".", "get", "(", "\"shouldFail\"", ")", "!=", "null", "&&", "properties", ".", "get", "(", "\"shouldFail\"", ")", ".", "equals", "(", "\"true\"", ")", ")", "shouldFail", "=", "true", ";", "}", "catch", "(", "Exception", "e", ")", "{", "fail", "(", "\"\"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "return", "properties", ";", "}", "public", "IDocument", "getDocument", "(", ")", "{", "return", "doc", ";", "}", "public", "void", "finalAssert", "(", ")", "{", "String", "expected", "=", "getExpected", "(", ")", ".", "get", "(", ")", ";", "String", "content", "=", "getDocument", "(", ")", ".", "get", "(", ")", ";", "assertEquals", "(", "\"\"", "+", "file", "+", "\"", "\"", ",", "expected", ",", "content", ")", ";", "}", "static", "public", "String", "getContents", "(", "File", "aFile", ")", "{", "StringBuilder", "contents", "=", "new", "StringBuilder", "(", ")", ";", "try", "{", "BufferedReader", "input", "=", "new", "BufferedReader", "(", "new", "FileReader", "(", "aFile", ")", ")", ";", "try", "{", "String", "line", "=", "null", ";", "while", "(", "(", "line", "=", "input", ".", "readLine", "(", ")", ")", "!=", "null", ")", "{", "contents", ".", "append", "(", "line", ")", ";", "contents", ".", "append", "(", "FilePartReader", ".", "getLineDelimiter", "(", "aFile", ")", ")", ";", "}", "}", "finally", "{", "input", ".", "close", "(", ")", ";", "}", "}", "catch", "(", "IOException", "ex", ")", "{", "ex", ".", "printStackTrace", "(", ")", ";", "}", "return", "contents", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
5,997
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "PreferenceConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "DefaultCodeFormatterConstants", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "preference", ".", "IPreferenceStore", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "preference", ".", "PreferenceStore", ";", "public", "class", "TestPrefInitializer", "{", "public", "static", "IPreferenceStore", "initializePreferences", "(", "HashMap", "<", "String", ",", "String", ">", "properties", ")", "{", "IPreferenceStore", "pref", "=", "new", "PreferenceStore", "(", ")", ";", "String", "indentation", "=", "properties", ".", "get", "(", "\"indentation\"", ")", ";", "if", "(", "indentation", "!=", "null", ")", "{", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_INDENTATION", ",", "indentation", ")", ";", "}", "String", "tabsize", "=", "properties", ".", "get", "(", "\"tabsize\"", ")", ";", "if", "(", "tabsize", "!=", "null", ")", "{", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_INDENTATION_SIZE", ",", "Integer", ".", "parseInt", "(", "tabsize", ")", ")", ";", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_TAB_SIZE", ",", "Integer", ".", "parseInt", "(", "tabsize", ")", ")", ";", "}", "String", "indentsize", "=", "properties", ".", "get", "(", "\"indentsize\"", ")", ";", "if", "(", "indentsize", "!=", "null", ")", "{", "if", "(", "\"space\"", ".", "equals", "(", "indentation", ")", ")", "{", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_TAB_SIZE", ",", "Integer", ".", "parseInt", "(", "indentsize", ")", ")", ";", "}", "else", "{", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_INDENTATION_SIZE", ",", "Integer", ".", "parseInt", "(", "indentsize", ")", ")", ";", "}", "}", "String", "multiInd", "=", "properties", ".", "get", "(", "\"\"", ")", ";", "if", "(", "multiInd", "!=", "null", ")", "{", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_MULTILINE_INDENTATION", ",", "Integer", ".", "parseInt", "(", "multiInd", ")", ")", ";", "}", "String", "bracesStart", "=", "properties", ".", "get", "(", "\"bracesStart\"", ")", ";", "if", "(", "bracesStart", "!=", "null", ")", "{", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_BRACES_START", ",", "bracesStart", ")", ";", "}", "String", "bracesEnd", "=", "properties", ".", "get", "(", "\"bracesEnd\"", ")", ";", "if", "(", "bracesEnd", "!=", "null", ")", "{", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_BRACES_END", ",", "bracesEnd", ")", ";", "}", "String", "maxLineLength", "=", "properties", ".", "get", "(", "\"maxLineLegth\"", ")", ";", "if", "(", "maxLineLength", "!=", "null", ")", "{", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_MAX_LINELENGTH", ",", "Integer", ".", "parseInt", "(", "maxLineLength", ")", ")", ";", "}", "String", "longListLength", "=", "properties", ".", "get", "(", "\"\"", ")", ";", "if", "(", "longListLength", "!=", "null", ")", "{", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_LONG_LIST_LENGTH", ",", "Integer", ".", "parseInt", "(", "longListLength", ")", ")", ";", "}", "String", "indentEmptyLines", "=", "properties", ".", "get", "(", "\"\"", ")", ";", "if", "(", "indentEmptyLines", "!=", "null", ")", "{", "pref", ".", "setValue", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_EMPTY_LINES", ",", "indentEmptyLines", ")", ";", "}", "String", "removeUnnecessarySemicolons", "=", "properties", ".", "get", "(", "\"\"", ")", ";", "if", "(", "removeUnnecessarySemicolons", "!=", "null", ")", "{", "pref", ".", "setValue", "(", "PreferenceConstants", ".", "GROOVY_FORMATTER_REMOVE_UNNECESSARY_SEMICOLONS", ",", "removeUnnecessarySemicolons", ")", ";", "}", "return", "pref", ";", "}", "}", "</s>" ]
5,998
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "core", ".", "model", ".", "GroovyRuntime", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "test", ".", "EclipseTestCase", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "model", ".", "GroovyNature", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IWorkspace", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "Change", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "CheckConditionsOperation", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "CreateChangeOperation", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "IUndoManager", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "PerformChangeOperation", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "Refactoring", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringCore", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringDescriptor", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatus", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatusEntry", ";", "public", "abstract", "class", "AbstractRefactoringTest", "extends", "EclipseTestCase", "{", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "super", ".", "setUp", "(", ")", ";", "GroovyRuntime", ".", "addGroovyRuntime", "(", "testProject", ".", "getProject", "(", ")", ")", ";", "testProject", ".", "addNature", "(", "GroovyNature", ".", "GROOVY_NATURE", ")", ";", "testProject", ".", "createPackage", "(", "\"p\"", ")", ";", "}", "protected", "ICompilationUnit", "[", "]", "createUnits", "(", "String", "[", "]", "packages", ",", "String", "[", "]", "cuNames", ",", "String", "[", "]", "cuContents", ")", "throws", "CoreException", "{", "return", "testProject", ".", "createUnits", "(", "packages", ",", "cuNames", ",", "cuContents", ")", ";", "}", "protected", "ICompilationUnit", "createUnit", "(", "String", "pkg", ",", "String", "cuName", ",", "String", "cuContents", ")", "throws", "CoreException", "{", "return", "testProject", ".", "createUnit", "(", "pkg", ",", "cuName", ",", "cuContents", ")", ";", "}", "protected", "void", "assertContents", "(", "ICompilationUnit", "[", "]", "existingUnits", ",", "String", "[", "]", "expectedContents", ")", "throws", "JavaModelException", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "existingUnits", ".", "length", ";", "i", "++", ")", "{", "if", "(", "expectedContents", "[", "i", "]", "!=", "null", ")", "{", "char", "[", "]", "contents", "=", "extractContents", "(", "existingUnits", "[", "i", "]", ")", ";", "String", "actualContents", "=", "String", ".", "valueOf", "(", "contents", ")", ";", "if", "(", "!", "actualContents", ".", "equals", "(", "expectedContents", "[", "i", "]", ")", ")", "{", "sb", ".", "append", "(", "\"\"", ")", ";", "sb", ".", "append", "(", "expectedContents", "[", "i", "]", ")", ";", "sb", ".", "append", "(", "\"\"", ")", ";", "sb", ".", "append", "(", "actualContents", ")", ";", "}", "}", "else", "{", "if", "(", "existingUnits", "[", "i", "]", ".", "exists", "(", ")", ")", "{", "sb", ".", "append", "(", "\"nUnit", "\"", "+", "existingUnits", "[", "i", "]", ".", "getElementName", "(", ")", "+", "\"\"", ")", ";", "sb", ".", "append", "(", "\"\"", ")", ";", "sb", ".", "append", "(", "extractContents", "(", "existingUnits", "[", "i", "]", ")", ")", ";", "}", "}", "}", "if", "(", "sb", ".", "length", "(", ")", ">", "0", ")", "{", "fail", "(", "\"\"", "+", "sb", ".", "toString", "(", ")", ")", ";", "}", "}", "public", "char", "[", "]", "extractContents", "(", "ICompilationUnit", "unit", ")", "throws", "JavaModelException", "{", "return", "(", "(", "CompilationUnit", ")", "unit", ")", ".", "getContents", "(", ")", ";", "}", "protected", "void", "assertContents", "(", "ICompilationUnit", "existingUnits", ",", "String", "expectedContents", ")", "throws", "JavaModelException", "{", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", ")", ";", "char", "[", "]", "contents", ";", "contents", "=", "extractContents", "(", "existingUnits", ")", ";", "String", "actualContents", "=", "String", ".", "valueOf", "(", "contents", ")", ";", "if", "(", "!", "actualContents", ".", "equals", "(", "expectedContents", ")", ")", "{", "sb", ".", "append", "(", "\"\"", ")", ";", "sb", ".", "append", "(", "expectedContents", ")", ";", "sb", ".", "append", "(", "\"\"", ")", ";", "sb", ".", "append", "(", "actualContents", ")", ";", "}", "if", "(", "sb", ".", "length", "(", ")", ">", "0", ")", "{", "fail", "(", "\"\"", "+", "sb", ".", "toString", "(", ")", ")", ";", "}", "}", "protected", "RefactoringStatus", "performRefactoring", "(", "Refactoring", "ref", ",", "boolean", "providesUndo", ",", "boolean", "performOnFail", ")", "throws", "Exception", "{", "super", ".", "fullProjectBuild", "(", ")", ";", "performDummySearch", "(", ")", ";", "IUndoManager", "undoManager", "=", "getUndoManager", "(", ")", ";", "final", "CreateChangeOperation", "create", "=", "new", "CreateChangeOperation", "(", "new", "CheckConditionsOperation", "(", "ref", ",", "CheckConditionsOperation", ".", "ALL_CONDITIONS", ")", ",", "RefactoringStatus", ".", "FATAL", ")", ";", "final", "PerformChangeOperation", "perform", "=", "new", "PerformChangeOperation", "(", "create", ")", ";", "perform", ".", "setUndoManager", "(", "undoManager", ",", "ref", ".", "getName", "(", ")", ")", ";", "IWorkspace", "workspace", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "executePerformOperation", "(", "perform", ",", "workspace", ")", ";", "RefactoringStatus", "status", "=", "create", ".", "getConditionCheckingStatus", "(", ")", ";", "assertTrue", "(", "\"\"", ",", "perform", ".", "changeExecuted", "(", ")", "||", "!", "perform", ".", "changeExecutionFailed", "(", ")", ")", ";", "Change", "undo", "=", "perform", ".", "getUndoChange", "(", ")", ";", "if", "(", "providesUndo", ")", "{", "assertNotNull", "(", "\"\"", ",", "undo", ")", ";", "assertTrue", "(", "\"\"", ",", "undoManager", ".", "anythingToUndo", "(", ")", ")", ";", "}", "else", "{", "assertNull", "(", "\"\"", ",", "undo", ")", ";", "}", "return", "status", ";", "}", "protected", "RefactoringStatus", "ignoreKnownErrors", "(", "RefactoringStatus", "result", ")", "{", "if", "(", "result", ".", "getSeverity", "(", ")", "!=", "RefactoringStatus", ".", "ERROR", ")", "{", "return", "result", ";", "}", "RefactoringStatusEntry", "[", "]", "entries", "=", "result", ".", "getEntries", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entries", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "checkStringForKnownErrors", "(", "entries", "[", "i", "]", ".", "getMessage", "(", ")", ")", "&&", "entries", "[", "i", "]", ".", "isError", "(", ")", ")", "{", "return", "result", ";", "}", "}", "return", "new", "RefactoringStatus", "(", ")", ";", "}", "private", "boolean", "checkStringForKnownErrors", "(", "String", "resultString", ")", "{", "return", "resultString", ".", "indexOf", "(", "\"\"", ")", ">=", "0", "||", "resultString", ".", "indexOf", "(", "\"\"", ")", ">=", "0", "||", "resultString", ".", "indexOf", "(", "\"\"", ")", ">=", "0", "||", "resultString", ".", "indexOf", "(", "\"\"", ")", ">=", "0", "||", "resultString", ".", "indexOf", "(", "\"\"", ")", ">=", "0", ";", "}", "protected", "void", "performDummySearch", "(", ")", "throws", "Exception", "{", "RefactoringTest", ".", "performDummySearch", "(", "testProject", ".", "getJavaProject", "(", ")", ".", "findPackageFragment", "(", "new", "Path", "(", "\"/src/p\"", ")", ")", ")", ";", "}", "protected", "final", "Refactoring", "createRefactoring", "(", "RefactoringDescriptor", "descriptor", ")", "throws", "CoreException", "{", "RefactoringStatus", "status", "=", "new", "RefactoringStatus", "(", ")", ";", "Refactoring", "refactoring", "=", "descriptor", ".", "createRefactoring", "(", "status", ")", ";", "assertNotNull", "(", "\"\"", ",", "refactoring", ")", ";", "assertTrue", "(", "\"\"", "+", "status", ",", "status", ".", "isOK", "(", ")", ")", ";", "return", "refactoring", ";", "}", "protected", "IUndoManager", "getUndoManager", "(", ")", "{", "IUndoManager", "undoManager", "=", "RefactoringCore", ".", "getUndoManager", "(", ")", ";", "undoManager", ".", "flush", "(", ")", ";", "return", "undoManager", ";", "}", "protected", "void", "executePerformOperation", "(", "final", "PerformChangeOperation", "perform", ",", "IWorkspace", "workspace", ")", "throws", "CoreException", "{", "workspace", ".", "run", "(", "perform", ",", "new", "NullProgressMonitor", "(", ")", ")", ";", "}", "}", "</s>" ]
5,999
[ "<s>", "package", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "test", ";", "import", "java", ".", "io", ".", "BufferedReader", ";", "import", "java", ".", "io", ".", "ByteArrayInputStream", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "io", ".", "InputStreamReader", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "junit", ".", "framework", ".", "TestCase", ";", "import", "org", ".", "codehaus", ".", "groovy", ".", "eclipse", ".", "refactoring", ".", "core", ".", "rename", ".", "ForcePreviewParticipant", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IWorkspace", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMember", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ISourceManipulation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "refactoring", ".", "descriptors", ".", "JavaRefactoringDescriptor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "IJavaSearchConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchEngine", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchPattern", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "TypeNameRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "corext", ".", "refactoring", ".", "util", ".", "JavaElementUtil", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "corext", ".", "util", ".", "Strings", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "testplugin", ".", "JavaProjectHelper", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "Change", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "ChangeDescriptor", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "CheckConditionsOperation", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "CreateChangeOperation", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "IUndoManager", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "PerformChangeOperation", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "Refactoring", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringChangeDescriptor", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringContribution", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringCore", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringDescriptor", ";", "import", "org", ".", "eclipse", ".", "ltk", ".", "core", ".", "refactoring", ".", "RefactoringStatus", ";", "public", "abstract", "class", "RefactoringTest", "extends", "TestCase", "{", "private", "static", "final", "boolean", "DESCRIPTOR_TEST", "=", "false", ";", "private", "IPackageFragmentRoot", "fRoot", ";", "private", "IPackageFragment", "fPackageP", ";", "public", "boolean", "fIsPreDeltaTest", "=", "false", ";", "public", "static", "final", "String", "TEST_PATH_PREFIX", "=", "\"\"", ";", "protected", "static", "final", "String", "TEST_INPUT_INFIX", "=", "\"/in/\"", ";", "protected", "static", "final", "String", "TEST_OUTPUT_INFIX", "=", "\"/out/\"", ";", "protected", "static", "final", "String", "CONTAINER", "=", "\"src\"", ";", "protected", "static", "final", "List", "PROJECT_RESOURCE_CHILDREN", "=", "Arrays", ".", "asList", "(", "new", "String", "[", "]", "{", "\".project\"", ",", "\".classpath\"", ",", "\".settings\"", "}", ")", ";", "public", "RefactoringTest", "(", "String", "name", ")", "{", "super", "(", "name", ")", ";", "}", "@", "Override", "protected", "void", "setUp", "(", ")", "throws", "Exception", "{", "fRoot", "=", "RefactoringTestSetup", ".", "getDefaultSourceFolder", "(", ")", ";", "fPackageP", "=", "RefactoringTestSetup", ".", "getPackageP", "(", ")", ";", "fIsPreDeltaTest", "=", "false", ";", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", "\"nTest:\"", "+", "getClass", "(", ")", "+", "\".\"", "+", "getName", "(", ")", ")", ";", "RefactoringCore", ".", "getUndoManager", "(", ")", ".", "flush", "(", ")", ";", "ForcePreviewParticipant", ".", "mute", "(", ")", ";", "}", "protected", "void", "performDummySearch", "(", ")", "throws", "Exception", "{", "performDummySearch", "(", "getPackageP", "(", ")", ")", ";", "}", "@", "Override", "protected", "void", "tearDown", "(", ")", "throws", "Exception", "{", "try", "{", "refreshFromLocal", "(", ")", ";", "performDummySearch", "(", ")", ";", "if", "(", "getPackageP", "(", ")", ".", "exists", "(", ")", ")", "{", "tryDeletingAllJavaChildren", "(", "getPackageP", "(", ")", ")", ";", "tryDeletingAllNonJavaChildResources", "(", "getPackageP", "(", ")", ")", ";", "}", "if", "(", "getRoot", "(", ")", ".", "exists", "(", ")", ")", "{", "IJavaElement", "[", "]", "packages", "=", "getRoot", "(", ")", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "packages", ".", "length", ";", "i", "++", ")", "{", "IPackageFragment", "pack", "=", "(", "IPackageFragment", ")", "packages", "[", "i", "]", ";", "if", "(", "!", "pack", ".", "equals", "(", "getPackageP", "(", ")", ")", "&&", "pack", ".", "exists", "(", ")", "&&", "!", "pack", ".", "isReadOnly", "(", ")", ")", "if", "(", "pack", ".", "isDefaultPackage", "(", ")", ")", "pack", ".", "delete", "(", "true", ",", "null", ")", ";", "else", "JavaProjectHelper", ".", "delete", "(", "pack", ".", "getResource", "(", ")", ")", ";", "}", "}", "restoreTestProject", "(", ")", ";", "}", "finally", "{", "TestRenameParticipantShared", ".", "reset", "(", ")", ";", "TestRenameParticipantSingle", ".", "reset", "(", ")", ";", "ForcePreviewParticipant", ".", "unmute", "(", ")", ";", "}", "}", "private", "void", "restoreTestProject", "(", ")", "throws", "Exception", "{", "IJavaProject", "javaProject", "=", "getRoot", "(", ")", ".", "getJavaProject", "(", ")", ";", "if", "(", "javaProject", ".", "exists", "(", ")", ")", "{", "IClasspathEntry", "srcEntry", "=", "getRoot", "(", ")", ".", "getRawClasspathEntry", "(", ")", ";", "try", "{", "IClasspathEntry", "[", "]", "jreEntries", "=", "RefactoringTestSetup", ".", "getJRELibrariesAsRawClasspathEntry", "(", ")", ";", "IClasspathEntry", "[", "]", "cpes", "=", "javaProject", ".", "getRawClasspath", "(", ")", ";", "ArrayList", "newCPEs", "=", "new", "ArrayList", "(", ")", ";", "boolean", "cpChanged", "=", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cpes", ".", "length", ";", "i", "++", ")", "{", "IClasspathEntry", "cpe", "=", "cpes", "[", "i", "]", ";", "boolean", "isJREEntry", "=", "false", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "jreEntries", ".", "length", ";", "j", "++", ")", "{", "if", "(", "cpe", ".", "equals", "(", "jreEntries", "[", "j", "]", ")", ")", "{", "isJREEntry", "=", "true", ";", "break", ";", "}", "}", "if", "(", "cpe", ".", "equals", "(", "srcEntry", ")", "||", "isJREEntry", ")", "{", "newCPEs", ".", "add", "(", "cpe", ")", ";", "}", "else", "{", "cpChanged", "=", "true", ";", "}", "}", "if", "(", "cpChanged", ")", "{", "IClasspathEntry", "[", "]", "newCPEsArray", "=", "(", "IClasspathEntry", "[", "]", ")", "newCPEs", ".", "toArray", "(", "new", "IClasspathEntry", "[", "newCPEs", ".", "size", "(", ")", "]", ")", ";", "javaProject", ".", "setRawClasspath", "(", "newCPEsArray", ",", "null", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", ")", ";", "e", ".", "printStackTrace", "(", ")", ";", "}", "Object", "[", "]", "nonJavaResources", "=", "javaProject", ".", "getNonJavaResources", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nonJavaResources", ".", "length", ";", "i", "++", ")", "{", "Object", "kid", "=", "nonJavaResources", "[", "i", "]", ";", "if", "(", "kid", "instanceof", "IResource", ")", "{", "IResource", "resource", "=", "(", "IResource", ")", "kid", ";", "if", "(", "!", "PROJECT_RESOURCE_CHILDREN", ".", "contains", "(", "resource", ".", "getName", "(", ")", ")", ")", "{", "JavaProjectHelper", ".", "delete", "(", "resource", ")", ";", "}", "}", "}", "}", "}", "private", "void", "refreshFromLocal", "(", ")", "throws", "CoreException", "{", "if", "(", "getRoot", "(", ")", ".", "exists", "(", ")", ")", "getRoot", "(", ")", ".", "getResource", "(", ")", ".", "refreshLocal", "(", "IResource", ".", "DEPTH_INFINITE", ",", "null", ")", ";", "else", "if", "(", "getPackageP", "(", ")", ".", "exists", "(", ")", ")", "getPackageP", "(", ")", ".", "getResource", "(", ")", ".", "refreshLocal", "(", "IResource", ".", "DEPTH_INFINITE", ",", "null", ")", ";", "}", "private", "static", "void", "tryDeletingAllNonJavaChildResources", "(", "IPackageFragment", "pack", ")", "throws", "CoreException", "{", "Object", "[", "]", "nonJavaKids", "=", "pack", ".", "getNonJavaResources", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nonJavaKids", ".", "length", ";", "i", "++", ")", "{", "if", "(", "nonJavaKids", "[", "i", "]", "instanceof", "IResource", ")", "{", "IResource", "resource", "=", "(", "IResource", ")", "nonJavaKids", "[", "i", "]", ";", "JavaProjectHelper", ".", "delete", "(", "resource", ")", ";", "}", "}", "}", "private", "static", "void", "tryDeletingAllJavaChildren", "(", "IPackageFragment", "pack", ")", "throws", "CoreException", "{", "IJavaElement", "[", "]", "kids", "=", "pack", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "kids", ".", "length", ";", "i", "++", ")", "{", "if", "(", "kids", "[", "i", "]", "instanceof", "ISourceManipulation", ")", "{", "if", "(", "kids", "[", "i", "]", ".", "exists", "(", ")", "&&", "!", "kids", "[", "i", "]", ".", "isReadOnly", "(", ")", ")", "JavaProjectHelper", ".", "delete", "(", "kids", "[", "i", "]", ")", ";", "}", "}", "}", "protected", "IPackageFragmentRoot", "getRoot", "(", ")", "{", "return", "fRoot", ";", "}", "protected", "IPackageFragment", "getPackageP", "(", ")", "{", "return", "fPackageP", ";", "}", "protected", "IJavaProject", "getProject", "(", ")", "{", "return", "fRoot", ".", "getJavaProject", "(", ")", ";", "}", "protected", "final", "RefactoringStatus", "performRefactoring", "(", "RefactoringDescriptor", "descriptor", ")", "throws", "Exception", "{", "return", "performRefactoring", "(", "descriptor", ",", "true", ")", ";", "}", "protected", "final", "RefactoringStatus", "performRefactoring", "(", "RefactoringDescriptor", "descriptor", ",", "boolean", "providesUndo", ")", "throws", "Exception", "{", "Refactoring", "refactoring", "=", "createRefactoring", "(", "descriptor", ")", ";", "return", "performRefactoring", "(", "refactoring", ",", "providesUndo", ")", ";", "}", "protected", "final", "Refactoring", "createRefactoring", "(", "RefactoringDescriptor", "descriptor", ")", "throws", "CoreException", "{", "RefactoringStatus", "status", "=", "new", "RefactoringStatus", "(", ")", ";", "Refactoring", "refactoring", "=", "descriptor", ".", "createRefactoring", "(", "status", ")", ";", "assertNotNull", "(", "\"\"", ",", "refactoring", ")", ";", "assertTrue", "(", "\"\"", ",", "status", ".", "isOK", "(", ")", ")", ";", "return", "refactoring", ";", "}", "protected", "final", "RefactoringStatus", "performRefactoring", "(", "Refactoring", "ref", ",", "boolean", "performOnFail", ")", "throws", "Exception", "{", "return", "performRefactoring", "(", "ref", ",", "true", ",", "performOnFail", ")", ";", "}", "protected", "final", "RefactoringStatus", "performRefactoring", "(", "Refactoring", "ref", ",", "boolean", "providesUndo", ",", "boolean", "performOnFail", ")", "throws", "Exception", "{", "performDummySearch", "(", ")", ";", "IUndoManager", "undoManager", "=", "getUndoManager", "(", ")", ";", "if", "(", "DESCRIPTOR_TEST", ")", "{", "final", "CreateChangeOperation", "create", "=", "new", "CreateChangeOperation", "(", "new", "CheckConditionsOperation", "(", "ref", ",", "CheckConditionsOperation", ".", "ALL_CONDITIONS", ")", ",", "RefactoringStatus", ".", "FATAL", ")", ";", "create", ".", "run", "(", "new", "NullProgressMonitor", "(", ")", ")", ";", "RefactoringStatus", "checkingStatus", "=", "create", ".", "getConditionCheckingStatus", "(", ")", ";", "if", "(", "checkingStatus", ".", "hasError", "(", ")", ")", "return", "checkingStatus", ";", "Change", "change", "=", "create", ".", "getChange", "(", ")", ";", "ChangeDescriptor", "descriptor", "=", "change", ".", "getDescriptor", "(", ")", ";", "if", "(", "descriptor", "instanceof", "RefactoringChangeDescriptor", ")", "{", "RefactoringChangeDescriptor", "rcd", "=", "(", "RefactoringChangeDescriptor", ")", "descriptor", ";", "RefactoringDescriptor", "refactoringDescriptor", "=", "rcd", ".", "getRefactoringDescriptor", "(", ")", ";", "if", "(", "refactoringDescriptor", "instanceof", "JavaRefactoringDescriptor", ")", "{", "JavaRefactoringDescriptor", "jrd", "=", "(", "JavaRefactoringDescriptor", ")", "refactoringDescriptor", ";", "RefactoringStatus", "validation", "=", "jrd", ".", "validateDescriptor", "(", ")", ";", "if", "(", "validation", ".", "hasError", "(", ")", "&&", "!", "performOnFail", ")", "return", "validation", ";", "RefactoringStatus", "refactoringStatus", "=", "new", "RefactoringStatus", "(", ")", ";", "Class", "expected", "=", "jrd", ".", "getClass", "(", ")", ";", "RefactoringContribution", "contribution", "=", "RefactoringCore", ".", "getRefactoringContribution", "(", "jrd", ".", "getID", "(", ")", ")", ";", "jrd", "=", "(", "JavaRefactoringDescriptor", ")", "contribution", ".", "createDescriptor", "(", "jrd", ".", "getID", "(", ")", ",", "jrd", ".", "getProject", "(", ")", ",", "jrd", ".", "getDescription", "(", ")", ",", "jrd", ".", "getComment", "(", ")", ",", "contribution", ".", "retrieveArgumentMap", "(", "jrd", ")", ",", "jrd", ".", "getFlags", "(", ")", ")", ";", "assertEquals", "(", "expected", ",", "jrd", ".", "getClass", "(", ")", ")", ";", "ref", "=", "jrd", ".", "createRefactoring", "(", "refactoringStatus", ")", ";", "if", "(", "refactoringStatus", ".", "hasError", "(", ")", "&&", "!", "performOnFail", ")", "return", "refactoringStatus", ";", "TestRenameParticipantSingle", ".", "reset", "(", ")", ";", "}", "}", "}", "final", "CreateChangeOperation", "create", "=", "new", "CreateChangeOperation", "(", "new", "CheckConditionsOperation", "(", "ref", ",", "CheckConditionsOperation", ".", "ALL_CONDITIONS", ")", ",", "RefactoringStatus", ".", "FATAL", ")", ";", "final", "PerformChangeOperation", "perform", "=", "new", "PerformChangeOperation", "(", "create", ")", ";", "perform", ".", "setUndoManager", "(", "undoManager", ",", "ref", ".", "getName", "(", ")", ")", ";", "IWorkspace", "workspace", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "executePerformOperation", "(", "perform", ",", "workspace", ")", ";", "RefactoringStatus", "status", "=", "create", ".", "getConditionCheckingStatus", "(", ")", ";", "if", "(", "!", "status", ".", "hasError", "(", ")", "&&", "!", "performOnFail", ")", "return", "status", ";", "assertTrue", "(", "\"\"", ",", "perform", ".", "changeExecuted", "(", ")", ")", ";", "Change", "undo", "=", "perform", ".", "getUndoChange", "(", ")", ";", "if", "(", "providesUndo", ")", "{", "assertNotNull", "(", "\"\"", ",", "undo", ")", ";", "assertTrue", "(", "\"\"", ",", "undoManager", ".", "anythingToUndo", "(", ")", ")", ";", "}", "else", "{", "assertNull", "(", "\"\"", ",", "undo", ")", ";", "}", "return", "null", ";", "}", "protected", "void", "executePerformOperation", "(", "final", "PerformChangeOperation", "perform", ",", "IWorkspace", "workspace", ")", "throws", "CoreException", "{", "workspace", ".", "run", "(", "perform", ",", "new", "NullProgressMonitor", "(", ")", ")", ";", "}", "public", "RefactoringStatus", "performRefactoringWithStatus", "(", "Refactoring", "ref", ",", "boolean", "performOnFail", ")", "throws", "Exception", ",", "CoreException", "{", "RefactoringStatus", "status", "=", "performRefactoring", "(", "ref", ",", "performOnFail", ")", ";", "if", "(", "status", "==", "null", ")", "return", "new", "RefactoringStatus", "(", ")", ";", "return", "status", ";", "}", "protected", "final", "Change", "performChange", "(", "Refactoring", "refactoring", ",", "boolean", "storeUndo", ")", "throws", "Exception", "{", "CreateChangeOperation", "create", "=", "new", "CreateChangeOperation", "(", "refactoring", ")", ";", "PerformChangeOperation", "perform", "=", "new", "PerformChangeOperation", "(", "create", ")", ";", "if", "(", "storeUndo", ")", "{", "perform", ".", "setUndoManager", "(", "getUndoManager", "(", ")", ",", "refactoring", ".", "getName", "(", ")", ")", ";", "}", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "run", "(", "perform", ",", "new", "NullProgressMonitor", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "perform", ".", "changeExecuted", "(", ")", ")", ";", "return", "perform", ".", "getUndoChange", "(", ")", ";", "}", "protected", "final", "Change", "performChange", "(", "final", "Change", "change", ")", "throws", "Exception", "{", "PerformChangeOperation", "perform", "=", "new", "PerformChangeOperation", "(", "change", ")", ";", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "run", "(", "perform", ",", "new", "NullProgressMonitor", "(", ")", ")", ";", "assertTrue", "(", "\"\"", ",", "perform", ".", "changeExecuted", "(", ")", ")", ";", "return", "perform", ".", "getUndoChange", "(", ")", ";", "}", "protected", "IUndoManager", "getUndoManager", "(", ")", "{", "IUndoManager", "undoManager", "=", "RefactoringCore", ".", "getUndoManager", "(", ")", ";", "undoManager", ".", "flush", "(", ")", ";", "return", "undoManager", ";", "}", "protected", "IType", "getType", "(", "ICompilationUnit", "cu", ",", "String", "name", ")", "throws", "JavaModelException", "{", "IType", "[", "]", "types", "=", "cu", ".", "getAllTypes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "if", "(", "types", "[", "i", "]", ".", "getTypeQualifiedName", "(", "'.'", ")", ".", "equals", "(", "name", ")", "||", "types", "[", "i", "]", ".", "getElementName", "(", ")", ".", "equals", "(", "name", ")", ")", "return", "types", "[", "i", "]", ";", "return", "null", ";", "}", "protected", "String", "getRefactoringPath", "(", ")", "{", "return", "\"\"", ";", "}", "protected", "String", "getTestPath", "(", ")", "{", "return", "TEST_PATH_PREFIX", "+", "getRefactoringPath", "(", ")", ";", "}", "protected", "String", "createTestFileName", "(", "String", "cuName", ",", "String", "infix", ")", "{", "return", "getTestPath", "(", ")", "+", "getName", "(", ")", "+", "infix", "+", "cuName", "+", "\".groovy\"", ";", "}", "protected", "String", "getInputTestFileName", "(", "String", "cuName", ")", "{", "return", "createTestFileName", "(", "cuName", ",", "TEST_INPUT_INFIX", ")", ";", "}", "protected", "String", "getInputTestFileName", "(", "String", "cuName", ",", "String", "subDirName", ")", "{", "return", "createTestFileName", "(", "cuName", ",", "TEST_INPUT_INFIX", "+", "subDirName", ")", ";", "}", "protected", "String", "getOutputTestFileName", "(", "String", "cuName", ")", "{", "return", "createTestFileName", "(", "cuName", ",", "TEST_OUTPUT_INFIX", ")", ";", "}", "protected", "String", "getOutputTestFileName", "(", "String", "cuName", ",", "String", "subDirName", ")", "{", "return", "createTestFileName", "(", "cuName", ",", "TEST_OUTPUT_INFIX", "+", "subDirName", ")", ";", "}", "protected", "ICompilationUnit", "createCUfromTestFile", "(", "IPackageFragment", "pack", ",", "String", "cuName", ")", "throws", "Exception", "{", "return", "createCUfromTestFile", "(", "pack", ",", "cuName", ",", "true", ")", ";", "}", "protected", "ICompilationUnit", "createCUfromTestFile", "(", "IPackageFragment", "pack", ",", "String", "cuName", ",", "String", "subDirName", ")", "throws", "Exception", "{", "return", "createCUfromTestFile", "(", "pack", ",", "cuName", ",", "subDirName", ",", "true", ")", ";", "}", "protected", "ICompilationUnit", "createCUfromTestFile", "(", "IPackageFragment", "pack", ",", "String", "cuName", ",", "boolean", "input", ")", "throws", "Exception", "{", "String", "contents", "=", "input", "?", "getFileContents", "(", "getInputTestFileName", "(", "cuName", ")", ")", ":", "getFileContents", "(", "getOutputTestFileName", "(", "cuName", ")", ")", ";", "return", "createCU", "(", "pack", ",", "cuName", "+", "\".groovy\"", ",", "contents", ")", ";", "}", "protected", "ICompilationUnit", "createCUfromTestFile", "(", "IPackageFragment", "pack", ",", "String", "cuName", ",", "String", "subDirName", ",", "boolean", "input", ")", "throws", "Exception", "{", "String", "contents", "=", "input", "?", "getFileContents", "(", "getInputTestFileName", "(", "cuName", ",", "subDirName", ")", ")", ":", "getFileContents", "(", "getOutputTestFileName", "(", "cuName", ",", "subDirName", ")", ")", ";", "return", "createCU", "(", "pack", ",", "cuName", "+", "\".groovy\"", ",", "contents", ")", ";", "}", "protected", "void", "printTestDisabledMessage", "(", "String", "explanation", ")", "{", "System", ".", "out", ".", "println", "(", "\"n\"", "+", "getClass", "(", ")", ".", "getName", "(", ")", "+", "\"::\"", "+", "getName", "(", ")", "+", "\"", "disabled", "(\"", "+", "explanation", "+", "\")\"", ")", ";", "}", "public", "static", "InputStream", "getStream", "(", "String", "content", ")", "{", "return", "new", "ByteArrayInputStream", "(", "content", ".", "getBytes", "(", ")", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "getSourceFolder", "(", "IJavaProject", "javaProject", ",", "String", "name", ")", "throws", "JavaModelException", "{", "IPackageFragmentRoot", "[", "]", "roots", "=", "javaProject", ".", "getPackageFragmentRoots", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "roots", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "roots", "[", "i", "]", ".", "isArchive", "(", ")", "&&", "roots", "[", "i", "]", ".", "getElementName", "(", ")", ".", "equals", "(", "name", ")", ")", "return", "roots", "[", "i", "]", ";", "}", "return", "null", ";", "}", "public", "String", "getFileContents", "(", "String", "fileName", ")", "throws", "IOException", "{", "return", "getContents", "(", "getFileInputStream", "(", "fileName", ")", ")", ";", "}", "public", "static", "String", "getContents", "(", "IFile", "file", ")", "throws", "IOException", ",", "CoreException", "{", "return", "getContents", "(", "file", ".", "getContents", "(", ")", ")", ";", "}", "public", "static", "ICompilationUnit", "createCU", "(", "IPackageFragment", "pack", ",", "String", "name", ",", "String", "contents", ")", "throws", "Exception", "{", "assertTrue", "(", "!", "pack", ".", "getCompilationUnit", "(", "name", ")", ".", "exists", "(", ")", ")", ";", "ICompilationUnit", "cu", "=", "pack", ".", "createCompilationUnit", "(", "name", ",", "contents", ",", "true", ",", "null", ")", ";", "cu", ".", "save", "(", "null", ",", "true", ")", ";", "return", "cu", ";", "}", "public", "static", "String", "getContents", "(", "InputStream", "in", ")", "throws", "IOException", "{", "BufferedReader", "br", "=", "new", "BufferedReader", "(", "new", "InputStreamReader", "(", "in", ")", ")", ";", "StringBuffer", "sb", "=", "new", "StringBuffer", "(", "300", ")", ";", "try", "{", "int", "read", "=", "0", ";", "while", "(", "(", "read", "=", "br", ".", "read", "(", ")", ")", "!=", "-", "1", ")", "sb", ".", "append", "(", "(", "char", ")", "read", ")", ";", "}", "finally", "{", "br", ".", "close", "(", ")", ";", "}", "return", "sb", ".", "toString", "(", ")", ";", "}", "public", "static", "InputStream", "getFileInputStream", "(", "String", "fileName", ")", "throws", "IOException", "{", "return", "RefactoringTestPlugin", ".", "getDefault", "(", ")", ".", "getTestResourceStream", "(", "fileName", ")", ";", "}", "public", "static", "String", "removeExtension", "(", "String", "fileName", ")", "{", "return", "fileName", ".", "substring", "(", "0", ",", "fileName", ".", "lastIndexOf", "(", "'.'", ")", ")", ";", "}", "public", "static", "void", "performDummySearch", "(", "IJavaElement", "element", ")", "throws", "Exception", "{", "new", "SearchEngine", "(", ")", ".", "searchAllTypeNames", "(", "null", ",", "SearchPattern", ".", "R_EXACT_MATCH", ",", "\"XXXXXXXXX\"", ".", "toCharArray", "(", ")", ",", "SearchPattern", ".", "R_EXACT_MATCH", ",", "IJavaSearchConstants", ".", "CLASS", ",", "SearchEngine", ".", "createJavaSearchScope", "(", "new", "IJavaElement", "[", "]", "{", "element", "}", ")", ",", "new", "Requestor", "(", ")", ",", "IJavaSearchConstants", ".", "WAIT_UNTIL_READY_TO_SEARCH", ",", "null", ")", ";", "}", "public", "static", "IMember", "[", "]", "merge", "(", "IMember", "[", "]", "a1", ",", "IMember", "[", "]", "a2", ",", "IMember", "[", "]", "a3", ")", "{", "return", "JavaElementUtil", ".", "merge", "(", "JavaElementUtil", ".", "merge", "(", "a1", ",", "a2", ")", ",", "a3", ")", ";", "}", "public", "static", "IMember", "[", "]", "merge", "(", "IMember", "[", "]", "a1", ",", "IMember", "[", "]", "a2", ")", "{", "return", "JavaElementUtil", ".", "merge", "(", "a1", ",", "a2", ")", ";", "}", "public", "static", "IField", "[", "]", "getFields", "(", "IType", "type", ",", "String", "[", "]", "names", ")", "{", "if", "(", "names", "==", "null", ")", "return", "new", "IField", "[", "0", "]", ";", "Set", "fields", "=", "new", "HashSet", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "names", ".", "length", ";", "i", "++", ")", "{", "IField", "field", "=", "type", ".", "getField", "(", "names", "[", "i", "]", ")", ";", "assertTrue", "(", "\"field", "\"", "+", "field", ".", "getElementName", "(", ")", "+", "\"\"", ",", "field", ".", "exists", "(", ")", ")", ";", "fields", ".", "add", "(", "field", ")", ";", "}", "return", "(", "IField", "[", "]", ")", "fields", ".", "toArray", "(", "new", "IField", "[", "fields", ".", "size", "(", ")", "]", ")", ";", "}", "public", "static", "IType", "[", "]", "getMemberTypes", "(", "IType", "type", ",", "String", "[", "]", "names", ")", "{", "if", "(", "names", "==", "null", ")", "return", "new", "IType", "[", "0", "]", ";", "Set", "memberTypes", "=", "new", "HashSet", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "names", ".", "length", ";", "i", "++", ")", "{", "IType", "memberType", ";", "if", "(", "names", "[", "i", "]", ".", "indexOf", "(", "'.'", ")", "!=", "-", "1", ")", "{", "String", "[", "]", "path", "=", "names", "[", "i", "]", ".", "split", "(", "\"\\\\.\"", ")", ";", "memberType", "=", "type", ".", "getType", "(", "path", "[", "0", "]", ")", ";", "for", "(", "int", "j", "=", "1", ";", "j", "<", "path", ".", "length", ";", "j", "++", ")", "{", "memberType", "=", "memberType", ".", "getType", "(", "path", "[", "j", "]", ")", ";", "}", "}", "else", "memberType", "=", "type", ".", "getType", "(", "names", "[", "i", "]", ")", ";", "assertTrue", "(", "\"member", "type", "\"", "+", "memberType", ".", "getElementName", "(", ")", "+", "\"\"", ",", "memberType", ".", "exists", "(", ")", ")", ";", "memberTypes", ".", "add", "(", "memberType", ")", ";", "}", "return", "(", "IType", "[", "]", ")", "memberTypes", ".", "toArray", "(", "new", "IType", "[", "memberTypes", ".", "size", "(", ")", "]", ")", ";", "}", "public", "static", "IMethod", "[", "]", "getMethods", "(", "IType", "type", ",", "String", "[", "]", "names", ",", "String", "[", "]", "[", "]", "signatures", ")", "{", "if", "(", "names", "==", "null", "||", "signatures", "==", "null", ")", "return", "new", "IMethod", "[", "0", "]", ";", "List", "methods", "=", "new", "ArrayList", "(", "names", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "names", ".", "length", ";", "i", "++", ")", "{", "IMethod", "method", "=", "type", ".", "getMethod", "(", "names", "[", "i", "]", ",", "signatures", "[", "i", "]", ")", ";", "assertTrue", "(", "\"method", "\"", "+", "method", ".", "getElementName", "(", ")", "+", "\"\"", ",", "method", ".", "exists", "(", ")", ")", ";", "if", "(", "!", "methods", ".", "contains", "(", "method", ")", ")", "methods", ".", "add", "(", "method", ")", ";", "}", "return", "(", "IMethod", "[", "]", ")", "methods", ".", "toArray", "(", "new", "IMethod", "[", "methods", ".", "size", "(", ")", "]", ")", ";", "}", "public", "static", "IType", "[", "]", "findTypes", "(", "IType", "[", "]", "types", ",", "String", "[", "]", "namesOfTypesToPullUp", ")", "{", "List", "found", "=", "new", "ArrayList", "(", "types", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "{", "IType", "type", "=", "types", "[", "i", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "namesOfTypesToPullUp", ".", "length", ";", "j", "++", ")", "{", "String", "name", "=", "namesOfTypesToPullUp", "[", "j", "]", ";", "if", "(", "type", ".", "getElementName", "(", ")", ".", "equals", "(", "name", ")", ")", "found", ".", "add", "(", "type", ")", ";", "}", "}", "return", "(", "IType", "[", "]", ")", "found", ".", "toArray", "(", "new", "IType", "[", "found", ".", "size", "(", ")", "]", ")", ";", "}", "public", "static", "IField", "[", "]", "findFields", "(", "IField", "[", "]", "fields", ",", "String", "[", "]", "namesOfFieldsToPullUp", ")", "{", "List", "found", "=", "new", "ArrayList", "(", "fields", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fields", ".", "length", ";", "i", "++", ")", "{", "IField", "field", "=", "fields", "[", "i", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "namesOfFieldsToPullUp", ".", "length", ";", "j", "++", ")", "{", "String", "name", "=", "namesOfFieldsToPullUp", "[", "j", "]", ";", "if", "(", "field", ".", "getElementName", "(", ")", ".", "equals", "(", "name", ")", ")", "found", ".", "add", "(", "field", ")", ";", "}", "}", "return", "(", "IField", "[", "]", ")", "found", ".", "toArray", "(", "new", "IField", "[", "found", ".", "size", "(", ")", "]", ")", ";", "}", "public", "static", "IMethod", "[", "]", "findMethods", "(", "IMethod", "[", "]", "selectedMethods", ",", "String", "[", "]", "namesOfMethods", ",", "String", "[", "]", "[", "]", "signaturesOfMethods", ")", "{", "List", "found", "=", "new", "ArrayList", "(", "selectedMethods", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "selectedMethods", ".", "length", ";", "i", "++", ")", "{", "IMethod", "method", "=", "selectedMethods", "[", "i", "]", ";", "String", "[", "]", "paramTypes", "=", "method", ".", "getParameterTypes", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "namesOfMethods", ".", "length", ";", "j", "++", ")", "{", "String", "methodName", "=", "namesOfMethods", "[", "j", "]", ";", "if", "(", "!", "methodName", ".", "equals", "(", "method", ".", "getElementName", "(", ")", ")", ")", "continue", ";", "String", "[", "]", "methodSig", "=", "signaturesOfMethods", "[", "j", "]", ";", "if", "(", "!", "areSameSignatures", "(", "paramTypes", ",", "methodSig", ")", ")", "continue", ";", "found", ".", "add", "(", "method", ")", ";", "}", "}", "return", "(", "IMethod", "[", "]", ")", "found", ".", "toArray", "(", "new", "IMethod", "[", "found", ".", "size", "(", ")", "]", ")", ";", "}", "private", "static", "boolean", "areSameSignatures", "(", "String", "[", "]", "s1", ",", "String", "[", "]", "s2", ")", "{", "if", "(", "s1", ".", "length", "!=", "s2", ".", "length", ")", "return", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "s1", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "s1", "[", "i", "]", ".", "equals", "(", "s2", "[", "i", "]", ")", ")", "return", "false", ";", "}", "return", "true", ";", "}", "public", "static", "void", "assertEqualLines", "(", "String", "expected", ",", "String", "actual", ")", "{", "assertEqualLines", "(", "\"\"", ",", "expected", ",", "actual", ")", ";", "}", "public", "static", "void", "assertEqualLines", "(", "String", "message", ",", "String", "expected", ",", "String", "actual", ")", "{", "String", "[", "]", "expectedLines", "=", "Strings", ".", "convertIntoLines", "(", "expected", ")", ";", "String", "[", "]", "actualLines", "=", "Strings", ".", "convertIntoLines", "(", "actual", ")", ";", "String", "expected2", "=", "(", "expectedLines", "==", "null", "?", "null", ":", "Strings", ".", "concatenate", "(", "expectedLines", ",", "\"n\"", ")", ")", ";", "String", "actual2", "=", "(", "actualLines", "==", "null", "?", "null", ":", "Strings", ".", "concatenate", "(", "actualLines", ",", "\"n\"", ")", ")", ";", "assertEquals", "(", "message", ",", "expected2", ",", "actual2", ")", ";", "}", "private", "static", "class", "Requestor", "extends", "TypeNameRequestor", "{", "}", "}", "</s>" ]