id
int32
0
12.9k
code
sequencelengths
2
264k
3,900
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "public", "final", "class", "NameSet", "{", "public", "char", "[", "]", "[", "]", "names", ";", "public", "int", "elementSize", ";", "public", "int", "threshold", ";", "public", "NameSet", "(", "int", "size", ")", "{", "this", ".", "elementSize", "=", "0", ";", "this", ".", "threshold", "=", "size", ";", "int", "extraRoom", "=", "(", "int", ")", "(", "size", "*", "1.5f", ")", ";", "if", "(", "this", ".", "threshold", "==", "extraRoom", ")", "extraRoom", "++", ";", "this", ".", "names", "=", "new", "char", "[", "extraRoom", "]", "[", "]", ";", "}", "public", "char", "[", "]", "add", "(", "char", "[", "]", "name", ")", "{", "int", "length", "=", "this", ".", "names", ".", "length", ";", "int", "index", "=", "CharOperation", ".", "hashCode", "(", "name", ")", "%", "length", ";", "char", "[", "]", "current", ";", "while", "(", "(", "current", "=", "this", ".", "names", "[", "index", "]", ")", "!=", "null", ")", "{", "if", "(", "CharOperation", ".", "equals", "(", "current", ",", "name", ")", ")", "return", "current", ";", "if", "(", "++", "index", "==", "length", ")", "index", "=", "0", ";", "}", "this", ".", "names", "[", "index", "]", "=", "name", ";", "if", "(", "++", "this", ".", "elementSize", ">", "this", ".", "threshold", ")", "rehash", "(", ")", ";", "return", "name", ";", "}", "private", "void", "rehash", "(", ")", "{", "NameSet", "newSet", "=", "new", "NameSet", "(", "this", ".", "elementSize", "*", "2", ")", ";", "char", "[", "]", "current", ";", "for", "(", "int", "i", "=", "this", ".", "names", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "if", "(", "(", "current", "=", "this", ".", "names", "[", "i", "]", ")", "!=", "null", ")", "newSet", ".", "add", "(", "current", ")", ";", "this", ".", "names", "=", "newSet", ".", "names", ";", "this", ".", "elementSize", "=", "newSet", ".", "elementSize", ";", "this", ".", "threshold", "=", "newSet", ".", "threshold", ";", "}", "public", "String", "toString", "(", ")", "{", "String", "s", "=", "\"\"", ";", "char", "[", "]", "name", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "names", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "(", "name", "=", "this", ".", "names", "[", "i", "]", ")", "!=", "null", ")", "s", "+=", "new", "String", "(", "name", ")", "+", "\"n\"", ";", "return", "s", ";", "}", "}", "</s>" ]
3,901
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRuleSet", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "NameEnvironmentAnswer", ";", "public", "abstract", "class", "ClasspathLocation", "{", "static", "ClasspathLocation", "forSourceFolder", "(", "IContainer", "sourceFolder", ",", "IContainer", "outputFolder", ",", "char", "[", "]", "[", "]", "inclusionPatterns", ",", "char", "[", "]", "[", "]", "exclusionPatterns", ")", "{", "return", "new", "ClasspathMultiDirectory", "(", "sourceFolder", ",", "outputFolder", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ";", "}", "public", "static", "ClasspathLocation", "forBinaryFolder", "(", "IContainer", "binaryFolder", ",", "boolean", "isOutputFolder", ",", "AccessRuleSet", "accessRuleSet", ")", "{", "return", "new", "ClasspathDirectory", "(", "binaryFolder", ",", "isOutputFolder", ",", "accessRuleSet", ")", ";", "}", "static", "ClasspathLocation", "forLibrary", "(", "String", "libraryPathname", ",", "long", "lastModified", ",", "AccessRuleSet", "accessRuleSet", ")", "{", "return", "new", "ClasspathJar", "(", "libraryPathname", ",", "lastModified", ",", "accessRuleSet", ")", ";", "}", "static", "ClasspathLocation", "forLibrary", "(", "String", "libraryPathname", ",", "AccessRuleSet", "accessRuleSet", ")", "{", "return", "forLibrary", "(", "libraryPathname", ",", "0", ",", "accessRuleSet", ")", ";", "}", "static", "ClasspathLocation", "forLibrary", "(", "IFile", "library", ",", "AccessRuleSet", "accessRuleSet", ")", "{", "return", "new", "ClasspathJar", "(", "library", ",", "accessRuleSet", ")", ";", "}", "public", "abstract", "NameEnvironmentAnswer", "findClass", "(", "String", "binaryFileName", ",", "String", "qualifiedPackageName", ",", "String", "qualifiedBinaryFileName", ")", ";", "public", "abstract", "IPath", "getProjectRelativePath", "(", ")", ";", "public", "boolean", "isOutputFolder", "(", ")", "{", "return", "false", ";", "}", "public", "abstract", "boolean", "isPackage", "(", "String", "qualifiedPackageName", ")", ";", "public", "void", "cleanup", "(", ")", "{", "}", "public", "void", "reset", "(", ")", "{", "}", "public", "abstract", "String", "debugPathString", "(", ")", ";", "}", "</s>" ]
3,902
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "AbortCompilation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SimpleLookupTable", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SimpleSet", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "*", ";", "import", "java", ".", "io", ".", "*", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "NameEnvironment", "implements", "INameEnvironment", ",", "SuffixConstants", "{", "boolean", "isIncrementalBuild", ";", "ClasspathMultiDirectory", "[", "]", "sourceLocations", ";", "ClasspathLocation", "[", "]", "binaryLocations", ";", "BuildNotifier", "notifier", ";", "SimpleSet", "initialTypeNames", ";", "SimpleLookupTable", "additionalUnits", ";", "NameEnvironment", "(", "IWorkspaceRoot", "root", ",", "JavaProject", "javaProject", ",", "SimpleLookupTable", "binaryLocationsPerProject", ",", "BuildNotifier", "notifier", ")", "throws", "CoreException", "{", "this", ".", "isIncrementalBuild", "=", "false", ";", "this", ".", "notifier", "=", "notifier", ";", "computeClasspathLocations", "(", "root", ",", "javaProject", ",", "binaryLocationsPerProject", ")", ";", "setNames", "(", "null", ",", "null", ")", ";", "}", "public", "NameEnvironment", "(", "IJavaProject", "javaProject", ")", "{", "this", ".", "isIncrementalBuild", "=", "false", ";", "try", "{", "computeClasspathLocations", "(", "javaProject", ".", "getProject", "(", ")", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ",", "(", "JavaProject", ")", "javaProject", ",", "null", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "this", ".", "sourceLocations", "=", "new", "ClasspathMultiDirectory", "[", "0", "]", ";", "this", ".", "binaryLocations", "=", "new", "ClasspathLocation", "[", "0", "]", ";", "}", "setNames", "(", "null", ",", "null", ")", ";", "}", "private", "void", "computeClasspathLocations", "(", "IWorkspaceRoot", "root", ",", "JavaProject", "javaProject", ",", "SimpleLookupTable", "binaryLocationsPerProject", ")", "throws", "CoreException", "{", "IMarker", "cycleMarker", "=", "javaProject", ".", "getCycleMarker", "(", ")", ";", "if", "(", "cycleMarker", "!=", "null", ")", "{", "int", "severity", "=", "JavaCore", ".", "ERROR", ".", "equals", "(", "javaProject", ".", "getOption", "(", "JavaCore", ".", "CORE_CIRCULAR_CLASSPATH", ",", "true", ")", ")", "?", "IMarker", ".", "SEVERITY_ERROR", ":", "IMarker", ".", "SEVERITY_WARNING", ";", "if", "(", "severity", "!=", "cycleMarker", ".", "getAttribute", "(", "IMarker", ".", "SEVERITY", ",", "severity", ")", ")", "cycleMarker", ".", "setAttribute", "(", "IMarker", ".", "SEVERITY", ",", "severity", ")", ";", "}", "IClasspathEntry", "[", "]", "classpathEntries", "=", "javaProject", ".", "getExpandedClasspath", "(", ")", ";", "ArrayList", "sLocations", "=", "new", "ArrayList", "(", "classpathEntries", ".", "length", ")", ";", "ArrayList", "bLocations", "=", "new", "ArrayList", "(", "classpathEntries", ".", "length", ")", ";", "nextEntry", ":", "for", "(", "int", "i", "=", "0", ",", "l", "=", "classpathEntries", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "ClasspathEntry", "entry", "=", "(", "ClasspathEntry", ")", "classpathEntries", "[", "i", "]", ";", "IPath", "path", "=", "entry", ".", "getPath", "(", ")", ";", "Object", "target", "=", "JavaModel", ".", "getTarget", "(", "path", ",", "true", ")", ";", "if", "(", "target", "==", "null", ")", "continue", "nextEntry", ";", "switch", "(", "entry", ".", "getEntryKind", "(", ")", ")", "{", "case", "IClasspathEntry", ".", "CPE_SOURCE", ":", "if", "(", "!", "(", "target", "instanceof", "IContainer", ")", ")", "continue", "nextEntry", ";", "IPath", "outputPath", "=", "entry", ".", "getOutputLocation", "(", ")", "!=", "null", "?", "entry", ".", "getOutputLocation", "(", ")", ":", "javaProject", ".", "getOutputLocation", "(", ")", ";", "IContainer", "outputFolder", ";", "if", "(", "outputPath", ".", "segmentCount", "(", ")", "==", "1", ")", "{", "outputFolder", "=", "javaProject", ".", "getProject", "(", ")", ";", "}", "else", "{", "outputFolder", "=", "root", ".", "getFolder", "(", "outputPath", ")", ";", "if", "(", "!", "outputFolder", ".", "exists", "(", ")", ")", "createOutputFolder", "(", "outputFolder", ")", ";", "}", "sLocations", ".", "add", "(", "ClasspathLocation", ".", "forSourceFolder", "(", "(", "IContainer", ")", "target", ",", "outputFolder", ",", "entry", ".", "fullInclusionPatternChars", "(", ")", ",", "entry", ".", "fullExclusionPatternChars", "(", ")", ")", ")", ";", "continue", "nextEntry", ";", "case", "IClasspathEntry", ".", "CPE_PROJECT", ":", "if", "(", "!", "(", "target", "instanceof", "IProject", ")", ")", "continue", "nextEntry", ";", "IProject", "prereqProject", "=", "(", "IProject", ")", "target", ";", "if", "(", "!", "JavaProject", ".", "hasJavaNature", "(", "prereqProject", ")", ")", "continue", "nextEntry", ";", "JavaProject", "prereqJavaProject", "=", "(", "JavaProject", ")", "JavaCore", ".", "create", "(", "prereqProject", ")", ";", "IClasspathEntry", "[", "]", "prereqClasspathEntries", "=", "prereqJavaProject", ".", "getRawClasspath", "(", ")", ";", "ArrayList", "seen", "=", "new", "ArrayList", "(", ")", ";", "nextPrereqEntry", ":", "for", "(", "int", "j", "=", "0", ",", "m", "=", "prereqClasspathEntries", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "{", "IClasspathEntry", "prereqEntry", "=", "prereqClasspathEntries", "[", "j", "]", ";", "if", "(", "prereqEntry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_SOURCE", ")", "{", "Object", "prereqTarget", "=", "JavaModel", ".", "getTarget", "(", "prereqEntry", ".", "getPath", "(", ")", ",", "true", ")", ";", "if", "(", "!", "(", "prereqTarget", "instanceof", "IContainer", ")", ")", "continue", "nextPrereqEntry", ";", "IPath", "prereqOutputPath", "=", "prereqEntry", ".", "getOutputLocation", "(", ")", "!=", "null", "?", "prereqEntry", ".", "getOutputLocation", "(", ")", ":", "prereqJavaProject", ".", "getOutputLocation", "(", ")", ";", "IContainer", "binaryFolder", "=", "prereqOutputPath", ".", "segmentCount", "(", ")", "==", "1", "?", "(", "IContainer", ")", "prereqProject", ":", "(", "IContainer", ")", "root", ".", "getFolder", "(", "prereqOutputPath", ")", ";", "if", "(", "binaryFolder", ".", "exists", "(", ")", "&&", "!", "seen", ".", "contains", "(", "binaryFolder", ")", ")", "{", "seen", ".", "add", "(", "binaryFolder", ")", ";", "ClasspathLocation", "bLocation", "=", "ClasspathLocation", ".", "forBinaryFolder", "(", "binaryFolder", ",", "true", ",", "entry", ".", "getAccessRuleSet", "(", ")", ")", ";", "bLocations", ".", "add", "(", "bLocation", ")", ";", "if", "(", "binaryLocationsPerProject", "!=", "null", ")", "{", "ClasspathLocation", "[", "]", "existingLocations", "=", "(", "ClasspathLocation", "[", "]", ")", "binaryLocationsPerProject", ".", "get", "(", "prereqProject", ")", ";", "if", "(", "existingLocations", "==", "null", ")", "{", "existingLocations", "=", "new", "ClasspathLocation", "[", "]", "{", "bLocation", "}", ";", "}", "else", "{", "int", "size", "=", "existingLocations", ".", "length", ";", "System", ".", "arraycopy", "(", "existingLocations", ",", "0", ",", "existingLocations", "=", "new", "ClasspathLocation", "[", "size", "+", "1", "]", ",", "0", ",", "size", ")", ";", "existingLocations", "[", "size", "]", "=", "bLocation", ";", "}", "binaryLocationsPerProject", ".", "put", "(", "prereqProject", ",", "existingLocations", ")", ";", "}", "}", "}", "}", "continue", "nextEntry", ";", "case", "IClasspathEntry", ".", "CPE_LIBRARY", ":", "if", "(", "target", "instanceof", "IResource", ")", "{", "IResource", "resource", "=", "(", "IResource", ")", "target", ";", "ClasspathLocation", "bLocation", "=", "null", ";", "if", "(", "resource", "instanceof", "IFile", ")", "{", "AccessRuleSet", "accessRuleSet", "=", "(", "JavaCore", ".", "IGNORE", ".", "equals", "(", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_PB_FORBIDDEN_REFERENCE", ",", "true", ")", ")", "&&", "JavaCore", ".", "IGNORE", ".", "equals", "(", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_PB_DISCOURAGED_REFERENCE", ",", "true", ")", ")", ")", "?", "null", ":", "entry", ".", "getAccessRuleSet", "(", ")", ";", "bLocation", "=", "ClasspathLocation", ".", "forLibrary", "(", "(", "IFile", ")", "resource", ",", "accessRuleSet", ")", ";", "}", "else", "if", "(", "resource", "instanceof", "IContainer", ")", "{", "AccessRuleSet", "accessRuleSet", "=", "(", "JavaCore", ".", "IGNORE", ".", "equals", "(", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_PB_FORBIDDEN_REFERENCE", ",", "true", ")", ")", "&&", "JavaCore", ".", "IGNORE", ".", "equals", "(", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_PB_DISCOURAGED_REFERENCE", ",", "true", ")", ")", ")", "?", "null", ":", "entry", ".", "getAccessRuleSet", "(", ")", ";", "bLocation", "=", "ClasspathLocation", ".", "forBinaryFolder", "(", "(", "IContainer", ")", "target", ",", "false", ",", "accessRuleSet", ")", ";", "}", "bLocations", ".", "add", "(", "bLocation", ")", ";", "if", "(", "binaryLocationsPerProject", "!=", "null", ")", "{", "IProject", "p", "=", "resource", ".", "getProject", "(", ")", ";", "ClasspathLocation", "[", "]", "existingLocations", "=", "(", "ClasspathLocation", "[", "]", ")", "binaryLocationsPerProject", ".", "get", "(", "p", ")", ";", "if", "(", "existingLocations", "==", "null", ")", "{", "existingLocations", "=", "new", "ClasspathLocation", "[", "]", "{", "bLocation", "}", ";", "}", "else", "{", "int", "size", "=", "existingLocations", ".", "length", ";", "System", ".", "arraycopy", "(", "existingLocations", ",", "0", ",", "existingLocations", "=", "new", "ClasspathLocation", "[", "size", "+", "1", "]", ",", "0", ",", "size", ")", ";", "existingLocations", "[", "size", "]", "=", "bLocation", ";", "}", "binaryLocationsPerProject", ".", "put", "(", "p", ",", "existingLocations", ")", ";", "}", "}", "else", "if", "(", "target", "instanceof", "File", ")", "{", "AccessRuleSet", "accessRuleSet", "=", "(", "JavaCore", ".", "IGNORE", ".", "equals", "(", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_PB_FORBIDDEN_REFERENCE", ",", "true", ")", ")", "&&", "JavaCore", ".", "IGNORE", ".", "equals", "(", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_PB_DISCOURAGED_REFERENCE", ",", "true", ")", ")", ")", "?", "null", ":", "entry", ".", "getAccessRuleSet", "(", ")", ";", "bLocations", ".", "add", "(", "ClasspathLocation", ".", "forLibrary", "(", "path", ".", "toString", "(", ")", ",", "accessRuleSet", ")", ")", ";", "}", "continue", "nextEntry", ";", "}", "}", "ArrayList", "outputFolders", "=", "new", "ArrayList", "(", "1", ")", ";", "this", ".", "sourceLocations", "=", "new", "ClasspathMultiDirectory", "[", "sLocations", ".", "size", "(", ")", "]", ";", "if", "(", "!", "sLocations", ".", "isEmpty", "(", ")", ")", "{", "sLocations", ".", "toArray", "(", "this", ".", "sourceLocations", ")", ";", "next", ":", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "sourceLocations", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "ClasspathMultiDirectory", "md", "=", "this", ".", "sourceLocations", "[", "i", "]", ";", "IPath", "outputPath", "=", "md", ".", "binaryFolder", ".", "getFullPath", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "i", ";", "j", "++", ")", "{", "if", "(", "outputPath", ".", "equals", "(", "this", ".", "sourceLocations", "[", "j", "]", ".", "binaryFolder", ".", "getFullPath", "(", ")", ")", ")", "{", "md", ".", "hasIndependentOutputFolder", "=", "this", ".", "sourceLocations", "[", "j", "]", ".", "hasIndependentOutputFolder", ";", "continue", "next", ";", "}", "}", "outputFolders", ".", "add", "(", "md", ")", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "this", ".", "sourceLocations", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "if", "(", "outputPath", ".", "equals", "(", "this", ".", "sourceLocations", "[", "j", "]", ".", "sourceFolder", ".", "getFullPath", "(", ")", ")", ")", "continue", "next", ";", "md", ".", "hasIndependentOutputFolder", "=", "true", ";", "}", "}", "this", ".", "binaryLocations", "=", "new", "ClasspathLocation", "[", "outputFolders", ".", "size", "(", ")", "+", "bLocations", ".", "size", "(", ")", "]", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "outputFolders", ".", "size", "(", ")", ";", "i", "<", "l", ";", "i", "++", ")", "this", ".", "binaryLocations", "[", "index", "++", "]", "=", "(", "ClasspathLocation", ")", "outputFolders", ".", "get", "(", "i", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "bLocations", ".", "size", "(", ")", ";", "i", "<", "l", ";", "i", "++", ")", "this", ".", "binaryLocations", "[", "index", "++", "]", "=", "(", "ClasspathLocation", ")", "bLocations", ".", "get", "(", "i", ")", ";", "}", "public", "void", "cleanup", "(", ")", "{", "this", ".", "initialTypeNames", "=", "null", ";", "this", ".", "additionalUnits", "=", "null", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "sourceLocations", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "this", ".", "sourceLocations", "[", "i", "]", ".", "cleanup", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "binaryLocations", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "this", ".", "binaryLocations", "[", "i", "]", ".", "cleanup", "(", ")", ";", "}", "private", "void", "createOutputFolder", "(", "IContainer", "outputFolder", ")", "throws", "CoreException", "{", "createParentFolder", "(", "outputFolder", ".", "getParent", "(", ")", ")", ";", "(", "(", "IFolder", ")", "outputFolder", ")", ".", "create", "(", "IResource", ".", "FORCE", "|", "IResource", ".", "DERIVED", ",", "true", ",", "null", ")", ";", "}", "private", "void", "createParentFolder", "(", "IContainer", "parent", ")", "throws", "CoreException", "{", "if", "(", "!", "parent", ".", "exists", "(", ")", ")", "{", "createParentFolder", "(", "parent", ".", "getParent", "(", ")", ")", ";", "(", "(", "IFolder", ")", "parent", ")", ".", "create", "(", "true", ",", "true", ",", "null", ")", ";", "}", "}", "private", "NameEnvironmentAnswer", "findClass", "(", "String", "qualifiedTypeName", ",", "char", "[", "]", "typeName", ")", "{", "if", "(", "this", ".", "notifier", "!=", "null", ")", "this", ".", "notifier", ".", "checkCancelWithinCompiler", "(", ")", ";", "if", "(", "this", ".", "initialTypeNames", "!=", "null", "&&", "this", ".", "initialTypeNames", ".", "includes", "(", "qualifiedTypeName", ")", ")", "{", "if", "(", "this", ".", "isIncrementalBuild", ")", "throw", "new", "AbortCompilation", "(", "true", ",", "new", "AbortIncrementalBuildException", "(", "qualifiedTypeName", ")", ")", ";", "return", "null", ";", "}", "if", "(", "this", ".", "additionalUnits", "!=", "null", "&&", "this", ".", "sourceLocations", ".", "length", ">", "0", ")", "{", "SourceFile", "unit", "=", "(", "SourceFile", ")", "this", ".", "additionalUnits", ".", "get", "(", "qualifiedTypeName", ")", ";", "if", "(", "unit", "!=", "null", ")", "return", "new", "NameEnvironmentAnswer", "(", "unit", ",", "null", ")", ";", "}", "String", "qBinaryFileName", "=", "qualifiedTypeName", "+", "SUFFIX_STRING_class", ";", "String", "binaryFileName", "=", "qBinaryFileName", ";", "String", "qPackageName", "=", "\"\"", ";", "if", "(", "qualifiedTypeName", ".", "length", "(", ")", ">", "typeName", ".", "length", ")", "{", "int", "typeNameStart", "=", "qBinaryFileName", ".", "length", "(", ")", "-", "typeName", ".", "length", "-", "6", ";", "qPackageName", "=", "qBinaryFileName", ".", "substring", "(", "0", ",", "typeNameStart", "-", "1", ")", ";", "binaryFileName", "=", "qBinaryFileName", ".", "substring", "(", "typeNameStart", ")", ";", "}", "NameEnvironmentAnswer", "suggestedAnswer", "=", "null", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "binaryLocations", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "NameEnvironmentAnswer", "answer", "=", "this", ".", "binaryLocations", "[", "i", "]", ".", "findClass", "(", "binaryFileName", ",", "qPackageName", ",", "qBinaryFileName", ")", ";", "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", "]", ")", ";", "return", "null", ";", "}", "public", "NameEnvironmentAnswer", "findType", "(", "char", "[", "]", "typeName", ",", "char", "[", "]", "[", "]", "packageName", ")", "{", "if", "(", "typeName", "!=", "null", ")", "return", "findClass", "(", "new", "String", "(", "CharOperation", ".", "concatWith", "(", "packageName", ",", "typeName", ",", "'/'", ")", ")", ",", "typeName", ")", ";", "return", "null", ";", "}", "public", "boolean", "isPackage", "(", "char", "[", "]", "[", "]", "compoundName", ",", "char", "[", "]", "packageName", ")", "{", "return", "isPackage", "(", "new", "String", "(", "CharOperation", ".", "concatWith", "(", "compoundName", ",", "packageName", ",", "'/'", ")", ")", ")", ";", "}", "public", "boolean", "isPackage", "(", "String", "qualifiedPackageName", ")", "{", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "binaryLocations", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "this", ".", "binaryLocations", "[", "i", "]", ".", "isPackage", "(", "qualifiedPackageName", ")", ")", "return", "true", ";", "return", "false", ";", "}", "void", "setNames", "(", "String", "[", "]", "typeNames", ",", "SourceFile", "[", "]", "additionalFiles", ")", "{", "if", "(", "typeNames", "==", "null", ")", "{", "this", ".", "initialTypeNames", "=", "null", ";", "}", "else", "{", "this", ".", "initialTypeNames", "=", "new", "SimpleSet", "(", "typeNames", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "typeNames", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "this", ".", "initialTypeNames", ".", "add", "(", "typeNames", "[", "i", "]", ")", ";", "}", "if", "(", "additionalFiles", "==", "null", ")", "{", "this", ".", "additionalUnits", "=", "null", ";", "}", "else", "{", "this", ".", "additionalUnits", "=", "new", "SimpleLookupTable", "(", "additionalFiles", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "additionalFiles", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "SourceFile", "additionalUnit", "=", "additionalFiles", "[", "i", "]", ";", "if", "(", "additionalUnit", "!=", "null", ")", "this", ".", "additionalUnits", ".", "put", "(", "additionalUnit", ".", "initialTypeName", ",", "additionalFiles", "[", "i", "]", ")", ";", "}", "}", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "sourceLocations", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "this", ".", "sourceLocations", "[", "i", "]", ".", "reset", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "binaryLocations", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "this", ".", "binaryLocations", "[", "i", "]", ".", "reset", "(", ")", ";", "}", "}", "</s>" ]
3,903
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "java", ".", "io", ".", "ByteArrayInputStream", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "io", ".", "PrintWriter", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Locale", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ".", "LanguageSupportFactory", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IContainer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFolder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IMarker", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResourceProxy", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResourceProxyVisitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResourceStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelMarker", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMember", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ISourceRange", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaConventions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ".", "CompilerUtils", ";", "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", ".", "DefaultErrorHandlingPolicies", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ICompilerRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "AbortCompilation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SimpleSet", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "abstract", "class", "AbstractImageBuilder", "implements", "ICompilerRequestor", ",", "ICompilationUnitLocator", "{", "protected", "JavaBuilder", "javaBuilder", ";", "protected", "State", "newState", ";", "protected", "NameEnvironment", "nameEnvironment", ";", "protected", "ClasspathMultiDirectory", "[", "]", "sourceLocations", ";", "public", "BuildNotifier", "notifier", ";", "protected", "Compiler", "compiler", ";", "protected", "WorkQueue", "workQueue", ";", "protected", "ArrayList", "problemSourceFiles", ";", "protected", "boolean", "compiledAllAtOnce", ";", "private", "boolean", "inCompiler", ";", "protected", "boolean", "keepStoringProblemMarkers", ";", "protected", "SimpleSet", "filesWithAnnotations", "=", "null", ";", "public", "static", "int", "MAX_AT_ONCE", "=", "2000", ";", "public", "final", "static", "String", "[", "]", "JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES", "=", "{", "IMarker", ".", "MESSAGE", ",", "IMarker", ".", "SEVERITY", ",", "IJavaModelMarker", ".", "ID", ",", "IMarker", ".", "CHAR_START", ",", "IMarker", ".", "CHAR_END", ",", "IMarker", ".", "LINE_NUMBER", ",", "IJavaModelMarker", ".", "ARGUMENTS", ",", "IJavaModelMarker", ".", "CATEGORY_ID", ",", "}", ";", "public", "final", "static", "String", "[", "]", "JAVA_TASK_MARKER_ATTRIBUTE_NAMES", "=", "{", "IMarker", ".", "MESSAGE", ",", "IMarker", ".", "PRIORITY", ",", "IJavaModelMarker", ".", "ID", ",", "IMarker", ".", "CHAR_START", ",", "IMarker", ".", "CHAR_END", ",", "IMarker", ".", "LINE_NUMBER", ",", "IMarker", ".", "USER_EDITABLE", ",", "IMarker", ".", "SOURCE_ID", ",", "}", ";", "public", "final", "static", "Integer", "S_ERROR", "=", "new", "Integer", "(", "IMarker", ".", "SEVERITY_ERROR", ")", ";", "public", "final", "static", "Integer", "S_WARNING", "=", "new", "Integer", "(", "IMarker", ".", "SEVERITY_WARNING", ")", ";", "public", "final", "static", "Integer", "P_HIGH", "=", "new", "Integer", "(", "IMarker", ".", "PRIORITY_HIGH", ")", ";", "public", "final", "static", "Integer", "P_NORMAL", "=", "new", "Integer", "(", "IMarker", ".", "PRIORITY_NORMAL", ")", ";", "public", "final", "static", "Integer", "P_LOW", "=", "new", "Integer", "(", "IMarker", ".", "PRIORITY_LOW", ")", ";", "protected", "AbstractImageBuilder", "(", "JavaBuilder", "javaBuilder", ",", "boolean", "buildStarting", ",", "State", "newState", ")", "{", "this", ".", "javaBuilder", "=", "javaBuilder", ";", "this", ".", "nameEnvironment", "=", "javaBuilder", ".", "nameEnvironment", ";", "this", ".", "sourceLocations", "=", "this", ".", "nameEnvironment", ".", "sourceLocations", ";", "this", ".", "notifier", "=", "javaBuilder", ".", "notifier", ";", "this", ".", "keepStoringProblemMarkers", "=", "true", ";", "if", "(", "buildStarting", ")", "{", "this", ".", "newState", "=", "newState", "==", "null", "?", "new", "State", "(", "javaBuilder", ")", ":", "newState", ";", "this", ".", "compiler", "=", "newCompiler", "(", ")", ";", "this", ".", "workQueue", "=", "new", "WorkQueue", "(", ")", ";", "this", ".", "problemSourceFiles", "=", "new", "ArrayList", "(", "3", ")", ";", "if", "(", "this", ".", "javaBuilder", ".", "participants", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "javaBuilder", ".", "participants", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "if", "(", "this", ".", "javaBuilder", ".", "participants", "[", "i", "]", ".", "isAnnotationProcessor", "(", ")", ")", "{", "this", ".", "filesWithAnnotations", "=", "new", "SimpleSet", "(", "1", ")", ";", "break", ";", "}", "}", "}", "}", "}", "public", "void", "acceptResult", "(", "CompilationResult", "result", ")", "{", "SourceFile", "compilationUnit", "=", "(", "SourceFile", ")", "result", ".", "getCompilationUnit", "(", ")", ";", "if", "(", "!", "this", ".", "workQueue", ".", "isCompiled", "(", "compilationUnit", ")", ")", "{", "this", ".", "workQueue", ".", "finished", "(", "compilationUnit", ")", ";", "try", "{", "updateProblemsFor", "(", "compilationUnit", ",", "result", ")", ";", "updateTasksFor", "(", "compilationUnit", ",", "result", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "internalException", "(", "e", ")", ";", "}", "if", "(", "result", ".", "hasInconsistentToplevelHierarchies", ")", "if", "(", "!", "this", ".", "problemSourceFiles", ".", "contains", "(", "compilationUnit", ")", ")", "this", ".", "problemSourceFiles", ".", "add", "(", "compilationUnit", ")", ";", "IType", "mainType", "=", "null", ";", "String", "mainTypeName", "=", "null", ";", "String", "typeLocator", "=", "compilationUnit", ".", "typeLocator", "(", ")", ";", "ClassFile", "[", "]", "classFiles", "=", "result", ".", "getClassFiles", "(", ")", ";", "int", "length", "=", "classFiles", ".", "length", ";", "ArrayList", "duplicateTypeNames", "=", "null", ";", "ArrayList", "definedTypeNames", "=", "new", "ArrayList", "(", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ClassFile", "classFile", "=", "classFiles", "[", "i", "]", ";", "char", "[", "]", "[", "]", "compoundName", "=", "classFile", ".", "getCompoundName", "(", ")", ";", "char", "[", "]", "typeName", "=", "compoundName", "[", "compoundName", ".", "length", "-", "1", "]", ";", "boolean", "isNestedType", "=", "classFile", ".", "isNestedType", ";", "if", "(", "isNestedType", ")", "{", "String", "qualifiedTypeName", "=", "new", "String", "(", "classFile", ".", "outerMostEnclosingClassFile", "(", ")", ".", "fileName", "(", ")", ")", ";", "if", "(", "this", ".", "newState", ".", "isDuplicateLocator", "(", "qualifiedTypeName", ",", "typeLocator", ")", ")", "continue", ";", "}", "else", "{", "String", "qualifiedTypeName", "=", "new", "String", "(", "classFile", ".", "fileName", "(", ")", ")", ";", "if", "(", "this", ".", "newState", ".", "isDuplicateLocator", "(", "qualifiedTypeName", ",", "typeLocator", ")", ")", "{", "if", "(", "duplicateTypeNames", "==", "null", ")", "duplicateTypeNames", "=", "new", "ArrayList", "(", ")", ";", "duplicateTypeNames", ".", "add", "(", "compoundName", ")", ";", "if", "(", "mainType", "==", "null", ")", "{", "try", "{", "mainTypeName", "=", "compilationUnit", ".", "initialTypeName", ";", "mainType", "=", "this", ".", "javaBuilder", ".", "javaProject", ".", "findType", "(", "mainTypeName", ".", "replace", "(", "'/'", ",", "'.'", ")", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "IType", "type", ";", "if", "(", "qualifiedTypeName", ".", "equals", "(", "mainTypeName", ")", ")", "{", "type", "=", "mainType", ";", "}", "else", "{", "String", "simpleName", "=", "qualifiedTypeName", ".", "substring", "(", "qualifiedTypeName", ".", "lastIndexOf", "(", "'/'", ")", "+", "1", ")", ";", "type", "=", "mainType", "==", "null", "?", "null", ":", "mainType", ".", "getCompilationUnit", "(", ")", ".", "getType", "(", "simpleName", ")", ";", "}", "createProblemFor", "(", "compilationUnit", ".", "resource", ",", "type", ",", "Messages", ".", "bind", "(", "Messages", ".", "build_duplicateClassFile", ",", "new", "String", "(", "typeName", ")", ")", ",", "JavaCore", ".", "ERROR", ")", ";", "continue", ";", "}", "this", ".", "newState", ".", "recordLocatorForType", "(", "qualifiedTypeName", ",", "typeLocator", ")", ";", "if", "(", "result", ".", "checkSecondaryTypes", "&&", "!", "qualifiedTypeName", ".", "equals", "(", "compilationUnit", ".", "initialTypeName", ")", ")", "acceptSecondaryType", "(", "classFile", ")", ";", "}", "try", "{", "definedTypeNames", ".", "add", "(", "writeClassFile", "(", "classFile", ",", "compilationUnit", ",", "!", "isNestedType", ")", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "if", "(", "e", ".", "getStatus", "(", ")", ".", "getCode", "(", ")", "==", "IResourceStatus", ".", "CASE_VARIANT_EXISTS", ")", "createProblemFor", "(", "compilationUnit", ".", "resource", ",", "null", ",", "Messages", ".", "bind", "(", "Messages", ".", "build_classFileCollision", ",", "e", ".", "getMessage", "(", ")", ")", ",", "JavaCore", ".", "ERROR", ")", ";", "else", "createProblemFor", "(", "compilationUnit", ".", "resource", ",", "null", ",", "Messages", ".", "build_inconsistentClassFile", ",", "JavaCore", ".", "ERROR", ")", ";", "}", "}", "if", "(", "result", ".", "hasAnnotations", "&&", "this", ".", "filesWithAnnotations", "!=", "null", ")", "this", ".", "filesWithAnnotations", ".", "add", "(", "compilationUnit", ")", ";", "this", ".", "compiler", ".", "lookupEnvironment", ".", "releaseClassFiles", "(", "classFiles", ")", ";", "finishedWith", "(", "typeLocator", ",", "result", ",", "compilationUnit", ".", "getMainTypeName", "(", ")", ",", "definedTypeNames", ",", "duplicateTypeNames", ")", ";", "this", ".", "notifier", ".", "compiled", "(", "compilationUnit", ")", ";", "}", "}", "protected", "void", "acceptSecondaryType", "(", "ClassFile", "classFile", ")", "{", "}", "protected", "void", "addAllSourceFiles", "(", "final", "ArrayList", "sourceFiles", ")", "throws", "CoreException", "{", "final", "boolean", "isInterestingProject", "=", "LanguageSupportFactory", ".", "isInterestingProject", "(", "this", ".", "javaBuilder", ".", "getProject", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "sourceLocations", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "final", "ClasspathMultiDirectory", "sourceLocation", "=", "this", ".", "sourceLocations", "[", "i", "]", ";", "final", "char", "[", "]", "[", "]", "exclusionPatterns", "=", "sourceLocation", ".", "exclusionPatterns", ";", "final", "char", "[", "]", "[", "]", "inclusionPatterns", "=", "sourceLocation", ".", "inclusionPatterns", ";", "final", "boolean", "isAlsoProject", "=", "sourceLocation", ".", "sourceFolder", ".", "equals", "(", "this", ".", "javaBuilder", ".", "currentProject", ")", ";", "final", "int", "segmentCount", "=", "sourceLocation", ".", "sourceFolder", ".", "getFullPath", "(", ")", ".", "segmentCount", "(", ")", ";", "final", "IContainer", "outputFolder", "=", "sourceLocation", ".", "binaryFolder", ";", "final", "boolean", "isOutputFolder", "=", "sourceLocation", ".", "sourceFolder", ".", "equals", "(", "outputFolder", ")", ";", "sourceLocation", ".", "sourceFolder", ".", "accept", "(", "new", "IResourceProxyVisitor", "(", ")", "{", "public", "boolean", "visit", "(", "IResourceProxy", "proxy", ")", "throws", "CoreException", "{", "switch", "(", "proxy", ".", "getType", "(", ")", ")", "{", "case", "IResource", ".", "FILE", ":", "String", "resourceName", "=", "proxy", ".", "getName", "(", ")", ";", "if", "(", "(", "!", "isInterestingProject", "&&", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "isJavaLikeFileName", "(", "resourceName", ")", "&&", "!", "LanguageSupportFactory", ".", "isInterestingSourceFile", "(", "resourceName", ")", ")", "||", "(", "isInterestingProject", "&&", "LanguageSupportFactory", ".", "isSourceFile", "(", "resourceName", ",", "isInterestingProject", ")", ")", ")", "{", "IResource", "resource", "=", "proxy", ".", "requestResource", "(", ")", ";", "if", "(", "exclusionPatterns", "!=", "null", "||", "inclusionPatterns", "!=", "null", ")", "if", "(", "Util", ".", "isExcluded", "(", "resource", ".", "getFullPath", "(", ")", ",", "inclusionPatterns", ",", "exclusionPatterns", ",", "false", ")", ")", "return", "false", ";", "sourceFiles", ".", "add", "(", "new", "SourceFile", "(", "(", "IFile", ")", "resource", ",", "sourceLocation", ")", ")", ";", "}", "return", "false", ";", "case", "IResource", ".", "FOLDER", ":", "IPath", "folderPath", "=", "null", ";", "if", "(", "isAlsoProject", ")", "if", "(", "isExcludedFromProject", "(", "folderPath", "=", "proxy", ".", "requestFullPath", "(", ")", ")", ")", "return", "false", ";", "if", "(", "exclusionPatterns", "!=", "null", ")", "{", "if", "(", "folderPath", "==", "null", ")", "folderPath", "=", "proxy", ".", "requestFullPath", "(", ")", ";", "if", "(", "Util", ".", "isExcluded", "(", "folderPath", ",", "inclusionPatterns", ",", "exclusionPatterns", ",", "true", ")", ")", "{", "return", "inclusionPatterns", "!=", "null", ";", "}", "}", "if", "(", "!", "isOutputFolder", ")", "{", "if", "(", "folderPath", "==", "null", ")", "folderPath", "=", "proxy", ".", "requestFullPath", "(", ")", ";", "String", "packageName", "=", "folderPath", ".", "lastSegment", "(", ")", ";", "if", "(", "packageName", ".", "length", "(", ")", ">", "0", ")", "{", "String", "sourceLevel", "=", "AbstractImageBuilder", ".", "this", ".", "javaBuilder", ".", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ";", "String", "complianceLevel", "=", "AbstractImageBuilder", ".", "this", ".", "javaBuilder", ".", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ";", "if", "(", "JavaConventions", ".", "validatePackageName", "(", "packageName", ",", "sourceLevel", ",", "complianceLevel", ")", ".", "getSeverity", "(", ")", "!=", "IStatus", ".", "ERROR", ")", "createFolder", "(", "folderPath", ".", "removeFirstSegments", "(", "segmentCount", ")", ",", "outputFolder", ")", ";", "}", "}", "}", "return", "true", ";", "}", "}", ",", "IResource", ".", "NONE", ")", ";", "this", ".", "notifier", ".", "checkCancel", "(", ")", ";", "}", "}", "protected", "void", "cleanUp", "(", ")", "{", "this", ".", "nameEnvironment", ".", "cleanup", "(", ")", ";", "this", ".", "javaBuilder", "=", "null", ";", "this", ".", "nameEnvironment", "=", "null", ";", "this", ".", "sourceLocations", "=", "null", ";", "this", ".", "notifier", "=", "null", ";", "this", ".", "compiler", "=", "null", ";", "this", ".", "workQueue", "=", "null", ";", "this", ".", "problemSourceFiles", "=", "null", ";", "}", "protected", "void", "compile", "(", "SourceFile", "[", "]", "units", ")", "{", "if", "(", "this", ".", "filesWithAnnotations", "!=", "null", "&&", "this", ".", "filesWithAnnotations", ".", "elementSize", ">", "0", ")", "this", ".", "filesWithAnnotations", ".", "clear", "(", ")", ";", "CompilationParticipantResult", "[", "]", "participantResults", "=", "this", ".", "javaBuilder", ".", "participants", "==", "null", "?", "null", ":", "notifyParticipants", "(", "units", ")", ";", "if", "(", "participantResults", "!=", "null", "&&", "participantResults", ".", "length", ">", "units", ".", "length", ")", "{", "units", "=", "new", "SourceFile", "[", "participantResults", ".", "length", "]", ";", "for", "(", "int", "i", "=", "participantResults", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "units", "[", "i", "]", "=", "participantResults", "[", "i", "]", ".", "sourceFile", ";", "}", "int", "unitsLength", "=", "units", ".", "length", ";", "this", ".", "compiledAllAtOnce", "=", "unitsLength", "<=", "MAX_AT_ONCE", ";", "if", "(", "this", ".", "compiler", "!=", "null", "&&", "this", ".", "compiler", ".", "options", "!=", "null", "&&", "this", ".", "compiler", ".", "options", ".", "buildGroovyFiles", "==", "2", ")", "{", "this", ".", "compiledAllAtOnce", "=", "true", ";", "}", "if", "(", "this", ".", "compiledAllAtOnce", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "for", "(", "int", "i", "=", "0", ";", "i", "<", "unitsLength", ";", "i", "++", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "units", "[", "i", "]", ".", "typeLocator", "(", ")", ")", ";", "compile", "(", "units", ",", "null", ",", "true", ")", ";", "}", "else", "{", "SourceFile", "[", "]", "remainingUnits", "=", "new", "SourceFile", "[", "unitsLength", "]", ";", "System", ".", "arraycopy", "(", "units", ",", "0", ",", "remainingUnits", ",", "0", ",", "unitsLength", ")", ";", "int", "doNow", "=", "unitsLength", "<", "MAX_AT_ONCE", "?", "unitsLength", ":", "MAX_AT_ONCE", ";", "SourceFile", "[", "]", "toCompile", "=", "new", "SourceFile", "[", "doNow", "]", ";", "int", "remainingIndex", "=", "0", ";", "boolean", "compilingFirstGroup", "=", "true", ";", "while", "(", "remainingIndex", "<", "unitsLength", ")", "{", "int", "count", "=", "0", ";", "while", "(", "remainingIndex", "<", "unitsLength", "&&", "count", "<", "doNow", ")", "{", "SourceFile", "unit", "=", "remainingUnits", "[", "remainingIndex", "]", ";", "if", "(", "unit", "!=", "null", "&&", "(", "compilingFirstGroup", "||", "this", ".", "workQueue", ".", "isWaiting", "(", "unit", ")", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "remainingIndex", "+", "\"", ":", "\"", "+", "unit", ".", "typeLocator", "(", ")", ")", ";", "toCompile", "[", "count", "++", "]", "=", "unit", ";", "}", "remainingUnits", "[", "remainingIndex", "++", "]", "=", "null", ";", "}", "if", "(", "count", "<", "doNow", ")", "System", ".", "arraycopy", "(", "toCompile", ",", "0", ",", "toCompile", "=", "new", "SourceFile", "[", "count", "]", ",", "0", ",", "count", ")", ";", "if", "(", "!", "compilingFirstGroup", ")", "for", "(", "int", "a", "=", "remainingIndex", ";", "a", "<", "unitsLength", ";", "a", "++", ")", "if", "(", "remainingUnits", "[", "a", "]", "!=", "null", "&&", "this", ".", "workQueue", ".", "isCompiled", "(", "remainingUnits", "[", "a", "]", ")", ")", "remainingUnits", "[", "a", "]", "=", "null", ";", "compile", "(", "toCompile", ",", "remainingUnits", ",", "compilingFirstGroup", ")", ";", "compilingFirstGroup", "=", "false", ";", "}", "}", "if", "(", "participantResults", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "participantResults", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "if", "(", "participantResults", "[", "i", "]", "!=", "null", ")", "recordParticipantResult", "(", "participantResults", "[", "i", "]", ")", ";", "processAnnotations", "(", "participantResults", ")", ";", "}", "}", "protected", "void", "compile", "(", "SourceFile", "[", "]", "units", ",", "SourceFile", "[", "]", "additionalUnits", ",", "boolean", "compilingFirstGroup", ")", "{", "if", "(", "units", ".", "length", "==", "0", ")", "return", ";", "this", ".", "notifier", ".", "aboutToCompile", "(", "units", "[", "0", "]", ")", ";", "if", "(", "!", "this", ".", "problemSourceFiles", ".", "isEmpty", "(", ")", ")", "{", "int", "toAdd", "=", "this", ".", "problemSourceFiles", ".", "size", "(", ")", ";", "int", "length", "=", "additionalUnits", "==", "null", "?", "0", ":", "additionalUnits", ".", "length", ";", "if", "(", "length", "==", "0", ")", "additionalUnits", "=", "new", "SourceFile", "[", "toAdd", "]", ";", "else", "System", ".", "arraycopy", "(", "additionalUnits", ",", "0", ",", "additionalUnits", "=", "new", "SourceFile", "[", "length", "+", "toAdd", "]", ",", "0", ",", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "toAdd", ";", "i", "++", ")", "additionalUnits", "[", "length", "+", "i", "]", "=", "(", "SourceFile", ")", "this", ".", "problemSourceFiles", ".", "get", "(", "i", ")", ";", "}", "String", "[", "]", "initialTypeNames", "=", "new", "String", "[", "units", ".", "length", "]", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "units", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "initialTypeNames", "[", "i", "]", "=", "units", "[", "i", "]", ".", "initialTypeName", ";", "this", ".", "nameEnvironment", ".", "setNames", "(", "initialTypeNames", ",", "additionalUnits", ")", ";", "this", ".", "notifier", ".", "checkCancel", "(", ")", ";", "try", "{", "this", ".", "inCompiler", "=", "true", ";", "this", ".", "compiler", ".", "compile", "(", "units", ")", ";", "}", "catch", "(", "AbortCompilation", "ignored", ")", "{", "}", "finally", "{", "this", ".", "inCompiler", "=", "false", ";", "}", "this", ".", "notifier", ".", "checkCancel", "(", ")", ";", "}", "protected", "void", "copyResource", "(", "IResource", "source", ",", "IResource", "destination", ")", "throws", "CoreException", "{", "IPath", "destPath", "=", "destination", ".", "getFullPath", "(", ")", ";", "try", "{", "source", ".", "copy", "(", "destPath", ",", "IResource", ".", "FORCE", "|", "IResource", ".", "DERIVED", ",", "null", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "source", ".", "refreshLocal", "(", "0", ",", "null", ")", ";", "if", "(", "!", "source", ".", "exists", "(", ")", ")", "return", ";", "throw", "e", ";", "}", "Util", ".", "setReadOnly", "(", "destination", ",", "false", ")", ";", "}", "protected", "void", "createProblemFor", "(", "IResource", "resource", ",", "IMember", "javaElement", ",", "String", "message", ",", "String", "problemSeverity", ")", "{", "try", "{", "IMarker", "marker", "=", "resource", ".", "createMarker", "(", "IJavaModelMarker", ".", "JAVA_MODEL_PROBLEM_MARKER", ")", ";", "int", "severity", "=", "problemSeverity", ".", "equals", "(", "JavaCore", ".", "WARNING", ")", "?", "IMarker", ".", "SEVERITY_WARNING", ":", "IMarker", ".", "SEVERITY_ERROR", ";", "ISourceRange", "range", "=", "null", ";", "if", "(", "javaElement", "!=", "null", ")", "{", "try", "{", "range", "=", "javaElement", ".", "getNameRange", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "if", "(", "e", ".", "getJavaModelStatus", "(", ")", ".", "getCode", "(", ")", "!=", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ")", "{", "throw", "e", ";", "}", "if", "(", "!", "CharOperation", ".", "equals", "(", "javaElement", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ",", "TypeConstants", ".", "PACKAGE_INFO_NAME", ")", ")", "{", "throw", "e", ";", "}", "}", "}", "int", "start", "=", "range", "==", "null", "?", "0", ":", "range", ".", "getOffset", "(", ")", ";", "int", "end", "=", "range", "==", "null", "?", "1", ":", "start", "+", "range", ".", "getLength", "(", ")", ";", "marker", ".", "setAttributes", "(", "new", "String", "[", "]", "{", "IMarker", ".", "MESSAGE", ",", "IMarker", ".", "SEVERITY", ",", "IMarker", ".", "CHAR_START", ",", "IMarker", ".", "CHAR_END", ",", "IMarker", ".", "SOURCE_ID", "}", ",", "new", "Object", "[", "]", "{", "message", ",", "new", "Integer", "(", "severity", ")", ",", "new", "Integer", "(", "start", ")", ",", "new", "Integer", "(", "end", ")", ",", "JavaBuilder", ".", "SOURCE_ID", "}", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "internalException", "(", "e", ")", ";", "}", "}", "protected", "void", "deleteGeneratedFiles", "(", "IFile", "[", "]", "deletedGeneratedFiles", ")", "{", "}", "protected", "SourceFile", "findSourceFile", "(", "IFile", "file", ",", "boolean", "mustExist", ")", "{", "if", "(", "mustExist", "&&", "!", "file", ".", "exists", "(", ")", ")", "return", "null", ";", "ClasspathMultiDirectory", "md", "=", "this", ".", "sourceLocations", "[", "0", "]", ";", "if", "(", "this", ".", "sourceLocations", ".", "length", ">", "1", ")", "{", "IPath", "sourceFileFullPath", "=", "file", ".", "getFullPath", "(", ")", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "this", ".", "sourceLocations", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "{", "if", "(", "this", ".", "sourceLocations", "[", "j", "]", ".", "sourceFolder", ".", "getFullPath", "(", ")", ".", "isPrefixOf", "(", "sourceFileFullPath", ")", ")", "{", "md", "=", "this", ".", "sourceLocations", "[", "j", "]", ";", "if", "(", "md", ".", "exclusionPatterns", "==", "null", "&&", "md", ".", "inclusionPatterns", "==", "null", ")", "break", ";", "if", "(", "!", "Util", ".", "isExcluded", "(", "file", ",", "md", ".", "inclusionPatterns", ",", "md", ".", "exclusionPatterns", ")", ")", "break", ";", "}", "}", "}", "return", "new", "SourceFile", "(", "file", ",", "md", ")", ";", "}", "protected", "void", "finishedWith", "(", "String", "sourceLocator", ",", "CompilationResult", "result", ",", "char", "[", "]", "mainTypeName", ",", "ArrayList", "definedTypeNames", ",", "ArrayList", "duplicateTypeNames", ")", "{", "if", "(", "duplicateTypeNames", "==", "null", ")", "{", "this", ".", "newState", ".", "record", "(", "sourceLocator", ",", "result", ".", "qualifiedReferences", ",", "result", ".", "simpleNameReferences", ",", "result", ".", "rootReferences", ",", "mainTypeName", ",", "definedTypeNames", ")", ";", "return", ";", "}", "char", "[", "]", "[", "]", "simpleRefs", "=", "result", ".", "simpleNameReferences", ";", "next", ":", "for", "(", "int", "i", "=", "0", ",", "l", "=", "duplicateTypeNames", ".", "size", "(", ")", ";", "i", "<", "l", ";", "i", "++", ")", "{", "char", "[", "]", "[", "]", "compoundName", "=", "(", "char", "[", "]", "[", "]", ")", "duplicateTypeNames", ".", "get", "(", "i", ")", ";", "char", "[", "]", "typeName", "=", "compoundName", "[", "compoundName", ".", "length", "-", "1", "]", ";", "int", "sLength", "=", "simpleRefs", ".", "length", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "sLength", ";", "j", "++", ")", "if", "(", "CharOperation", ".", "equals", "(", "simpleRefs", "[", "j", "]", ",", "typeName", ")", ")", "continue", "next", ";", "System", ".", "arraycopy", "(", "simpleRefs", ",", "0", ",", "simpleRefs", "=", "new", "char", "[", "sLength", "+", "1", "]", "[", "]", ",", "0", ",", "sLength", ")", ";", "simpleRefs", "[", "sLength", "]", "=", "typeName", ";", "}", "this", ".", "newState", ".", "record", "(", "sourceLocator", ",", "result", ".", "qualifiedReferences", ",", "simpleRefs", ",", "result", ".", "rootReferences", ",", "mainTypeName", ",", "definedTypeNames", ")", ";", "}", "protected", "IContainer", "createFolder", "(", "IPath", "packagePath", ",", "IContainer", "outputFolder", ")", "throws", "CoreException", "{", "if", "(", "packagePath", ".", "isEmpty", "(", ")", ")", "return", "outputFolder", ";", "IFolder", "folder", "=", "outputFolder", ".", "getFolder", "(", "packagePath", ")", ";", "if", "(", "!", "folder", ".", "exists", "(", ")", ")", "{", "createFolder", "(", "packagePath", ".", "removeLastSegments", "(", "1", ")", ",", "outputFolder", ")", ";", "folder", ".", "create", "(", "IResource", ".", "FORCE", "|", "IResource", ".", "DERIVED", ",", "true", ",", "null", ")", ";", "}", "return", "folder", ";", "}", "public", "ICompilationUnit", "fromIFile", "(", "IFile", "file", ")", "{", "return", "findSourceFile", "(", "file", ",", "true", ")", ";", "}", "protected", "void", "initializeAnnotationProcessorManager", "(", "Compiler", "newCompiler", ")", "{", "AbstractAnnotationProcessorManager", "annotationManager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "createAnnotationProcessorManager", "(", ")", ";", "if", "(", "annotationManager", "!=", "null", ")", "{", "annotationManager", ".", "configureFromPlatform", "(", "newCompiler", ",", "this", ",", "this", ".", "javaBuilder", ".", "javaProject", ")", ";", "annotationManager", ".", "setErr", "(", "new", "PrintWriter", "(", "System", ".", "err", ")", ")", ";", "annotationManager", ".", "setOut", "(", "new", "PrintWriter", "(", "System", ".", "out", ")", ")", ";", "}", "newCompiler", ".", "annotationProcessorManager", "=", "annotationManager", ";", "}", "protected", "RuntimeException", "internalException", "(", "CoreException", "t", ")", "{", "ImageBuilderInternalException", "imageBuilderException", "=", "new", "ImageBuilderInternalException", "(", "t", ")", ";", "if", "(", "this", ".", "inCompiler", ")", "return", "new", "AbortCompilation", "(", "true", ",", "imageBuilderException", ")", ";", "return", "imageBuilderException", ";", "}", "protected", "boolean", "isExcludedFromProject", "(", "IPath", "childPath", ")", "throws", "JavaModelException", "{", "if", "(", "childPath", ".", "segmentCount", "(", ")", ">", "2", ")", "return", "false", ";", "for", "(", "int", "j", "=", "0", ",", "k", "=", "this", ".", "sourceLocations", ".", "length", ";", "j", "<", "k", ";", "j", "++", ")", "{", "if", "(", "childPath", ".", "equals", "(", "this", ".", "sourceLocations", "[", "j", "]", ".", "binaryFolder", ".", "getFullPath", "(", ")", ")", ")", "return", "true", ";", "if", "(", "childPath", ".", "equals", "(", "this", ".", "sourceLocations", "[", "j", "]", ".", "sourceFolder", ".", "getFullPath", "(", ")", ")", ")", "return", "true", ";", "}", "return", "childPath", ".", "equals", "(", "this", ".", "javaBuilder", ".", "javaProject", ".", "getOutputLocation", "(", ")", ")", ";", "}", "protected", "Compiler", "newCompiler", "(", ")", "{", "Map", "projectOptions", "=", "this", ".", "javaBuilder", ".", "javaProject", ".", "getOptions", "(", "true", ")", ";", "String", "option", "=", "(", "String", ")", "projectOptions", ".", "get", "(", "JavaCore", ".", "COMPILER_PB_INVALID_JAVADOC", ")", ";", "if", "(", "option", "==", "null", "||", "option", ".", "equals", "(", "JavaCore", ".", "IGNORE", ")", ")", "{", "option", "=", "(", "String", ")", "projectOptions", ".", "get", "(", "JavaCore", ".", "COMPILER_PB_MISSING_JAVADOC_TAGS", ")", ";", "if", "(", "option", "==", "null", "||", "option", ".", "equals", "(", "JavaCore", ".", "IGNORE", ")", ")", "{", "option", "=", "(", "String", ")", "projectOptions", ".", "get", "(", "JavaCore", ".", "COMPILER_PB_MISSING_JAVADOC_COMMENTS", ")", ";", "if", "(", "option", "==", "null", "||", "option", ".", "equals", "(", "JavaCore", ".", "IGNORE", ")", ")", "{", "option", "=", "(", "String", ")", "projectOptions", ".", "get", "(", "JavaCore", ".", "COMPILER_PB_UNUSED_IMPORT", ")", ";", "if", "(", "option", "==", "null", "||", "option", ".", "equals", "(", "JavaCore", ".", "IGNORE", ")", ")", "{", "projectOptions", ".", "put", "(", "JavaCore", ".", "COMPILER_DOC_COMMENT_SUPPORT", ",", "JavaCore", ".", "DISABLED", ")", ";", "}", "}", "}", "}", "CompilerOptions", "compilerOptions", "=", "new", "CompilerOptions", "(", "projectOptions", ")", ";", "compilerOptions", ".", "performMethodsFullRecovery", "=", "true", ";", "compilerOptions", ".", "performStatementsRecovery", "=", "true", ";", "CompilerUtils", ".", "configureOptionsBasedOnNature", "(", "compilerOptions", ",", "this", ".", "javaBuilder", ".", "javaProject", ")", ";", "Compiler", "newCompiler", "=", "new", "Compiler", "(", "this", ".", "nameEnvironment", ",", "DefaultErrorHandlingPolicies", ".", "proceedWithAllProblems", "(", ")", ",", "compilerOptions", ",", "this", ",", "ProblemFactory", ".", "getProblemFactory", "(", "Locale", ".", "getDefault", "(", ")", ")", ")", ";", "CompilerOptions", "options", "=", "newCompiler", ".", "options", ";", "String", "setting", "=", "System", ".", "getProperty", "(", "\"\"", ")", ";", "newCompiler", ".", "useSingleThread", "=", "setting", "!=", "null", "&&", "setting", ".", "equals", "(", "\"true\"", ")", ";", "options", ".", "produceReferenceInfo", "=", "true", ";", "if", "(", "options", ".", "complianceLevel", ">=", "ClassFileConstants", ".", "JDK1_6", "&&", "options", ".", "processAnnotations", ")", "{", "initializeAnnotationProcessorManager", "(", "newCompiler", ")", ";", "}", "return", "newCompiler", ";", "}", "protected", "CompilationParticipantResult", "[", "]", "notifyParticipants", "(", "SourceFile", "[", "]", "unitsAboutToCompile", ")", "{", "CompilationParticipantResult", "[", "]", "results", "=", "new", "CompilationParticipantResult", "[", "unitsAboutToCompile", ".", "length", "]", ";", "for", "(", "int", "i", "=", "unitsAboutToCompile", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "results", "[", "i", "]", "=", "new", "CompilationParticipantResult", "(", "unitsAboutToCompile", "[", "i", "]", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "javaBuilder", ".", "participants", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "this", ".", "javaBuilder", ".", "participants", "[", "i", "]", ".", "buildStarting", "(", "results", ",", "this", "instanceof", "BatchImageBuilder", ")", ";", "SimpleSet", "uniqueFiles", "=", "null", ";", "CompilationParticipantResult", "[", "]", "toAdd", "=", "null", ";", "int", "added", "=", "0", ";", "for", "(", "int", "i", "=", "results", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "{", "CompilationParticipantResult", "result", "=", "results", "[", "i", "]", ";", "if", "(", "result", "==", "null", ")", "continue", ";", "IFile", "[", "]", "deletedGeneratedFiles", "=", "result", ".", "deletedFiles", ";", "if", "(", "deletedGeneratedFiles", "!=", "null", ")", "deleteGeneratedFiles", "(", "deletedGeneratedFiles", ")", ";", "IFile", "[", "]", "addedGeneratedFiles", "=", "result", ".", "addedFiles", ";", "if", "(", "addedGeneratedFiles", "!=", "null", ")", "{", "for", "(", "int", "j", "=", "addedGeneratedFiles", ".", "length", ";", "--", "j", ">=", "0", ";", ")", "{", "SourceFile", "sourceFile", "=", "findSourceFile", "(", "addedGeneratedFiles", "[", "j", "]", ",", "true", ")", ";", "if", "(", "sourceFile", "==", "null", ")", "continue", ";", "if", "(", "uniqueFiles", "==", "null", ")", "{", "uniqueFiles", "=", "new", "SimpleSet", "(", "unitsAboutToCompile", ".", "length", "+", "3", ")", ";", "for", "(", "int", "f", "=", "unitsAboutToCompile", ".", "length", ";", "--", "f", ">=", "0", ";", ")", "uniqueFiles", ".", "add", "(", "unitsAboutToCompile", "[", "f", "]", ")", ";", "}", "if", "(", "uniqueFiles", ".", "addIfNotIncluded", "(", "sourceFile", ")", "==", "sourceFile", ")", "{", "CompilationParticipantResult", "newResult", "=", "new", "CompilationParticipantResult", "(", "sourceFile", ")", ";", "if", "(", "toAdd", "==", "null", ")", "{", "toAdd", "=", "new", "CompilationParticipantResult", "[", "addedGeneratedFiles", ".", "length", "]", ";", "}", "else", "{", "int", "length", "=", "toAdd", ".", "length", ";", "if", "(", "added", "==", "length", ")", "System", ".", "arraycopy", "(", "toAdd", ",", "0", ",", "toAdd", "=", "new", "CompilationParticipantResult", "[", "length", "+", "addedGeneratedFiles", ".", "length", "]", ",", "0", ",", "length", ")", ";", "}", "toAdd", "[", "added", "++", "]", "=", "newResult", ";", "}", "}", "}", "}", "if", "(", "added", ">", "0", ")", "{", "int", "length", "=", "results", ".", "length", ";", "System", ".", "arraycopy", "(", "results", ",", "0", ",", "results", "=", "new", "CompilationParticipantResult", "[", "length", "+", "added", "]", ",", "0", ",", "length", ")", ";", "System", ".", "arraycopy", "(", "toAdd", ",", "0", ",", "results", ",", "length", ",", "added", ")", ";", "}", "return", "results", ";", "}", "protected", "abstract", "void", "processAnnotationResults", "(", "CompilationParticipantResult", "[", "]", "results", ")", ";", "protected", "void", "processAnnotations", "(", "CompilationParticipantResult", "[", "]", "results", ")", "{", "boolean", "hasAnnotationProcessor", "=", "false", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "javaBuilder", ".", "participants", ".", "length", ";", "!", "hasAnnotationProcessor", "&&", "i", "<", "l", ";", "i", "++", ")", "hasAnnotationProcessor", "=", "this", ".", "javaBuilder", ".", "participants", "[", "i", "]", ".", "isAnnotationProcessor", "(", ")", ";", "if", "(", "!", "hasAnnotationProcessor", ")", "return", ";", "boolean", "foundAnnotations", "=", "this", ".", "filesWithAnnotations", "!=", "null", "&&", "this", ".", "filesWithAnnotations", ".", "elementSize", ">", "0", ";", "for", "(", "int", "i", "=", "results", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "results", "[", "i", "]", ".", "reset", "(", "foundAnnotations", "&&", "this", ".", "filesWithAnnotations", ".", "includes", "(", "results", "[", "i", "]", ".", "sourceFile", ")", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "javaBuilder", ".", "participants", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "this", ".", "javaBuilder", ".", "participants", "[", "i", "]", ".", "isAnnotationProcessor", "(", ")", ")", "this", ".", "javaBuilder", ".", "participants", "[", "i", "]", ".", "processAnnotations", "(", "results", ")", ";", "processAnnotationResults", "(", "results", ")", ";", "}", "protected", "void", "recordParticipantResult", "(", "CompilationParticipantResult", "result", ")", "{", "CategorizedProblem", "[", "]", "problems", "=", "result", ".", "problems", ";", "if", "(", "problems", "!=", "null", "&&", "problems", ".", "length", ">", "0", ")", "{", "this", ".", "notifier", ".", "updateProblemCounts", "(", "problems", ")", ";", "try", "{", "storeProblemsFor", "(", "result", ".", "sourceFile", ",", "problems", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "}", "}", "String", "[", "]", "dependencies", "=", "result", ".", "dependencies", ";", "if", "(", "dependencies", "!=", "null", ")", "{", "ReferenceCollection", "refs", "=", "(", "ReferenceCollection", ")", "this", ".", "newState", ".", "references", ".", "get", "(", "result", ".", "sourceFile", ".", "typeLocator", "(", ")", ")", ";", "if", "(", "refs", "!=", "null", ")", "refs", ".", "addDependencies", "(", "dependencies", ")", ";", "}", "}", "protected", "void", "storeProblemsFor", "(", "SourceFile", "sourceFile", ",", "CategorizedProblem", "[", "]", "problems", ")", "throws", "CoreException", "{", "if", "(", "sourceFile", "==", "null", "||", "problems", "==", "null", "||", "problems", ".", "length", "==", "0", ")", "return", ";", "if", "(", "!", "this", ".", "keepStoringProblemMarkers", ")", "return", ";", "IResource", "resource", "=", "sourceFile", ".", "resource", ";", "HashSet", "managedMarkerTypes", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "compilationParticipants", ".", "managedMarkerTypes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "problems", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "CategorizedProblem", "problem", "=", "problems", "[", "i", "]", ";", "int", "id", "=", "problem", ".", "getID", "(", ")", ";", "if", "(", "id", "==", "IProblem", ".", "IsClassPathCorrect", ")", "{", "String", "missingClassfileName", "=", "problem", ".", "getArguments", "(", ")", "[", "0", "]", ";", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "build_incompleteClassPath", ",", "missingClassfileName", ")", ")", ";", "boolean", "isInvalidClasspathError", "=", "JavaCore", ".", "ERROR", ".", "equals", "(", "this", ".", "javaBuilder", ".", "javaProject", ".", "getOption", "(", "JavaCore", ".", "CORE_INCOMPLETE_CLASSPATH", ",", "true", ")", ")", ";", "if", "(", "isInvalidClasspathError", "&&", "JavaCore", ".", "ABORT", ".", "equals", "(", "this", ".", "javaBuilder", ".", "javaProject", ".", "getOption", "(", "JavaCore", ".", "CORE_JAVA_BUILD_INVALID_CLASSPATH", ",", "true", ")", ")", ")", "{", "JavaBuilder", ".", "removeProblemsAndTasksFor", "(", "this", ".", "javaBuilder", ".", "currentProject", ")", ";", "this", ".", "keepStoringProblemMarkers", "=", "false", ";", "}", "IMarker", "marker", "=", "this", ".", "javaBuilder", ".", "currentProject", ".", "createMarker", "(", "IJavaModelMarker", ".", "JAVA_MODEL_PROBLEM_MARKER", ")", ";", "marker", ".", "setAttributes", "(", "new", "String", "[", "]", "{", "IMarker", ".", "MESSAGE", ",", "IMarker", ".", "SEVERITY", ",", "IJavaModelMarker", ".", "CATEGORY_ID", ",", "IMarker", ".", "SOURCE_ID", "}", ",", "new", "Object", "[", "]", "{", "Messages", ".", "bind", "(", "Messages", ".", "build_incompleteClassPath", ",", "missingClassfileName", ")", ",", "new", "Integer", "(", "isInvalidClasspathError", "?", "IMarker", ".", "SEVERITY_ERROR", ":", "IMarker", ".", "SEVERITY_WARNING", ")", ",", "new", "Integer", "(", "CategorizedProblem", ".", "CAT_BUILDPATH", ")", ",", "JavaBuilder", ".", "SOURCE_ID", "}", ")", ";", "}", "String", "markerType", "=", "problem", ".", "getMarkerType", "(", ")", ";", "boolean", "managedProblem", "=", "false", ";", "if", "(", "IJavaModelMarker", ".", "JAVA_MODEL_PROBLEM_MARKER", ".", "equals", "(", "markerType", ")", "||", "(", "managedProblem", "=", "managedMarkerTypes", ".", "contains", "(", "markerType", ")", ")", ")", "{", "IMarker", "marker", "=", "resource", ".", "createMarker", "(", "markerType", ")", ";", "String", "[", "]", "attributeNames", "=", "JAVA_PROBLEM_MARKER_ATTRIBUTE_NAMES", ";", "int", "standardLength", "=", "attributeNames", ".", "length", ";", "String", "[", "]", "allNames", "=", "attributeNames", ";", "int", "managedLength", "=", "managedProblem", "?", "0", ":", "1", ";", "String", "[", "]", "extraAttributeNames", "=", "problem", ".", "getExtraMarkerAttributeNames", "(", ")", ";", "int", "extraLength", "=", "extraAttributeNames", "==", "null", "?", "0", ":", "extraAttributeNames", ".", "length", ";", "if", "(", "managedLength", ">", "0", "||", "extraLength", ">", "0", ")", "{", "allNames", "=", "new", "String", "[", "standardLength", "+", "managedLength", "+", "extraLength", "]", ";", "System", ".", "arraycopy", "(", "attributeNames", ",", "0", ",", "allNames", ",", "0", ",", "standardLength", ")", ";", "if", "(", "managedLength", ">", "0", ")", "allNames", "[", "standardLength", "]", "=", "IMarker", ".", "SOURCE_ID", ";", "System", ".", "arraycopy", "(", "extraAttributeNames", ",", "0", ",", "allNames", ",", "standardLength", "+", "managedLength", ",", "extraLength", ")", ";", "}", "Object", "[", "]", "allValues", "=", "new", "Object", "[", "allNames", ".", "length", "]", ";", "int", "index", "=", "0", ";", "allValues", "[", "index", "++", "]", "=", "problem", ".", "getMessage", "(", ")", ";", "allValues", "[", "index", "++", "]", "=", "problem", ".", "isError", "(", ")", "?", "S_ERROR", ":", "S_WARNING", ";", "allValues", "[", "index", "++", "]", "=", "new", "Integer", "(", "id", ")", ";", "allValues", "[", "index", "++", "]", "=", "new", "Integer", "(", "problem", ".", "getSourceStart", "(", ")", ")", ";", "int", "end", "=", "problem", ".", "getSourceEnd", "(", ")", ";", "allValues", "[", "index", "++", "]", "=", "new", "Integer", "(", "end", ">", "0", "?", "end", "+", "1", ":", "end", ")", ";", "allValues", "[", "index", "++", "]", "=", "new", "Integer", "(", "problem", ".", "getSourceLineNumber", "(", ")", ")", ";", "allValues", "[", "index", "++", "]", "=", "Util", ".", "getProblemArgumentsForMarker", "(", "problem", ".", "getArguments", "(", ")", ")", ";", "allValues", "[", "index", "++", "]", "=", "new", "Integer", "(", "problem", ".", "getCategoryID", "(", ")", ")", ";", "if", "(", "managedLength", ">", "0", ")", "allValues", "[", "index", "++", "]", "=", "JavaBuilder", ".", "SOURCE_ID", ";", "if", "(", "extraLength", ">", "0", ")", "System", ".", "arraycopy", "(", "problem", ".", "getExtraMarkerAttributeValues", "(", ")", ",", "0", ",", "allValues", ",", "index", ",", "extraLength", ")", ";", "marker", ".", "setAttributes", "(", "allNames", ",", "allValues", ")", ";", "if", "(", "!", "this", ".", "keepStoringProblemMarkers", ")", "return", ";", "}", "}", "}", "protected", "void", "storeTasksFor", "(", "SourceFile", "sourceFile", ",", "CategorizedProblem", "[", "]", "tasks", ")", "throws", "CoreException", "{", "if", "(", "sourceFile", "==", "null", "||", "tasks", "==", "null", "||", "tasks", ".", "length", "==", "0", ")", "return", ";", "IResource", "resource", "=", "sourceFile", ".", "resource", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "tasks", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "CategorizedProblem", "task", "=", "tasks", "[", "i", "]", ";", "if", "(", "task", ".", "getID", "(", ")", "==", "IProblem", ".", "Task", ")", "{", "IMarker", "marker", "=", "resource", ".", "createMarker", "(", "IJavaModelMarker", ".", "TASK_MARKER", ")", ";", "Integer", "priority", "=", "P_NORMAL", ";", "String", "compilerPriority", "=", "task", ".", "getArguments", "(", ")", "[", "2", "]", ";", "if", "(", "JavaCore", ".", "COMPILER_TASK_PRIORITY_HIGH", ".", "equals", "(", "compilerPriority", ")", ")", "priority", "=", "P_HIGH", ";", "else", "if", "(", "JavaCore", ".", "COMPILER_TASK_PRIORITY_LOW", ".", "equals", "(", "compilerPriority", ")", ")", "priority", "=", "P_LOW", ";", "String", "[", "]", "attributeNames", "=", "JAVA_TASK_MARKER_ATTRIBUTE_NAMES", ";", "int", "standardLength", "=", "attributeNames", ".", "length", ";", "String", "[", "]", "allNames", "=", "attributeNames", ";", "String", "[", "]", "extraAttributeNames", "=", "task", ".", "getExtraMarkerAttributeNames", "(", ")", ";", "int", "extraLength", "=", "extraAttributeNames", "==", "null", "?", "0", ":", "extraAttributeNames", ".", "length", ";", "if", "(", "extraLength", ">", "0", ")", "{", "allNames", "=", "new", "String", "[", "standardLength", "+", "extraLength", "]", ";", "System", ".", "arraycopy", "(", "attributeNames", ",", "0", ",", "allNames", ",", "0", ",", "standardLength", ")", ";", "System", ".", "arraycopy", "(", "extraAttributeNames", ",", "0", ",", "allNames", ",", "standardLength", ",", "extraLength", ")", ";", "}", "Object", "[", "]", "allValues", "=", "new", "Object", "[", "allNames", ".", "length", "]", ";", "int", "index", "=", "0", ";", "allValues", "[", "index", "++", "]", "=", "task", ".", "getMessage", "(", ")", ";", "allValues", "[", "index", "++", "]", "=", "priority", ";", "allValues", "[", "index", "++", "]", "=", "new", "Integer", "(", "task", ".", "getID", "(", ")", ")", ";", "allValues", "[", "index", "++", "]", "=", "new", "Integer", "(", "task", ".", "getSourceStart", "(", ")", ")", ";", "allValues", "[", "index", "++", "]", "=", "new", "Integer", "(", "task", ".", "getSourceEnd", "(", ")", "+", "1", ")", ";", "allValues", "[", "index", "++", "]", "=", "new", "Integer", "(", "task", ".", "getSourceLineNumber", "(", ")", ")", ";", "allValues", "[", "index", "++", "]", "=", "Boolean", ".", "FALSE", ";", "allValues", "[", "index", "++", "]", "=", "JavaBuilder", ".", "SOURCE_ID", ";", "if", "(", "extraLength", ">", "0", ")", "System", ".", "arraycopy", "(", "task", ".", "getExtraMarkerAttributeValues", "(", ")", ",", "0", ",", "allValues", ",", "index", ",", "extraLength", ")", ";", "marker", ".", "setAttributes", "(", "allNames", ",", "allValues", ")", ";", "}", "}", "}", "protected", "void", "updateProblemsFor", "(", "SourceFile", "sourceFile", ",", "CompilationResult", "result", ")", "throws", "CoreException", "{", "CategorizedProblem", "[", "]", "problems", "=", "result", ".", "getProblems", "(", ")", ";", "if", "(", "problems", "==", "null", "||", "problems", ".", "length", "==", "0", ")", "return", ";", "this", ".", "notifier", ".", "updateProblemCounts", "(", "problems", ")", ";", "storeProblemsFor", "(", "sourceFile", ",", "problems", ")", ";", "}", "protected", "void", "updateTasksFor", "(", "SourceFile", "sourceFile", ",", "CompilationResult", "result", ")", "throws", "CoreException", "{", "CategorizedProblem", "[", "]", "tasks", "=", "result", ".", "getTasks", "(", ")", ";", "if", "(", "tasks", "==", "null", "||", "tasks", ".", "length", "==", "0", ")", "return", ";", "storeTasksFor", "(", "sourceFile", ",", "tasks", ")", ";", "}", "protected", "char", "[", "]", "writeClassFile", "(", "ClassFile", "classFile", ",", "SourceFile", "compilationUnit", ",", "boolean", "isTopLevelType", ")", "throws", "CoreException", "{", "String", "fileName", "=", "new", "String", "(", "classFile", ".", "fileName", "(", ")", ")", ";", "IPath", "filePath", "=", "new", "Path", "(", "fileName", ")", ";", "IContainer", "outputFolder", "=", "compilationUnit", ".", "sourceLocation", ".", "binaryFolder", ";", "IContainer", "container", "=", "outputFolder", ";", "if", "(", "filePath", ".", "segmentCount", "(", ")", ">", "1", ")", "{", "container", "=", "createFolder", "(", "filePath", ".", "removeLastSegments", "(", "1", ")", ",", "outputFolder", ")", ";", "filePath", "=", "new", "Path", "(", "filePath", ".", "lastSegment", "(", ")", ")", ";", "}", "IFile", "file", "=", "container", ".", "getFile", "(", "filePath", ".", "addFileExtension", "(", "SuffixConstants", ".", "EXTENSION_class", ")", ")", ";", "writeClassFileContents", "(", "classFile", ",", "file", ",", "fileName", ",", "isTopLevelType", ",", "compilationUnit", ")", ";", "return", "filePath", ".", "lastSegment", "(", ")", ".", "toCharArray", "(", ")", ";", "}", "protected", "void", "writeClassFileContents", "(", "ClassFile", "classFile", ",", "IFile", "file", ",", "String", "qualifiedFileName", ",", "boolean", "isTopLevelType", ",", "SourceFile", "compilationUnit", ")", "throws", "CoreException", "{", "InputStream", "input", "=", "new", "ByteArrayInputStream", "(", "classFile", ".", "getBytes", "(", ")", ")", ";", "if", "(", "file", ".", "exists", "(", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "file", ".", "getName", "(", ")", ")", ";", "if", "(", "!", "file", ".", "isDerived", "(", ")", ")", "file", ".", "setDerived", "(", "true", ",", "null", ")", ";", "file", ".", "setContents", "(", "input", ",", "true", ",", "false", ",", "null", ")", ";", "}", "else", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "file", ".", "getName", "(", ")", ")", ";", "file", ".", "create", "(", "input", ",", "IResource", ".", "FORCE", "|", "IResource", ".", "DERIVED", ",", "null", ")", ";", "}", "}", "}", "</s>" ]
3,904
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "public", "class", "MissingSourceFileException", "extends", "RuntimeException", "{", "protected", "String", "missingSourceFile", ";", "private", "static", "final", "long", "serialVersionUID", "=", "-", "1416609004971115719L", ";", "public", "MissingSourceFileException", "(", "String", "missingSourceFile", ")", "{", "this", ".", "missingSourceFile", "=", "missingSourceFile", ";", "}", "}", "</s>" ]
3,905
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "public", "class", "QualifiedNameSet", "{", "public", "char", "[", "]", "[", "]", "[", "]", "qualifiedNames", ";", "public", "int", "elementSize", ";", "public", "int", "threshold", ";", "public", "QualifiedNameSet", "(", "int", "size", ")", "{", "this", ".", "elementSize", "=", "0", ";", "this", ".", "threshold", "=", "size", ";", "int", "extraRoom", "=", "(", "int", ")", "(", "size", "*", "1.5f", ")", ";", "if", "(", "this", ".", "threshold", "==", "extraRoom", ")", "extraRoom", "++", ";", "this", ".", "qualifiedNames", "=", "new", "char", "[", "extraRoom", "]", "[", "]", "[", "]", ";", "}", "public", "char", "[", "]", "[", "]", "add", "(", "char", "[", "]", "[", "]", "qualifiedName", ")", "{", "int", "qLength", "=", "qualifiedName", ".", "length", ";", "if", "(", "qLength", "==", "0", ")", "return", "CharOperation", ".", "NO_CHAR_CHAR", ";", "int", "length", "=", "this", ".", "qualifiedNames", ".", "length", ";", "int", "index", "=", "CharOperation", ".", "hashCode", "(", "qualifiedName", "[", "qLength", "-", "1", "]", ")", "%", "length", ";", "char", "[", "]", "[", "]", "current", ";", "while", "(", "(", "current", "=", "this", ".", "qualifiedNames", "[", "index", "]", ")", "!=", "null", ")", "{", "if", "(", "CharOperation", ".", "equals", "(", "current", ",", "qualifiedName", ")", ")", "return", "current", ";", "if", "(", "++", "index", "==", "length", ")", "index", "=", "0", ";", "}", "this", ".", "qualifiedNames", "[", "index", "]", "=", "qualifiedName", ";", "if", "(", "++", "this", ".", "elementSize", ">", "this", ".", "threshold", ")", "rehash", "(", ")", ";", "return", "qualifiedName", ";", "}", "private", "void", "rehash", "(", ")", "{", "QualifiedNameSet", "newSet", "=", "new", "QualifiedNameSet", "(", "this", ".", "elementSize", "*", "2", ")", ";", "char", "[", "]", "[", "]", "current", ";", "for", "(", "int", "i", "=", "this", ".", "qualifiedNames", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "if", "(", "(", "current", "=", "this", ".", "qualifiedNames", "[", "i", "]", ")", "!=", "null", ")", "newSet", ".", "add", "(", "current", ")", ";", "this", ".", "qualifiedNames", "=", "newSet", ".", "qualifiedNames", ";", "this", ".", "elementSize", "=", "newSet", ".", "elementSize", ";", "this", ".", "threshold", "=", "newSet", ".", "threshold", ";", "}", "public", "String", "toString", "(", ")", "{", "String", "s", "=", "\"\"", ";", "char", "[", "]", "[", "]", "qualifiedName", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "qualifiedNames", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "(", "qualifiedName", "=", "this", ".", "qualifiedNames", "[", "i", "]", ")", "!=", "null", ")", "s", "+=", "CharOperation", ".", "toString", "(", "qualifiedName", ")", "+", "\"n\"", ";", "return", "s", ";", "}", "}", "</s>" ]
3,906
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRuleSet", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SimpleLookupTable", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "ClasspathAccessRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ";", "import", "java", ".", "io", ".", "*", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "State", "{", "String", "javaProjectName", ";", "ClasspathMultiDirectory", "[", "]", "sourceLocations", ";", "ClasspathLocation", "[", "]", "binaryLocations", ";", "SimpleLookupTable", "references", ";", "public", "SimpleLookupTable", "typeLocators", ";", "int", "buildNumber", ";", "long", "lastStructuralBuildTime", ";", "SimpleLookupTable", "structuralBuildTimes", ";", "private", "String", "[", "]", "knownPackageNames", ";", "private", "long", "previousStructuralBuildTime", ";", "private", "StringSet", "structurallyChangedTypes", ";", "public", "static", "int", "MaxStructurallyChangedTypes", "=", "100", ";", "public", "static", "final", "byte", "VERSION", "=", "0x001A", ";", "static", "final", "byte", "SOURCE_FOLDER", "=", "1", ";", "static", "final", "byte", "BINARY_FOLDER", "=", "2", ";", "static", "final", "byte", "EXTERNAL_JAR", "=", "3", ";", "static", "final", "byte", "INTERNAL_JAR", "=", "4", ";", "State", "(", ")", "{", "}", "protected", "State", "(", "JavaBuilder", "javaBuilder", ")", "{", "this", ".", "knownPackageNames", "=", "null", ";", "this", ".", "previousStructuralBuildTime", "=", "-", "1", ";", "this", ".", "structurallyChangedTypes", "=", "null", ";", "this", ".", "javaProjectName", "=", "javaBuilder", ".", "currentProject", ".", "getName", "(", ")", ";", "this", ".", "sourceLocations", "=", "javaBuilder", ".", "nameEnvironment", ".", "sourceLocations", ";", "this", ".", "binaryLocations", "=", "javaBuilder", ".", "nameEnvironment", ".", "binaryLocations", ";", "this", ".", "references", "=", "new", "SimpleLookupTable", "(", "7", ")", ";", "this", ".", "typeLocators", "=", "new", "SimpleLookupTable", "(", "7", ")", ";", "this", ".", "buildNumber", "=", "0", ";", "this", ".", "lastStructuralBuildTime", "=", "computeStructuralBuildTime", "(", "javaBuilder", ".", "lastState", "==", "null", "?", "0", ":", "javaBuilder", ".", "lastState", ".", "lastStructuralBuildTime", ")", ";", "this", ".", "structuralBuildTimes", "=", "new", "SimpleLookupTable", "(", "3", ")", ";", "}", "long", "computeStructuralBuildTime", "(", "long", "previousTime", ")", "{", "long", "newTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "if", "(", "newTime", "<=", "previousTime", ")", "newTime", "=", "previousTime", "+", "1", ";", "return", "newTime", ";", "}", "void", "copyFrom", "(", "State", "lastState", ")", "{", "this", ".", "knownPackageNames", "=", "null", ";", "this", ".", "previousStructuralBuildTime", "=", "lastState", ".", "previousStructuralBuildTime", ";", "this", ".", "structurallyChangedTypes", "=", "lastState", ".", "structurallyChangedTypes", ";", "this", ".", "buildNumber", "=", "lastState", ".", "buildNumber", "+", "1", ";", "this", ".", "lastStructuralBuildTime", "=", "lastState", ".", "lastStructuralBuildTime", ";", "this", ".", "structuralBuildTimes", "=", "lastState", ".", "structuralBuildTimes", ";", "try", "{", "this", ".", "references", "=", "(", "SimpleLookupTable", ")", "lastState", ".", "references", ".", "clone", "(", ")", ";", "this", ".", "typeLocators", "=", "(", "SimpleLookupTable", ")", "lastState", ".", "typeLocators", ".", "clone", "(", ")", ";", "}", "catch", "(", "CloneNotSupportedException", "e", ")", "{", "this", ".", "references", "=", "new", "SimpleLookupTable", "(", "lastState", ".", "references", ".", "elementSize", ")", ";", "Object", "[", "]", "keyTable", "=", "lastState", ".", "references", ".", "keyTable", ";", "Object", "[", "]", "valueTable", "=", "lastState", ".", "references", ".", "valueTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "keyTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "keyTable", "[", "i", "]", "!=", "null", ")", "this", ".", "references", ".", "put", "(", "keyTable", "[", "i", "]", ",", "valueTable", "[", "i", "]", ")", ";", "this", ".", "typeLocators", "=", "new", "SimpleLookupTable", "(", "lastState", ".", "typeLocators", ".", "elementSize", ")", ";", "keyTable", "=", "lastState", ".", "typeLocators", ".", "keyTable", ";", "valueTable", "=", "lastState", ".", "typeLocators", ".", "valueTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "keyTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "keyTable", "[", "i", "]", "!=", "null", ")", "this", ".", "typeLocators", ".", "put", "(", "keyTable", "[", "i", "]", ",", "valueTable", "[", "i", "]", ")", ";", "}", "}", "public", "char", "[", "]", "[", "]", "getDefinedTypeNamesFor", "(", "String", "typeLocator", ")", "{", "Object", "c", "=", "this", ".", "references", ".", "get", "(", "typeLocator", ")", ";", "if", "(", "c", "instanceof", "AdditionalTypeCollection", ")", "return", "(", "(", "AdditionalTypeCollection", ")", "c", ")", ".", "definedTypeNames", ";", "return", "null", ";", "}", "public", "SimpleLookupTable", "getReferences", "(", ")", "{", "return", "this", ".", "references", ";", "}", "StringSet", "getStructurallyChangedTypes", "(", "State", "prereqState", ")", "{", "if", "(", "prereqState", "!=", "null", "&&", "prereqState", ".", "previousStructuralBuildTime", ">", "0", ")", "{", "Object", "o", "=", "this", ".", "structuralBuildTimes", ".", "get", "(", "prereqState", ".", "javaProjectName", ")", ";", "long", "previous", "=", "o", "==", "null", "?", "0", ":", "(", "(", "Long", ")", "o", ")", ".", "longValue", "(", ")", ";", "if", "(", "previous", "==", "prereqState", ".", "previousStructuralBuildTime", ")", "return", "prereqState", ".", "structurallyChangedTypes", ";", "}", "return", "null", ";", "}", "public", "boolean", "isDuplicateLocator", "(", "String", "qualifiedTypeName", ",", "String", "typeLocator", ")", "{", "String", "existing", "=", "(", "String", ")", "this", ".", "typeLocators", ".", "get", "(", "qualifiedTypeName", ")", ";", "return", "existing", "!=", "null", "&&", "!", "existing", ".", "equals", "(", "typeLocator", ")", ";", "}", "public", "boolean", "isKnownPackage", "(", "String", "qualifiedPackageName", ")", "{", "if", "(", "this", ".", "knownPackageNames", "==", "null", ")", "{", "ArrayList", "names", "=", "new", "ArrayList", "(", "this", ".", "typeLocators", ".", "elementSize", ")", ";", "Object", "[", "]", "keyTable", "=", "this", ".", "typeLocators", ".", "keyTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "keyTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "if", "(", "keyTable", "[", "i", "]", "!=", "null", ")", "{", "String", "packageName", "=", "(", "String", ")", "keyTable", "[", "i", "]", ";", "int", "last", "=", "packageName", ".", "lastIndexOf", "(", "'/'", ")", ";", "packageName", "=", "last", "==", "-", "1", "?", "null", ":", "packageName", ".", "substring", "(", "0", ",", "last", ")", ";", "while", "(", "packageName", "!=", "null", "&&", "!", "names", ".", "contains", "(", "packageName", ")", ")", "{", "names", ".", "add", "(", "packageName", ")", ";", "last", "=", "packageName", ".", "lastIndexOf", "(", "'/'", ")", ";", "packageName", "=", "last", "==", "-", "1", "?", "null", ":", "packageName", ".", "substring", "(", "0", ",", "last", ")", ";", "}", "}", "}", "this", ".", "knownPackageNames", "=", "new", "String", "[", "names", ".", "size", "(", ")", "]", ";", "names", ".", "toArray", "(", "this", ".", "knownPackageNames", ")", ";", "}", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "knownPackageNames", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "this", ".", "knownPackageNames", "[", "i", "]", ".", "equals", "(", "qualifiedPackageName", ")", ")", "return", "true", ";", "return", "false", ";", "}", "public", "boolean", "isKnownType", "(", "String", "qualifiedTypeName", ")", "{", "return", "this", ".", "typeLocators", ".", "containsKey", "(", "qualifiedTypeName", ")", ";", "}", "boolean", "isSourceFolderEmpty", "(", "IContainer", "sourceFolder", ")", "{", "String", "sourceFolderName", "=", "sourceFolder", ".", "getProjectRelativePath", "(", ")", ".", "addTrailingSeparator", "(", ")", ".", "toString", "(", ")", ";", "Object", "[", "]", "table", "=", "this", ".", "typeLocators", ".", "valueTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "table", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "table", "[", "i", "]", "!=", "null", "&&", "(", "(", "String", ")", "table", "[", "i", "]", ")", ".", "startsWith", "(", "sourceFolderName", ")", ")", "return", "false", ";", "return", "true", ";", "}", "void", "record", "(", "String", "typeLocator", ",", "char", "[", "]", "[", "]", "[", "]", "qualifiedRefs", ",", "char", "[", "]", "[", "]", "simpleRefs", ",", "char", "[", "]", "[", "]", "rootRefs", ",", "char", "[", "]", "mainTypeName", ",", "ArrayList", "typeNames", ")", "{", "if", "(", "typeNames", ".", "size", "(", ")", "==", "1", "&&", "CharOperation", ".", "equals", "(", "mainTypeName", ",", "(", "char", "[", "]", ")", "typeNames", ".", "get", "(", "0", ")", ")", ")", "{", "this", ".", "references", ".", "put", "(", "typeLocator", ",", "new", "ReferenceCollection", "(", "qualifiedRefs", ",", "simpleRefs", ",", "rootRefs", ")", ")", ";", "}", "else", "{", "char", "[", "]", "[", "]", "definedTypeNames", "=", "new", "char", "[", "typeNames", ".", "size", "(", ")", "]", "[", "]", ";", "typeNames", ".", "toArray", "(", "definedTypeNames", ")", ";", "this", ".", "references", ".", "put", "(", "typeLocator", ",", "new", "AdditionalTypeCollection", "(", "definedTypeNames", ",", "qualifiedRefs", ",", "simpleRefs", ",", "rootRefs", ")", ")", ";", "}", "}", "void", "recordLocatorForType", "(", "String", "qualifiedTypeName", ",", "String", "typeLocator", ")", "{", "this", ".", "knownPackageNames", "=", "null", ";", "int", "start", "=", "typeLocator", ".", "indexOf", "(", "qualifiedTypeName", ",", "0", ")", ";", "if", "(", "start", ">", "0", ")", "qualifiedTypeName", "=", "typeLocator", ".", "substring", "(", "start", ",", "start", "+", "qualifiedTypeName", ".", "length", "(", ")", ")", ";", "this", ".", "typeLocators", ".", "put", "(", "qualifiedTypeName", ",", "typeLocator", ")", ";", "}", "void", "recordStructuralDependency", "(", "IProject", "prereqProject", ",", "State", "prereqState", ")", "{", "if", "(", "prereqState", "!=", "null", ")", "if", "(", "prereqState", ".", "lastStructuralBuildTime", ">", "0", ")", "this", ".", "structuralBuildTimes", ".", "put", "(", "prereqProject", ".", "getName", "(", ")", ",", "new", "Long", "(", "prereqState", ".", "lastStructuralBuildTime", ")", ")", ";", "}", "void", "removeLocator", "(", "String", "typeLocatorToRemove", ")", "{", "this", ".", "knownPackageNames", "=", "null", ";", "this", ".", "references", ".", "removeKey", "(", "typeLocatorToRemove", ")", ";", "this", ".", "typeLocators", ".", "removeValue", "(", "typeLocatorToRemove", ")", ";", "}", "void", "removePackage", "(", "IResourceDelta", "sourceDelta", ")", "{", "IResource", "resource", "=", "sourceDelta", ".", "getResource", "(", ")", ";", "switch", "(", "resource", ".", "getType", "(", ")", ")", "{", "case", "IResource", ".", "FOLDER", ":", "IResourceDelta", "[", "]", "children", "=", "sourceDelta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "children", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "removePackage", "(", "children", "[", "i", "]", ")", ";", "return", ";", "case", "IResource", ".", "FILE", ":", "IPath", "typeLocatorPath", "=", "resource", ".", "getProjectRelativePath", "(", ")", ";", "if", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "isJavaLikeFileName", "(", "typeLocatorPath", ".", "lastSegment", "(", ")", ")", ")", "removeLocator", "(", "typeLocatorPath", ".", "toString", "(", ")", ")", ";", "}", "}", "void", "removeQualifiedTypeName", "(", "String", "qualifiedTypeNameToRemove", ")", "{", "this", ".", "knownPackageNames", "=", "null", ";", "this", ".", "typeLocators", ".", "removeKey", "(", "qualifiedTypeNameToRemove", ")", ";", "}", "static", "State", "read", "(", "IProject", "project", ",", "DataInputStream", "in", ")", "throws", "IOException", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "project", ".", "getName", "(", ")", ")", ";", "if", "(", "VERSION", "!=", "in", ".", "readByte", "(", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "project", ".", "getName", "(", ")", ")", ";", "return", "null", ";", "}", "State", "newState", "=", "new", "State", "(", ")", ";", "newState", ".", "javaProjectName", "=", "in", ".", "readUTF", "(", ")", ";", "if", "(", "!", "project", ".", "getName", "(", ")", ".", "equals", "(", "newState", ".", "javaProjectName", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "return", "null", ";", "}", "newState", ".", "buildNumber", "=", "in", ".", "readInt", "(", ")", ";", "newState", ".", "lastStructuralBuildTime", "=", "in", ".", "readLong", "(", ")", ";", "int", "length", "=", "in", ".", "readInt", "(", ")", ";", "newState", ".", "sourceLocations", "=", "new", "ClasspathMultiDirectory", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IContainer", "sourceFolder", "=", "project", ",", "outputFolder", "=", "project", ";", "String", "folderName", ";", "if", "(", "(", "folderName", "=", "in", ".", "readUTF", "(", ")", ")", ".", "length", "(", ")", ">", "0", ")", "sourceFolder", "=", "project", ".", "getFolder", "(", "folderName", ")", ";", "if", "(", "(", "folderName", "=", "in", ".", "readUTF", "(", ")", ")", ".", "length", "(", ")", ">", "0", ")", "outputFolder", "=", "project", ".", "getFolder", "(", "folderName", ")", ";", "ClasspathMultiDirectory", "md", "=", "(", "ClasspathMultiDirectory", ")", "ClasspathLocation", ".", "forSourceFolder", "(", "sourceFolder", ",", "outputFolder", ",", "readNames", "(", "in", ")", ",", "readNames", "(", "in", ")", ")", ";", "if", "(", "in", ".", "readBoolean", "(", ")", ")", "md", ".", "hasIndependentOutputFolder", "=", "true", ";", "newState", ".", "sourceLocations", "[", "i", "]", "=", "md", ";", "}", "length", "=", "in", ".", "readInt", "(", ")", ";", "newState", ".", "binaryLocations", "=", "new", "ClasspathLocation", "[", "length", "]", ";", "IWorkspaceRoot", "root", "=", "project", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "switch", "(", "in", ".", "readByte", "(", ")", ")", "{", "case", "SOURCE_FOLDER", ":", "newState", ".", "binaryLocations", "[", "i", "]", "=", "newState", ".", "sourceLocations", "[", "in", ".", "readInt", "(", ")", "]", ";", "break", ";", "case", "BINARY_FOLDER", ":", "IPath", "path", "=", "new", "Path", "(", "in", ".", "readUTF", "(", ")", ")", ";", "IContainer", "outputFolder", "=", "path", ".", "segmentCount", "(", ")", "==", "1", "?", "(", "IContainer", ")", "root", ".", "getProject", "(", "path", ".", "toString", "(", ")", ")", ":", "(", "IContainer", ")", "root", ".", "getFolder", "(", "path", ")", ";", "newState", ".", "binaryLocations", "[", "i", "]", "=", "ClasspathLocation", ".", "forBinaryFolder", "(", "outputFolder", ",", "in", ".", "readBoolean", "(", ")", ",", "readRestriction", "(", "in", ")", ")", ";", "break", ";", "case", "EXTERNAL_JAR", ":", "newState", ".", "binaryLocations", "[", "i", "]", "=", "ClasspathLocation", ".", "forLibrary", "(", "in", ".", "readUTF", "(", ")", ",", "in", ".", "readLong", "(", ")", ",", "readRestriction", "(", "in", ")", ")", ";", "break", ";", "case", "INTERNAL_JAR", ":", "newState", ".", "binaryLocations", "[", "i", "]", "=", "ClasspathLocation", ".", "forLibrary", "(", "root", ".", "getFile", "(", "new", "Path", "(", "in", ".", "readUTF", "(", ")", ")", ")", ",", "readRestriction", "(", "in", ")", ")", ";", "}", "}", "newState", ".", "structuralBuildTimes", "=", "new", "SimpleLookupTable", "(", "length", "=", "in", ".", "readInt", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "newState", ".", "structuralBuildTimes", ".", "put", "(", "in", ".", "readUTF", "(", ")", ",", "new", "Long", "(", "in", ".", "readLong", "(", ")", ")", ")", ";", "String", "[", "]", "internedTypeLocators", "=", "new", "String", "[", "length", "=", "in", ".", "readInt", "(", ")", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "internedTypeLocators", "[", "i", "]", "=", "in", ".", "readUTF", "(", ")", ";", "newState", ".", "typeLocators", "=", "new", "SimpleLookupTable", "(", "length", "=", "in", ".", "readInt", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "newState", ".", "recordLocatorForType", "(", "in", ".", "readUTF", "(", ")", ",", "internedTypeLocators", "[", "in", ".", "readInt", "(", ")", "]", ")", ";", "char", "[", "]", "[", "]", "internedRootNames", "=", "ReferenceCollection", ".", "internSimpleNames", "(", "readNames", "(", "in", ")", ",", "false", ")", ";", "char", "[", "]", "[", "]", "internedSimpleNames", "=", "ReferenceCollection", ".", "internSimpleNames", "(", "readNames", "(", "in", ")", ",", "false", ")", ";", "char", "[", "]", "[", "]", "[", "]", "internedQualifiedNames", "=", "new", "char", "[", "length", "=", "in", ".", "readInt", "(", ")", "]", "[", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "int", "qLength", "=", "in", ".", "readInt", "(", ")", ";", "char", "[", "]", "[", "]", "qName", "=", "new", "char", "[", "qLength", "]", "[", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "qLength", ";", "j", "++", ")", "qName", "[", "j", "]", "=", "internedSimpleNames", "[", "in", ".", "readInt", "(", ")", "]", ";", "internedQualifiedNames", "[", "i", "]", "=", "qName", ";", "}", "internedQualifiedNames", "=", "ReferenceCollection", ".", "internQualifiedNames", "(", "internedQualifiedNames", ",", "false", ")", ";", "newState", ".", "references", "=", "new", "SimpleLookupTable", "(", "length", "=", "in", ".", "readInt", "(", ")", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "typeLocator", "=", "internedTypeLocators", "[", "in", ".", "readInt", "(", ")", "]", ";", "ReferenceCollection", "collection", "=", "null", ";", "switch", "(", "in", ".", "readByte", "(", ")", ")", "{", "case", "1", ":", "char", "[", "]", "[", "]", "additionalTypeNames", "=", "readNames", "(", "in", ")", ";", "char", "[", "]", "[", "]", "[", "]", "qualifiedNames", "=", "new", "char", "[", "in", ".", "readInt", "(", ")", "]", "[", "]", "[", "]", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "qualifiedNames", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "qualifiedNames", "[", "j", "]", "=", "internedQualifiedNames", "[", "in", ".", "readInt", "(", ")", "]", ";", "char", "[", "]", "[", "]", "simpleNames", "=", "new", "char", "[", "in", ".", "readInt", "(", ")", "]", "[", "]", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "simpleNames", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "simpleNames", "[", "j", "]", "=", "internedSimpleNames", "[", "in", ".", "readInt", "(", ")", "]", ";", "char", "[", "]", "[", "]", "rootNames", "=", "new", "char", "[", "in", ".", "readInt", "(", ")", "]", "[", "]", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "rootNames", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "rootNames", "[", "j", "]", "=", "internedRootNames", "[", "in", ".", "readInt", "(", ")", "]", ";", "collection", "=", "new", "AdditionalTypeCollection", "(", "additionalTypeNames", ",", "qualifiedNames", ",", "simpleNames", ",", "rootNames", ")", ";", "break", ";", "case", "2", ":", "char", "[", "]", "[", "]", "[", "]", "qNames", "=", "new", "char", "[", "in", ".", "readInt", "(", ")", "]", "[", "]", "[", "]", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "qNames", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "qNames", "[", "j", "]", "=", "internedQualifiedNames", "[", "in", ".", "readInt", "(", ")", "]", ";", "char", "[", "]", "[", "]", "sNames", "=", "new", "char", "[", "in", ".", "readInt", "(", ")", "]", "[", "]", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "sNames", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "sNames", "[", "j", "]", "=", "internedSimpleNames", "[", "in", ".", "readInt", "(", ")", "]", ";", "char", "[", "]", "[", "]", "rNames", "=", "new", "char", "[", "in", ".", "readInt", "(", ")", "]", "[", "]", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "rNames", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "rNames", "[", "j", "]", "=", "internedRootNames", "[", "in", ".", "readInt", "(", ")", "]", ";", "collection", "=", "new", "ReferenceCollection", "(", "qNames", ",", "sNames", ",", "rNames", ")", ";", "}", "newState", ".", "references", ".", "put", "(", "typeLocator", ",", "collection", ")", ";", "}", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "newState", ".", "javaProjectName", ")", ";", "return", "newState", ";", "}", "private", "static", "char", "[", "]", "readName", "(", "DataInputStream", "in", ")", "throws", "IOException", "{", "int", "nLength", "=", "in", ".", "readInt", "(", ")", ";", "char", "[", "]", "name", "=", "new", "char", "[", "nLength", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "nLength", ";", "j", "++", ")", "name", "[", "j", "]", "=", "in", ".", "readChar", "(", ")", ";", "return", "name", ";", "}", "private", "static", "char", "[", "]", "[", "]", "readNames", "(", "DataInputStream", "in", ")", "throws", "IOException", "{", "int", "length", "=", "in", ".", "readInt", "(", ")", ";", "char", "[", "]", "[", "]", "names", "=", "new", "char", "[", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "names", "[", "i", "]", "=", "readName", "(", "in", ")", ";", "return", "names", ";", "}", "private", "static", "AccessRuleSet", "readRestriction", "(", "DataInputStream", "in", ")", "throws", "IOException", "{", "int", "length", "=", "in", ".", "readInt", "(", ")", ";", "if", "(", "length", "==", "0", ")", "return", "null", ";", "AccessRule", "[", "]", "accessRules", "=", "new", "AccessRule", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "char", "[", "]", "pattern", "=", "readName", "(", "in", ")", ";", "int", "problemId", "=", "in", ".", "readInt", "(", ")", ";", "accessRules", "[", "i", "]", "=", "new", "ClasspathAccessRule", "(", "pattern", ",", "problemId", ")", ";", "}", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "return", "new", "AccessRuleSet", "(", "accessRules", ",", "in", ".", "readByte", "(", ")", ",", "manager", ".", "intern", "(", "in", ".", "readUTF", "(", ")", ")", ")", ";", "}", "void", "tagAsNoopBuild", "(", ")", "{", "this", ".", "buildNumber", "=", "-", "1", ";", "}", "boolean", "wasNoopBuild", "(", ")", "{", "return", "this", ".", "buildNumber", "==", "-", "1", ";", "}", "void", "tagAsStructurallyChanged", "(", ")", "{", "this", ".", "previousStructuralBuildTime", "=", "this", ".", "lastStructuralBuildTime", ";", "this", ".", "structurallyChangedTypes", "=", "new", "StringSet", "(", "7", ")", ";", "this", ".", "lastStructuralBuildTime", "=", "computeStructuralBuildTime", "(", "this", ".", "previousStructuralBuildTime", ")", ";", "}", "boolean", "wasStructurallyChanged", "(", "IProject", "prereqProject", ",", "State", "prereqState", ")", "{", "if", "(", "prereqState", "!=", "null", ")", "{", "Object", "o", "=", "this", ".", "structuralBuildTimes", ".", "get", "(", "prereqProject", ".", "getName", "(", ")", ")", ";", "long", "previous", "=", "o", "==", "null", "?", "0", ":", "(", "(", "Long", ")", "o", ")", ".", "longValue", "(", ")", ";", "if", "(", "previous", "==", "prereqState", ".", "lastStructuralBuildTime", ")", "return", "false", ";", "}", "return", "true", ";", "}", "void", "wasStructurallyChanged", "(", "String", "typeName", ")", "{", "if", "(", "this", ".", "structurallyChangedTypes", "!=", "null", ")", "{", "if", "(", "this", ".", "structurallyChangedTypes", ".", "elementSize", ">", "MaxStructurallyChangedTypes", ")", "this", ".", "structurallyChangedTypes", "=", "null", ";", "else", "this", ".", "structurallyChangedTypes", ".", "add", "(", "typeName", ")", ";", "}", "}", "void", "write", "(", "DataOutputStream", "out", ")", "throws", "IOException", "{", "int", "length", ";", "Object", "[", "]", "keyTable", ";", "Object", "[", "]", "valueTable", ";", "out", ".", "writeByte", "(", "VERSION", ")", ";", "out", ".", "writeUTF", "(", "this", ".", "javaProjectName", ")", ";", "out", ".", "writeInt", "(", "this", ".", "buildNumber", ")", ";", "out", ".", "writeLong", "(", "this", ".", "lastStructuralBuildTime", ")", ";", "out", ".", "writeInt", "(", "length", "=", "this", ".", "sourceLocations", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ClasspathMultiDirectory", "md", "=", "this", ".", "sourceLocations", "[", "i", "]", ";", "out", ".", "writeUTF", "(", "md", ".", "sourceFolder", ".", "getProjectRelativePath", "(", ")", ".", "toString", "(", ")", ")", ";", "out", ".", "writeUTF", "(", "md", ".", "binaryFolder", ".", "getProjectRelativePath", "(", ")", ".", "toString", "(", ")", ")", ";", "writeNames", "(", "md", ".", "inclusionPatterns", ",", "out", ")", ";", "writeNames", "(", "md", ".", "exclusionPatterns", ",", "out", ")", ";", "out", ".", "writeBoolean", "(", "md", ".", "hasIndependentOutputFolder", ")", ";", "}", "out", ".", "writeInt", "(", "length", "=", "this", ".", "binaryLocations", ".", "length", ")", ";", "next", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ClasspathLocation", "c", "=", "this", ".", "binaryLocations", "[", "i", "]", ";", "if", "(", "c", "instanceof", "ClasspathMultiDirectory", ")", "{", "out", ".", "writeByte", "(", "SOURCE_FOLDER", ")", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "this", ".", "sourceLocations", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "{", "if", "(", "this", ".", "sourceLocations", "[", "j", "]", "==", "c", ")", "{", "out", ".", "writeInt", "(", "j", ")", ";", "continue", "next", ";", "}", "}", "}", "else", "if", "(", "c", "instanceof", "ClasspathDirectory", ")", "{", "out", ".", "writeByte", "(", "BINARY_FOLDER", ")", ";", "ClasspathDirectory", "cd", "=", "(", "ClasspathDirectory", ")", "c", ";", "out", ".", "writeUTF", "(", "cd", ".", "binaryFolder", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ")", ";", "out", ".", "writeBoolean", "(", "cd", ".", "isOutputFolder", ")", ";", "writeRestriction", "(", "cd", ".", "accessRuleSet", ",", "out", ")", ";", "}", "else", "{", "ClasspathJar", "jar", "=", "(", "ClasspathJar", ")", "c", ";", "if", "(", "jar", ".", "resource", "==", "null", ")", "{", "out", ".", "writeByte", "(", "EXTERNAL_JAR", ")", ";", "out", ".", "writeUTF", "(", "jar", ".", "zipFilename", ")", ";", "out", ".", "writeLong", "(", "jar", ".", "lastModified", "(", ")", ")", ";", "}", "else", "{", "out", ".", "writeByte", "(", "INTERNAL_JAR", ")", ";", "out", ".", "writeUTF", "(", "jar", ".", "resource", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ")", ";", "}", "writeRestriction", "(", "jar", ".", "accessRuleSet", ",", "out", ")", ";", "}", "}", "out", ".", "writeInt", "(", "length", "=", "this", ".", "structuralBuildTimes", ".", "elementSize", ")", ";", "if", "(", "length", ">", "0", ")", "{", "keyTable", "=", "this", ".", "structuralBuildTimes", ".", "keyTable", ";", "valueTable", "=", "this", ".", "structuralBuildTimes", ".", "valueTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "keyTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "if", "(", "keyTable", "[", "i", "]", "!=", "null", ")", "{", "length", "--", ";", "out", ".", "writeUTF", "(", "(", "String", ")", "keyTable", "[", "i", "]", ")", ";", "out", ".", "writeLong", "(", "(", "(", "Long", ")", "valueTable", "[", "i", "]", ")", ".", "longValue", "(", ")", ")", ";", "}", "}", "if", "(", "JavaBuilder", ".", "DEBUG", "&&", "length", "!=", "0", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "out", ".", "writeInt", "(", "length", "=", "this", ".", "references", ".", "elementSize", ")", ";", "SimpleLookupTable", "internedTypeLocators", "=", "new", "SimpleLookupTable", "(", "length", ")", ";", "if", "(", "length", ">", "0", ")", "{", "keyTable", "=", "this", ".", "references", ".", "keyTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "keyTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "if", "(", "keyTable", "[", "i", "]", "!=", "null", ")", "{", "length", "--", ";", "String", "key", "=", "(", "String", ")", "keyTable", "[", "i", "]", ";", "out", ".", "writeUTF", "(", "key", ")", ";", "internedTypeLocators", ".", "put", "(", "key", ",", "new", "Integer", "(", "internedTypeLocators", ".", "elementSize", ")", ")", ";", "}", "}", "if", "(", "JavaBuilder", ".", "DEBUG", "&&", "length", "!=", "0", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "out", ".", "writeInt", "(", "length", "=", "this", ".", "typeLocators", ".", "elementSize", ")", ";", "if", "(", "length", ">", "0", ")", "{", "keyTable", "=", "this", ".", "typeLocators", ".", "keyTable", ";", "valueTable", "=", "this", ".", "typeLocators", ".", "valueTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "keyTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "if", "(", "keyTable", "[", "i", "]", "!=", "null", ")", "{", "length", "--", ";", "out", ".", "writeUTF", "(", "(", "String", ")", "keyTable", "[", "i", "]", ")", ";", "Integer", "index", "=", "(", "Integer", ")", "internedTypeLocators", ".", "get", "(", "valueTable", "[", "i", "]", ")", ";", "out", ".", "writeInt", "(", "index", ".", "intValue", "(", ")", ")", ";", "}", "}", "if", "(", "JavaBuilder", ".", "DEBUG", "&&", "length", "!=", "0", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "SimpleLookupTable", "internedRootNames", "=", "new", "SimpleLookupTable", "(", "3", ")", ";", "SimpleLookupTable", "internedQualifiedNames", "=", "new", "SimpleLookupTable", "(", "31", ")", ";", "SimpleLookupTable", "internedSimpleNames", "=", "new", "SimpleLookupTable", "(", "31", ")", ";", "valueTable", "=", "this", ".", "references", ".", "valueTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "valueTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "if", "(", "valueTable", "[", "i", "]", "!=", "null", ")", "{", "ReferenceCollection", "collection", "=", "(", "ReferenceCollection", ")", "valueTable", "[", "i", "]", ";", "char", "[", "]", "[", "]", "rNames", "=", "collection", ".", "rootReferences", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "rNames", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "{", "char", "[", "]", "rName", "=", "rNames", "[", "j", "]", ";", "if", "(", "!", "internedRootNames", ".", "containsKey", "(", "rName", ")", ")", "internedRootNames", ".", "put", "(", "rName", ",", "new", "Integer", "(", "internedRootNames", ".", "elementSize", ")", ")", ";", "}", "char", "[", "]", "[", "]", "[", "]", "qNames", "=", "collection", ".", "qualifiedNameReferences", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "qNames", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "{", "char", "[", "]", "[", "]", "qName", "=", "qNames", "[", "j", "]", ";", "if", "(", "!", "internedQualifiedNames", ".", "containsKey", "(", "qName", ")", ")", "{", "internedQualifiedNames", ".", "put", "(", "qName", ",", "new", "Integer", "(", "internedQualifiedNames", ".", "elementSize", ")", ")", ";", "for", "(", "int", "k", "=", "0", ",", "n", "=", "qName", ".", "length", ";", "k", "<", "n", ";", "k", "++", ")", "{", "char", "[", "]", "sName", "=", "qName", "[", "k", "]", ";", "if", "(", "!", "internedSimpleNames", ".", "containsKey", "(", "sName", ")", ")", "internedSimpleNames", ".", "put", "(", "sName", ",", "new", "Integer", "(", "internedSimpleNames", ".", "elementSize", ")", ")", ";", "}", "}", "}", "char", "[", "]", "[", "]", "sNames", "=", "collection", ".", "simpleNameReferences", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "sNames", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "{", "char", "[", "]", "sName", "=", "sNames", "[", "j", "]", ";", "if", "(", "!", "internedSimpleNames", ".", "containsKey", "(", "sName", ")", ")", "internedSimpleNames", ".", "put", "(", "sName", ",", "new", "Integer", "(", "internedSimpleNames", ".", "elementSize", ")", ")", ";", "}", "}", "}", "char", "[", "]", "[", "]", "internedArray", "=", "new", "char", "[", "internedRootNames", ".", "elementSize", "]", "[", "]", ";", "Object", "[", "]", "rootNames", "=", "internedRootNames", ".", "keyTable", ";", "Object", "[", "]", "positions", "=", "internedRootNames", ".", "valueTable", ";", "for", "(", "int", "i", "=", "positions", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "{", "if", "(", "positions", "[", "i", "]", "!=", "null", ")", "{", "int", "index", "=", "(", "(", "Integer", ")", "positions", "[", "i", "]", ")", ".", "intValue", "(", ")", ";", "internedArray", "[", "index", "]", "=", "(", "char", "[", "]", ")", "rootNames", "[", "i", "]", ";", "}", "}", "writeNames", "(", "internedArray", ",", "out", ")", ";", "internedArray", "=", "new", "char", "[", "internedSimpleNames", ".", "elementSize", "]", "[", "]", ";", "Object", "[", "]", "simpleNames", "=", "internedSimpleNames", ".", "keyTable", ";", "positions", "=", "internedSimpleNames", ".", "valueTable", ";", "for", "(", "int", "i", "=", "positions", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "{", "if", "(", "positions", "[", "i", "]", "!=", "null", ")", "{", "int", "index", "=", "(", "(", "Integer", ")", "positions", "[", "i", "]", ")", ".", "intValue", "(", ")", ";", "internedArray", "[", "index", "]", "=", "(", "char", "[", "]", ")", "simpleNames", "[", "i", "]", ";", "}", "}", "writeNames", "(", "internedArray", ",", "out", ")", ";", "char", "[", "]", "[", "]", "[", "]", "internedQArray", "=", "new", "char", "[", "internedQualifiedNames", ".", "elementSize", "]", "[", "]", "[", "]", ";", "Object", "[", "]", "qualifiedNames", "=", "internedQualifiedNames", ".", "keyTable", ";", "positions", "=", "internedQualifiedNames", ".", "valueTable", ";", "for", "(", "int", "i", "=", "positions", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "{", "if", "(", "positions", "[", "i", "]", "!=", "null", ")", "{", "int", "index", "=", "(", "(", "Integer", ")", "positions", "[", "i", "]", ")", ".", "intValue", "(", ")", ";", "internedQArray", "[", "index", "]", "=", "(", "char", "[", "]", "[", "]", ")", "qualifiedNames", "[", "i", "]", ";", "}", "}", "out", ".", "writeInt", "(", "length", "=", "internedQArray", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "char", "[", "]", "[", "]", "qName", "=", "internedQArray", "[", "i", "]", ";", "int", "qLength", "=", "qName", ".", "length", ";", "out", ".", "writeInt", "(", "qLength", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "qLength", ";", "j", "++", ")", "{", "Integer", "index", "=", "(", "Integer", ")", "internedSimpleNames", ".", "get", "(", "qName", "[", "j", "]", ")", ";", "out", ".", "writeInt", "(", "index", ".", "intValue", "(", ")", ")", ";", "}", "}", "out", ".", "writeInt", "(", "length", "=", "this", ".", "references", ".", "elementSize", ")", ";", "if", "(", "length", ">", "0", ")", "{", "keyTable", "=", "this", ".", "references", ".", "keyTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "keyTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "if", "(", "keyTable", "[", "i", "]", "!=", "null", ")", "{", "length", "--", ";", "Integer", "index", "=", "(", "Integer", ")", "internedTypeLocators", ".", "get", "(", "keyTable", "[", "i", "]", ")", ";", "out", ".", "writeInt", "(", "index", ".", "intValue", "(", ")", ")", ";", "ReferenceCollection", "collection", "=", "(", "ReferenceCollection", ")", "valueTable", "[", "i", "]", ";", "if", "(", "collection", "instanceof", "AdditionalTypeCollection", ")", "{", "out", ".", "writeByte", "(", "1", ")", ";", "AdditionalTypeCollection", "atc", "=", "(", "AdditionalTypeCollection", ")", "collection", ";", "writeNames", "(", "atc", ".", "definedTypeNames", ",", "out", ")", ";", "}", "else", "{", "out", ".", "writeByte", "(", "2", ")", ";", "}", "char", "[", "]", "[", "]", "[", "]", "qNames", "=", "collection", ".", "qualifiedNameReferences", ";", "int", "qLength", "=", "qNames", ".", "length", ";", "out", ".", "writeInt", "(", "qLength", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "qLength", ";", "j", "++", ")", "{", "index", "=", "(", "Integer", ")", "internedQualifiedNames", ".", "get", "(", "qNames", "[", "j", "]", ")", ";", "out", ".", "writeInt", "(", "index", ".", "intValue", "(", ")", ")", ";", "}", "char", "[", "]", "[", "]", "sNames", "=", "collection", ".", "simpleNameReferences", ";", "int", "sLength", "=", "sNames", ".", "length", ";", "out", ".", "writeInt", "(", "sLength", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "sLength", ";", "j", "++", ")", "{", "index", "=", "(", "Integer", ")", "internedSimpleNames", ".", "get", "(", "sNames", "[", "j", "]", ")", ";", "out", ".", "writeInt", "(", "index", ".", "intValue", "(", ")", ")", ";", "}", "char", "[", "]", "[", "]", "rNames", "=", "collection", ".", "rootReferences", ";", "int", "rLength", "=", "rNames", ".", "length", ";", "out", ".", "writeInt", "(", "rLength", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "rLength", ";", "j", "++", ")", "{", "index", "=", "(", "Integer", ")", "internedRootNames", ".", "get", "(", "rNames", "[", "j", "]", ")", ";", "out", ".", "writeInt", "(", "index", ".", "intValue", "(", ")", ")", ";", "}", "}", "}", "if", "(", "JavaBuilder", ".", "DEBUG", "&&", "length", "!=", "0", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "}", "}", "private", "void", "writeName", "(", "char", "[", "]", "name", ",", "DataOutputStream", "out", ")", "throws", "IOException", "{", "int", "nLength", "=", "name", ".", "length", ";", "out", ".", "writeInt", "(", "nLength", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "nLength", ";", "j", "++", ")", "out", ".", "writeChar", "(", "name", "[", "j", "]", ")", ";", "}", "private", "void", "writeNames", "(", "char", "[", "]", "[", "]", "names", ",", "DataOutputStream", "out", ")", "throws", "IOException", "{", "int", "length", "=", "names", "==", "null", "?", "0", ":", "names", ".", "length", ";", "out", ".", "writeInt", "(", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "writeName", "(", "names", "[", "i", "]", ",", "out", ")", ";", "}", "private", "void", "writeRestriction", "(", "AccessRuleSet", "accessRuleSet", ",", "DataOutputStream", "out", ")", "throws", "IOException", "{", "if", "(", "accessRuleSet", "==", "null", ")", "{", "out", ".", "writeInt", "(", "0", ")", ";", "}", "else", "{", "AccessRule", "[", "]", "accessRules", "=", "accessRuleSet", ".", "getAccessRules", "(", ")", ";", "int", "length", "=", "accessRules", ".", "length", ";", "out", ".", "writeInt", "(", "length", ")", ";", "if", "(", "length", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "AccessRule", "accessRule", "=", "accessRules", "[", "i", "]", ";", "writeName", "(", "accessRule", ".", "pattern", ",", "out", ")", ";", "out", ".", "writeInt", "(", "accessRule", ".", "problemId", ")", ";", "}", "out", ".", "writeByte", "(", "accessRuleSet", ".", "classpathEntryType", ")", ";", "out", ".", "writeUTF", "(", "accessRuleSet", ".", "classpathEntryName", ")", ";", "}", "}", "}", "public", "String", "toString", "(", ")", "{", "return", "\"State", "for", "\"", "+", "this", ".", "javaProjectName", "+", "\"", "(#\"", "+", "this", ".", "buildNumber", "+", "\"", "@", "\"", "+", "new", "Date", "(", "this", ".", "lastStructuralBuildTime", ")", "+", "\")\"", ";", "}", "}", "</s>" ]
3,907
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SimpleSet", ";", "public", "class", "WorkQueue", "{", "private", "SimpleSet", "needsCompileList", ";", "private", "SimpleSet", "compiledList", ";", "public", "WorkQueue", "(", ")", "{", "this", ".", "needsCompileList", "=", "new", "SimpleSet", "(", ")", ";", "this", ".", "compiledList", "=", "new", "SimpleSet", "(", ")", ";", "}", "public", "void", "add", "(", "SourceFile", "element", ")", "{", "this", ".", "needsCompileList", ".", "add", "(", "element", ")", ";", "}", "public", "void", "addAll", "(", "SourceFile", "[", "]", "elements", ")", "{", "for", "(", "int", "i", "=", "0", ",", "l", "=", "elements", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "add", "(", "elements", "[", "i", "]", ")", ";", "}", "public", "void", "clear", "(", ")", "{", "this", ".", "needsCompileList", ".", "clear", "(", ")", ";", "this", ".", "compiledList", ".", "clear", "(", ")", ";", "}", "public", "void", "finished", "(", "SourceFile", "element", ")", "{", "this", ".", "needsCompileList", ".", "remove", "(", "element", ")", ";", "this", ".", "compiledList", ".", "add", "(", "element", ")", ";", "}", "public", "boolean", "isCompiled", "(", "SourceFile", "element", ")", "{", "return", "this", ".", "compiledList", ".", "includes", "(", "element", ")", ";", "}", "public", "boolean", "isWaiting", "(", "SourceFile", "element", ")", "{", "return", "this", ".", "needsCompileList", ".", "includes", "(", "element", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"WorkQueue:", "\"", "+", "this", ".", "needsCompileList", ";", "}", "}", "</s>" ]
3,908
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "class", "ClasspathMultiDirectory", "extends", "ClasspathDirectory", "{", "IContainer", "sourceFolder", ";", "char", "[", "]", "[", "]", "inclusionPatterns", ";", "char", "[", "]", "[", "]", "exclusionPatterns", ";", "boolean", "hasIndependentOutputFolder", ";", "ClasspathMultiDirectory", "(", "IContainer", "sourceFolder", ",", "IContainer", "binaryFolder", ",", "char", "[", "]", "[", "]", "inclusionPatterns", ",", "char", "[", "]", "[", "]", "exclusionPatterns", ")", "{", "super", "(", "binaryFolder", ",", "true", ",", "null", ")", ";", "this", ".", "sourceFolder", "=", "sourceFolder", ";", "this", ".", "inclusionPatterns", "=", "inclusionPatterns", ";", "this", ".", "exclusionPatterns", "=", "exclusionPatterns", ";", "this", ".", "hasIndependentOutputFolder", "=", "false", ";", "if", "(", "this", ".", "inclusionPatterns", "!=", "null", "&&", "this", ".", "inclusionPatterns", ".", "length", "==", "0", ")", "this", ".", "inclusionPatterns", "=", "null", ";", "if", "(", "this", ".", "exclusionPatterns", "!=", "null", "&&", "this", ".", "exclusionPatterns", ".", "length", "==", "0", ")", "this", ".", "exclusionPatterns", "=", "null", ";", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "this", "==", "o", ")", "return", "true", ";", "if", "(", "!", "(", "o", "instanceof", "ClasspathMultiDirectory", ")", ")", "return", "false", ";", "ClasspathMultiDirectory", "md", "=", "(", "ClasspathMultiDirectory", ")", "o", ";", "return", "this", ".", "sourceFolder", ".", "equals", "(", "md", ".", "sourceFolder", ")", "&&", "this", ".", "binaryFolder", ".", "equals", "(", "md", ".", "binaryFolder", ")", "&&", "CharOperation", ".", "equals", "(", "this", ".", "inclusionPatterns", ",", "md", ".", "inclusionPatterns", ")", "&&", "CharOperation", ".", "equals", "(", "this", ".", "exclusionPatterns", ",", "md", ".", "exclusionPatterns", ")", ";", "}", "protected", "boolean", "isExcluded", "(", "IResource", "resource", ")", "{", "if", "(", "this", ".", "exclusionPatterns", "!=", "null", "||", "this", ".", "inclusionPatterns", "!=", "null", ")", "if", "(", "this", ".", "sourceFolder", ".", "equals", "(", "this", ".", "binaryFolder", ")", ")", "return", "Util", ".", "isExcluded", "(", "resource", ",", "this", ".", "inclusionPatterns", ",", "this", ".", "exclusionPatterns", ")", ";", "return", "false", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"\"", "+", "this", ".", "sourceFolder", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", "+", "\"", "with", "\"", "+", "super", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,909
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "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", ".", "util", ".", "SimpleLookupTable", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "ClasspathDirectory", "extends", "ClasspathLocation", "{", "IContainer", "binaryFolder", ";", "boolean", "isOutputFolder", ";", "SimpleLookupTable", "directoryCache", ";", "String", "[", "]", "missingPackageHolder", "=", "new", "String", "[", "1", "]", ";", "AccessRuleSet", "accessRuleSet", ";", "ClasspathDirectory", "(", "IContainer", "binaryFolder", ",", "boolean", "isOutputFolder", ",", "AccessRuleSet", "accessRuleSet", ")", "{", "this", ".", "binaryFolder", "=", "binaryFolder", ";", "this", ".", "isOutputFolder", "=", "isOutputFolder", "||", "binaryFolder", ".", "getProjectRelativePath", "(", ")", ".", "isEmpty", "(", ")", ";", "this", ".", "directoryCache", "=", "new", "SimpleLookupTable", "(", "5", ")", ";", "this", ".", "accessRuleSet", "=", "accessRuleSet", ";", "}", "public", "void", "cleanup", "(", ")", "{", "this", ".", "directoryCache", "=", "null", ";", "}", "String", "[", "]", "directoryList", "(", "String", "qualifiedPackageName", ")", "{", "String", "[", "]", "dirList", "=", "(", "String", "[", "]", ")", "this", ".", "directoryCache", ".", "get", "(", "qualifiedPackageName", ")", ";", "if", "(", "dirList", "==", "this", ".", "missingPackageHolder", ")", "return", "null", ";", "if", "(", "dirList", "!=", "null", ")", "return", "dirList", ";", "try", "{", "IResource", "container", "=", "this", ".", "binaryFolder", ".", "findMember", "(", "qualifiedPackageName", ")", ";", "if", "(", "container", "instanceof", "IContainer", ")", "{", "IResource", "[", "]", "members", "=", "(", "(", "IContainer", ")", "container", ")", ".", "members", "(", ")", ";", "dirList", "=", "new", "String", "[", "members", ".", "length", "]", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "members", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "IResource", "m", "=", "members", "[", "i", "]", ";", "if", "(", "m", ".", "getType", "(", ")", "==", "IResource", ".", "FILE", "&&", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "isClassFileName", "(", "m", ".", "getName", "(", ")", ")", ")", "dirList", "[", "index", "++", "]", "=", "m", ".", "getName", "(", ")", ";", "}", "if", "(", "index", "<", "dirList", ".", "length", ")", "System", ".", "arraycopy", "(", "dirList", ",", "0", ",", "dirList", "=", "new", "String", "[", "index", "]", ",", "0", ",", "index", ")", ";", "this", ".", "directoryCache", ".", "put", "(", "qualifiedPackageName", ",", "dirList", ")", ";", "return", "dirList", ";", "}", "}", "catch", "(", "CoreException", "ignored", ")", "{", "}", "this", ".", "directoryCache", ".", "put", "(", "qualifiedPackageName", ",", "this", ".", "missingPackageHolder", ")", ";", "return", "null", ";", "}", "boolean", "doesFileExist", "(", "String", "fileName", ",", "String", "qualifiedPackageName", ",", "String", "qualifiedFullName", ")", "{", "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", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "this", "==", "o", ")", "return", "true", ";", "if", "(", "!", "(", "o", "instanceof", "ClasspathDirectory", ")", ")", "return", "false", ";", "ClasspathDirectory", "dir", "=", "(", "ClasspathDirectory", ")", "o", ";", "if", "(", "this", ".", "accessRuleSet", "!=", "dir", ".", "accessRuleSet", ")", "if", "(", "this", ".", "accessRuleSet", "==", "null", "||", "!", "this", ".", "accessRuleSet", ".", "equals", "(", "dir", ".", "accessRuleSet", ")", ")", "return", "false", ";", "return", "this", ".", "binaryFolder", ".", "equals", "(", "dir", ".", "binaryFolder", ")", ";", "}", "public", "NameEnvironmentAnswer", "findClass", "(", "String", "binaryFileName", ",", "String", "qualifiedPackageName", ",", "String", "qualifiedBinaryFileName", ")", "{", "if", "(", "!", "doesFileExist", "(", "binaryFileName", ",", "qualifiedPackageName", ",", "qualifiedBinaryFileName", ")", ")", "return", "null", ";", "ClassFileReader", "reader", "=", "null", ";", "try", "{", "reader", "=", "Util", ".", "newClassFileReader", "(", "this", ".", "binaryFolder", ".", "getFile", "(", "new", "Path", "(", "qualifiedBinaryFileName", ")", ")", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "return", "null", ";", "}", "catch", "(", "ClassFormatException", "e", ")", "{", "return", "null", ";", "}", "catch", "(", "IOException", "e", ")", "{", "return", "null", ";", "}", "if", "(", "reader", "!=", "null", ")", "{", "if", "(", "this", ".", "accessRuleSet", "==", "null", ")", "return", "new", "NameEnvironmentAnswer", "(", "reader", ",", "null", ")", ";", "String", "fileNameWithoutExtension", "=", "qualifiedBinaryFileName", ".", "substring", "(", "0", ",", "qualifiedBinaryFileName", ".", "length", "(", ")", "-", "SuffixConstants", ".", "SUFFIX_CLASS", ".", "length", ")", ";", "return", "new", "NameEnvironmentAnswer", "(", "reader", ",", "this", ".", "accessRuleSet", ".", "getViolatedRestriction", "(", "fileNameWithoutExtension", ".", "toCharArray", "(", ")", ")", ")", ";", "}", "return", "null", ";", "}", "public", "IPath", "getProjectRelativePath", "(", ")", "{", "return", "this", ".", "binaryFolder", ".", "getProjectRelativePath", "(", ")", ";", "}", "public", "int", "hashCode", "(", ")", "{", "return", "this", ".", "binaryFolder", "==", "null", "?", "super", ".", "hashCode", "(", ")", ":", "this", ".", "binaryFolder", ".", "hashCode", "(", ")", ";", "}", "protected", "boolean", "isExcluded", "(", "IResource", "resource", ")", "{", "return", "false", ";", "}", "public", "boolean", "isOutputFolder", "(", ")", "{", "return", "this", ".", "isOutputFolder", ";", "}", "public", "boolean", "isPackage", "(", "String", "qualifiedPackageName", ")", "{", "return", "directoryList", "(", "qualifiedPackageName", ")", "!=", "null", ";", "}", "public", "void", "reset", "(", ")", "{", "this", ".", "directoryCache", "=", "new", "SimpleLookupTable", "(", "5", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "String", "start", "=", "\"\"", "+", "this", ".", "binaryFolder", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ";", "if", "(", "this", ".", "accessRuleSet", "==", "null", ")", "return", "start", ";", "return", "start", "+", "\"", "with", "\"", "+", "this", ".", "accessRuleSet", ";", "}", "public", "String", "debugPathString", "(", ")", "{", "return", "this", ".", "binaryFolder", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,910
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ".", "LanguageSupportFactory", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SimpleLookupTable", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "import", "java", ".", "io", ".", "*", ";", "import", "java", ".", "net", ".", "URI", ";", "import", "java", ".", "util", ".", "*", ";", "public", "class", "IncrementalImageBuilder", "extends", "AbstractImageBuilder", "{", "protected", "ArrayList", "sourceFiles", ";", "protected", "ArrayList", "previousSourceFiles", ";", "protected", "StringSet", "qualifiedStrings", ";", "protected", "StringSet", "simpleStrings", ";", "protected", "StringSet", "rootStrings", ";", "protected", "SimpleLookupTable", "secondaryTypesToRemove", ";", "protected", "boolean", "hasStructuralChanges", ";", "protected", "int", "compileLoop", ";", "protected", "boolean", "makeOutputFolderConsistent", ";", "public", "static", "int", "MaxCompileLoop", "=", "5", ";", "protected", "IncrementalImageBuilder", "(", "JavaBuilder", "javaBuilder", ",", "State", "buildState", ")", "{", "super", "(", "javaBuilder", ",", "true", ",", "buildState", ")", ";", "this", ".", "nameEnvironment", ".", "isIncrementalBuild", "=", "true", ";", "this", ".", "makeOutputFolderConsistent", "=", "JavaCore", ".", "ENABLED", ".", "equals", "(", "javaBuilder", ".", "javaProject", ".", "getOption", "(", "JavaCore", ".", "CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER", ",", "true", ")", ")", ";", "}", "protected", "IncrementalImageBuilder", "(", "JavaBuilder", "javaBuilder", ")", "{", "this", "(", "javaBuilder", ",", "null", ")", ";", "this", ".", "newState", ".", "copyFrom", "(", "javaBuilder", ".", "lastState", ")", ";", "}", "protected", "IncrementalImageBuilder", "(", "BatchImageBuilder", "batchBuilder", ")", "{", "this", "(", "batchBuilder", ".", "javaBuilder", ",", "batchBuilder", ".", "newState", ")", ";", "resetCollections", "(", ")", ";", "}", "public", "boolean", "build", "(", "SimpleLookupTable", "deltas", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "try", "{", "resetCollections", "(", ")", ";", "this", ".", "notifier", ".", "subTask", "(", "Messages", ".", "build_analyzingDeltas", ")", ";", "if", "(", "this", ".", "javaBuilder", ".", "hasBuildpathErrors", "(", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "this", ".", "javaBuilder", ".", "currentProject", ".", "deleteMarkers", "(", "IJavaModelMarker", ".", "JAVA_MODEL_PROBLEM_MARKER", ",", "false", ",", "IResource", ".", "DEPTH_ZERO", ")", ";", "addAllSourceFiles", "(", "this", ".", "sourceFiles", ")", ";", "this", ".", "notifier", ".", "updateProgressDelta", "(", "0.25f", ")", ";", "}", "else", "{", "IResourceDelta", "sourceDelta", "=", "(", "IResourceDelta", ")", "deltas", ".", "get", "(", "this", ".", "javaBuilder", ".", "currentProject", ")", ";", "if", "(", "sourceDelta", "!=", "null", ")", "if", "(", "!", "findSourceFiles", "(", "sourceDelta", ")", ")", "return", "false", ";", "this", ".", "notifier", ".", "updateProgressDelta", "(", "0.10f", ")", ";", "Object", "[", "]", "keyTable", "=", "deltas", ".", "keyTable", ";", "Object", "[", "]", "valueTable", "=", "deltas", ".", "valueTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "valueTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "IResourceDelta", "delta", "=", "(", "IResourceDelta", ")", "valueTable", "[", "i", "]", ";", "if", "(", "delta", "!=", "null", ")", "{", "IProject", "p", "=", "(", "IProject", ")", "keyTable", "[", "i", "]", ";", "ClasspathLocation", "[", "]", "classFoldersAndJars", "=", "(", "ClasspathLocation", "[", "]", ")", "this", ".", "javaBuilder", ".", "binaryLocationsPerProject", ".", "get", "(", "p", ")", ";", "if", "(", "classFoldersAndJars", "!=", "null", ")", "if", "(", "!", "findAffectedSourceFiles", "(", "delta", ",", "classFoldersAndJars", ",", "p", ")", ")", "return", "false", ";", "}", "}", "this", ".", "notifier", ".", "updateProgressDelta", "(", "0.10f", ")", ";", "this", ".", "notifier", ".", "subTask", "(", "Messages", ".", "build_analyzingSources", ")", ";", "addAffectedSourceFiles", "(", ")", ";", "this", ".", "notifier", ".", "updateProgressDelta", "(", "0.05f", ")", ";", "}", "this", ".", "compileLoop", "=", "0", ";", "float", "increment", "=", "0.40f", ";", "while", "(", "this", ".", "sourceFiles", ".", "size", "(", ")", ">", "0", ")", "{", "if", "(", "++", "this", ".", "compileLoop", ">", "MaxCompileLoop", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "return", "false", ";", "}", "this", ".", "notifier", ".", "checkCancel", "(", ")", ";", "SourceFile", "[", "]", "allSourceFiles", "=", "new", "SourceFile", "[", "this", ".", "sourceFiles", ".", "size", "(", ")", "]", ";", "this", ".", "sourceFiles", ".", "toArray", "(", "allSourceFiles", ")", ";", "resetCollections", "(", ")", ";", "this", ".", "workQueue", ".", "addAll", "(", "allSourceFiles", ")", ";", "this", ".", "notifier", ".", "setProgressPerCompilationUnit", "(", "increment", "/", "allSourceFiles", ".", "length", ")", ";", "increment", "=", "increment", "/", "2", ";", "compile", "(", "allSourceFiles", ")", ";", "removeSecondaryTypes", "(", ")", ";", "addAffectedSourceFiles", "(", ")", ";", "}", "if", "(", "this", ".", "hasStructuralChanges", "&&", "this", ".", "javaBuilder", ".", "javaProject", ".", "hasCycleMarker", "(", ")", ")", "this", ".", "javaBuilder", ".", "mustPropagateStructuralChanges", "(", ")", ";", "}", "catch", "(", "AbortIncrementalBuildException", "e", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "e", ".", "qualifiedTypeName", "+", "\"\"", ")", ";", "return", "false", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "internalException", "(", "e", ")", ";", "}", "finally", "{", "cleanUp", "(", ")", ";", "}", "return", "true", ";", "}", "protected", "void", "buildAfterBatchBuild", "(", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "new", "Date", "(", "System", ".", "currentTimeMillis", "(", ")", ")", ")", ";", "try", "{", "addAffectedSourceFiles", "(", ")", ";", "while", "(", "this", ".", "sourceFiles", ".", "size", "(", ")", ">", "0", ")", "{", "this", ".", "notifier", ".", "checkCancel", "(", ")", ";", "SourceFile", "[", "]", "allSourceFiles", "=", "new", "SourceFile", "[", "this", ".", "sourceFiles", ".", "size", "(", ")", "]", ";", "this", ".", "sourceFiles", ".", "toArray", "(", "allSourceFiles", ")", ";", "resetCollections", "(", ")", ";", "this", ".", "notifier", ".", "setProgressPerCompilationUnit", "(", "0.08f", "/", "allSourceFiles", ".", "length", ")", ";", "this", ".", "workQueue", ".", "addAll", "(", "allSourceFiles", ")", ";", "compile", "(", "allSourceFiles", ")", ";", "removeSecondaryTypes", "(", ")", ";", "addAffectedSourceFiles", "(", ")", ";", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "internalException", "(", "e", ")", ";", "}", "finally", "{", "cleanUp", "(", ")", ";", "}", "}", "protected", "void", "addAffectedSourceFiles", "(", ")", "{", "if", "(", "this", ".", "qualifiedStrings", ".", "elementSize", "==", "0", "&&", "this", ".", "simpleStrings", ".", "elementSize", "==", "0", ")", "return", ";", "addAffectedSourceFiles", "(", "this", ".", "qualifiedStrings", ",", "this", ".", "simpleStrings", ",", "this", ".", "rootStrings", ",", "null", ")", ";", "}", "protected", "void", "addAffectedSourceFiles", "(", "StringSet", "qualifiedSet", ",", "StringSet", "simpleSet", ",", "StringSet", "rootSet", ",", "StringSet", "affectedTypes", ")", "{", "char", "[", "]", "[", "]", "[", "]", "internedQualifiedNames", "=", "ReferenceCollection", ".", "internQualifiedNames", "(", "qualifiedSet", ")", ";", "if", "(", "internedQualifiedNames", ".", "length", "<", "qualifiedSet", ".", "elementSize", ")", "internedQualifiedNames", "=", "null", ";", "char", "[", "]", "[", "]", "internedSimpleNames", "=", "ReferenceCollection", ".", "internSimpleNames", "(", "simpleSet", ",", "true", ")", ";", "if", "(", "internedSimpleNames", ".", "length", "<", "simpleSet", ".", "elementSize", ")", "internedSimpleNames", "=", "null", ";", "char", "[", "]", "[", "]", "internedRootNames", "=", "ReferenceCollection", ".", "internSimpleNames", "(", "rootSet", ",", "false", ")", ";", "Object", "[", "]", "keyTable", "=", "this", ".", "newState", ".", "references", ".", "keyTable", ";", "Object", "[", "]", "valueTable", "=", "this", ".", "newState", ".", "references", ".", "valueTable", ";", "next", ":", "for", "(", "int", "i", "=", "0", ",", "l", "=", "valueTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "String", "typeLocator", "=", "(", "String", ")", "keyTable", "[", "i", "]", ";", "if", "(", "typeLocator", "!=", "null", ")", "{", "if", "(", "affectedTypes", "!=", "null", "&&", "!", "affectedTypes", ".", "includes", "(", "typeLocator", ")", ")", "continue", "next", ";", "ReferenceCollection", "refs", "=", "(", "ReferenceCollection", ")", "valueTable", "[", "i", "]", ";", "if", "(", "refs", ".", "includes", "(", "internedQualifiedNames", ",", "internedSimpleNames", ",", "internedRootNames", ")", ")", "{", "IFile", "file", "=", "this", ".", "javaBuilder", ".", "currentProject", ".", "getFile", "(", "typeLocator", ")", ";", "SourceFile", "sourceFile", "=", "findSourceFile", "(", "file", ",", "true", ")", ";", "if", "(", "sourceFile", "==", "null", ")", "continue", "next", ";", "if", "(", "this", ".", "sourceFiles", ".", "contains", "(", "sourceFile", ")", ")", "continue", "next", ";", "if", "(", "this", ".", "compiledAllAtOnce", "&&", "this", ".", "previousSourceFiles", "!=", "null", "&&", "this", ".", "previousSourceFiles", ".", "contains", "(", "sourceFile", ")", ")", "continue", "next", ";", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typeLocator", ")", ";", "this", ".", "sourceFiles", ".", "add", "(", "sourceFile", ")", ";", "}", "}", "}", "}", "protected", "void", "addDependentsOf", "(", "IPath", "path", ",", "boolean", "isStructuralChange", ")", "{", "addDependentsOf", "(", "path", ",", "isStructuralChange", ",", "this", ".", "qualifiedStrings", ",", "this", ".", "simpleStrings", ",", "this", ".", "rootStrings", ")", ";", "}", "protected", "void", "addDependentsOf", "(", "IPath", "path", ",", "boolean", "isStructuralChange", ",", "StringSet", "qualifiedNames", ",", "StringSet", "simpleNames", ",", "StringSet", "rootNames", ")", "{", "path", "=", "path", ".", "setDevice", "(", "null", ")", ";", "if", "(", "isStructuralChange", ")", "{", "String", "last", "=", "path", ".", "lastSegment", "(", ")", ";", "if", "(", "last", ".", "length", "(", ")", "==", "TypeConstants", ".", "PACKAGE_INFO_NAME", ".", "length", ")", "if", "(", "CharOperation", ".", "equals", "(", "last", ".", "toCharArray", "(", ")", ",", "TypeConstants", ".", "PACKAGE_INFO_NAME", ")", ")", "{", "path", "=", "path", ".", "removeLastSegments", "(", "1", ")", ";", "if", "(", "path", ".", "isEmpty", "(", ")", ")", "return", ";", "}", "}", "if", "(", "isStructuralChange", "&&", "!", "this", ".", "hasStructuralChanges", ")", "{", "this", ".", "newState", ".", "tagAsStructurallyChanged", "(", ")", ";", "this", ".", "hasStructuralChanges", "=", "true", ";", "}", "rootNames", ".", "add", "(", "path", ".", "segment", "(", "0", ")", ")", ";", "String", "packageName", "=", "path", ".", "removeLastSegments", "(", "1", ")", ".", "toString", "(", ")", ";", "boolean", "wasNew", "=", "qualifiedNames", ".", "add", "(", "packageName", ")", ";", "String", "typeName", "=", "path", ".", "lastSegment", "(", ")", ";", "int", "memberIndex", "=", "typeName", ".", "indexOf", "(", "'$'", ")", ";", "if", "(", "memberIndex", ">", "0", ")", "typeName", "=", "typeName", ".", "substring", "(", "0", ",", "memberIndex", ")", ";", "wasNew", "=", "simpleNames", ".", "add", "(", "typeName", ")", "|", "wasNew", ";", "if", "(", "wasNew", "&&", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typeName", "+", "\"", "in", "\"", "+", "packageName", ")", ";", "}", "protected", "boolean", "checkForClassFileChanges", "(", "IResourceDelta", "binaryDelta", ",", "ClasspathMultiDirectory", "md", ",", "int", "segmentCount", ")", "throws", "CoreException", "{", "IResource", "resource", "=", "binaryDelta", ".", "getResource", "(", ")", ";", "boolean", "isExcluded", "=", "(", "md", ".", "exclusionPatterns", "!=", "null", "||", "md", ".", "inclusionPatterns", "!=", "null", ")", "&&", "Util", ".", "isExcluded", "(", "resource", ",", "md", ".", "inclusionPatterns", ",", "md", ".", "exclusionPatterns", ")", ";", "switch", "(", "resource", ".", "getType", "(", ")", ")", "{", "case", "IResource", ".", "FOLDER", ":", "if", "(", "isExcluded", "&&", "md", ".", "inclusionPatterns", "==", "null", ")", "return", "true", ";", "IResourceDelta", "[", "]", "children", "=", "binaryDelta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "children", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "!", "checkForClassFileChanges", "(", "children", "[", "i", "]", ",", "md", ",", "segmentCount", ")", ")", "return", "false", ";", "return", "true", ";", "case", "IResource", ".", "FILE", ":", "if", "(", "!", "isExcluded", "&&", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "isClassFileName", "(", "resource", ".", "getName", "(", ")", ")", ")", "{", "IPath", "typePath", "=", "resource", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "segmentCount", ")", ".", "removeFileExtension", "(", ")", ";", "if", "(", "this", ".", "newState", ".", "isKnownType", "(", "typePath", ".", "toString", "(", ")", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typePath", ")", ";", "return", "false", ";", "}", "return", "true", ";", "}", "}", "return", "true", ";", "}", "protected", "void", "cleanUp", "(", ")", "{", "super", ".", "cleanUp", "(", ")", ";", "this", ".", "sourceFiles", "=", "null", ";", "this", ".", "previousSourceFiles", "=", "null", ";", "this", ".", "qualifiedStrings", "=", "null", ";", "this", ".", "simpleStrings", "=", "null", ";", "this", ".", "rootStrings", "=", "null", ";", "this", ".", "secondaryTypesToRemove", "=", "null", ";", "this", ".", "hasStructuralChanges", "=", "false", ";", "this", ".", "compileLoop", "=", "0", ";", "}", "protected", "void", "compile", "(", "SourceFile", "[", "]", "units", ",", "SourceFile", "[", "]", "additionalUnits", ",", "boolean", "compilingFirstGroup", ")", "{", "if", "(", "compilingFirstGroup", "&&", "additionalUnits", "!=", "null", ")", "{", "ArrayList", "extras", "=", "null", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "additionalUnits", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "SourceFile", "unit", "=", "additionalUnits", "[", "i", "]", ";", "if", "(", "unit", "!=", "null", "&&", "this", ".", "newState", ".", "getDefinedTypeNamesFor", "(", "unit", ".", "typeLocator", "(", ")", ")", "!=", "null", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "unit", ".", "typeLocator", "(", ")", ")", ";", "if", "(", "extras", "==", "null", ")", "extras", "=", "new", "ArrayList", "(", "3", ")", ";", "extras", ".", "add", "(", "unit", ")", ";", "}", "}", "if", "(", "extras", "!=", "null", ")", "{", "int", "oldLength", "=", "units", ".", "length", ";", "int", "toAdd", "=", "extras", ".", "size", "(", ")", ";", "System", ".", "arraycopy", "(", "units", ",", "0", ",", "units", "=", "new", "SourceFile", "[", "oldLength", "+", "toAdd", "]", ",", "0", ",", "oldLength", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "toAdd", ";", "i", "++", ")", "units", "[", "oldLength", "++", "]", "=", "(", "SourceFile", ")", "extras", ".", "get", "(", "i", ")", ";", "}", "}", "super", ".", "compile", "(", "units", ",", "additionalUnits", ",", "compilingFirstGroup", ")", ";", "}", "protected", "void", "deleteGeneratedFiles", "(", "IFile", "[", "]", "deletedGeneratedFiles", ")", "{", "try", "{", "for", "(", "int", "j", "=", "deletedGeneratedFiles", ".", "length", ";", "--", "j", ">=", "0", ";", ")", "{", "IFile", "deletedFile", "=", "deletedGeneratedFiles", "[", "j", "]", ";", "if", "(", "deletedFile", ".", "exists", "(", ")", ")", "continue", ";", "SourceFile", "sourceFile", "=", "findSourceFile", "(", "deletedFile", ",", "false", ")", ";", "String", "typeLocator", "=", "sourceFile", ".", "typeLocator", "(", ")", ";", "int", "mdSegmentCount", "=", "sourceFile", ".", "sourceLocation", ".", "sourceFolder", ".", "getFullPath", "(", ")", ".", "segmentCount", "(", ")", ";", "IPath", "typePath", "=", "sourceFile", ".", "resource", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "mdSegmentCount", ")", ".", "removeFileExtension", "(", ")", ";", "addDependentsOf", "(", "typePath", ",", "true", ")", ";", "this", ".", "previousSourceFiles", "=", "null", ";", "char", "[", "]", "[", "]", "definedTypeNames", "=", "this", ".", "newState", ".", "getDefinedTypeNamesFor", "(", "typeLocator", ")", ";", "if", "(", "definedTypeNames", "==", "null", ")", "{", "removeClassFile", "(", "typePath", ",", "sourceFile", ".", "sourceLocation", ".", "binaryFolder", ")", ";", "}", "else", "{", "if", "(", "definedTypeNames", ".", "length", ">", "0", ")", "{", "IPath", "packagePath", "=", "typePath", ".", "removeLastSegments", "(", "1", ")", ";", "for", "(", "int", "d", "=", "0", ",", "l", "=", "definedTypeNames", ".", "length", ";", "d", "<", "l", ";", "d", "++", ")", "removeClassFile", "(", "packagePath", ".", "append", "(", "new", "String", "(", "definedTypeNames", "[", "d", "]", ")", ")", ",", "sourceFile", ".", "sourceLocation", ".", "binaryFolder", ")", ";", "}", "}", "this", ".", "newState", ".", "removeLocator", "(", "typeLocator", ")", ";", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "}", "}", "protected", "boolean", "findAffectedSourceFiles", "(", "IResourceDelta", "delta", ",", "ClasspathLocation", "[", "]", "classFoldersAndJars", ",", "IProject", "prereqProject", ")", "{", "for", "(", "int", "i", "=", "0", ",", "l", "=", "classFoldersAndJars", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "ClasspathLocation", "bLocation", "=", "classFoldersAndJars", "[", "i", "]", ";", "if", "(", "bLocation", "!=", "null", ")", "{", "IPath", "p", "=", "bLocation", ".", "getProjectRelativePath", "(", ")", ";", "if", "(", "p", "!=", "null", ")", "{", "IResourceDelta", "binaryDelta", "=", "delta", ".", "findMember", "(", "p", ")", ";", "if", "(", "binaryDelta", "!=", "null", ")", "{", "if", "(", "bLocation", "instanceof", "ClasspathJar", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "return", "false", ";", "}", "if", "(", "binaryDelta", ".", "getKind", "(", ")", "==", "IResourceDelta", ".", "ADDED", "||", "binaryDelta", ".", "getKind", "(", ")", "==", "IResourceDelta", ".", "REMOVED", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "return", "false", ";", "}", "int", "segmentCount", "=", "binaryDelta", ".", "getFullPath", "(", ")", ".", "segmentCount", "(", ")", ";", "IResourceDelta", "[", "]", "children", "=", "binaryDelta", ".", "getAffectedChildren", "(", ")", ";", "StringSet", "structurallyChangedTypes", "=", "null", ";", "if", "(", "bLocation", ".", "isOutputFolder", "(", ")", ")", "structurallyChangedTypes", "=", "this", ".", "newState", ".", "getStructurallyChangedTypes", "(", "this", ".", "javaBuilder", ".", "getLastState", "(", "prereqProject", ")", ")", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "children", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "findAffectedSourceFiles", "(", "children", "[", "j", "]", ",", "segmentCount", ",", "structurallyChangedTypes", ")", ";", "this", ".", "notifier", ".", "checkCancel", "(", ")", ";", "}", "}", "}", "}", "return", "true", ";", "}", "protected", "void", "findAffectedSourceFiles", "(", "IResourceDelta", "binaryDelta", ",", "int", "segmentCount", ",", "StringSet", "structurallyChangedTypes", ")", "{", "IResource", "resource", "=", "binaryDelta", ".", "getResource", "(", ")", ";", "switch", "(", "resource", ".", "getType", "(", ")", ")", "{", "case", "IResource", ".", "FOLDER", ":", "switch", "(", "binaryDelta", ".", "getKind", "(", ")", ")", "{", "case", "IResourceDelta", ".", "ADDED", ":", "case", "IResourceDelta", ".", "REMOVED", ":", "IPath", "packagePath", "=", "resource", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "segmentCount", ")", ";", "String", "packageName", "=", "packagePath", ".", "toString", "(", ")", ";", "if", "(", "binaryDelta", ".", "getKind", "(", ")", "==", "IResourceDelta", ".", "ADDED", ")", "{", "if", "(", "!", "this", ".", "newState", ".", "isKnownPackage", "(", "packageName", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "packageName", ")", ";", "addDependentsOf", "(", "packagePath", ",", "false", ")", ";", "return", ";", "}", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "packageName", ")", ";", "}", "else", "{", "if", "(", "!", "this", ".", "nameEnvironment", ".", "isPackage", "(", "packageName", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "packageName", ")", ";", "addDependentsOf", "(", "packagePath", ",", "false", ")", ";", "return", ";", "}", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "packageName", ")", ";", "}", "case", "IResourceDelta", ".", "CHANGED", ":", "IResourceDelta", "[", "]", "children", "=", "binaryDelta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "children", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "findAffectedSourceFiles", "(", "children", "[", "i", "]", ",", "segmentCount", ",", "structurallyChangedTypes", ")", ";", "}", "return", ";", "case", "IResource", ".", "FILE", ":", "if", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "isClassFileName", "(", "resource", ".", "getName", "(", ")", ")", ")", "{", "IPath", "typePath", "=", "resource", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "segmentCount", ")", ".", "removeFileExtension", "(", ")", ";", "switch", "(", "binaryDelta", ".", "getKind", "(", ")", ")", "{", "case", "IResourceDelta", ".", "ADDED", ":", "case", "IResourceDelta", ".", "REMOVED", ":", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typePath", ")", ";", "addDependentsOf", "(", "typePath", ",", "false", ")", ";", "return", ";", "case", "IResourceDelta", ".", "CHANGED", ":", "if", "(", "(", "binaryDelta", ".", "getFlags", "(", ")", "&", "IResourceDelta", ".", "CONTENT", ")", "==", "0", ")", "return", ";", "if", "(", "structurallyChangedTypes", "!=", "null", "&&", "!", "structurallyChangedTypes", ".", "includes", "(", "typePath", ".", "toString", "(", ")", ")", ")", "return", ";", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typePath", ")", ";", "addDependentsOf", "(", "typePath", ",", "false", ")", ";", "}", "return", ";", "}", "}", "}", "protected", "boolean", "findSourceFiles", "(", "IResourceDelta", "delta", ")", "throws", "CoreException", "{", "ArrayList", "visited", "=", "this", ".", "makeOutputFolderConsistent", "?", "new", "ArrayList", "(", "this", ".", "sourceLocations", ".", "length", ")", ":", "null", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "sourceLocations", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "ClasspathMultiDirectory", "md", "=", "this", ".", "sourceLocations", "[", "i", "]", ";", "if", "(", "this", ".", "makeOutputFolderConsistent", "&&", "md", ".", "hasIndependentOutputFolder", "&&", "!", "visited", ".", "contains", "(", "md", ".", "binaryFolder", ")", ")", "{", "visited", ".", "add", "(", "md", ".", "binaryFolder", ")", ";", "IResourceDelta", "binaryDelta", "=", "delta", ".", "findMember", "(", "md", ".", "binaryFolder", ".", "getProjectRelativePath", "(", ")", ")", ";", "if", "(", "binaryDelta", "!=", "null", ")", "{", "int", "segmentCount", "=", "binaryDelta", ".", "getFullPath", "(", ")", ".", "segmentCount", "(", ")", ";", "IResourceDelta", "[", "]", "children", "=", "binaryDelta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "children", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "if", "(", "!", "checkForClassFileChanges", "(", "children", "[", "j", "]", ",", "md", ",", "segmentCount", ")", ")", "return", "false", ";", "}", "}", "if", "(", "md", ".", "sourceFolder", ".", "equals", "(", "this", ".", "javaBuilder", ".", "currentProject", ")", ")", "{", "int", "segmentCount", "=", "delta", ".", "getFullPath", "(", ")", ".", "segmentCount", "(", ")", ";", "IResourceDelta", "[", "]", "children", "=", "delta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "children", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "if", "(", "!", "isExcludedFromProject", "(", "children", "[", "j", "]", ".", "getFullPath", "(", ")", ")", ")", "if", "(", "!", "findSourceFiles", "(", "children", "[", "j", "]", ",", "md", ",", "segmentCount", ")", ")", "return", "false", ";", "}", "else", "{", "IResourceDelta", "sourceDelta", "=", "delta", ".", "findMember", "(", "md", ".", "sourceFolder", ".", "getProjectRelativePath", "(", ")", ")", ";", "if", "(", "sourceDelta", "!=", "null", ")", "{", "if", "(", "sourceDelta", ".", "getKind", "(", ")", "==", "IResourceDelta", ".", "REMOVED", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "return", "false", ";", "}", "int", "segmentCount", "=", "sourceDelta", ".", "getFullPath", "(", ")", ".", "segmentCount", "(", ")", ";", "IResourceDelta", "[", "]", "children", "=", "sourceDelta", ".", "getAffectedChildren", "(", ")", ";", "try", "{", "for", "(", "int", "j", "=", "0", ",", "m", "=", "children", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "if", "(", "!", "findSourceFiles", "(", "children", "[", "j", "]", ",", "md", ",", "segmentCount", ")", ")", "return", "false", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "e", ".", "getStatus", "(", ")", ".", "getCode", "(", ")", "==", "IResourceStatus", ".", "CASE_VARIANT_EXISTS", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", ")", ";", "return", "false", ";", "}", "throw", "e", ";", "}", "}", "}", "this", ".", "notifier", ".", "checkCancel", "(", ")", ";", "}", "return", "true", ";", "}", "protected", "boolean", "findSourceFiles", "(", "IResourceDelta", "sourceDelta", ",", "ClasspathMultiDirectory", "md", ",", "int", "segmentCount", ")", "throws", "CoreException", "{", "IResource", "resource", "=", "sourceDelta", ".", "getResource", "(", ")", ";", "boolean", "isExcluded", "=", "(", "md", ".", "exclusionPatterns", "!=", "null", "||", "md", ".", "inclusionPatterns", "!=", "null", ")", "&&", "Util", ".", "isExcluded", "(", "resource", ",", "md", ".", "inclusionPatterns", ",", "md", ".", "exclusionPatterns", ")", ";", "switch", "(", "resource", ".", "getType", "(", ")", ")", "{", "case", "IResource", ".", "FOLDER", ":", "if", "(", "isExcluded", "&&", "md", ".", "inclusionPatterns", "==", "null", ")", "return", "true", ";", "switch", "(", "sourceDelta", ".", "getKind", "(", ")", ")", "{", "case", "IResourceDelta", ".", "ADDED", ":", "if", "(", "!", "isExcluded", ")", "{", "IPath", "addedPackagePath", "=", "resource", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "segmentCount", ")", ";", "createFolder", "(", "addedPackagePath", ",", "md", ".", "binaryFolder", ")", ";", "if", "(", "this", ".", "sourceLocations", ".", "length", ">", "1", "&&", "this", ".", "newState", ".", "isKnownPackage", "(", "addedPackagePath", ".", "toString", "(", ")", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "addedPackagePath", ")", ";", "}", "else", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "addedPackagePath", ")", ";", "addDependentsOf", "(", "addedPackagePath", ",", "true", ")", ";", "}", "}", "case", "IResourceDelta", ".", "CHANGED", ":", "IResourceDelta", "[", "]", "children", "=", "sourceDelta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "children", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "!", "findSourceFiles", "(", "children", "[", "i", "]", ",", "md", ",", "segmentCount", ")", ")", "return", "false", ";", "return", "true", ";", "case", "IResourceDelta", ".", "REMOVED", ":", "if", "(", "isExcluded", ")", "{", "children", "=", "sourceDelta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "children", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "!", "findSourceFiles", "(", "children", "[", "i", "]", ",", "md", ",", "segmentCount", ")", ")", "return", "false", ";", "return", "true", ";", "}", "IPath", "removedPackagePath", "=", "resource", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "segmentCount", ")", ";", "if", "(", "this", ".", "sourceLocations", ".", "length", ">", "1", ")", "{", "for", "(", "int", "i", "=", "0", ",", "l", "=", "this", ".", "sourceLocations", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "if", "(", "this", ".", "sourceLocations", "[", "i", "]", ".", "sourceFolder", ".", "getFolder", "(", "removedPackagePath", ")", ".", "exists", "(", ")", ")", "{", "createFolder", "(", "removedPackagePath", ",", "md", ".", "binaryFolder", ")", ";", "IResourceDelta", "[", "]", "removedChildren", "=", "sourceDelta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "removedChildren", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "if", "(", "!", "findSourceFiles", "(", "removedChildren", "[", "j", "]", ",", "md", ",", "segmentCount", ")", ")", "return", "false", ";", "return", "true", ";", "}", "}", "}", "if", "(", "(", "sourceDelta", ".", "getFlags", "(", ")", "&", "IResourceDelta", ".", "MOVED_TO", ")", "!=", "0", ")", "{", "IResource", "movedFolder", "=", "this", ".", "javaBuilder", ".", "workspaceRoot", ".", "getFolder", "(", "sourceDelta", ".", "getMovedToPath", "(", ")", ")", ";", "JavaBuilder", ".", "removeProblemsAndTasksFor", "(", "movedFolder", ")", ";", "}", "IFolder", "removedPackageFolder", "=", "md", ".", "binaryFolder", ".", "getFolder", "(", "removedPackagePath", ")", ";", "if", "(", "removedPackageFolder", ".", "exists", "(", ")", ")", "removedPackageFolder", ".", "delete", "(", "IResource", ".", "FORCE", ",", "null", ")", ";", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "removedPackagePath", ")", ";", "addDependentsOf", "(", "removedPackagePath", ",", "true", ")", ";", "this", ".", "newState", ".", "removePackage", "(", "sourceDelta", ")", ";", "}", "return", "true", ";", "case", "IResource", ".", "FILE", ":", "if", "(", "isExcluded", ")", "return", "true", ";", "String", "resourceName", "=", "resource", ".", "getName", "(", ")", ";", "final", "boolean", "isInterestingProject", "=", "LanguageSupportFactory", ".", "isInterestingProject", "(", "this", ".", "javaBuilder", ".", "getProject", "(", ")", ")", ";", "if", "(", "(", "!", "isInterestingProject", "&&", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "isJavaLikeFileName", "(", "resourceName", ")", "&&", "!", "LanguageSupportFactory", ".", "isInterestingSourceFile", "(", "resourceName", ")", ")", "||", "(", "isInterestingProject", "&&", "LanguageSupportFactory", ".", "isSourceFile", "(", "resourceName", ",", "isInterestingProject", ")", ")", ")", "{", "IPath", "typePath", "=", "resource", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "segmentCount", ")", ".", "removeFileExtension", "(", ")", ";", "String", "typeLocator", "=", "resource", ".", "getProjectRelativePath", "(", ")", ".", "toString", "(", ")", ";", "switch", "(", "sourceDelta", ".", "getKind", "(", ")", ")", "{", "case", "IResourceDelta", ".", "ADDED", ":", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typeLocator", ")", ";", "this", ".", "sourceFiles", ".", "add", "(", "new", "SourceFile", "(", "(", "IFile", ")", "resource", ",", "md", ",", "true", ")", ")", ";", "String", "typeName", "=", "typePath", ".", "toString", "(", ")", ";", "if", "(", "!", "this", ".", "newState", ".", "isDuplicateLocator", "(", "typeName", ",", "typeLocator", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typeName", ")", ";", "addDependentsOf", "(", "typePath", ",", "true", ")", ";", "}", "return", "true", ";", "case", "IResourceDelta", ".", "REMOVED", ":", "char", "[", "]", "[", "]", "definedTypeNames", "=", "this", ".", "newState", ".", "getDefinedTypeNamesFor", "(", "typeLocator", ")", ";", "if", "(", "definedTypeNames", "==", "null", ")", "{", "removeClassFile", "(", "typePath", ",", "md", ".", "binaryFolder", ")", ";", "if", "(", "(", "sourceDelta", ".", "getFlags", "(", ")", "&", "IResourceDelta", ".", "MOVED_TO", ")", "!=", "0", ")", "{", "IResource", "movedFile", "=", "this", ".", "javaBuilder", ".", "workspaceRoot", ".", "getFile", "(", "sourceDelta", ".", "getMovedToPath", "(", ")", ")", ";", "JavaBuilder", ".", "removeProblemsAndTasksFor", "(", "movedFile", ")", ";", "}", "}", "else", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typePath", ".", "toString", "(", ")", ")", ";", "addDependentsOf", "(", "typePath", ",", "true", ")", ";", "if", "(", "definedTypeNames", ".", "length", ">", "0", ")", "{", "IPath", "packagePath", "=", "typePath", ".", "removeLastSegments", "(", "1", ")", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "definedTypeNames", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "removeClassFile", "(", "packagePath", ".", "append", "(", "new", "String", "(", "definedTypeNames", "[", "i", "]", ")", ")", ",", "md", ".", "binaryFolder", ")", ";", "}", "}", "this", ".", "newState", ".", "removeLocator", "(", "typeLocator", ")", ";", "return", "true", ";", "case", "IResourceDelta", ".", "CHANGED", ":", "if", "(", "(", "sourceDelta", ".", "getFlags", "(", ")", "&", "IResourceDelta", ".", "CONTENT", ")", "==", "0", "&&", "(", "sourceDelta", ".", "getFlags", "(", ")", "&", "IResourceDelta", ".", "ENCODING", ")", "==", "0", ")", "return", "true", ";", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typeLocator", ")", ";", "this", ".", "sourceFiles", ".", "add", "(", "new", "SourceFile", "(", "(", "IFile", ")", "resource", ",", "md", ",", "true", ")", ")", ";", "}", "return", "true", ";", "}", "else", "if", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "isClassFileName", "(", "resourceName", ")", ")", "{", "if", "(", "this", ".", "makeOutputFolderConsistent", ")", "{", "IPath", "typePath", "=", "resource", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "segmentCount", ")", ".", "removeFileExtension", "(", ")", ";", "if", "(", "this", ".", "newState", ".", "isKnownType", "(", "typePath", ".", "toString", "(", ")", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typePath", ")", ";", "return", "false", ";", "}", "}", "return", "true", ";", "}", "else", "if", "(", "md", ".", "hasIndependentOutputFolder", ")", "{", "if", "(", "this", ".", "javaBuilder", ".", "filterExtraResource", "(", "resource", ")", ")", "return", "true", ";", "IPath", "resourcePath", "=", "resource", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "segmentCount", ")", ";", "IResource", "outputFile", "=", "md", ".", "binaryFolder", ".", "getFile", "(", "resourcePath", ")", ";", "switch", "(", "sourceDelta", ".", "getKind", "(", ")", ")", "{", "case", "IResourceDelta", ".", "ADDED", ":", "if", "(", "outputFile", ".", "exists", "(", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "resourcePath", ")", ";", "outputFile", ".", "delete", "(", "IResource", ".", "FORCE", ",", "null", ")", ";", "}", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "resourcePath", ")", ";", "createFolder", "(", "resourcePath", ".", "removeLastSegments", "(", "1", ")", ",", "md", ".", "binaryFolder", ")", ";", "copyResource", "(", "resource", ",", "outputFile", ")", ";", "return", "true", ";", "case", "IResourceDelta", ".", "REMOVED", ":", "if", "(", "outputFile", ".", "exists", "(", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "resourcePath", ")", ";", "outputFile", ".", "delete", "(", "IResource", ".", "FORCE", ",", "null", ")", ";", "}", "return", "true", ";", "case", "IResourceDelta", ".", "CHANGED", ":", "if", "(", "(", "sourceDelta", ".", "getFlags", "(", ")", "&", "IResourceDelta", ".", "CONTENT", ")", "==", "0", "&&", "(", "sourceDelta", ".", "getFlags", "(", ")", "&", "IResourceDelta", ".", "ENCODING", ")", "==", "0", ")", "return", "true", ";", "if", "(", "outputFile", ".", "exists", "(", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "resourcePath", ")", ";", "outputFile", ".", "delete", "(", "IResource", ".", "FORCE", ",", "null", ")", ";", "}", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "resourcePath", ")", ";", "createFolder", "(", "resourcePath", ".", "removeLastSegments", "(", "1", ")", ",", "md", ".", "binaryFolder", ")", ";", "copyResource", "(", "resource", ",", "outputFile", ")", ";", "}", "return", "true", ";", "}", "}", "return", "true", ";", "}", "protected", "void", "finishedWith", "(", "String", "sourceLocator", ",", "CompilationResult", "result", ",", "char", "[", "]", "mainTypeName", ",", "ArrayList", "definedTypeNames", ",", "ArrayList", "duplicateTypeNames", ")", "{", "char", "[", "]", "[", "]", "previousTypeNames", "=", "this", ".", "newState", ".", "getDefinedTypeNamesFor", "(", "sourceLocator", ")", ";", "if", "(", "previousTypeNames", "==", "null", ")", "previousTypeNames", "=", "new", "char", "[", "]", "[", "]", "{", "mainTypeName", "}", ";", "IPath", "packagePath", "=", "null", ";", "next", ":", "for", "(", "int", "i", "=", "0", ",", "l", "=", "previousTypeNames", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "char", "[", "]", "previous", "=", "previousTypeNames", "[", "i", "]", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "definedTypeNames", ".", "size", "(", ")", ";", "j", "<", "m", ";", "j", "++", ")", "if", "(", "CharOperation", ".", "equals", "(", "previous", ",", "(", "char", "[", "]", ")", "definedTypeNames", ".", "get", "(", "j", ")", ")", ")", "continue", "next", ";", "SourceFile", "sourceFile", "=", "(", "SourceFile", ")", "result", ".", "getCompilationUnit", "(", ")", ";", "if", "(", "packagePath", "==", "null", ")", "{", "int", "count", "=", "sourceFile", ".", "sourceLocation", ".", "sourceFolder", ".", "getFullPath", "(", ")", ".", "segmentCount", "(", ")", ";", "packagePath", "=", "sourceFile", ".", "resource", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "count", ")", ".", "removeLastSegments", "(", "1", ")", ";", "}", "if", "(", "this", ".", "secondaryTypesToRemove", "==", "null", ")", "this", ".", "secondaryTypesToRemove", "=", "new", "SimpleLookupTable", "(", ")", ";", "ArrayList", "types", "=", "(", "ArrayList", ")", "this", ".", "secondaryTypesToRemove", ".", "get", "(", "sourceFile", ".", "sourceLocation", ".", "binaryFolder", ")", ";", "if", "(", "types", "==", "null", ")", "types", "=", "new", "ArrayList", "(", "definedTypeNames", ".", "size", "(", ")", ")", ";", "types", ".", "add", "(", "packagePath", ".", "append", "(", "new", "String", "(", "previous", ")", ")", ")", ";", "this", ".", "secondaryTypesToRemove", ".", "put", "(", "sourceFile", ".", "sourceLocation", ".", "binaryFolder", ",", "types", ")", ";", "}", "super", ".", "finishedWith", "(", "sourceLocator", ",", "result", ",", "mainTypeName", ",", "definedTypeNames", ",", "duplicateTypeNames", ")", ";", "}", "protected", "void", "processAnnotationResults", "(", "CompilationParticipantResult", "[", "]", "results", ")", "{", "for", "(", "int", "i", "=", "results", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "{", "CompilationParticipantResult", "result", "=", "results", "[", "i", "]", ";", "if", "(", "result", "==", "null", ")", "continue", ";", "IFile", "[", "]", "deletedGeneratedFiles", "=", "result", ".", "deletedFiles", ";", "if", "(", "deletedGeneratedFiles", "!=", "null", ")", "deleteGeneratedFiles", "(", "deletedGeneratedFiles", ")", ";", "IFile", "[", "]", "addedGeneratedFiles", "=", "result", ".", "addedFiles", ";", "if", "(", "addedGeneratedFiles", "!=", "null", ")", "{", "for", "(", "int", "j", "=", "addedGeneratedFiles", ".", "length", ";", "--", "j", ">=", "0", ";", ")", "{", "SourceFile", "sourceFile", "=", "findSourceFile", "(", "addedGeneratedFiles", "[", "j", "]", ",", "true", ")", ";", "if", "(", "sourceFile", "!=", "null", "&&", "!", "this", ".", "sourceFiles", ".", "contains", "(", "sourceFile", ")", ")", "this", ".", "sourceFiles", ".", "add", "(", "sourceFile", ")", ";", "}", "}", "recordParticipantResult", "(", "result", ")", ";", "}", "}", "protected", "void", "removeClassFile", "(", "IPath", "typePath", ",", "IContainer", "outputFolder", ")", "throws", "CoreException", "{", "if", "(", "typePath", ".", "lastSegment", "(", ")", ".", "indexOf", "(", "'$'", ")", "==", "-", "1", ")", "{", "this", ".", "newState", ".", "removeQualifiedTypeName", "(", "typePath", ".", "toString", "(", ")", ")", ";", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typePath", ")", ";", "addDependentsOf", "(", "typePath", ",", "true", ")", ";", "}", "IFile", "classFile", "=", "outputFolder", ".", "getFile", "(", "typePath", ".", "addFileExtension", "(", "SuffixConstants", ".", "EXTENSION_class", ")", ")", ";", "if", "(", "classFile", ".", "exists", "(", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "typePath", ")", ";", "classFile", ".", "delete", "(", "IResource", ".", "FORCE", ",", "null", ")", ";", "}", "}", "protected", "void", "removeSecondaryTypes", "(", ")", "throws", "CoreException", "{", "if", "(", "this", ".", "secondaryTypesToRemove", "!=", "null", ")", "{", "Object", "[", "]", "keyTable", "=", "this", ".", "secondaryTypesToRemove", ".", "keyTable", ";", "Object", "[", "]", "valueTable", "=", "this", ".", "secondaryTypesToRemove", ".", "valueTable", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "keyTable", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "IContainer", "outputFolder", "=", "(", "IContainer", ")", "keyTable", "[", "i", "]", ";", "if", "(", "outputFolder", "!=", "null", ")", "{", "ArrayList", "paths", "=", "(", "ArrayList", ")", "valueTable", "[", "i", "]", ";", "for", "(", "int", "j", "=", "0", ",", "m", "=", "paths", ".", "size", "(", ")", ";", "j", "<", "m", ";", "j", "++", ")", "removeClassFile", "(", "(", "IPath", ")", "paths", ".", "get", "(", "j", ")", ",", "outputFolder", ")", ";", "}", "}", "this", ".", "secondaryTypesToRemove", "=", "null", ";", "if", "(", "this", ".", "previousSourceFiles", "!=", "null", ")", "this", ".", "previousSourceFiles", "=", "null", ";", "}", "}", "protected", "void", "resetCollections", "(", ")", "{", "if", "(", "this", ".", "sourceFiles", "==", "null", ")", "{", "this", ".", "sourceFiles", "=", "new", "ArrayList", "(", "33", ")", ";", "this", ".", "previousSourceFiles", "=", "null", ";", "this", ".", "qualifiedStrings", "=", "new", "StringSet", "(", "3", ")", ";", "this", ".", "simpleStrings", "=", "new", "StringSet", "(", "3", ")", ";", "this", ".", "rootStrings", "=", "new", "StringSet", "(", "3", ")", ";", "this", ".", "hasStructuralChanges", "=", "false", ";", "this", ".", "compileLoop", "=", "0", ";", "}", "else", "{", "this", ".", "previousSourceFiles", "=", "this", ".", "sourceFiles", ".", "isEmpty", "(", ")", "?", "null", ":", "(", "ArrayList", ")", "this", ".", "sourceFiles", ".", "clone", "(", ")", ";", "this", ".", "sourceFiles", ".", "clear", "(", ")", ";", "this", ".", "qualifiedStrings", ".", "clear", "(", ")", ";", "this", ".", "simpleStrings", ".", "clear", "(", ")", ";", "this", ".", "rootStrings", ".", "clear", "(", ")", ";", "this", ".", "workQueue", ".", "clear", "(", ")", ";", "}", "}", "protected", "void", "updateProblemsFor", "(", "SourceFile", "sourceFile", ",", "CompilationResult", "result", ")", "throws", "CoreException", "{", "IMarker", "[", "]", "markers", "=", "JavaBuilder", ".", "getProblemsFor", "(", "sourceFile", ".", "resource", ")", ";", "CategorizedProblem", "[", "]", "problems", "=", "result", ".", "getProblems", "(", ")", ";", "if", "(", "problems", "==", "null", "&&", "markers", ".", "length", "==", "0", ")", "return", ";", "this", ".", "notifier", ".", "updateProblemCounts", "(", "markers", ",", "problems", ")", ";", "JavaBuilder", ".", "removeProblemsFor", "(", "sourceFile", ".", "resource", ")", ";", "storeProblemsFor", "(", "sourceFile", ",", "problems", ")", ";", "}", "protected", "void", "updateTasksFor", "(", "SourceFile", "sourceFile", ",", "CompilationResult", "result", ")", "throws", "CoreException", "{", "IMarker", "[", "]", "markers", "=", "JavaBuilder", ".", "getTasksFor", "(", "sourceFile", ".", "resource", ")", ";", "CategorizedProblem", "[", "]", "tasks", "=", "result", ".", "getTasks", "(", ")", ";", "if", "(", "tasks", "==", "null", "&&", "markers", ".", "length", "==", "0", ")", "return", ";", "JavaBuilder", ".", "removeTasksFor", "(", "sourceFile", ".", "resource", ")", ";", "storeTasksFor", "(", "sourceFile", ",", "tasks", ")", ";", "}", "protected", "void", "writeClassFileContents", "(", "ClassFile", "classfile", ",", "IFile", "file", ",", "String", "qualifiedFileName", ",", "boolean", "isTopLevelType", ",", "SourceFile", "compilationUnit", ")", "throws", "CoreException", "{", "byte", "[", "]", "bytes", "=", "classfile", ".", "getBytes", "(", ")", ";", "if", "(", "file", ".", "exists", "(", ")", ")", "{", "if", "(", "writeClassFileCheck", "(", "file", ",", "qualifiedFileName", ",", "bytes", ")", "||", "compilationUnit", ".", "updateClassFile", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "file", ".", "getName", "(", ")", ")", ";", "if", "(", "!", "file", ".", "isDerived", "(", ")", ")", "file", ".", "setDerived", "(", "true", ",", "null", ")", ";", "file", ".", "setContents", "(", "new", "ByteArrayInputStream", "(", "bytes", ")", ",", "true", ",", "false", ",", "null", ")", ";", "}", "else", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "file", ".", "getName", "(", ")", ")", ";", "}", "}", "else", "{", "if", "(", "isTopLevelType", ")", "addDependentsOf", "(", "new", "Path", "(", "qualifiedFileName", ")", ",", "true", ")", ";", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "file", ".", "getName", "(", ")", ")", ";", "try", "{", "file", ".", "create", "(", "new", "ByteArrayInputStream", "(", "bytes", ")", ",", "IResource", ".", "FORCE", "|", "IResource", ".", "DERIVED", ",", "null", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "e", ".", "getStatus", "(", ")", ".", "getCode", "(", ")", "==", "IResourceStatus", ".", "CASE_VARIANT_EXISTS", ")", "{", "IStatus", "status", "=", "e", ".", "getStatus", "(", ")", ";", "if", "(", "status", "instanceof", "IResourceStatus", ")", "{", "IPath", "oldFilePath", "=", "(", "(", "IResourceStatus", ")", "status", ")", ".", "getPath", "(", ")", ";", "char", "[", "]", "oldTypeName", "=", "oldFilePath", ".", "removeFileExtension", "(", ")", ".", "lastSegment", "(", ")", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "[", "]", "previousTypeNames", "=", "this", ".", "newState", ".", "getDefinedTypeNamesFor", "(", "compilationUnit", ".", "typeLocator", "(", ")", ")", ";", "boolean", "fromSameFile", "=", "false", ";", "if", "(", "previousTypeNames", "==", "null", ")", "{", "fromSameFile", "=", "CharOperation", ".", "equals", "(", "compilationUnit", ".", "getMainTypeName", "(", ")", ",", "oldTypeName", ")", ";", "}", "else", "{", "for", "(", "int", "i", "=", "0", ",", "l", "=", "previousTypeNames", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "if", "(", "CharOperation", ".", "equals", "(", "previousTypeNames", "[", "i", "]", ",", "oldTypeName", ")", ")", "{", "fromSameFile", "=", "true", ";", "break", ";", "}", "}", "}", "if", "(", "fromSameFile", ")", "{", "IFile", "collision", "=", "file", ".", "getParent", "(", ")", ".", "getFile", "(", "new", "Path", "(", "oldFilePath", ".", "lastSegment", "(", ")", ")", ")", ";", "collision", ".", "delete", "(", "true", ",", "false", ",", "null", ")", ";", "boolean", "success", "=", "false", ";", "try", "{", "file", ".", "create", "(", "new", "ByteArrayInputStream", "(", "bytes", ")", ",", "IResource", ".", "FORCE", "|", "IResource", ".", "DERIVED", ",", "null", ")", ";", "success", "=", "true", ";", "}", "catch", "(", "CoreException", "ignored", ")", "{", "}", "if", "(", "success", ")", "return", ";", "}", "}", "throw", "new", "AbortCompilation", "(", "true", ",", "new", "AbortIncrementalBuildException", "(", "qualifiedFileName", ")", ")", ";", "}", "throw", "e", ";", "}", "}", "}", "protected", "boolean", "writeClassFileCheck", "(", "IFile", "file", ",", "String", "fileName", ",", "byte", "[", "]", "newBytes", ")", "throws", "CoreException", "{", "try", "{", "byte", "[", "]", "oldBytes", "=", "Util", ".", "getResourceContentsAsByteArray", "(", "file", ")", ";", "notEqual", ":", "if", "(", "newBytes", ".", "length", "==", "oldBytes", ".", "length", ")", "{", "for", "(", "int", "i", "=", "newBytes", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "if", "(", "newBytes", "[", "i", "]", "!=", "oldBytes", "[", "i", "]", ")", "break", "notEqual", ";", "return", "false", ";", "}", "URI", "location", "=", "file", ".", "getLocationURI", "(", ")", ";", "if", "(", "location", "==", "null", ")", "return", "false", ";", "String", "filePath", "=", "location", ".", "getSchemeSpecificPart", "(", ")", ";", "ClassFileReader", "reader", "=", "new", "ClassFileReader", "(", "oldBytes", ",", "filePath", ".", "toCharArray", "(", ")", ")", ";", "if", "(", "!", "(", "reader", ".", "isLocal", "(", ")", "||", "reader", ".", "isAnonymous", "(", ")", ")", "&&", "reader", ".", "hasStructuralChanges", "(", "newBytes", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "fileName", ")", ";", "addDependentsOf", "(", "new", "Path", "(", "fileName", ")", ",", "true", ")", ";", "this", ".", "newState", ".", "wasStructurallyChanged", "(", "fileName", ")", ";", "}", "}", "catch", "(", "ClassFormatException", "e", ")", "{", "addDependentsOf", "(", "new", "Path", "(", "fileName", ")", ",", "true", ")", ";", "this", ".", "newState", ".", "wasStructurallyChanged", "(", "fileName", ")", ";", "}", "return", "true", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"\"", "+", "this", ".", "newState", ";", "}", "}", "</s>" ]
3,911
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "AbortCompilation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "BuildNotifier", "{", "protected", "IProgressMonitor", "monitor", ";", "protected", "boolean", "cancelling", ";", "protected", "float", "percentComplete", ";", "protected", "float", "progressPerCompilationUnit", ";", "protected", "int", "newErrorCount", ";", "protected", "int", "fixedErrorCount", ";", "protected", "int", "newWarningCount", ";", "protected", "int", "fixedWarningCount", ";", "protected", "int", "workDone", ";", "protected", "int", "totalWork", ";", "protected", "String", "previousSubtask", ";", "public", "static", "int", "NewErrorCount", "=", "0", ";", "public", "static", "int", "FixedErrorCount", "=", "0", ";", "public", "static", "int", "NewWarningCount", "=", "0", ";", "public", "static", "int", "FixedWarningCount", "=", "0", ";", "public", "static", "void", "resetProblemCounters", "(", ")", "{", "NewErrorCount", "=", "0", ";", "FixedErrorCount", "=", "0", ";", "NewWarningCount", "=", "0", ";", "FixedWarningCount", "=", "0", ";", "}", "public", "BuildNotifier", "(", "IProgressMonitor", "monitor", ",", "IProject", "project", ")", "{", "this", ".", "monitor", "=", "monitor", ";", "this", ".", "cancelling", "=", "false", ";", "this", ".", "newErrorCount", "=", "NewErrorCount", ";", "this", ".", "fixedErrorCount", "=", "FixedErrorCount", ";", "this", ".", "newWarningCount", "=", "NewWarningCount", ";", "this", ".", "fixedWarningCount", "=", "FixedWarningCount", ";", "this", ".", "workDone", "=", "0", ";", "this", ".", "totalWork", "=", "1000000", ";", "}", "public", "void", "aboutToCompile", "(", "SourceFile", "unit", ")", "{", "String", "message", "=", "Messages", ".", "bind", "(", "Messages", ".", "build_compiling", ",", "unit", ".", "resource", ".", "getFullPath", "(", ")", ".", "removeLastSegments", "(", "1", ")", ".", "makeRelative", "(", ")", ".", "toString", "(", ")", ")", ";", "subTask", "(", "message", ")", ";", "}", "public", "void", "begin", "(", ")", "{", "if", "(", "this", ".", "monitor", "!=", "null", ")", "this", ".", "monitor", ".", "beginTask", "(", "\"\"", ",", "this", ".", "totalWork", ")", ";", "this", ".", "previousSubtask", "=", "null", ";", "}", "public", "void", "checkCancel", "(", ")", "{", "if", "(", "this", ".", "monitor", "!=", "null", "&&", "this", ".", "monitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", ")", ";", "}", "public", "void", "checkCancelWithinCompiler", "(", ")", "{", "if", "(", "this", ".", "monitor", "!=", "null", "&&", "this", ".", "monitor", ".", "isCanceled", "(", ")", "&&", "!", "this", ".", "cancelling", ")", "{", "setCancelling", "(", "true", ")", ";", "throw", "new", "AbortCompilation", "(", "true", ",", "null", ")", ";", "}", "}", "public", "void", "compiled", "(", "SourceFile", "unit", ")", "{", "String", "message", "=", "Messages", ".", "bind", "(", "Messages", ".", "build_compiling", ",", "unit", ".", "resource", ".", "getFullPath", "(", ")", ".", "removeLastSegments", "(", "1", ")", ".", "makeRelative", "(", ")", ".", "toString", "(", ")", ")", ";", "subTask", "(", "message", ")", ";", "updateProgressDelta", "(", "this", ".", "progressPerCompilationUnit", ")", ";", "checkCancelWithinCompiler", "(", ")", ";", "}", "public", "void", "done", "(", ")", "{", "NewErrorCount", "=", "this", ".", "newErrorCount", ";", "FixedErrorCount", "=", "this", ".", "fixedErrorCount", ";", "NewWarningCount", "=", "this", ".", "newWarningCount", ";", "FixedWarningCount", "=", "this", ".", "fixedWarningCount", ";", "updateProgress", "(", "1.0f", ")", ";", "subTask", "(", "Messages", ".", "build_done", ")", ";", "if", "(", "this", ".", "monitor", "!=", "null", ")", "this", ".", "monitor", ".", "done", "(", ")", ";", "this", ".", "previousSubtask", "=", "null", ";", "}", "protected", "String", "problemsMessage", "(", ")", "{", "int", "numNew", "=", "this", ".", "newErrorCount", "+", "this", ".", "newWarningCount", ";", "int", "numFixed", "=", "this", ".", "fixedErrorCount", "+", "this", ".", "fixedWarningCount", ";", "if", "(", "numNew", "==", "0", "&&", "numFixed", "==", "0", ")", "return", "\"\"", ";", "boolean", "displayBoth", "=", "numNew", ">", "0", "&&", "numFixed", ">", "0", ";", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "'('", ")", ";", "if", "(", "numNew", ">", "0", ")", "{", "buffer", ".", "append", "(", "Messages", ".", "build_foundHeader", ")", ";", "buffer", ".", "append", "(", "'", "'", ")", ";", "if", "(", "displayBoth", "||", "this", ".", "newErrorCount", ">", "0", ")", "{", "if", "(", "this", ".", "newErrorCount", "==", "1", ")", "buffer", ".", "append", "(", "Messages", ".", "build_oneError", ")", ";", "else", "buffer", ".", "append", "(", "Messages", ".", "bind", "(", "Messages", ".", "build_multipleErrors", ",", "String", ".", "valueOf", "(", "this", ".", "newErrorCount", ")", ")", ")", ";", "if", "(", "displayBoth", "||", "this", ".", "newWarningCount", ">", "0", ")", "buffer", ".", "append", "(", "\"", "+", "\"", ")", ";", "}", "if", "(", "displayBoth", "||", "this", ".", "newWarningCount", ">", "0", ")", "{", "if", "(", "this", ".", "newWarningCount", "==", "1", ")", "buffer", ".", "append", "(", "Messages", ".", "build_oneWarning", ")", ";", "else", "buffer", ".", "append", "(", "Messages", ".", "bind", "(", "Messages", ".", "build_multipleWarnings", ",", "String", ".", "valueOf", "(", "this", ".", "newWarningCount", ")", ")", ")", ";", "}", "if", "(", "numFixed", ">", "0", ")", "buffer", ".", "append", "(", "\",", "\"", ")", ";", "}", "if", "(", "numFixed", ">", "0", ")", "{", "buffer", ".", "append", "(", "Messages", ".", "build_fixedHeader", ")", ";", "buffer", ".", "append", "(", "'", "'", ")", ";", "if", "(", "displayBoth", ")", "{", "buffer", ".", "append", "(", "String", ".", "valueOf", "(", "this", ".", "fixedErrorCount", ")", ")", ";", "buffer", ".", "append", "(", "\"", "+", "\"", ")", ";", "buffer", ".", "append", "(", "String", ".", "valueOf", "(", "this", ".", "fixedWarningCount", ")", ")", ";", "}", "else", "{", "if", "(", "this", ".", "fixedErrorCount", ">", "0", ")", "{", "if", "(", "this", ".", "fixedErrorCount", "==", "1", ")", "buffer", ".", "append", "(", "Messages", ".", "build_oneError", ")", ";", "else", "buffer", ".", "append", "(", "Messages", ".", "bind", "(", "Messages", ".", "build_multipleErrors", ",", "String", ".", "valueOf", "(", "this", ".", "fixedErrorCount", ")", ")", ")", ";", "if", "(", "this", ".", "fixedWarningCount", ">", "0", ")", "buffer", ".", "append", "(", "\"", "+", "\"", ")", ";", "}", "if", "(", "this", ".", "fixedWarningCount", ">", "0", ")", "{", "if", "(", "this", ".", "fixedWarningCount", "==", "1", ")", "buffer", ".", "append", "(", "Messages", ".", "build_oneWarning", ")", ";", "else", "buffer", ".", "append", "(", "Messages", ".", "bind", "(", "Messages", ".", "build_multipleWarnings", ",", "String", ".", "valueOf", "(", "this", ".", "fixedWarningCount", ")", ")", ")", ";", "}", "}", "}", "buffer", ".", "append", "(", "')'", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "void", "setCancelling", "(", "boolean", "cancelling", ")", "{", "this", ".", "cancelling", "=", "cancelling", ";", "}", "public", "void", "setProgressPerCompilationUnit", "(", "float", "progress", ")", "{", "this", ".", "progressPerCompilationUnit", "=", "progress", ";", "}", "public", "void", "subTask", "(", "String", "message", ")", "{", "String", "pm", "=", "problemsMessage", "(", ")", ";", "String", "msg", "=", "pm", ".", "length", "(", ")", "==", "0", "?", "message", ":", "pm", "+", "\"", "\"", "+", "message", ";", "if", "(", "msg", ".", "equals", "(", "this", ".", "previousSubtask", ")", ")", "return", ";", "if", "(", "this", ".", "monitor", "!=", "null", ")", "this", ".", "monitor", ".", "subTask", "(", "msg", ")", ";", "this", ".", "previousSubtask", "=", "msg", ";", "}", "protected", "void", "updateProblemCounts", "(", "CategorizedProblem", "[", "]", "newProblems", ")", "{", "for", "(", "int", "i", "=", "0", ",", "l", "=", "newProblems", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "if", "(", "newProblems", "[", "i", "]", ".", "isError", "(", ")", ")", "this", ".", "newErrorCount", "++", ";", "else", "this", ".", "newWarningCount", "++", ";", "}", "protected", "void", "updateProblemCounts", "(", "IMarker", "[", "]", "oldProblems", ",", "CategorizedProblem", "[", "]", "newProblems", ")", "{", "if", "(", "newProblems", "!=", "null", ")", "{", "next", ":", "for", "(", "int", "i", "=", "0", ",", "l", "=", "newProblems", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "CategorizedProblem", "newProblem", "=", "newProblems", "[", "i", "]", ";", "if", "(", "newProblem", ".", "getID", "(", ")", "==", "IProblem", ".", "Task", ")", "continue", ";", "boolean", "isError", "=", "newProblem", ".", "isError", "(", ")", ";", "String", "message", "=", "newProblem", ".", "getMessage", "(", ")", ";", "if", "(", "oldProblems", "!=", "null", ")", "{", "for", "(", "int", "j", "=", "0", ",", "m", "=", "oldProblems", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "{", "IMarker", "pb", "=", "oldProblems", "[", "j", "]", ";", "if", "(", "pb", "==", "null", ")", "continue", ";", "boolean", "wasError", "=", "IMarker", ".", "SEVERITY_ERROR", "==", "pb", ".", "getAttribute", "(", "IMarker", ".", "SEVERITY", ",", "IMarker", ".", "SEVERITY_ERROR", ")", ";", "if", "(", "isError", "==", "wasError", "&&", "message", ".", "equals", "(", "pb", ".", "getAttribute", "(", "IMarker", ".", "MESSAGE", ",", "\"\"", ")", ")", ")", "{", "oldProblems", "[", "j", "]", "=", "null", ";", "continue", "next", ";", "}", "}", "}", "if", "(", "isError", ")", "this", ".", "newErrorCount", "++", ";", "else", "this", ".", "newWarningCount", "++", ";", "}", "}", "if", "(", "oldProblems", "!=", "null", ")", "{", "next", ":", "for", "(", "int", "i", "=", "0", ",", "l", "=", "oldProblems", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "{", "IMarker", "oldProblem", "=", "oldProblems", "[", "i", "]", ";", "if", "(", "oldProblem", "==", "null", ")", "continue", "next", ";", "boolean", "wasError", "=", "IMarker", ".", "SEVERITY_ERROR", "==", "oldProblem", ".", "getAttribute", "(", "IMarker", ".", "SEVERITY", ",", "IMarker", ".", "SEVERITY_ERROR", ")", ";", "String", "message", "=", "oldProblem", ".", "getAttribute", "(", "IMarker", ".", "MESSAGE", ",", "\"\"", ")", ";", "if", "(", "newProblems", "!=", "null", ")", "{", "for", "(", "int", "j", "=", "0", ",", "m", "=", "newProblems", ".", "length", ";", "j", "<", "m", ";", "j", "++", ")", "{", "CategorizedProblem", "pb", "=", "newProblems", "[", "j", "]", ";", "if", "(", "pb", ".", "getID", "(", ")", "==", "IProblem", ".", "Task", ")", "continue", ";", "if", "(", "wasError", "==", "pb", ".", "isError", "(", ")", "&&", "message", ".", "equals", "(", "pb", ".", "getMessage", "(", ")", ")", ")", "continue", "next", ";", "}", "}", "if", "(", "wasError", ")", "this", ".", "fixedErrorCount", "++", ";", "else", "this", ".", "fixedWarningCount", "++", ";", "}", "}", "}", "public", "void", "updateProgress", "(", "float", "newPercentComplete", ")", "{", "if", "(", "newPercentComplete", ">", "this", ".", "percentComplete", ")", "{", "this", ".", "percentComplete", "=", "Math", ".", "min", "(", "newPercentComplete", ",", "1.0f", ")", ";", "int", "work", "=", "Math", ".", "round", "(", "this", ".", "percentComplete", "*", "this", ".", "totalWork", ")", ";", "if", "(", "work", ">", "this", ".", "workDone", ")", "{", "if", "(", "this", ".", "monitor", "!=", "null", ")", "this", ".", "monitor", ".", "worked", "(", "work", "-", "this", ".", "workDone", ")", ";", "this", ".", "workDone", "=", "work", ";", "}", "}", "}", "public", "void", "updateProgressDelta", "(", "float", "percentWorked", ")", "{", "updateProgress", "(", "this", ".", "percentComplete", "+", "percentWorked", ")", ";", "}", "}", "</s>" ]
3,912
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ISourceRange", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "SourceRange", ";", "class", "SourceRefElementInfo", "extends", "JavaElementInfo", "{", "protected", "int", "sourceRangeStart", ",", "sourceRangeEnd", ";", "public", "int", "getDeclarationSourceEnd", "(", ")", "{", "return", "this", ".", "sourceRangeEnd", ";", "}", "public", "int", "getDeclarationSourceStart", "(", ")", "{", "return", "this", ".", "sourceRangeStart", ";", "}", "protected", "ISourceRange", "getSourceRange", "(", ")", "{", "return", "new", "SourceRange", "(", "this", ".", "sourceRangeStart", ",", "this", ".", "sourceRangeEnd", "-", "this", ".", "sourceRangeStart", "+", "1", ")", ";", "}", "protected", "void", "setSourceRangeEnd", "(", "int", "end", ")", "{", "this", ".", "sourceRangeEnd", "=", "end", ";", "}", "protected", "void", "setSourceRangeStart", "(", "int", "start", ")", "{", "this", ".", "sourceRangeStart", "=", "start", ";", "}", "}", "</s>" ]
3,913
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "BufferedInputStream", ";", "import", "java", ".", "io", ".", "FileNotFoundException", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "lang", ".", "reflect", ".", "InvocationTargetException", ";", "import", "java", ".", "lang", ".", "reflect", ".", "Method", ";", "import", "java", ".", "net", ".", "JarURLConnection", ";", "import", "java", ".", "net", ".", "MalformedURLException", ";", "import", "java", ".", "net", ".", "ProtocolException", ";", "import", "java", ".", "net", ".", "SocketException", ";", "import", "java", ".", "net", ".", "SocketTimeoutException", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "net", ".", "URLConnection", ";", "import", "java", ".", "net", ".", "UnknownHostException", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "jobs", ".", "ISchedulingRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Binding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "MementoTokenizer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "abstract", "class", "JavaElement", "extends", "PlatformObject", "implements", "IJavaElement", "{", "private", "static", "final", "byte", "[", "]", "CLOSING_DOUBLE_QUOTE", "=", "new", "byte", "[", "]", "{", "34", "}", ";", "private", "static", "final", "byte", "[", "]", "CHARSET", "=", "new", "byte", "[", "]", "{", "99", ",", "104", ",", "97", ",", "114", ",", "115", ",", "101", ",", "116", ",", "61", "}", ";", "private", "static", "final", "byte", "[", "]", "CONTENT_TYPE", "=", "new", "byte", "[", "]", "{", "34", ",", "67", ",", "111", ",", "110", ",", "116", ",", "101", ",", "110", ",", "116", ",", "45", ",", "84", ",", "121", ",", "112", ",", "101", ",", "34", "}", ";", "private", "static", "final", "byte", "[", "]", "CONTENT", "=", "new", "byte", "[", "]", "{", "99", ",", "111", ",", "110", ",", "116", ",", "101", ",", "110", ",", "116", ",", "61", ",", "34", "}", ";", "public", "static", "final", "char", "JEM_ESCAPE", "=", "'\\\\'", ";", "public", "static", "final", "char", "JEM_JAVAPROJECT", "=", "'='", ";", "public", "static", "final", "char", "JEM_PACKAGEFRAGMENTROOT", "=", "'/'", ";", "public", "static", "final", "char", "JEM_PACKAGEFRAGMENT", "=", "'<'", ";", "public", "static", "final", "char", "JEM_FIELD", "=", "'^'", ";", "public", "static", "final", "char", "JEM_METHOD", "=", "'~'", ";", "public", "static", "final", "char", "JEM_INITIALIZER", "=", "'|'", ";", "public", "static", "final", "char", "JEM_COMPILATIONUNIT", "=", "'{'", ";", "public", "static", "final", "char", "JEM_CLASSFILE", "=", "'('", ";", "public", "static", "final", "char", "JEM_TYPE", "=", "'['", ";", "public", "static", "final", "char", "JEM_PACKAGEDECLARATION", "=", "'%'", ";", "public", "static", "final", "char", "JEM_IMPORTDECLARATION", "=", "'#'", ";", "public", "static", "final", "char", "JEM_COUNT", "=", "'!'", ";", "public", "static", "final", "char", "JEM_LOCALVARIABLE", "=", "'@'", ";", "public", "static", "final", "char", "JEM_TYPE_PARAMETER", "=", "']'", ";", "public", "static", "final", "char", "JEM_ANNOTATION", "=", "'}'", ";", "protected", "JavaElement", "parent", ";", "protected", "static", "final", "JavaElement", "[", "]", "NO_ELEMENTS", "=", "new", "JavaElement", "[", "0", "]", ";", "protected", "static", "final", "Object", "NO_INFO", "=", "new", "Object", "(", ")", ";", "protected", "JavaElement", "(", "JavaElement", "parent", ")", "throws", "IllegalArgumentException", "{", "this", ".", "parent", "=", "parent", ";", "}", "public", "void", "close", "(", ")", "throws", "JavaModelException", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "removeInfoAndChildren", "(", "this", ")", ";", "}", "protected", "abstract", "void", "closing", "(", "Object", "info", ")", "throws", "JavaModelException", ";", "protected", "abstract", "Object", "createElementInfo", "(", ")", ";", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "this", "==", "o", ")", "return", "true", ";", "if", "(", "this", ".", "parent", "==", "null", ")", "return", "super", ".", "equals", "(", "o", ")", ";", "JavaElement", "other", "=", "(", "JavaElement", ")", "o", ";", "return", "getElementName", "(", ")", ".", "equals", "(", "other", ".", "getElementName", "(", ")", ")", "&&", "this", ".", "parent", ".", "equals", "(", "other", ".", "parent", ")", ";", "}", "protected", "void", "escapeMementoName", "(", "StringBuffer", "buffer", ",", "String", "mementoName", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "mementoName", ".", "length", "(", ")", ";", "i", "<", "length", ";", "i", "++", ")", "{", "char", "character", "=", "mementoName", ".", "charAt", "(", "i", ")", ";", "switch", "(", "character", ")", "{", "case", "JEM_ESCAPE", ":", "case", "JEM_COUNT", ":", "case", "JEM_JAVAPROJECT", ":", "case", "JEM_PACKAGEFRAGMENTROOT", ":", "case", "JEM_PACKAGEFRAGMENT", ":", "case", "JEM_FIELD", ":", "case", "JEM_METHOD", ":", "case", "JEM_INITIALIZER", ":", "case", "JEM_COMPILATIONUNIT", ":", "case", "JEM_CLASSFILE", ":", "case", "JEM_TYPE", ":", "case", "JEM_PACKAGEDECLARATION", ":", "case", "JEM_IMPORTDECLARATION", ":", "case", "JEM_LOCALVARIABLE", ":", "case", "JEM_TYPE_PARAMETER", ":", "case", "JEM_ANNOTATION", ":", "buffer", ".", "append", "(", "JEM_ESCAPE", ")", ";", "}", "buffer", ".", "append", "(", "character", ")", ";", "}", "}", "public", "boolean", "exists", "(", ")", "{", "try", "{", "getElementInfo", "(", ")", ";", "return", "true", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "return", "false", ";", "}", "public", "ASTNode", "findNode", "(", "CompilationUnit", "ast", ")", "{", "return", "null", ";", "}", "protected", "abstract", "void", "generateInfos", "(", "Object", "info", ",", "HashMap", "newElements", ",", "IProgressMonitor", "pm", ")", "throws", "JavaModelException", ";", "public", "IJavaElement", "getAncestor", "(", "int", "ancestorType", ")", "{", "IJavaElement", "element", "=", "this", ";", "while", "(", "element", "!=", "null", ")", "{", "if", "(", "element", ".", "getElementType", "(", ")", "==", "ancestorType", ")", "return", "element", ";", "element", "=", "element", ".", "getParent", "(", ")", ";", "}", "return", "null", ";", "}", "public", "IJavaElement", "[", "]", "getChildren", "(", ")", "throws", "JavaModelException", "{", "Object", "elementInfo", "=", "getElementInfo", "(", ")", ";", "if", "(", "elementInfo", "instanceof", "JavaElementInfo", ")", "{", "return", "(", "(", "JavaElementInfo", ")", "elementInfo", ")", ".", "getChildren", "(", ")", ";", "}", "else", "{", "return", "NO_ELEMENTS", ";", "}", "}", "public", "ArrayList", "getChildrenOfType", "(", "int", "type", ")", "throws", "JavaModelException", "{", "IJavaElement", "[", "]", "children", "=", "getChildren", "(", ")", ";", "int", "size", "=", "children", ".", "length", ";", "ArrayList", "list", "=", "new", "ArrayList", "(", "size", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "++", "i", ")", "{", "JavaElement", "elt", "=", "(", "JavaElement", ")", "children", "[", "i", "]", ";", "if", "(", "elt", ".", "getElementType", "(", ")", "==", "type", ")", "{", "list", ".", "add", "(", "elt", ")", ";", "}", "}", "return", "list", ";", "}", "public", "IClassFile", "getClassFile", "(", ")", "{", "return", "null", ";", "}", "public", "ICompilationUnit", "getCompilationUnit", "(", ")", "{", "return", "null", ";", "}", "public", "Object", "getElementInfo", "(", ")", "throws", "JavaModelException", "{", "return", "getElementInfo", "(", "null", ")", ";", "}", "public", "Object", "getElementInfo", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "Object", "info", "=", "manager", ".", "getInfo", "(", "this", ")", ";", "if", "(", "info", "!=", "null", ")", "return", "info", ";", "return", "openWhenClosed", "(", "createElementInfo", "(", ")", ",", "monitor", ")", ";", "}", "public", "String", "getElementName", "(", ")", "{", "return", "\"\"", ";", "}", "public", "abstract", "IJavaElement", "getHandleFromMemento", "(", "String", "token", ",", "MementoTokenizer", "memento", ",", "WorkingCopyOwner", "owner", ")", ";", "public", "IJavaElement", "getHandleFromMemento", "(", "MementoTokenizer", "memento", ",", "WorkingCopyOwner", "owner", ")", "{", "if", "(", "!", "memento", ".", "hasMoreTokens", "(", ")", ")", "return", "this", ";", "String", "token", "=", "memento", ".", "nextToken", "(", ")", ";", "return", "getHandleFromMemento", "(", "token", ",", "memento", ",", "owner", ")", ";", "}", "public", "String", "getHandleIdentifier", "(", ")", "{", "return", "getHandleMemento", "(", ")", ";", "}", "public", "String", "getHandleMemento", "(", ")", "{", "StringBuffer", "buff", "=", "new", "StringBuffer", "(", ")", ";", "getHandleMemento", "(", "buff", ")", ";", "return", "buff", ".", "toString", "(", ")", ";", "}", "protected", "void", "getHandleMemento", "(", "StringBuffer", "buff", ")", "{", "(", "(", "JavaElement", ")", "getParent", "(", ")", ")", ".", "getHandleMemento", "(", "buff", ")", ";", "buff", ".", "append", "(", "getHandleMementoDelimiter", "(", ")", ")", ";", "escapeMementoName", "(", "buff", ",", "getElementName", "(", ")", ")", ";", "}", "protected", "abstract", "char", "getHandleMementoDelimiter", "(", ")", ";", "public", "IJavaModel", "getJavaModel", "(", ")", "{", "IJavaElement", "current", "=", "this", ";", "do", "{", "if", "(", "current", "instanceof", "IJavaModel", ")", "return", "(", "IJavaModel", ")", "current", ";", "}", "while", "(", "(", "current", "=", "current", ".", "getParent", "(", ")", ")", "!=", "null", ")", ";", "return", "null", ";", "}", "public", "IJavaProject", "getJavaProject", "(", ")", "{", "IJavaElement", "current", "=", "this", ";", "do", "{", "if", "(", "current", "instanceof", "IJavaProject", ")", "return", "(", "IJavaProject", ")", "current", ";", "}", "while", "(", "(", "current", "=", "current", ".", "getParent", "(", ")", ")", "!=", "null", ")", ";", "return", "null", ";", "}", "public", "IOpenable", "getOpenable", "(", ")", "{", "return", "getOpenableParent", "(", ")", ";", "}", "public", "IOpenable", "getOpenableParent", "(", ")", "{", "return", "(", "IOpenable", ")", "this", ".", "parent", ";", "}", "public", "IJavaElement", "getParent", "(", ")", "{", "return", "this", ".", "parent", ";", "}", "public", "IJavaElement", "getPrimaryElement", "(", ")", "{", "return", "getPrimaryElement", "(", "true", ")", ";", "}", "public", "IJavaElement", "getPrimaryElement", "(", "boolean", "checkOwner", ")", "{", "return", "this", ";", "}", "public", "IResource", "getResource", "(", ")", "{", "return", "resource", "(", ")", ";", "}", "public", "abstract", "IResource", "resource", "(", ")", ";", "protected", "IJavaElement", "getSourceElementAt", "(", "int", "position", ")", "throws", "JavaModelException", "{", "if", "(", "this", "instanceof", "ISourceReference", ")", "{", "IJavaElement", "[", "]", "children", "=", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "children", ".", "length", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "IJavaElement", "aChild", "=", "children", "[", "i", "]", ";", "if", "(", "aChild", "instanceof", "SourceRefElement", ")", "{", "SourceRefElement", "child", "=", "(", "SourceRefElement", ")", "children", "[", "i", "]", ";", "ISourceRange", "range", "=", "child", ".", "getSourceRange", "(", ")", ";", "int", "start", "=", "range", ".", "getOffset", "(", ")", ";", "int", "end", "=", "start", "+", "range", ".", "getLength", "(", ")", ";", "if", "(", "start", "<=", "position", "&&", "position", "<=", "end", ")", "{", "if", "(", "child", "instanceof", "IField", ")", "{", "int", "declarationStart", "=", "start", ";", "SourceRefElement", "candidate", "=", "null", ";", "do", "{", "range", "=", "(", "(", "IField", ")", "child", ")", ".", "getNameRange", "(", ")", ";", "if", "(", "position", "<=", "range", ".", "getOffset", "(", ")", "+", "range", ".", "getLength", "(", ")", ")", "{", "candidate", "=", "child", ";", "}", "else", "{", "return", "candidate", "==", "null", "?", "child", ".", "getSourceElementAt", "(", "position", ")", ":", "candidate", ".", "getSourceElementAt", "(", "position", ")", ";", "}", "child", "=", "--", "i", ">=", "0", "?", "(", "SourceRefElement", ")", "children", "[", "i", "]", ":", "null", ";", "}", "while", "(", "child", "!=", "null", "&&", "child", ".", "getSourceRange", "(", ")", ".", "getOffset", "(", ")", "==", "declarationStart", ")", ";", "return", "candidate", ".", "getSourceElementAt", "(", "position", ")", ";", "}", "else", "if", "(", "child", "instanceof", "IParent", ")", "{", "return", "child", ".", "getSourceElementAt", "(", "position", ")", ";", "}", "else", "{", "return", "child", ";", "}", "}", "}", "}", "}", "else", "{", "Assert", ".", "isTrue", "(", "false", ")", ";", "}", "return", "this", ";", "}", "public", "SourceMapper", "getSourceMapper", "(", ")", "{", "return", "(", "(", "JavaElement", ")", "getParent", "(", ")", ")", ".", "getSourceMapper", "(", ")", ";", "}", "public", "ISchedulingRule", "getSchedulingRule", "(", ")", "{", "IResource", "resource", "=", "resource", "(", ")", ";", "if", "(", "resource", "==", "null", ")", "{", "class", "NoResourceSchedulingRule", "implements", "ISchedulingRule", "{", "public", "IPath", "path", ";", "public", "NoResourceSchedulingRule", "(", "IPath", "path", ")", "{", "this", ".", "path", "=", "path", ";", "}", "public", "boolean", "contains", "(", "ISchedulingRule", "rule", ")", "{", "if", "(", "rule", "instanceof", "NoResourceSchedulingRule", ")", "{", "return", "this", ".", "path", ".", "isPrefixOf", "(", "(", "(", "NoResourceSchedulingRule", ")", "rule", ")", ".", "path", ")", ";", "}", "else", "{", "return", "false", ";", "}", "}", "public", "boolean", "isConflicting", "(", "ISchedulingRule", "rule", ")", "{", "if", "(", "rule", "instanceof", "NoResourceSchedulingRule", ")", "{", "IPath", "otherPath", "=", "(", "(", "NoResourceSchedulingRule", ")", "rule", ")", ".", "path", ";", "return", "this", ".", "path", ".", "isPrefixOf", "(", "otherPath", ")", "||", "otherPath", ".", "isPrefixOf", "(", "this", ".", "path", ")", ";", "}", "else", "{", "return", "false", ";", "}", "}", "}", "return", "new", "NoResourceSchedulingRule", "(", "getPath", "(", ")", ")", ";", "}", "else", "{", "return", "resource", ";", "}", "}", "public", "boolean", "hasChildren", "(", ")", "throws", "JavaModelException", "{", "Object", "elementInfo", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getInfo", "(", "this", ")", ";", "if", "(", "elementInfo", "instanceof", "JavaElementInfo", ")", "{", "return", "(", "(", "JavaElementInfo", ")", "elementInfo", ")", ".", "getChildren", "(", ")", ".", "length", ">", "0", ";", "}", "else", "{", "return", "true", ";", "}", "}", "public", "int", "hashCode", "(", ")", "{", "if", "(", "this", ".", "parent", "==", "null", ")", "return", "super", ".", "hashCode", "(", ")", ";", "return", "Util", ".", "combineHashCodes", "(", "getElementName", "(", ")", ".", "hashCode", "(", ")", ",", "this", ".", "parent", ".", "hashCode", "(", ")", ")", ";", "}", "public", "boolean", "isAncestorOf", "(", "IJavaElement", "e", ")", "{", "IJavaElement", "parentElement", "=", "e", ".", "getParent", "(", ")", ";", "while", "(", "parentElement", "!=", "null", "&&", "!", "parentElement", ".", "equals", "(", "this", ")", ")", "{", "parentElement", "=", "parentElement", ".", "getParent", "(", ")", ";", "}", "return", "parentElement", "!=", "null", ";", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "false", ";", "}", "public", "JavaModelException", "newNotPresentException", "(", ")", "{", "return", "new", "JavaModelException", "(", "newDoesNotExistStatus", "(", ")", ")", ";", "}", "protected", "JavaModelStatus", "newDoesNotExistStatus", "(", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ",", "this", ")", ";", "}", "public", "JavaModelException", "newJavaModelException", "(", "IStatus", "status", ")", "{", "if", "(", "status", "instanceof", "IJavaModelStatus", ")", "return", "new", "JavaModelException", "(", "(", "IJavaModelStatus", ")", "status", ")", ";", "else", "return", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "status", ".", "getSeverity", "(", ")", ",", "status", ".", "getCode", "(", ")", ",", "status", ".", "getMessage", "(", ")", ")", ")", ";", "}", "protected", "Object", "openWhenClosed", "(", "Object", "info", ",", "boolean", "b", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "return", "openWhenClosed", "(", "info", ",", "monitor", ")", ";", "}", "protected", "Object", "openWhenClosed", "(", "Object", "info", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "boolean", "hadTemporaryCache", "=", "manager", ".", "hasTemporaryCache", "(", ")", ";", "try", "{", "HashMap", "newElements", "=", "manager", ".", "getTemporaryCache", "(", ")", ";", "generateInfos", "(", "info", ",", "newElements", ",", "monitor", ")", ";", "if", "(", "info", "==", "null", ")", "{", "info", "=", "newElements", ".", "get", "(", "this", ")", ";", "}", "if", "(", "info", "==", "null", ")", "{", "Openable", "openable", "=", "(", "Openable", ")", "getOpenable", "(", ")", ";", "if", "(", "newElements", ".", "containsKey", "(", "openable", ")", ")", "{", "openable", ".", "closeBuffer", "(", ")", ";", "}", "throw", "newNotPresentException", "(", ")", ";", "}", "if", "(", "!", "hadTemporaryCache", ")", "{", "manager", ".", "putInfos", "(", "this", ",", "newElements", ")", ";", "}", "}", "finally", "{", "if", "(", "!", "hadTemporaryCache", ")", "{", "manager", ".", "resetTemporaryCache", "(", ")", ";", "}", "}", "return", "info", ";", "}", "public", "String", "readableName", "(", ")", "{", "return", "getElementName", "(", ")", ";", "}", "public", "JavaElement", "resolved", "(", "Binding", "binding", ")", "{", "return", "this", ";", "}", "public", "JavaElement", "unresolved", "(", ")", "{", "return", "this", ";", "}", "protected", "String", "tabString", "(", "int", "tab", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "tab", ";", "i", ">", "0", ";", "i", "--", ")", "buffer", ".", "append", "(", "\"", "\"", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "String", "toDebugString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "this", ".", "toStringInfo", "(", "0", ",", "buffer", ",", "NO_INFO", ",", "true", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "toString", "(", "0", ",", "buffer", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "protected", "void", "toString", "(", "int", "tab", ",", "StringBuffer", "buffer", ")", "{", "Object", "info", "=", "this", ".", "toStringInfo", "(", "tab", ",", "buffer", ")", ";", "if", "(", "tab", "==", "0", ")", "{", "toStringAncestors", "(", "buffer", ")", ";", "}", "toStringChildren", "(", "tab", ",", "buffer", ",", "info", ")", ";", "}", "public", "String", "toStringWithAncestors", "(", ")", "{", "return", "toStringWithAncestors", "(", "true", ")", ";", "}", "public", "String", "toStringWithAncestors", "(", "boolean", "showResolvedInfo", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "this", ".", "toStringInfo", "(", "0", ",", "buffer", ",", "NO_INFO", ",", "showResolvedInfo", ")", ";", "toStringAncestors", "(", "buffer", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "protected", "void", "toStringAncestors", "(", "StringBuffer", "buffer", ")", "{", "JavaElement", "parentElement", "=", "(", "JavaElement", ")", "getParent", "(", ")", ";", "if", "(", "parentElement", "!=", "null", "&&", "parentElement", ".", "getParent", "(", ")", "!=", "null", ")", "{", "buffer", ".", "append", "(", "\"", "[in", "\"", ")", ";", "parentElement", ".", "toStringInfo", "(", "0", ",", "buffer", ",", "NO_INFO", ",", "false", ")", ";", "parentElement", ".", "toStringAncestors", "(", "buffer", ")", ";", "buffer", ".", "append", "(", "\"]\"", ")", ";", "}", "}", "protected", "void", "toStringChildren", "(", "int", "tab", ",", "StringBuffer", "buffer", ",", "Object", "info", ")", "{", "if", "(", "info", "==", "null", "||", "!", "(", "info", "instanceof", "JavaElementInfo", ")", ")", "return", ";", "IJavaElement", "[", "]", "children", "=", "(", "(", "JavaElementInfo", ")", "info", ")", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "\"n\"", ")", ";", "(", "(", "JavaElement", ")", "children", "[", "i", "]", ")", ".", "toString", "(", "tab", "+", "1", ",", "buffer", ")", ";", "}", "}", "public", "Object", "toStringInfo", "(", "int", "tab", ",", "StringBuffer", "buffer", ")", "{", "Object", "info", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "peekAtInfo", "(", "this", ")", ";", "this", ".", "toStringInfo", "(", "tab", ",", "buffer", ",", "info", ",", "true", ")", ";", "return", "info", ";", "}", "protected", "void", "toStringInfo", "(", "int", "tab", ",", "StringBuffer", "buffer", ",", "Object", "info", ",", "boolean", "showResolvedInfo", ")", "{", "buffer", ".", "append", "(", "tabString", "(", "tab", ")", ")", ";", "toStringName", "(", "buffer", ")", ";", "if", "(", "info", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"", "(not", "open)\"", ")", ";", "}", "}", "protected", "void", "toStringName", "(", "StringBuffer", "buffer", ")", "{", "buffer", ".", "append", "(", "getElementName", "(", ")", ")", ";", "}", "protected", "URL", "getJavadocBaseLocation", "(", ")", "throws", "JavaModelException", "{", "IPackageFragmentRoot", "root", "=", "(", "IPackageFragmentRoot", ")", "getAncestor", "(", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ")", ";", "if", "(", "root", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "root", ".", "getKind", "(", ")", "==", "IPackageFragmentRoot", ".", "K_BINARY", ")", "{", "IClasspathEntry", "entry", "=", "null", ";", "try", "{", "entry", "=", "root", ".", "getResolvedClasspathEntry", "(", ")", ";", "URL", "url", "=", "getLibraryJavadocLocation", "(", "entry", ")", ";", "if", "(", "url", "!=", "null", ")", "{", "return", "url", ";", "}", "}", "catch", "(", "JavaModelException", "jme", ")", "{", "}", "entry", "=", "root", ".", "getRawClasspathEntry", "(", ")", ";", "switch", "(", "entry", ".", "getEntryKind", "(", ")", ")", "{", "case", "IClasspathEntry", ".", "CPE_LIBRARY", ":", "case", "IClasspathEntry", ".", "CPE_VARIABLE", ":", "return", "getLibraryJavadocLocation", "(", "entry", ")", ";", "default", ":", "return", "null", ";", "}", "}", "return", "null", ";", "}", "protected", "static", "URL", "getLibraryJavadocLocation", "(", "IClasspathEntry", "entry", ")", "throws", "JavaModelException", "{", "switch", "(", "entry", ".", "getEntryKind", "(", ")", ")", "{", "case", "IClasspathEntry", ".", "CPE_LIBRARY", ":", "case", "IClasspathEntry", ".", "CPE_VARIABLE", ":", "break", ";", "default", ":", "throw", "new", "IllegalArgumentException", "(", "\"\"", ")", ";", "}", "IClasspathAttribute", "[", "]", "extraAttributes", "=", "entry", ".", "getExtraAttributes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "extraAttributes", ".", "length", ";", "i", "++", ")", "{", "IClasspathAttribute", "attrib", "=", "extraAttributes", "[", "i", "]", ";", "if", "(", "IClasspathAttribute", ".", "JAVADOC_LOCATION_ATTRIBUTE_NAME", ".", "equals", "(", "attrib", ".", "getName", "(", ")", ")", ")", "{", "String", "value", "=", "attrib", ".", "getValue", "(", ")", ";", "try", "{", "return", "new", "URL", "(", "value", ")", ";", "}", "catch", "(", "MalformedURLException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "CANNOT_RETRIEVE_ATTACHED_JAVADOC", ",", "value", ")", ")", ";", "}", "}", "}", "return", "null", ";", "}", "public", "String", "getAttachedJavadoc", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "return", "null", ";", "}", "int", "getIndexOf", "(", "byte", "[", "]", "array", ",", "byte", "[", "]", "toBeFound", ",", "int", "start", ")", "{", "if", "(", "array", "==", "null", "||", "toBeFound", "==", "null", ")", "return", "-", "1", ";", "final", "int", "toBeFoundLength", "=", "toBeFound", ".", "length", ";", "final", "int", "arrayLength", "=", "array", ".", "length", ";", "if", "(", "arrayLength", "<", "toBeFoundLength", ")", "return", "-", "1", ";", "loop", ":", "for", "(", "int", "i", "=", "start", ",", "max", "=", "arrayLength", "-", "toBeFoundLength", "+", "1", ";", "i", "<", "max", ";", "i", "++", ")", "{", "if", "(", "array", "[", "i", "]", "==", "toBeFound", "[", "0", "]", ")", "{", "for", "(", "int", "j", "=", "1", ";", "j", "<", "toBeFoundLength", ";", "j", "++", ")", "{", "if", "(", "array", "[", "i", "+", "j", "]", "!=", "toBeFound", "[", "j", "]", ")", "continue", "loop", ";", "}", "return", "i", ";", "}", "}", "return", "-", "1", ";", "}", "protected", "String", "getURLContents", "(", "String", "docUrlValue", ")", "throws", "JavaModelException", "{", "InputStream", "stream", "=", "null", ";", "JarURLConnection", "connection2", "=", "null", ";", "try", "{", "URL", "docUrl", "=", "new", "URL", "(", "docUrlValue", ")", ";", "URLConnection", "connection", "=", "docUrl", ".", "openConnection", "(", ")", ";", "Class", "[", "]", "parameterTypes", "=", "new", "Class", "[", "]", "{", "int", ".", "class", "}", ";", "Integer", "timeoutVal", "=", "new", "Integer", "(", "10000", ")", ";", "Class", "URLClass", "=", "connection", ".", "getClass", "(", ")", ";", "try", "{", "Method", "connectTimeoutMethod", "=", "URLClass", ".", "getDeclaredMethod", "(", "\"\"", ",", "parameterTypes", ")", ";", "Method", "readTimeoutMethod", "=", "URLClass", ".", "getDeclaredMethod", "(", "\"\"", ",", "parameterTypes", ")", ";", "connectTimeoutMethod", ".", "invoke", "(", "connection", ",", "new", "Object", "[", "]", "{", "timeoutVal", "}", ")", ";", "readTimeoutMethod", ".", "invoke", "(", "connection", ",", "new", "Object", "[", "]", "{", "timeoutVal", "}", ")", ";", "}", "catch", "(", "SecurityException", "e", ")", "{", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "}", "catch", "(", "NoSuchMethodException", "e", ")", "{", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "}", "catch", "(", "InvocationTargetException", "e", ")", "{", "}", "if", "(", "connection", "instanceof", "JarURLConnection", ")", "{", "connection2", "=", "(", "JarURLConnection", ")", "connection", ";", "connection", ".", "setUseCaches", "(", "false", ")", ";", "}", "try", "{", "stream", "=", "new", "BufferedInputStream", "(", "connection", ".", "getInputStream", "(", ")", ")", ";", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "return", "null", ";", "}", "catch", "(", "NullPointerException", "e", ")", "{", "return", "null", ";", "}", "String", "encoding", "=", "connection", ".", "getContentEncoding", "(", ")", ";", "byte", "[", "]", "contents", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "getInputStreamAsByteArray", "(", "stream", ",", "connection", ".", "getContentLength", "(", ")", ")", ";", "if", "(", "encoding", "==", "null", ")", "{", "int", "index", "=", "getIndexOf", "(", "contents", ",", "CONTENT_TYPE", ",", "0", ")", ";", "if", "(", "index", "!=", "-", "1", ")", "{", "index", "=", "getIndexOf", "(", "contents", ",", "CONTENT", ",", "index", ")", ";", "if", "(", "index", "!=", "-", "1", ")", "{", "int", "offset", "=", "index", "+", "CONTENT", ".", "length", ";", "int", "index2", "=", "getIndexOf", "(", "contents", ",", "CLOSING_DOUBLE_QUOTE", ",", "offset", ")", ";", "if", "(", "index2", "!=", "-", "1", ")", "{", "final", "int", "charsetIndex", "=", "getIndexOf", "(", "contents", ",", "CHARSET", ",", "offset", ")", ";", "if", "(", "charsetIndex", "!=", "-", "1", ")", "{", "int", "start", "=", "charsetIndex", "+", "CHARSET", ".", "length", ";", "encoding", "=", "new", "String", "(", "contents", ",", "start", ",", "index2", "-", "start", ",", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "UTF_8", ")", ";", "}", "}", "}", "}", "}", "try", "{", "if", "(", "encoding", "==", "null", ")", "{", "encoding", "=", "getJavaProject", "(", ")", ".", "getProject", "(", ")", ".", "getDefaultCharset", "(", ")", ";", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "}", "if", "(", "contents", "!=", "null", ")", "{", "if", "(", "encoding", "!=", "null", ")", "{", "return", "new", "String", "(", "contents", ",", "encoding", ")", ";", "}", "else", "{", "return", "new", "String", "(", "contents", ")", ";", "}", "}", "}", "catch", "(", "SocketTimeoutException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT", ",", "this", ")", ")", ";", "}", "catch", "(", "MalformedURLException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "CANNOT_RETRIEVE_ATTACHED_JAVADOC", ",", "this", ")", ")", ";", "}", "catch", "(", "FileNotFoundException", "e", ")", "{", "}", "catch", "(", "SocketException", "e", ")", "{", "}", "catch", "(", "UnknownHostException", "e", ")", "{", "}", "catch", "(", "ProtocolException", "e", ")", "{", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ",", "IJavaModelStatusConstants", ".", "IO_EXCEPTION", ")", ";", "}", "finally", "{", "if", "(", "stream", "!=", "null", ")", "{", "try", "{", "stream", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "if", "(", "connection2", "!=", "null", ")", "{", "try", "{", "connection2", ".", "getJarFile", "(", ")", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "catch", "(", "IllegalStateException", "e", ")", "{", "}", "}", "}", "return", "null", ";", "}", "}", "</s>" ]
3,914
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IContainer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "PlatformObject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJarEntryResource", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "NonJavaResource", "extends", "PlatformObject", "implements", "IJarEntryResource", "{", "private", "static", "final", "IJarEntryResource", "[", "]", "NO_CHILDREN", "=", "new", "IJarEntryResource", "[", "0", "]", ";", "protected", "Object", "parent", ";", "protected", "IResource", "resource", ";", "public", "NonJavaResource", "(", "Object", "parent", ",", "IResource", "resource", ")", "{", "this", ".", "parent", "=", "parent", ";", "this", ".", "resource", "=", "resource", ";", "}", "public", "boolean", "equals", "(", "Object", "obj", ")", "{", "if", "(", "!", "(", "obj", "instanceof", "NonJavaResource", ")", ")", "return", "false", ";", "NonJavaResource", "other", "=", "(", "NonJavaResource", ")", "obj", ";", "return", "this", ".", "parent", ".", "equals", "(", "other", ".", "parent", ")", "&&", "this", ".", "resource", ".", "equals", "(", "other", ".", "resource", ")", ";", "}", "public", "IJarEntryResource", "[", "]", "getChildren", "(", ")", "{", "if", "(", "this", ".", "resource", "instanceof", "IContainer", ")", "{", "IResource", "[", "]", "members", ";", "try", "{", "members", "=", "(", "(", "IContainer", ")", "this", ".", "resource", ")", ".", "members", "(", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "this", ".", "resource", ".", "getFullPath", "(", ")", ")", ";", "return", "NO_CHILDREN", ";", "}", "int", "length", "=", "members", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", "NO_CHILDREN", ";", "IJarEntryResource", "[", "]", "children", "=", "new", "IJarEntryResource", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "children", "[", "i", "]", "=", "new", "NonJavaResource", "(", "this", ",", "members", "[", "i", "]", ")", ";", "}", "return", "children", ";", "}", "return", "NO_CHILDREN", ";", "}", "public", "InputStream", "getContents", "(", ")", "throws", "CoreException", "{", "if", "(", "this", ".", "resource", "instanceof", "IFile", ")", "return", "(", "(", "IFile", ")", "this", ".", "resource", ")", ".", "getContents", "(", ")", ";", "return", "null", ";", "}", "protected", "String", "getEntryName", "(", ")", "{", "String", "parentEntryName", ";", "if", "(", "this", ".", "parent", "instanceof", "IPackageFragment", ")", "{", "String", "elementName", "=", "(", "(", "IPackageFragment", ")", "this", ".", "parent", ")", ".", "getElementName", "(", ")", ";", "parentEntryName", "=", "elementName", ".", "length", "(", ")", "==", "0", "?", "\"\"", ":", "elementName", ".", "replace", "(", "'.'", ",", "'/'", ")", "+", "'/'", ";", "}", "else", "if", "(", "this", ".", "parent", "instanceof", "IPackageFragmentRoot", ")", "{", "parentEntryName", "=", "\"\"", ";", "}", "else", "{", "parentEntryName", "=", "(", "(", "NonJavaResource", ")", "this", ".", "parent", ")", ".", "getEntryName", "(", ")", "+", "'/'", ";", "}", "return", "parentEntryName", "+", "getName", "(", ")", ";", "}", "public", "IPath", "getFullPath", "(", ")", "{", "return", "new", "Path", "(", "getEntryName", "(", ")", ")", ".", "makeAbsolute", "(", ")", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "this", ".", "resource", ".", "getName", "(", ")", ";", "}", "public", "IPackageFragmentRoot", "getPackageFragmentRoot", "(", ")", "{", "if", "(", "this", ".", "parent", "instanceof", "IPackageFragment", ")", "{", "return", "(", "IPackageFragmentRoot", ")", "(", "(", "IPackageFragment", ")", "this", ".", "parent", ")", ".", "getParent", "(", ")", ";", "}", "else", "if", "(", "this", ".", "parent", "instanceof", "IPackageFragmentRoot", ")", "{", "return", "(", "IPackageFragmentRoot", ")", "this", ".", "parent", ";", "}", "else", "{", "return", "(", "(", "NonJavaResource", ")", "this", ".", "parent", ")", ".", "getPackageFragmentRoot", "(", ")", ";", "}", "}", "public", "Object", "getParent", "(", ")", "{", "return", "this", ".", "parent", ";", "}", "public", "int", "hashCode", "(", ")", "{", "return", "Util", ".", "combineHashCodes", "(", "this", ".", "resource", ".", "hashCode", "(", ")", ",", "this", ".", "parent", ".", "hashCode", "(", ")", ")", ";", "}", "public", "boolean", "isFile", "(", ")", "{", "return", "this", ".", "resource", "instanceof", "IFile", ";", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "true", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"\"", "+", "getEntryName", "(", ")", "+", "\"]\"", ";", "}", "}", "</s>" ]
3,915
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IOpenable", ";", "public", "class", "NullBuffer", "extends", "Buffer", "{", "public", "NullBuffer", "(", "IFile", "file", ",", "IOpenable", "owner", ",", "boolean", "readOnly", ")", "{", "super", "(", "file", ",", "owner", ",", "readOnly", ")", ";", "}", "}", "</s>" ]
3,916
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElementDelta", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "public", "class", "DiscardWorkingCopyOperation", "extends", "JavaModelOperation", "{", "public", "DiscardWorkingCopyOperation", "(", "IJavaElement", "workingCopy", ")", "{", "super", "(", "new", "IJavaElement", "[", "]", "{", "workingCopy", "}", ")", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "CompilationUnit", "workingCopy", "=", "getWorkingCopy", "(", ")", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "int", "useCount", "=", "manager", ".", "discardPerWorkingCopyInfo", "(", "workingCopy", ")", ";", "if", "(", "useCount", "==", "0", ")", "{", "IJavaProject", "javaProject", "=", "workingCopy", ".", "getJavaProject", "(", ")", ";", "if", "(", "ExternalJavaProject", ".", "EXTERNAL_PROJECT_NAME", ".", "equals", "(", "javaProject", ".", "getElementName", "(", ")", ")", ")", "{", "manager", ".", "removePerProjectInfo", "(", "(", "JavaProject", ")", "javaProject", ",", "true", ")", ";", "manager", ".", "containerRemove", "(", "javaProject", ")", ";", "}", "if", "(", "!", "workingCopy", ".", "isPrimary", "(", ")", ")", "{", "JavaElementDelta", "delta", "=", "new", "JavaElementDelta", "(", "getJavaModel", "(", ")", ")", ";", "delta", ".", "removed", "(", "workingCopy", ")", ";", "addDelta", "(", "delta", ")", ";", "removeReconcileDelta", "(", "workingCopy", ")", ";", "}", "else", "{", "if", "(", "workingCopy", ".", "getResource", "(", ")", ".", "isAccessible", "(", ")", ")", "{", "JavaElementDelta", "delta", "=", "new", "JavaElementDelta", "(", "getJavaModel", "(", ")", ")", ";", "delta", ".", "changed", "(", "workingCopy", ",", "IJavaElementDelta", ".", "F_PRIMARY_WORKING_COPY", ")", ";", "addDelta", "(", "delta", ")", ";", "}", "else", "{", "JavaElementDelta", "delta", "=", "new", "JavaElementDelta", "(", "getJavaModel", "(", ")", ")", ";", "delta", ".", "removed", "(", "workingCopy", ",", "IJavaElementDelta", ".", "F_PRIMARY_WORKING_COPY", ")", ";", "addDelta", "(", "delta", ")", ";", "}", "}", "}", "}", "protected", "CompilationUnit", "getWorkingCopy", "(", ")", "{", "return", "(", "CompilationUnit", ")", "getElementToProcess", "(", ")", ";", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "true", ";", "}", "}", "</s>" ]
3,917
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "public", "class", "ImportContainerInfo", "extends", "JavaElementInfo", "{", "protected", "IJavaElement", "[", "]", "children", "=", "JavaElement", ".", "NO_ELEMENTS", ";", "public", "IJavaElement", "[", "]", "getChildren", "(", ")", "{", "return", "this", ".", "children", ";", "}", "}", "</s>" ]
3,918
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ISourceField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ISourceImport", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ISourceMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ISourceType", ";", "public", "class", "SourceTypeElementInfo", "extends", "AnnotatableInfo", "implements", "ISourceType", "{", "protected", "static", "final", "ISourceImport", "[", "]", "NO_IMPORTS", "=", "new", "ISourceImport", "[", "0", "]", ";", "protected", "static", "final", "InitializerElementInfo", "[", "]", "NO_INITIALIZERS", "=", "new", "InitializerElementInfo", "[", "0", "]", ";", "protected", "static", "final", "SourceField", "[", "]", "NO_FIELDS", "=", "new", "SourceField", "[", "0", "]", ";", "protected", "static", "final", "SourceMethod", "[", "]", "NO_METHODS", "=", "new", "SourceMethod", "[", "0", "]", ";", "protected", "static", "final", "SourceType", "[", "]", "NO_TYPES", "=", "new", "SourceType", "[", "0", "]", ";", "protected", "IJavaElement", "[", "]", "children", "=", "JavaElement", ".", "NO_ELEMENTS", ";", "protected", "char", "[", "]", "superclassName", ";", "protected", "char", "[", "]", "[", "]", "superInterfaceNames", ";", "protected", "IType", "handle", "=", "null", ";", "protected", "ITypeParameter", "[", "]", "typeParameters", "=", "TypeParameter", ".", "NO_TYPE_PARAMETERS", ";", "protected", "HashMap", "categories", ";", "protected", "void", "addCategories", "(", "IJavaElement", "element", ",", "char", "[", "]", "[", "]", "elementCategories", ")", "{", "if", "(", "elementCategories", "==", "null", ")", "return", ";", "if", "(", "this", ".", "categories", "==", "null", ")", "this", ".", "categories", "=", "new", "HashMap", "(", ")", ";", "this", ".", "categories", ".", "put", "(", "element", ",", "CharOperation", ".", "toStrings", "(", "elementCategories", ")", ")", ";", "}", "public", "HashMap", "getCategories", "(", ")", "{", "return", "this", ".", "categories", ";", "}", "public", "IJavaElement", "[", "]", "getChildren", "(", ")", "{", "return", "this", ".", "children", ";", "}", "public", "ISourceType", "getEnclosingType", "(", ")", "{", "IJavaElement", "parent", "=", "this", ".", "handle", ".", "getParent", "(", ")", ";", "if", "(", "parent", "!=", "null", "&&", "parent", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "TYPE", ")", "{", "try", "{", "return", "(", "ISourceType", ")", "(", "(", "JavaElement", ")", "parent", ")", ".", "getElementInfo", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "null", ";", "}", "}", "else", "{", "return", "null", ";", "}", "}", "public", "ISourceField", "[", "]", "getFields", "(", ")", "{", "SourceField", "[", "]", "fieldHandles", "=", "getFieldHandles", "(", ")", ";", "int", "length", "=", "fieldHandles", ".", "length", ";", "ISourceField", "[", "]", "fields", "=", "new", "ISourceField", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "try", "{", "ISourceField", "field", "=", "(", "ISourceField", ")", "fieldHandles", "[", "i", "]", ".", "getElementInfo", "(", ")", ";", "fields", "[", "i", "]", "=", "field", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "return", "fields", ";", "}", "public", "SourceField", "[", "]", "getFieldHandles", "(", ")", "{", "int", "length", "=", "this", ".", "children", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", "NO_FIELDS", ";", "SourceField", "[", "]", "fields", "=", "new", "SourceField", "[", "length", "]", ";", "int", "fieldIndex", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaElement", "child", "=", "this", ".", "children", "[", "i", "]", ";", "if", "(", "child", "instanceof", "SourceField", ")", "fields", "[", "fieldIndex", "++", "]", "=", "(", "SourceField", ")", "child", ";", "}", "if", "(", "fieldIndex", "==", "0", ")", "return", "NO_FIELDS", ";", "if", "(", "fieldIndex", "<", "length", ")", "System", ".", "arraycopy", "(", "fields", ",", "0", ",", "fields", "=", "new", "SourceField", "[", "fieldIndex", "]", ",", "0", ",", "fieldIndex", ")", ";", "return", "fields", ";", "}", "public", "char", "[", "]", "getFileName", "(", ")", "{", "return", "this", ".", "handle", ".", "getPath", "(", ")", ".", "toString", "(", ")", ".", "toCharArray", "(", ")", ";", "}", "public", "IType", "getHandle", "(", ")", "{", "return", "this", ".", "handle", ";", "}", "public", "InitializerElementInfo", "[", "]", "getInitializers", "(", ")", "{", "int", "length", "=", "this", ".", "children", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", "NO_INITIALIZERS", ";", "InitializerElementInfo", "[", "]", "initializers", "=", "new", "InitializerElementInfo", "[", "length", "]", ";", "int", "initializerIndex", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaElement", "child", "=", "this", ".", "children", "[", "i", "]", ";", "if", "(", "child", "instanceof", "Initializer", ")", "{", "try", "{", "InitializerElementInfo", "initializer", "=", "(", "InitializerElementInfo", ")", "(", "(", "Initializer", ")", "child", ")", ".", "getElementInfo", "(", ")", ";", "initializers", "[", "initializerIndex", "++", "]", "=", "initializer", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "if", "(", "initializerIndex", "==", "0", ")", "return", "NO_INITIALIZERS", ";", "System", ".", "arraycopy", "(", "initializers", ",", "0", ",", "initializers", "=", "new", "InitializerElementInfo", "[", "initializerIndex", "]", ",", "0", ",", "initializerIndex", ")", ";", "return", "initializers", ";", "}", "public", "char", "[", "]", "[", "]", "getInterfaceNames", "(", ")", "{", "if", "(", "this", ".", "handle", ".", "getElementName", "(", ")", ".", "length", "(", ")", "==", "0", ")", "{", "return", "null", ";", "}", "return", "this", ".", "superInterfaceNames", ";", "}", "public", "ISourceType", "[", "]", "getMemberTypes", "(", ")", "{", "SourceType", "[", "]", "memberTypeHandles", "=", "getMemberTypeHandles", "(", ")", ";", "int", "length", "=", "memberTypeHandles", ".", "length", ";", "ISourceType", "[", "]", "memberTypes", "=", "new", "ISourceType", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "try", "{", "ISourceType", "type", "=", "(", "ISourceType", ")", "memberTypeHandles", "[", "i", "]", ".", "getElementInfo", "(", ")", ";", "memberTypes", "[", "i", "]", "=", "type", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "return", "memberTypes", ";", "}", "public", "SourceType", "[", "]", "getMemberTypeHandles", "(", ")", "{", "int", "length", "=", "this", ".", "children", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", "NO_TYPES", ";", "SourceType", "[", "]", "memberTypes", "=", "new", "SourceType", "[", "length", "]", ";", "int", "typeIndex", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaElement", "child", "=", "this", ".", "children", "[", "i", "]", ";", "if", "(", "child", "instanceof", "SourceType", ")", "memberTypes", "[", "typeIndex", "++", "]", "=", "(", "SourceType", ")", "child", ";", "}", "if", "(", "typeIndex", "==", "0", ")", "return", "NO_TYPES", ";", "if", "(", "typeIndex", "<", "length", ")", "System", ".", "arraycopy", "(", "memberTypes", ",", "0", ",", "memberTypes", "=", "new", "SourceType", "[", "typeIndex", "]", ",", "0", ",", "typeIndex", ")", ";", "return", "memberTypes", ";", "}", "public", "ISourceMethod", "[", "]", "getMethods", "(", ")", "{", "SourceMethod", "[", "]", "methodHandles", "=", "getMethodHandles", "(", ")", ";", "int", "length", "=", "methodHandles", ".", "length", ";", "ISourceMethod", "[", "]", "methods", "=", "new", "ISourceMethod", "[", "length", "]", ";", "int", "methodIndex", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "try", "{", "ISourceMethod", "method", "=", "(", "ISourceMethod", ")", "methodHandles", "[", "i", "]", ".", "getElementInfo", "(", ")", ";", "methods", "[", "methodIndex", "++", "]", "=", "method", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "return", "methods", ";", "}", "public", "SourceMethod", "[", "]", "getMethodHandles", "(", ")", "{", "int", "length", "=", "this", ".", "children", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", "NO_METHODS", ";", "SourceMethod", "[", "]", "methods", "=", "new", "SourceMethod", "[", "length", "]", ";", "int", "methodIndex", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaElement", "child", "=", "this", ".", "children", "[", "i", "]", ";", "if", "(", "child", "instanceof", "SourceMethod", ")", "methods", "[", "methodIndex", "++", "]", "=", "(", "SourceMethod", ")", "child", ";", "}", "if", "(", "methodIndex", "==", "0", ")", "return", "NO_METHODS", ";", "if", "(", "methodIndex", "<", "length", ")", "System", ".", "arraycopy", "(", "methods", ",", "0", ",", "methods", "=", "new", "SourceMethod", "[", "methodIndex", "]", ",", "0", ",", "methodIndex", ")", ";", "return", "methods", ";", "}", "public", "char", "[", "]", "getName", "(", ")", "{", "return", "this", ".", "handle", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "}", "public", "char", "[", "]", "getSuperclassName", "(", ")", "{", "if", "(", "this", ".", "handle", ".", "getElementName", "(", ")", ".", "length", "(", ")", "==", "0", ")", "{", "char", "[", "]", "[", "]", "interfaceNames", "=", "this", ".", "superInterfaceNames", ";", "if", "(", "interfaceNames", "!=", "null", "&&", "interfaceNames", ".", "length", ">", "0", ")", "{", "return", "interfaceNames", "[", "0", "]", ";", "}", "}", "return", "this", ".", "superclassName", ";", "}", "public", "char", "[", "]", "[", "]", "[", "]", "getTypeParameterBounds", "(", ")", "{", "int", "length", "=", "this", ".", "typeParameters", ".", "length", ";", "char", "[", "]", "[", "]", "[", "]", "typeParameterBounds", "=", "new", "char", "[", "length", "]", "[", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "try", "{", "TypeParameterElementInfo", "info", "=", "(", "TypeParameterElementInfo", ")", "(", "(", "JavaElement", ")", "this", ".", "typeParameters", "[", "i", "]", ")", ".", "getElementInfo", "(", ")", ";", "typeParameterBounds", "[", "i", "]", "=", "info", ".", "bounds", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "return", "typeParameterBounds", ";", "}", "public", "char", "[", "]", "[", "]", "getTypeParameterNames", "(", ")", "{", "int", "length", "=", "this", ".", "typeParameters", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", "CharOperation", ".", "NO_CHAR_CHAR", ";", "char", "[", "]", "[", "]", "typeParameterNames", "=", "new", "char", "[", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "typeParameterNames", "[", "i", "]", "=", "this", ".", "typeParameters", "[", "i", "]", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "}", "return", "typeParameterNames", ";", "}", "public", "boolean", "isBinaryType", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isAnonymousMember", "(", ")", "{", "return", "false", ";", "}", "protected", "void", "setHandle", "(", "IType", "handle", ")", "{", "this", ".", "handle", "=", "handle", ";", "}", "protected", "void", "setSuperclassName", "(", "char", "[", "]", "superclassName", ")", "{", "this", ".", "superclassName", "=", "superclassName", ";", "}", "protected", "void", "setSuperInterfaceNames", "(", "char", "[", "]", "[", "]", "superInterfaceNames", ")", "{", "this", ".", "superInterfaceNames", "=", "superInterfaceNames", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"Info", "for", "\"", "+", "this", ".", "handle", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,919
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "List", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "AST", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "AnnotationTypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "EnumDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "SimpleName", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "StructuralPropertyDescriptor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "rewrite", ".", "ASTRewrite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "IndentManipulation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "public", "abstract", "class", "CreateTypeMemberOperation", "extends", "CreateElementInCUOperation", "{", "protected", "String", "source", "=", "null", ";", "protected", "String", "alteredName", ";", "protected", "ASTNode", "createdNode", ";", "public", "CreateTypeMemberOperation", "(", "IJavaElement", "parentElement", ",", "String", "source", ",", "boolean", "force", ")", "{", "super", "(", "parentElement", ")", ";", "this", ".", "source", "=", "source", ";", "this", ".", "force", "=", "force", ";", "}", "protected", "StructuralPropertyDescriptor", "getChildPropertyDescriptor", "(", "ASTNode", "parent", ")", "{", "switch", "(", "parent", ".", "getNodeType", "(", ")", ")", "{", "case", "ASTNode", ".", "COMPILATION_UNIT", ":", "return", "CompilationUnit", ".", "TYPES_PROPERTY", ";", "case", "ASTNode", ".", "ENUM_DECLARATION", ":", "return", "EnumDeclaration", ".", "BODY_DECLARATIONS_PROPERTY", ";", "case", "ASTNode", ".", "ANNOTATION_TYPE_DECLARATION", ":", "return", "AnnotationTypeDeclaration", ".", "BODY_DECLARATIONS_PROPERTY", ";", "default", ":", "return", "TypeDeclaration", ".", "BODY_DECLARATIONS_PROPERTY", ";", "}", "}", "protected", "ASTNode", "generateElementAST", "(", "ASTRewrite", "rewriter", ",", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", "{", "if", "(", "this", ".", "createdNode", "==", "null", ")", "{", "this", ".", "source", "=", "removeIndentAndNewLines", "(", "this", ".", "source", ",", "cu", ")", ";", "ASTParser", "parser", "=", "ASTParser", ".", "newParser", "(", "AST", ".", "JLS4", ")", ";", "parser", ".", "setSource", "(", "this", ".", "source", ".", "toCharArray", "(", ")", ")", ";", "parser", ".", "setProject", "(", "getCompilationUnit", "(", ")", ".", "getJavaProject", "(", ")", ")", ";", "parser", ".", "setKind", "(", "ASTParser", ".", "K_CLASS_BODY_DECLARATIONS", ")", ";", "ASTNode", "node", "=", "parser", ".", "createAST", "(", "this", ".", "progressMonitor", ")", ";", "String", "createdNodeSource", ";", "if", "(", "node", ".", "getNodeType", "(", ")", "!=", "ASTNode", ".", "TYPE_DECLARATION", ")", "{", "createdNodeSource", "=", "generateSyntaxIncorrectAST", "(", ")", ";", "if", "(", "this", ".", "createdNode", "==", "null", ")", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CONTENTS", ")", ")", ";", "}", "else", "{", "TypeDeclaration", "typeDeclaration", "=", "(", "TypeDeclaration", ")", "node", ";", "if", "(", "(", "typeDeclaration", ".", "getFlags", "(", ")", "&", "ASTNode", ".", "MALFORMED", ")", "!=", "0", ")", "{", "createdNodeSource", "=", "generateSyntaxIncorrectAST", "(", ")", ";", "if", "(", "this", ".", "createdNode", "==", "null", ")", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CONTENTS", ")", ")", ";", "}", "else", "{", "List", "bodyDeclarations", "=", "typeDeclaration", ".", "bodyDeclarations", "(", ")", ";", "if", "(", "bodyDeclarations", ".", "size", "(", ")", "==", "0", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CONTENTS", ")", ")", ";", "}", "this", ".", "createdNode", "=", "(", "ASTNode", ")", "bodyDeclarations", ".", "iterator", "(", ")", ".", "next", "(", ")", ";", "createdNodeSource", "=", "this", ".", "source", ";", "}", "}", "if", "(", "this", ".", "alteredName", "!=", "null", ")", "{", "SimpleName", "newName", "=", "this", ".", "createdNode", ".", "getAST", "(", ")", ".", "newSimpleName", "(", "this", ".", "alteredName", ")", ";", "SimpleName", "oldName", "=", "rename", "(", "this", ".", "createdNode", ",", "newName", ")", ";", "int", "nameStart", "=", "oldName", ".", "getStartPosition", "(", ")", ";", "int", "nameEnd", "=", "nameStart", "+", "oldName", ".", "getLength", "(", ")", ";", "StringBuffer", "newSource", "=", "new", "StringBuffer", "(", ")", ";", "if", "(", "this", ".", "source", ".", "equals", "(", "createdNodeSource", ")", ")", "{", "newSource", ".", "append", "(", "createdNodeSource", ".", "substring", "(", "0", ",", "nameStart", ")", ")", ";", "newSource", ".", "append", "(", "this", ".", "alteredName", ")", ";", "newSource", ".", "append", "(", "createdNodeSource", ".", "substring", "(", "nameEnd", ")", ")", ";", "}", "else", "{", "int", "createdNodeStart", "=", "this", ".", "createdNode", ".", "getStartPosition", "(", ")", ";", "int", "createdNodeEnd", "=", "createdNodeStart", "+", "this", ".", "createdNode", ".", "getLength", "(", ")", ";", "newSource", ".", "append", "(", "createdNodeSource", ".", "substring", "(", "createdNodeStart", ",", "nameStart", ")", ")", ";", "newSource", ".", "append", "(", "this", ".", "alteredName", ")", ";", "newSource", ".", "append", "(", "createdNodeSource", ".", "substring", "(", "nameEnd", ",", "createdNodeEnd", ")", ")", ";", "}", "this", ".", "source", "=", "newSource", ".", "toString", "(", ")", ";", "}", "}", "if", "(", "rewriter", "==", "null", ")", "return", "this", ".", "createdNode", ";", "return", "rewriter", ".", "createStringPlaceholder", "(", "this", ".", "source", ",", "this", ".", "createdNode", ".", "getNodeType", "(", ")", ")", ";", "}", "private", "String", "removeIndentAndNewLines", "(", "String", "code", ",", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", "{", "IJavaProject", "project", "=", "cu", ".", "getJavaProject", "(", ")", ";", "Map", "options", "=", "project", ".", "getOptions", "(", "true", ")", ";", "int", "tabWidth", "=", "IndentManipulation", ".", "getTabWidth", "(", "options", ")", ";", "int", "indentWidth", "=", "IndentManipulation", ".", "getIndentWidth", "(", "options", ")", ";", "int", "indent", "=", "IndentManipulation", ".", "measureIndentUnits", "(", "code", ",", "tabWidth", ",", "indentWidth", ")", ";", "int", "firstNonWhiteSpace", "=", "-", "1", ";", "int", "length", "=", "code", ".", "length", "(", ")", ";", "while", "(", "firstNonWhiteSpace", "<", "length", "-", "1", ")", "if", "(", "!", "ScannerHelper", ".", "isWhitespace", "(", "code", ".", "charAt", "(", "++", "firstNonWhiteSpace", ")", ")", ")", "break", ";", "int", "lastNonWhiteSpace", "=", "length", ";", "while", "(", "lastNonWhiteSpace", ">", "0", ")", "if", "(", "!", "ScannerHelper", ".", "isWhitespace", "(", "code", ".", "charAt", "(", "--", "lastNonWhiteSpace", ")", ")", ")", "break", ";", "String", "lineDelimiter", "=", "cu", ".", "findRecommendedLineSeparator", "(", ")", ";", "return", "IndentManipulation", ".", "changeIndent", "(", "code", ".", "substring", "(", "firstNonWhiteSpace", ",", "lastNonWhiteSpace", "+", "1", ")", ",", "indent", ",", "tabWidth", ",", "indentWidth", ",", "\"\"", ",", "lineDelimiter", ")", ";", "}", "protected", "abstract", "SimpleName", "rename", "(", "ASTNode", "node", ",", "SimpleName", "newName", ")", ";", "protected", "String", "generateSyntaxIncorrectAST", "(", ")", "{", "StringBuffer", "buff", "=", "new", "StringBuffer", "(", ")", ";", "IType", "type", "=", "getType", "(", ")", ";", "String", "lineSeparator", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "getLineSeparator", "(", "this", ".", "source", ",", "type", "==", "null", "?", "null", ":", "type", ".", "getJavaProject", "(", ")", ")", ";", "buff", ".", "append", "(", "lineSeparator", "+", "\"\"", "+", "lineSeparator", ")", ";", "buff", ".", "append", "(", "this", ".", "source", ")", ";", "buff", ".", "append", "(", "lineSeparator", ")", ".", "append", "(", "'}'", ")", ";", "ASTParser", "parser", "=", "ASTParser", ".", "newParser", "(", "AST", ".", "JLS4", ")", ";", "parser", ".", "setSource", "(", "buff", ".", "toString", "(", ")", ".", "toCharArray", "(", ")", ")", ";", "CompilationUnit", "compilationUnit", "=", "(", "CompilationUnit", ")", "parser", ".", "createAST", "(", "null", ")", ";", "TypeDeclaration", "typeDeclaration", "=", "(", "TypeDeclaration", ")", "compilationUnit", ".", "types", "(", ")", ".", "iterator", "(", ")", ".", "next", "(", ")", ";", "List", "bodyDeclarations", "=", "typeDeclaration", ".", "bodyDeclarations", "(", ")", ";", "if", "(", "bodyDeclarations", ".", "size", "(", ")", "!=", "0", ")", "this", ".", "createdNode", "=", "(", "ASTNode", ")", "bodyDeclarations", ".", "iterator", "(", ")", ".", "next", "(", ")", ";", "return", "buff", ".", "toString", "(", ")", ";", "}", "protected", "IType", "getType", "(", ")", "{", "return", "(", "IType", ")", "getParentElement", "(", ")", ";", "}", "protected", "void", "setAlteredName", "(", "String", "newName", ")", "{", "this", ".", "alteredName", "=", "newName", ";", "}", "public", "IJavaModelStatus", "verify", "(", ")", "{", "IJavaModelStatus", "status", "=", "super", ".", "verify", "(", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "if", "(", "this", ".", "source", "==", "null", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CONTENTS", ")", ";", "}", "if", "(", "!", "this", ".", "force", ")", "{", "try", "{", "ICompilationUnit", "cu", "=", "getCompilationUnit", "(", ")", ";", "generateElementAST", "(", "null", ",", "cu", ")", ";", "}", "catch", "(", "JavaModelException", "jme", ")", "{", "return", "jme", ".", "getJavaModelStatus", "(", ")", ";", "}", "return", "verifyNameCollision", "(", ")", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "protected", "IJavaModelStatus", "verifyNameCollision", "(", ")", "{", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,920
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "public", "class", "ExternalJavaProject", "extends", "JavaProject", "{", "public", "static", "final", "String", "EXTERNAL_PROJECT_NAME", "=", "\"", "\"", ";", "public", "ExternalJavaProject", "(", "IClasspathEntry", "[", "]", "rawClasspath", ")", "{", "super", "(", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getProject", "(", "EXTERNAL_PROJECT_NAME", ")", ",", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getJavaModel", "(", ")", ")", ";", "try", "{", "getPerProjectInfo", "(", ")", ".", "setRawClasspath", "(", "rawClasspath", ",", "defaultOutputLocation", "(", ")", ",", "JavaModelStatus", ".", "VERIFIED_OK", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "return", "this", "==", "o", ";", "}", "public", "boolean", "exists", "(", ")", "{", "return", "false", ";", "}", "public", "String", "getOption", "(", "String", "optionName", ",", "boolean", "inheritJavaCoreOptions", ")", "{", "if", "(", "JavaCore", ".", "COMPILER_PB_FORBIDDEN_REFERENCE", ".", "equals", "(", "optionName", ")", "||", "JavaCore", ".", "COMPILER_PB_DISCOURAGED_REFERENCE", ".", "equals", "(", "optionName", ")", ")", "return", "JavaCore", ".", "IGNORE", ";", "return", "super", ".", "getOption", "(", "optionName", ",", "inheritJavaCoreOptions", ")", ";", "}", "public", "boolean", "isOnClasspath", "(", "IJavaElement", "element", ")", "{", "return", "false", ";", "}", "public", "boolean", "isOnClasspath", "(", "IResource", "resource", ")", "{", "return", "false", ";", "}", "protected", "IStatus", "validateExistence", "(", "IResource", "underlyingResource", ")", "{", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,921
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Signature", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "MethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "SimpleName", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "SingleVariableDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "rewrite", ".", "ASTRewrite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "CreateMethodOperation", "extends", "CreateTypeMemberOperation", "{", "protected", "String", "[", "]", "parameterTypes", ";", "public", "CreateMethodOperation", "(", "IType", "parentElement", ",", "String", "source", ",", "boolean", "force", ")", "{", "super", "(", "parentElement", ",", "source", ",", "force", ")", ";", "}", "protected", "String", "[", "]", "convertASTMethodTypesToSignatures", "(", ")", "{", "if", "(", "this", ".", "parameterTypes", "==", "null", ")", "{", "if", "(", "this", ".", "createdNode", "!=", "null", ")", "{", "MethodDeclaration", "methodDeclaration", "=", "(", "MethodDeclaration", ")", "this", ".", "createdNode", ";", "List", "parameters", "=", "methodDeclaration", ".", "parameters", "(", ")", ";", "int", "size", "=", "parameters", ".", "size", "(", ")", ";", "this", ".", "parameterTypes", "=", "new", "String", "[", "size", "]", ";", "Iterator", "iterator", "=", "parameters", ".", "iterator", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "SingleVariableDeclaration", "parameter", "=", "(", "SingleVariableDeclaration", ")", "iterator", ".", "next", "(", ")", ";", "String", "typeSig", "=", "Util", ".", "getSignature", "(", "parameter", ".", "getType", "(", ")", ")", ";", "int", "extraDimensions", "=", "parameter", ".", "getExtraDimensions", "(", ")", ";", "if", "(", "methodDeclaration", ".", "isVarargs", "(", ")", "&&", "i", "==", "size", "-", "1", ")", "extraDimensions", "++", ";", "this", ".", "parameterTypes", "[", "i", "]", "=", "Signature", ".", "createArraySignature", "(", "typeSig", ",", "extraDimensions", ")", ";", "}", "}", "}", "return", "this", ".", "parameterTypes", ";", "}", "protected", "ASTNode", "generateElementAST", "(", "ASTRewrite", "rewriter", ",", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", "{", "ASTNode", "node", "=", "super", ".", "generateElementAST", "(", "rewriter", ",", "cu", ")", ";", "if", "(", "node", ".", "getNodeType", "(", ")", "!=", "ASTNode", ".", "METHOD_DECLARATION", ")", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CONTENTS", ")", ")", ";", "return", "node", ";", "}", "protected", "IJavaElement", "generateResultHandle", "(", ")", "{", "String", "[", "]", "types", "=", "convertASTMethodTypesToSignatures", "(", ")", ";", "String", "name", "=", "getASTNodeName", "(", ")", ";", "return", "getType", "(", ")", ".", "getMethod", "(", "name", ",", "types", ")", ";", "}", "private", "String", "getASTNodeName", "(", ")", "{", "return", "(", "(", "MethodDeclaration", ")", "this", ".", "createdNode", ")", ".", "getName", "(", ")", ".", "getIdentifier", "(", ")", ";", "}", "public", "String", "getMainTaskName", "(", ")", "{", "return", "Messages", ".", "operation_createMethodProgress", ";", "}", "protected", "SimpleName", "rename", "(", "ASTNode", "node", ",", "SimpleName", "newName", ")", "{", "MethodDeclaration", "method", "=", "(", "MethodDeclaration", ")", "node", ";", "SimpleName", "oldName", "=", "method", ".", "getName", "(", ")", ";", "method", ".", "setName", "(", "newName", ")", ";", "return", "oldName", ";", "}", "protected", "IJavaModelStatus", "verifyNameCollision", "(", ")", "{", "if", "(", "this", ".", "createdNode", "!=", "null", ")", "{", "IType", "type", "=", "getType", "(", ")", ";", "String", "name", ";", "if", "(", "(", "(", "MethodDeclaration", ")", "this", ".", "createdNode", ")", ".", "isConstructor", "(", ")", ")", "name", "=", "type", ".", "getElementName", "(", ")", ";", "else", "name", "=", "getASTNodeName", "(", ")", ";", "String", "[", "]", "types", "=", "convertASTMethodTypesToSignatures", "(", ")", ";", "if", "(", "type", ".", "getMethod", "(", "name", ",", "types", ")", ".", "exists", "(", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "NAME_COLLISION", ",", "Messages", ".", "bind", "(", "Messages", ".", "status_nameCollision", ",", "name", ")", ")", ";", "}", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,922
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "jobs", ".", "ISchedulingRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "public", "abstract", "class", "ChangeClasspathOperation", "extends", "JavaModelOperation", "{", "protected", "boolean", "canChangeResources", ";", "public", "ChangeClasspathOperation", "(", "IJavaElement", "[", "]", "elements", ",", "boolean", "canChangeResources", ")", "{", "super", "(", "elements", ")", ";", "this", ".", "canChangeResources", "=", "canChangeResources", ";", "}", "protected", "boolean", "canModifyRoots", "(", ")", "{", "return", "true", ";", "}", "protected", "void", "classpathChanged", "(", "ClasspathChange", "change", ",", "boolean", "refreshExternalFolder", ")", "throws", "JavaModelException", "{", "JavaProject", "project", "=", "change", ".", "project", ";", "project", ".", "resetCaches", "(", ")", ";", "if", "(", "this", ".", "canChangeResources", ")", "{", "if", "(", "isTopLevelOperation", "(", ")", "&&", "!", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "isTreeLocked", "(", ")", ")", "{", "new", "ClasspathValidation", "(", "project", ")", ".", "validate", "(", ")", ";", "}", "new", "ProjectReferenceChange", "(", "project", ",", "change", ".", "oldResolvedClasspath", ")", ".", "updateProjectReferencesIfNecessary", "(", ")", ";", "new", "ExternalFolderChange", "(", "project", ",", "change", ".", "oldResolvedClasspath", ")", ".", "updateExternalFoldersIfNecessary", "(", "refreshExternalFolder", ",", "null", ")", ";", "}", "else", "{", "DeltaProcessingState", "state", "=", "JavaModelManager", ".", "getDeltaState", "(", ")", ";", "JavaElementDelta", "delta", "=", "new", "JavaElementDelta", "(", "getJavaModel", "(", ")", ")", ";", "int", "result", "=", "change", ".", "generateDelta", "(", "delta", ",", "true", ")", ";", "if", "(", "(", "result", "&", "ClasspathChange", ".", "HAS_DELTA", ")", "!=", "0", ")", "{", "addDelta", "(", "delta", ")", ";", "state", ".", "rootsAreStale", "=", "true", ";", "change", ".", "requestIndexing", "(", ")", ";", "state", ".", "addClasspathValidation", "(", "project", ")", ";", "}", "if", "(", "(", "result", "&", "ClasspathChange", ".", "HAS_PROJECT_CHANGE", ")", "!=", "0", ")", "{", "state", ".", "addProjectReferenceChange", "(", "project", ",", "change", ".", "oldResolvedClasspath", ")", ";", "}", "if", "(", "(", "result", "&", "ClasspathChange", ".", "HAS_LIBRARY_CHANGE", ")", "!=", "0", ")", "{", "state", ".", "addExternalFolderChange", "(", "project", ",", "change", ".", "oldResolvedClasspath", ")", ";", "}", "}", "}", "protected", "ISchedulingRule", "getSchedulingRule", "(", ")", "{", "return", "null", ";", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "!", "this", ".", "canChangeResources", ";", "}", "}", "</s>" ]
3,923
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMemberValuePair", ";", "public", "class", "AnnotationInfo", "extends", "SourceRefElementInfo", "{", "public", "int", "nameStart", "=", "-", "1", ";", "public", "int", "nameEnd", "=", "-", "1", ";", "public", "IMemberValuePair", "[", "]", "members", ";", "}", "</s>" ]
3,924
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IImportDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMember", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IParent", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "CopyElementsOperation", "extends", "MultiOperation", "implements", "SuffixConstants", "{", "private", "Map", "sources", "=", "new", "HashMap", "(", ")", ";", "public", "CopyElementsOperation", "(", "IJavaElement", "[", "]", "elementsToCopy", ",", "IJavaElement", "[", "]", "destContainers", ",", "boolean", "force", ")", "{", "super", "(", "elementsToCopy", ",", "destContainers", ",", "force", ")", ";", "}", "public", "CopyElementsOperation", "(", "IJavaElement", "[", "]", "elementsToCopy", ",", "IJavaElement", "destContainer", ",", "boolean", "force", ")", "{", "this", "(", "elementsToCopy", ",", "new", "IJavaElement", "[", "]", "{", "destContainer", "}", ",", "force", ")", ";", "}", "protected", "String", "getMainTaskName", "(", ")", "{", "return", "Messages", ".", "operation_copyElementProgress", ";", "}", "protected", "JavaModelOperation", "getNestedOperation", "(", "IJavaElement", "element", ")", "{", "try", "{", "IJavaElement", "dest", "=", "getDestinationParent", "(", "element", ")", ";", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "PACKAGE_DECLARATION", ":", "return", "new", "CreatePackageDeclarationOperation", "(", "element", ".", "getElementName", "(", ")", ",", "(", "ICompilationUnit", ")", "dest", ")", ";", "case", "IJavaElement", ".", "IMPORT_DECLARATION", ":", "IImportDeclaration", "importDeclaration", "=", "(", "IImportDeclaration", ")", "element", ";", "return", "new", "CreateImportOperation", "(", "element", ".", "getElementName", "(", ")", ",", "(", "ICompilationUnit", ")", "dest", ",", "importDeclaration", ".", "getFlags", "(", ")", ")", ";", "case", "IJavaElement", ".", "TYPE", ":", "if", "(", "isRenamingMainType", "(", "element", ",", "dest", ")", ")", "{", "IPath", "path", "=", "element", ".", "getPath", "(", ")", ";", "String", "extension", "=", "path", ".", "getFileExtension", "(", ")", ";", "return", "new", "RenameResourceElementsOperation", "(", "new", "IJavaElement", "[", "]", "{", "dest", "}", ",", "new", "IJavaElement", "[", "]", "{", "dest", ".", "getParent", "(", ")", "}", ",", "new", "String", "[", "]", "{", "getNewNameFor", "(", "element", ")", "+", "'.'", "+", "extension", "}", ",", "this", ".", "force", ")", ";", "}", "else", "{", "String", "source", "=", "getSourceFor", "(", "element", ")", ";", "String", "lineSeparator", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "getLineSeparator", "(", "source", ",", "element", ".", "getJavaProject", "(", ")", ")", ";", "return", "new", "CreateTypeOperation", "(", "dest", ",", "source", "+", "lineSeparator", ",", "this", ".", "force", ")", ";", "}", "case", "IJavaElement", ".", "METHOD", ":", "String", "source", "=", "getSourceFor", "(", "element", ")", ";", "String", "lineSeparator", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "getLineSeparator", "(", "source", ",", "element", ".", "getJavaProject", "(", ")", ")", ";", "return", "new", "CreateMethodOperation", "(", "(", "IType", ")", "dest", ",", "source", "+", "lineSeparator", ",", "this", ".", "force", ")", ";", "case", "IJavaElement", ".", "FIELD", ":", "source", "=", "getSourceFor", "(", "element", ")", ";", "lineSeparator", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "getLineSeparator", "(", "source", ",", "element", ".", "getJavaProject", "(", ")", ")", ";", "return", "new", "CreateFieldOperation", "(", "(", "IType", ")", "dest", ",", "source", "+", "lineSeparator", ",", "this", ".", "force", ")", ";", "case", "IJavaElement", ".", "INITIALIZER", ":", "source", "=", "getSourceFor", "(", "element", ")", ";", "lineSeparator", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "getLineSeparator", "(", "source", ",", "element", ".", "getJavaProject", "(", ")", ")", ";", "return", "new", "CreateInitializerOperation", "(", "(", "IType", ")", "dest", ",", "source", "+", "lineSeparator", ")", ";", "default", ":", "return", "null", ";", "}", "}", "catch", "(", "JavaModelException", "npe", ")", "{", "return", "null", ";", "}", "}", "private", "String", "getSourceFor", "(", "IJavaElement", "element", ")", "throws", "JavaModelException", "{", "String", "source", "=", "(", "String", ")", "this", ".", "sources", ".", "get", "(", "element", ")", ";", "if", "(", "source", "==", "null", "&&", "element", "instanceof", "IMember", ")", "{", "source", "=", "(", "(", "IMember", ")", "element", ")", ".", "getSource", "(", ")", ";", "this", ".", "sources", ".", "put", "(", "element", ",", "source", ")", ";", "}", "return", "source", ";", "}", "protected", "boolean", "isRenamingMainType", "(", "IJavaElement", "element", ",", "IJavaElement", "dest", ")", "throws", "JavaModelException", "{", "if", "(", "(", "isRename", "(", ")", "||", "getNewNameFor", "(", "element", ")", "!=", "null", ")", "&&", "dest", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "COMPILATION_UNIT", ")", "{", "String", "typeName", "=", "dest", ".", "getElementName", "(", ")", ";", "typeName", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "getNameWithoutJavaLikeExtension", "(", "typeName", ")", ";", "return", "element", ".", "getElementName", "(", ")", ".", "equals", "(", "typeName", ")", "&&", "element", ".", "getParent", "(", ")", ".", "equals", "(", "dest", ")", ";", "}", "return", "false", ";", "}", "protected", "void", "processElement", "(", "IJavaElement", "element", ")", "throws", "JavaModelException", "{", "JavaModelOperation", "op", "=", "getNestedOperation", "(", "element", ")", ";", "boolean", "createElementInCUOperation", "=", "op", "instanceof", "CreateElementInCUOperation", ";", "if", "(", "op", "==", "null", ")", "{", "return", ";", "}", "if", "(", "createElementInCUOperation", ")", "{", "IJavaElement", "sibling", "=", "(", "IJavaElement", ")", "this", ".", "insertBeforeElements", ".", "get", "(", "element", ")", ";", "if", "(", "sibling", "!=", "null", ")", "{", "(", "(", "CreateElementInCUOperation", ")", "op", ")", ".", "setRelativePosition", "(", "sibling", ",", "CreateElementInCUOperation", ".", "INSERT_BEFORE", ")", ";", "}", "else", "if", "(", "isRename", "(", ")", ")", "{", "IJavaElement", "anchor", "=", "resolveRenameAnchor", "(", "element", ")", ";", "if", "(", "anchor", "!=", "null", ")", "{", "(", "(", "CreateElementInCUOperation", ")", "op", ")", ".", "setRelativePosition", "(", "anchor", ",", "CreateElementInCUOperation", ".", "INSERT_AFTER", ")", ";", "}", "}", "String", "newName", "=", "getNewNameFor", "(", "element", ")", ";", "if", "(", "newName", "!=", "null", ")", "{", "(", "(", "CreateElementInCUOperation", ")", "op", ")", ".", "setAlteredName", "(", "newName", ")", ";", "}", "}", "executeNestedOperation", "(", "op", ",", "1", ")", ";", "JavaElement", "destination", "=", "(", "JavaElement", ")", "getDestinationParent", "(", "element", ")", ";", "ICompilationUnit", "unit", "=", "destination", ".", "getCompilationUnit", "(", ")", ";", "if", "(", "!", "unit", ".", "isWorkingCopy", "(", ")", ")", "{", "unit", ".", "close", "(", ")", ";", "}", "if", "(", "createElementInCUOperation", "&&", "isMove", "(", ")", "&&", "!", "isRenamingMainType", "(", "element", ",", "destination", ")", ")", "{", "JavaModelOperation", "deleteOp", "=", "new", "DeleteElementsOperation", "(", "new", "IJavaElement", "[", "]", "{", "element", "}", ",", "this", ".", "force", ")", ";", "executeNestedOperation", "(", "deleteOp", ",", "1", ")", ";", "}", "}", "private", "IJavaElement", "resolveRenameAnchor", "(", "IJavaElement", "element", ")", "throws", "JavaModelException", "{", "IParent", "parent", "=", "(", "IParent", ")", "element", ".", "getParent", "(", ")", ";", "IJavaElement", "[", "]", "children", "=", "parent", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "IJavaElement", "child", "=", "children", "[", "i", "]", ";", "if", "(", "child", ".", "equals", "(", "element", ")", ")", "{", "return", "child", ";", "}", "}", "return", "null", ";", "}", "protected", "IJavaModelStatus", "verify", "(", ")", "{", "IJavaModelStatus", "status", "=", "super", ".", "verify", "(", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "if", "(", "this", ".", "renamingsList", "!=", "null", "&&", "this", ".", "renamingsList", ".", "length", "!=", "this", ".", "elementsToProcess", ".", "length", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INDEX_OUT_OF_BOUNDS", ")", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "protected", "void", "verify", "(", "IJavaElement", "element", ")", "throws", "JavaModelException", "{", "if", "(", "element", "==", "null", "||", "!", "element", ".", "exists", "(", ")", ")", "error", "(", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ",", "element", ")", ";", "if", "(", "element", ".", "getElementType", "(", ")", "<", "IJavaElement", ".", "TYPE", ")", "error", "(", "IJavaModelStatusConstants", ".", "INVALID_ELEMENT_TYPES", ",", "element", ")", ";", "if", "(", "element", ".", "isReadOnly", "(", ")", ")", "error", "(", "IJavaModelStatusConstants", ".", "READ_ONLY", ",", "element", ")", ";", "IJavaElement", "dest", "=", "getDestinationParent", "(", "element", ")", ";", "verifyDestination", "(", "element", ",", "dest", ")", ";", "verifySibling", "(", "element", ",", "dest", ")", ";", "if", "(", "this", ".", "renamingsList", "!=", "null", ")", "{", "verifyRenaming", "(", "element", ")", ";", "}", "}", "}", "</s>" ]
3,925
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "StringReader", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "preferences", ".", "IEclipsePreferences", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathContainer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "import", "org", ".", "osgi", ".", "service", ".", "prefs", ".", "BackingStoreException", ";", "public", "class", "UserLibraryManager", "{", "public", "final", "static", "String", "CP_USERLIBRARY_PREFERENCES_PREFIX", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "Map", "userLibraries", ";", "public", "UserLibraryManager", "(", ")", "{", "initialize", "(", ")", ";", "}", "public", "synchronized", "UserLibrary", "getUserLibrary", "(", "String", "libName", ")", "{", "return", "(", "UserLibrary", ")", "this", ".", "userLibraries", ".", "get", "(", "libName", ")", ";", "}", "public", "synchronized", "String", "[", "]", "getUserLibraryNames", "(", ")", "{", "Set", "set", "=", "this", ".", "userLibraries", ".", "keySet", "(", ")", ";", "return", "(", "String", "[", "]", ")", "set", ".", "toArray", "(", "new", "String", "[", "set", ".", "size", "(", ")", "]", ")", ";", "}", "private", "void", "initialize", "(", ")", "{", "this", ".", "userLibraries", "=", "new", "HashMap", "(", ")", ";", "IEclipsePreferences", "instancePreferences", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getInstancePreferences", "(", ")", ";", "String", "[", "]", "propertyNames", ";", "try", "{", "propertyNames", "=", "instancePreferences", ".", "keys", "(", ")", ";", "}", "catch", "(", "BackingStoreException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "return", ";", "}", "boolean", "preferencesNeedFlush", "=", "false", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "propertyNames", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "propertyName", "=", "propertyNames", "[", "i", "]", ";", "if", "(", "propertyName", ".", "startsWith", "(", "CP_USERLIBRARY_PREFERENCES_PREFIX", ")", ")", "{", "String", "propertyValue", "=", "instancePreferences", ".", "get", "(", "propertyName", ",", "null", ")", ";", "if", "(", "propertyValue", "!=", "null", ")", "{", "String", "libName", "=", "propertyName", ".", "substring", "(", "CP_USERLIBRARY_PREFERENCES_PREFIX", ".", "length", "(", ")", ")", ";", "StringReader", "reader", "=", "new", "StringReader", "(", "propertyValue", ")", ";", "UserLibrary", "library", ";", "try", "{", "library", "=", "UserLibrary", ".", "createFromString", "(", "reader", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "libName", ")", ";", "instancePreferences", ".", "remove", "(", "propertyName", ")", ";", "preferencesNeedFlush", "=", "true", ";", "continue", ";", "}", "catch", "(", "ClasspathEntry", ".", "AssertionFailedException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "libName", ")", ";", "instancePreferences", ".", "remove", "(", "propertyName", ")", ";", "preferencesNeedFlush", "=", "true", ";", "continue", ";", "}", "this", ".", "userLibraries", ".", "put", "(", "libName", ",", "library", ")", ";", "}", "}", "}", "if", "(", "preferencesNeedFlush", ")", "{", "try", "{", "instancePreferences", ".", "flush", "(", ")", ";", "}", "catch", "(", "BackingStoreException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "}", "}", "}", "public", "void", "updateUserLibrary", "(", "String", "libName", ",", "String", "encodedUserLibrary", ")", "{", "try", "{", "IPath", "containerPath", "=", "new", "Path", "(", "JavaCore", ".", "USER_LIBRARY_CONTAINER_ID", ")", ".", "append", "(", "libName", ")", ";", "IJavaProject", "[", "]", "allJavaProjects", "=", "JavaCore", ".", "create", "(", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ")", ".", "getJavaProjects", "(", ")", ";", "ArrayList", "affectedProjects", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "allJavaProjects", ".", "length", ";", "i", "++", ")", "{", "IJavaProject", "javaProject", "=", "allJavaProjects", "[", "i", "]", ";", "IClasspathEntry", "[", "]", "entries", "=", "javaProject", ".", "getRawClasspath", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "entries", ".", "length", ";", "j", "++", ")", "{", "IClasspathEntry", "entry", "=", "entries", "[", "j", "]", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_CONTAINER", ")", "{", "if", "(", "containerPath", ".", "equals", "(", "entry", ".", "getPath", "(", ")", ")", ")", "{", "affectedProjects", ".", "add", "(", "javaProject", ")", ";", "break", ";", "}", "}", "}", "}", "UserLibrary", "userLibrary", "=", "encodedUserLibrary", "==", "null", "?", "null", ":", "UserLibrary", ".", "createFromString", "(", "new", "StringReader", "(", "encodedUserLibrary", ")", ")", ";", "synchronized", "(", "this", ")", "{", "if", "(", "userLibrary", "!=", "null", ")", "{", "this", ".", "userLibraries", ".", "put", "(", "libName", ",", "userLibrary", ")", ";", "}", "else", "{", "this", ".", "userLibraries", ".", "remove", "(", "libName", ")", ";", "}", "}", "int", "length", "=", "affectedProjects", ".", "size", "(", ")", ";", "if", "(", "length", "==", "0", ")", "return", ";", "IJavaProject", "[", "]", "projects", "=", "new", "IJavaProject", "[", "length", "]", ";", "affectedProjects", ".", "toArray", "(", "projects", ")", ";", "IClasspathContainer", "[", "]", "containers", "=", "new", "IClasspathContainer", "[", "length", "]", ";", "if", "(", "userLibrary", "!=", "null", ")", "{", "UserLibraryClasspathContainer", "container", "=", "new", "UserLibraryClasspathContainer", "(", "libName", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "containers", "[", "i", "]", "=", "container", ";", "}", "}", "JavaCore", ".", "setClasspathContainer", "(", "containerPath", ",", "projects", ",", "containers", ",", "null", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "libName", "+", "\"'.\"", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "libName", "+", "\"'.\"", ")", ";", "}", "catch", "(", "ClasspathEntry", ".", "AssertionFailedException", "ase", ")", "{", "Util", ".", "log", "(", "ase", ",", "\"\"", "+", "libName", "+", "\"'.\"", ")", ";", "}", "}", "public", "void", "removeUserLibrary", "(", "String", "libName", ")", "{", "synchronized", "(", "this", ".", "userLibraries", ")", "{", "IEclipsePreferences", "instancePreferences", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getInstancePreferences", "(", ")", ";", "String", "propertyName", "=", "CP_USERLIBRARY_PREFERENCES_PREFIX", "+", "libName", ";", "instancePreferences", ".", "remove", "(", "propertyName", ")", ";", "try", "{", "instancePreferences", ".", "flush", "(", ")", ";", "}", "catch", "(", "BackingStoreException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "libName", ")", ";", "}", "}", "}", "public", "void", "setUserLibrary", "(", "String", "libName", ",", "IClasspathEntry", "[", "]", "entries", ",", "boolean", "isSystemLibrary", ")", "{", "synchronized", "(", "this", ".", "userLibraries", ")", "{", "IEclipsePreferences", "instancePreferences", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getInstancePreferences", "(", ")", ";", "String", "propertyName", "=", "CP_USERLIBRARY_PREFERENCES_PREFIX", "+", "libName", ";", "try", "{", "String", "propertyValue", "=", "UserLibrary", ".", "serialize", "(", "entries", ",", "isSystemLibrary", ")", ";", "instancePreferences", ".", "put", "(", "propertyName", ",", "propertyValue", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "libName", ")", ";", "return", ";", "}", "try", "{", "instancePreferences", ".", "flush", "(", ")", ";", "}", "catch", "(", "BackingStoreException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "libName", ")", ";", "}", "}", "}", "}", "</s>" ]
3,926
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Stack", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Flags", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IAnnotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMemberValuePair", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ITypeParameter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Signature", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ISourceElementRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Argument", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayInitializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ClassLiteralAccess", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ImportReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Literal", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MemberValuePair", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "NullLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "OperatorIds", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedNameReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SingleNameReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "UnaryExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Parser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "RecoveryScanner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "HashtableOfObject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "HashtableOfObjectToInt", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "ReferenceInfoAdapter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "CompilationUnitStructureRequestor", "extends", "ReferenceInfoAdapter", "implements", "ISourceElementRequestor", "{", "protected", "ICompilationUnit", "unit", ";", "protected", "CompilationUnitElementInfo", "unitInfo", ";", "protected", "ImportContainerInfo", "importContainerInfo", "=", "null", ";", "protected", "ImportContainer", "importContainer", ";", "protected", "Map", "newElements", ";", "private", "HashtableOfObjectToInt", "occurenceCounts", ";", "protected", "Stack", "infoStack", ";", "protected", "HashMap", "children", ";", "protected", "Stack", "handleStack", ";", "protected", "int", "referenceCount", "=", "0", ";", "protected", "boolean", "hasSyntaxErrors", "=", "false", ";", "protected", "Parser", "parser", ";", "protected", "HashtableOfObject", "fieldRefCache", ";", "protected", "HashtableOfObject", "messageRefCache", ";", "protected", "HashtableOfObject", "typeRefCache", ";", "protected", "HashtableOfObject", "unknownRefCache", ";", "protected", "CompilationUnitStructureRequestor", "(", "ICompilationUnit", "unit", ",", "CompilationUnitElementInfo", "unitInfo", ",", "Map", "newElements", ")", "{", "this", ".", "unit", "=", "unit", ";", "this", ".", "unitInfo", "=", "unitInfo", ";", "this", ".", "newElements", "=", "newElements", ";", "this", ".", "occurenceCounts", "=", "new", "HashtableOfObjectToInt", "(", ")", ";", "}", "public", "void", "acceptImport", "(", "int", "declarationStart", ",", "int", "declarationEnd", ",", "int", "nameSourceStart", ",", "int", "nameSourceEnd", ",", "char", "[", "]", "[", "]", "tokens", ",", "boolean", "onDemand", ",", "int", "modifiers", ")", "{", "JavaElement", "parentHandle", "=", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "if", "(", "!", "(", "parentHandle", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "COMPILATION_UNIT", ")", ")", "{", "Assert", ".", "isTrue", "(", "false", ")", ";", "}", "ICompilationUnit", "parentCU", "=", "(", "ICompilationUnit", ")", "parentHandle", ";", "if", "(", "this", ".", "importContainer", "==", "null", ")", "{", "this", ".", "importContainer", "=", "createImportContainer", "(", "parentCU", ")", ";", "this", ".", "importContainerInfo", "=", "new", "ImportContainerInfo", "(", ")", ";", "Object", "parentInfo", "=", "this", ".", "infoStack", ".", "peek", "(", ")", ";", "addToChildren", "(", "parentInfo", ",", "this", ".", "importContainer", ")", ";", "this", ".", "newElements", ".", "put", "(", "this", ".", "importContainer", ",", "this", ".", "importContainerInfo", ")", ";", "}", "String", "elementName", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "intern", "(", "new", "String", "(", "CharOperation", ".", "concatWith", "(", "tokens", ",", "'.'", ")", ")", ")", ";", "ImportDeclaration", "handle", "=", "createImportDeclaration", "(", "this", ".", "importContainer", ",", "elementName", ",", "onDemand", ")", ";", "resolveDuplicates", "(", "handle", ")", ";", "ImportDeclarationElementInfo", "info", "=", "new", "ImportDeclarationElementInfo", "(", ")", ";", "info", ".", "setSourceRangeStart", "(", "declarationStart", ")", ";", "info", ".", "setSourceRangeEnd", "(", "declarationEnd", ")", ";", "info", ".", "setNameSourceStart", "(", "nameSourceStart", ")", ";", "info", ".", "setNameSourceEnd", "(", "nameSourceEnd", ")", ";", "info", ".", "setFlags", "(", "modifiers", ")", ";", "addToChildren", "(", "this", ".", "importContainerInfo", ",", "handle", ")", ";", "this", ".", "newElements", ".", "put", "(", "handle", ",", "info", ")", ";", "}", "public", "void", "acceptLineSeparatorPositions", "(", "int", "[", "]", "positions", ")", "{", "}", "public", "void", "acceptPackage", "(", "ImportReference", "importReference", ")", "{", "Object", "parentInfo", "=", "this", ".", "infoStack", ".", "peek", "(", ")", ";", "JavaElement", "parentHandle", "=", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "PackageDeclaration", "handle", "=", "null", ";", "if", "(", "parentHandle", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "COMPILATION_UNIT", ")", "{", "char", "[", "]", "name", "=", "CharOperation", ".", "concatWith", "(", "importReference", ".", "getImportName", "(", ")", ",", "'.'", ")", ";", "handle", "=", "createPackageDeclaration", "(", "parentHandle", ",", "new", "String", "(", "name", ")", ")", ";", "}", "else", "{", "Assert", ".", "isTrue", "(", "false", ")", ";", "}", "resolveDuplicates", "(", "handle", ")", ";", "AnnotatableInfo", "info", "=", "new", "AnnotatableInfo", "(", ")", ";", "info", ".", "setSourceRangeStart", "(", "importReference", ".", "declarationSourceStart", ")", ";", "info", ".", "setSourceRangeEnd", "(", "importReference", ".", "declarationSourceEnd", ")", ";", "info", ".", "setNameSourceStart", "(", "importReference", ".", "sourceStart", ")", ";", "info", ".", "setNameSourceEnd", "(", "importReference", ".", "sourceEnd", ")", ";", "addToChildren", "(", "parentInfo", ",", "handle", ")", ";", "this", ".", "newElements", ".", "put", "(", "handle", ",", "info", ")", ";", "if", "(", "importReference", ".", "annotations", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "importReference", ".", "annotations", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", "annotation", "=", "importReference", ".", "annotations", "[", "i", "]", ";", "acceptAnnotation", "(", "annotation", ",", "info", ",", "handle", ")", ";", "}", "}", "}", "public", "void", "acceptProblem", "(", "CategorizedProblem", "problem", ")", "{", "if", "(", "(", "problem", ".", "getID", "(", ")", "&", "IProblem", ".", "Syntax", ")", "!=", "0", ")", "{", "this", ".", "hasSyntaxErrors", "=", "true", ";", "}", "}", "private", "void", "addToChildren", "(", "Object", "parentInfo", ",", "JavaElement", "handle", ")", "{", "ArrayList", "childrenList", "=", "(", "ArrayList", ")", "this", ".", "children", ".", "get", "(", "parentInfo", ")", ";", "if", "(", "childrenList", "==", "null", ")", "this", ".", "children", ".", "put", "(", "parentInfo", ",", "childrenList", "=", "new", "ArrayList", "(", ")", ")", ";", "childrenList", ".", "add", "(", "handle", ")", ";", "}", "protected", "Annotation", "createAnnotation", "(", "JavaElement", "parent", ",", "String", "name", ")", "{", "return", "new", "Annotation", "(", "parent", ",", "name", ")", ";", "}", "protected", "SourceField", "createField", "(", "JavaElement", "parent", ",", "FieldInfo", "fieldInfo", ")", "{", "String", "fieldName", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "intern", "(", "new", "String", "(", "fieldInfo", ".", "name", ")", ")", ";", "return", "new", "SourceField", "(", "parent", ",", "fieldName", ")", ";", "}", "protected", "ImportContainer", "createImportContainer", "(", "ICompilationUnit", "parent", ")", "{", "return", "(", "ImportContainer", ")", "parent", ".", "getImportContainer", "(", ")", ";", "}", "protected", "ImportDeclaration", "createImportDeclaration", "(", "ImportContainer", "parent", ",", "String", "name", ",", "boolean", "onDemand", ")", "{", "return", "new", "ImportDeclaration", "(", "parent", ",", "name", ",", "onDemand", ")", ";", "}", "protected", "Initializer", "createInitializer", "(", "JavaElement", "parent", ")", "{", "return", "new", "Initializer", "(", "parent", ",", "1", ")", ";", "}", "protected", "SourceMethod", "createMethodHandle", "(", "JavaElement", "parent", ",", "MethodInfo", "methodInfo", ")", "{", "String", "selector", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "intern", "(", "new", "String", "(", "methodInfo", ".", "name", ")", ")", ";", "String", "[", "]", "parameterTypeSigs", "=", "convertTypeNamesToSigs", "(", "methodInfo", ".", "parameterTypes", ")", ";", "return", "new", "SourceMethod", "(", "parent", ",", "selector", ",", "parameterTypeSigs", ")", ";", "}", "protected", "PackageDeclaration", "createPackageDeclaration", "(", "JavaElement", "parent", ",", "String", "name", ")", "{", "return", "new", "PackageDeclaration", "(", "(", "CompilationUnit", ")", "parent", ",", "name", ")", ";", "}", "protected", "SourceType", "createTypeHandle", "(", "JavaElement", "parent", ",", "TypeInfo", "typeInfo", ")", "{", "String", "nameString", "=", "new", "String", "(", "typeInfo", ".", "name", ")", ";", "return", "new", "SourceType", "(", "parent", ",", "nameString", ")", ";", "}", "protected", "TypeParameter", "createTypeParameter", "(", "JavaElement", "parent", ",", "String", "name", ")", "{", "return", "new", "TypeParameter", "(", "parent", ",", "name", ")", ";", "}", "protected", "static", "String", "[", "]", "convertTypeNamesToSigs", "(", "char", "[", "]", "[", "]", "typeNames", ")", "{", "if", "(", "typeNames", "==", "null", ")", "return", "CharOperation", ".", "NO_STRINGS", ";", "int", "n", "=", "typeNames", ".", "length", ";", "if", "(", "n", "==", "0", ")", "return", "CharOperation", ".", "NO_STRINGS", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "String", "[", "]", "typeSigs", "=", "new", "String", "[", "n", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n", ";", "++", "i", ")", "{", "typeSigs", "[", "i", "]", "=", "manager", ".", "intern", "(", "Signature", ".", "createTypeSignature", "(", "typeNames", "[", "i", "]", ",", "false", ")", ")", ";", "}", "return", "typeSigs", ";", "}", "protected", "IAnnotation", "acceptAnnotation", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", "annotation", ",", "AnnotatableInfo", "parentInfo", ",", "JavaElement", "parentHandle", ")", "{", "String", "nameString", "=", "new", "String", "(", "CharOperation", ".", "concatWith", "(", "annotation", ".", "type", ".", "getTypeName", "(", ")", ",", "'.'", ")", ")", ";", "Annotation", "handle", "=", "createAnnotation", "(", "parentHandle", ",", "nameString", ")", ";", "resolveDuplicates", "(", "handle", ")", ";", "AnnotationInfo", "info", "=", "new", "AnnotationInfo", "(", ")", ";", "this", ".", "newElements", ".", "put", "(", "handle", ",", "info", ")", ";", "this", ".", "handleStack", ".", "push", "(", "handle", ")", ";", "info", ".", "setSourceRangeStart", "(", "annotation", ".", "sourceStart", "(", ")", ")", ";", "info", ".", "nameStart", "=", "annotation", ".", "type", ".", "sourceStart", "(", ")", ";", "info", ".", "nameEnd", "=", "annotation", ".", "type", ".", "sourceEnd", "(", ")", ";", "MemberValuePair", "[", "]", "memberValuePairs", "=", "annotation", ".", "memberValuePairs", "(", ")", ";", "int", "membersLength", "=", "memberValuePairs", ".", "length", ";", "if", "(", "membersLength", "==", "0", ")", "{", "info", ".", "members", "=", "Annotation", ".", "NO_MEMBER_VALUE_PAIRS", ";", "}", "else", "{", "info", ".", "members", "=", "getMemberValuePairs", "(", "memberValuePairs", ")", ";", "}", "if", "(", "parentInfo", "!=", "null", ")", "{", "IAnnotation", "[", "]", "annotations", "=", "parentInfo", ".", "annotations", ";", "int", "length", "=", "annotations", ".", "length", ";", "System", ".", "arraycopy", "(", "annotations", ",", "0", ",", "annotations", "=", "new", "IAnnotation", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "annotations", "[", "length", "]", "=", "handle", ";", "parentInfo", ".", "annotations", "=", "annotations", ";", "}", "info", ".", "setSourceRangeEnd", "(", "annotation", ".", "declarationSourceEnd", ")", ";", "this", ".", "handleStack", ".", "pop", "(", ")", ";", "return", "handle", ";", "}", "public", "void", "enterCompilationUnit", "(", ")", "{", "this", ".", "infoStack", "=", "new", "Stack", "(", ")", ";", "this", ".", "children", "=", "new", "HashMap", "(", ")", ";", "this", ".", "handleStack", "=", "new", "Stack", "(", ")", ";", "this", ".", "infoStack", ".", "push", "(", "this", ".", "unitInfo", ")", ";", "this", ".", "handleStack", ".", "push", "(", "this", ".", "unit", ")", ";", "}", "public", "void", "enterConstructor", "(", "MethodInfo", "methodInfo", ")", "{", "enterMethod", "(", "methodInfo", ")", ";", "}", "public", "void", "enterField", "(", "FieldInfo", "fieldInfo", ")", "{", "TypeInfo", "parentInfo", "=", "(", "TypeInfo", ")", "this", ".", "infoStack", ".", "peek", "(", ")", ";", "JavaElement", "parentHandle", "=", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "SourceField", "handle", "=", "null", ";", "if", "(", "parentHandle", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "TYPE", ")", "{", "handle", "=", "createField", "(", "parentHandle", ",", "fieldInfo", ")", ";", "}", "else", "{", "Assert", ".", "isTrue", "(", "false", ")", ";", "}", "resolveDuplicates", "(", "handle", ")", ";", "addToChildren", "(", "parentInfo", ",", "handle", ")", ";", "parentInfo", ".", "childrenCategories", ".", "put", "(", "handle", ",", "fieldInfo", ".", "categories", ")", ";", "this", ".", "infoStack", ".", "push", "(", "fieldInfo", ")", ";", "this", ".", "handleStack", ".", "push", "(", "handle", ")", ";", "}", "public", "void", "enterInitializer", "(", "int", "declarationSourceStart", ",", "int", "modifiers", ")", "{", "Object", "parentInfo", "=", "this", ".", "infoStack", ".", "peek", "(", ")", ";", "JavaElement", "parentHandle", "=", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "Initializer", "handle", "=", "null", ";", "if", "(", "parentHandle", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "TYPE", ")", "{", "handle", "=", "createInitializer", "(", "parentHandle", ")", ";", "}", "else", "{", "Assert", ".", "isTrue", "(", "false", ")", ";", "}", "resolveDuplicates", "(", "handle", ")", ";", "addToChildren", "(", "parentInfo", ",", "handle", ")", ";", "this", ".", "infoStack", ".", "push", "(", "new", "int", "[", "]", "{", "declarationSourceStart", ",", "modifiers", "}", ")", ";", "this", ".", "handleStack", ".", "push", "(", "handle", ")", ";", "}", "public", "void", "enterMethod", "(", "MethodInfo", "methodInfo", ")", "{", "TypeInfo", "parentInfo", "=", "(", "TypeInfo", ")", "this", ".", "infoStack", ".", "peek", "(", ")", ";", "JavaElement", "parentHandle", "=", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "SourceMethod", "handle", "=", "null", ";", "if", "(", "methodInfo", ".", "parameterTypes", "==", "null", ")", "{", "methodInfo", ".", "parameterTypes", "=", "CharOperation", ".", "NO_CHAR_CHAR", ";", "}", "if", "(", "methodInfo", ".", "parameterNames", "==", "null", ")", "{", "methodInfo", ".", "parameterNames", "=", "CharOperation", ".", "NO_CHAR_CHAR", ";", "}", "if", "(", "methodInfo", ".", "exceptionTypes", "==", "null", ")", "{", "methodInfo", ".", "exceptionTypes", "=", "CharOperation", ".", "NO_CHAR_CHAR", ";", "}", "if", "(", "parentHandle", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "TYPE", ")", "{", "handle", "=", "createMethodHandle", "(", "parentHandle", ",", "methodInfo", ")", ";", "}", "else", "{", "Assert", ".", "isTrue", "(", "false", ")", ";", "}", "resolveDuplicates", "(", "handle", ")", ";", "this", ".", "infoStack", ".", "push", "(", "methodInfo", ")", ";", "this", ".", "handleStack", ".", "push", "(", "handle", ")", ";", "addToChildren", "(", "parentInfo", ",", "handle", ")", ";", "parentInfo", ".", "childrenCategories", ".", "put", "(", "handle", ",", "methodInfo", ".", "categories", ")", ";", "}", "private", "SourceMethodElementInfo", "createMethodInfo", "(", "MethodInfo", "methodInfo", ",", "SourceMethod", "handle", ")", "{", "IJavaElement", "[", "]", "elements", "=", "getChildren", "(", "methodInfo", ")", ";", "SourceMethodElementInfo", "info", ";", "if", "(", "methodInfo", ".", "isConstructor", ")", "{", "info", "=", "elements", ".", "length", "==", "0", "?", "new", "SourceConstructorInfo", "(", ")", ":", "new", "SourceConstructorWithChildrenInfo", "(", "elements", ")", ";", "}", "else", "if", "(", "methodInfo", ".", "isAnnotation", ")", "{", "info", "=", "new", "SourceAnnotationMethodInfo", "(", ")", ";", "}", "else", "{", "info", "=", "elements", ".", "length", "==", "0", "?", "new", "SourceMethodInfo", "(", ")", ":", "new", "SourceMethodWithChildrenInfo", "(", "elements", ")", ";", "}", "info", ".", "setSourceRangeStart", "(", "methodInfo", ".", "declarationStart", ")", ";", "int", "flags", "=", "methodInfo", ".", "modifiers", ";", "info", ".", "setNameSourceStart", "(", "methodInfo", ".", "nameSourceStart", ")", ";", "info", ".", "setNameSourceEnd", "(", "methodInfo", ".", "nameSourceEnd", ")", ";", "info", ".", "setFlags", "(", "flags", ")", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "char", "[", "]", "[", "]", "parameterNames", "=", "methodInfo", ".", "parameterNames", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "parameterNames", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "parameterNames", "[", "i", "]", "=", "manager", ".", "intern", "(", "parameterNames", "[", "i", "]", ")", ";", "info", ".", "setArgumentNames", "(", "parameterNames", ")", ";", "char", "[", "]", "returnType", "=", "methodInfo", ".", "returnType", "==", "null", "?", "new", "char", "[", "]", "{", "'v'", ",", "'o'", ",", "'i'", ",", "'d'", "}", ":", "methodInfo", ".", "returnType", ";", "info", ".", "setReturnType", "(", "manager", ".", "intern", "(", "returnType", ")", ")", ";", "char", "[", "]", "[", "]", "exceptionTypes", "=", "methodInfo", ".", "exceptionTypes", ";", "info", ".", "setExceptionTypeNames", "(", "exceptionTypes", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "exceptionTypes", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "exceptionTypes", "[", "i", "]", "=", "manager", ".", "intern", "(", "exceptionTypes", "[", "i", "]", ")", ";", "this", ".", "newElements", ".", "put", "(", "handle", ",", "info", ")", ";", "if", "(", "methodInfo", ".", "typeParameters", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "methodInfo", ".", "typeParameters", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "TypeParameterInfo", "typeParameterInfo", "=", "methodInfo", ".", "typeParameters", "[", "i", "]", ";", "acceptTypeParameter", "(", "typeParameterInfo", ",", "info", ")", ";", "}", "}", "if", "(", "methodInfo", ".", "annotations", "!=", "null", ")", "{", "int", "length", "=", "methodInfo", ".", "annotations", ".", "length", ";", "this", ".", "unitInfo", ".", "annotationNumber", "+=", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", "annotation", "=", "methodInfo", ".", "annotations", "[", "i", "]", ";", "acceptAnnotation", "(", "annotation", ",", "info", ",", "handle", ")", ";", "}", "}", "if", "(", "methodInfo", ".", "node", "!=", "null", "&&", "methodInfo", ".", "node", ".", "arguments", "!=", "null", ")", "{", "info", ".", "arguments", "=", "acceptMethodParameters", "(", "methodInfo", ".", "node", ".", "arguments", ",", "handle", ",", "methodInfo", ")", ";", "}", "return", "info", ";", "}", "private", "LocalVariable", "[", "]", "acceptMethodParameters", "(", "Argument", "[", "]", "arguments", ",", "JavaElement", "methodHandle", ",", "MethodInfo", "methodInfo", ")", "{", "if", "(", "arguments", "==", "null", ")", "return", "null", ";", "LocalVariable", "[", "]", "result", "=", "new", "LocalVariable", "[", "arguments", ".", "length", "]", ";", "Annotation", "[", "]", "[", "]", "paramAnnotations", "=", "new", "Annotation", "[", "arguments", ".", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "arguments", ".", "length", ";", "i", "++", ")", "{", "Argument", "argument", "=", "arguments", "[", "i", "]", ";", "AnnotatableInfo", "localVarInfo", "=", "new", "AnnotatableInfo", "(", ")", ";", "localVarInfo", ".", "setSourceRangeStart", "(", "argument", ".", "declarationSourceStart", ")", ";", "localVarInfo", ".", "setSourceRangeEnd", "(", "argument", ".", "declarationSourceStart", ")", ";", "localVarInfo", ".", "setNameSourceStart", "(", "argument", ".", "sourceStart", ")", ";", "localVarInfo", ".", "setNameSourceEnd", "(", "argument", ".", "sourceEnd", ")", ";", "String", "paramTypeSig", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "intern", "(", "Signature", ".", "createTypeSignature", "(", "methodInfo", ".", "parameterTypes", "[", "i", "]", ",", "false", ")", ")", ";", "result", "[", "i", "]", "=", "new", "LocalVariable", "(", "methodHandle", ",", "new", "String", "(", "argument", ".", "name", ")", ",", "argument", ".", "declarationSourceStart", ",", "argument", ".", "declarationSourceEnd", ",", "argument", ".", "sourceStart", ",", "argument", ".", "sourceEnd", ",", "paramTypeSig", ",", "argument", ".", "annotations", ",", "argument", ".", "modifiers", ",", "true", ")", ";", "this", ".", "newElements", ".", "put", "(", "result", "[", "i", "]", ",", "localVarInfo", ")", ";", "this", ".", "infoStack", ".", "push", "(", "localVarInfo", ")", ";", "this", ".", "handleStack", ".", "push", "(", "result", "[", "i", "]", ")", ";", "if", "(", "argument", ".", "annotations", "!=", "null", ")", "{", "paramAnnotations", "[", "i", "]", "=", "new", "Annotation", "[", "argument", ".", "annotations", ".", "length", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "argument", ".", "annotations", ".", "length", ";", "j", "++", ")", "{", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", "annotation", "=", "argument", ".", "annotations", "[", "j", "]", ";", "acceptAnnotation", "(", "annotation", ",", "localVarInfo", ",", "result", "[", "i", "]", ")", ";", "}", "}", "this", ".", "infoStack", ".", "pop", "(", ")", ";", "this", ".", "handleStack", ".", "pop", "(", ")", ";", "}", "return", "result", ";", "}", "public", "void", "enterType", "(", "TypeInfo", "typeInfo", ")", "{", "Object", "parentInfo", "=", "this", ".", "infoStack", ".", "peek", "(", ")", ";", "JavaElement", "parentHandle", "=", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "SourceType", "handle", "=", "createTypeHandle", "(", "parentHandle", ",", "typeInfo", ")", ";", "resolveDuplicates", "(", "handle", ")", ";", "this", ".", "infoStack", ".", "push", "(", "typeInfo", ")", ";", "this", ".", "handleStack", ".", "push", "(", "handle", ")", ";", "if", "(", "parentHandle", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "TYPE", ")", "(", "(", "TypeInfo", ")", "parentInfo", ")", ".", "childrenCategories", ".", "put", "(", "handle", ",", "typeInfo", ".", "categories", ")", ";", "addToChildren", "(", "parentInfo", ",", "handle", ")", ";", "}", "private", "SourceTypeElementInfo", "createTypeInfo", "(", "TypeInfo", "typeInfo", ",", "SourceType", "handle", ")", "{", "SourceTypeElementInfo", "info", "=", "typeInfo", ".", "anonymousMember", "?", "new", "SourceTypeElementInfo", "(", ")", "{", "public", "boolean", "isAnonymousMember", "(", ")", "{", "return", "true", ";", "}", "}", ":", "new", "SourceTypeElementInfo", "(", ")", ";", "info", ".", "setHandle", "(", "handle", ")", ";", "info", ".", "setSourceRangeStart", "(", "typeInfo", ".", "declarationStart", ")", ";", "info", ".", "setFlags", "(", "typeInfo", ".", "modifiers", ")", ";", "info", ".", "setNameSourceStart", "(", "typeInfo", ".", "nameSourceStart", ")", ";", "info", ".", "setNameSourceEnd", "(", "typeInfo", ".", "nameSourceEnd", ")", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "char", "[", "]", "superclass", "=", "typeInfo", ".", "superclass", ";", "info", ".", "setSuperclassName", "(", "superclass", "==", "null", "?", "null", ":", "manager", ".", "intern", "(", "superclass", ")", ")", ";", "char", "[", "]", "[", "]", "superinterfaces", "=", "typeInfo", ".", "superinterfaces", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "superinterfaces", "==", "null", "?", "0", ":", "superinterfaces", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "superinterfaces", "[", "i", "]", "=", "manager", ".", "intern", "(", "superinterfaces", "[", "i", "]", ")", ";", "info", ".", "setSuperInterfaceNames", "(", "superinterfaces", ")", ";", "info", ".", "addCategories", "(", "handle", ",", "typeInfo", ".", "categories", ")", ";", "this", ".", "newElements", ".", "put", "(", "handle", ",", "info", ")", ";", "if", "(", "typeInfo", ".", "typeParameters", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "typeInfo", ".", "typeParameters", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "TypeParameterInfo", "typeParameterInfo", "=", "typeInfo", ".", "typeParameters", "[", "i", "]", ";", "acceptTypeParameter", "(", "typeParameterInfo", ",", "info", ")", ";", "}", "}", "if", "(", "typeInfo", ".", "annotations", "!=", "null", ")", "{", "int", "length", "=", "typeInfo", ".", "annotations", ".", "length", ";", "this", ".", "unitInfo", ".", "annotationNumber", "+=", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", "annotation", "=", "typeInfo", ".", "annotations", "[", "i", "]", ";", "acceptAnnotation", "(", "annotation", ",", "info", ",", "handle", ")", ";", "}", "}", "if", "(", "typeInfo", ".", "childrenCategories", "!=", "null", ")", "{", "Iterator", "iterator", "=", "typeInfo", ".", "childrenCategories", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "iterator", ".", "next", "(", ")", ";", "info", ".", "addCategories", "(", "(", "IJavaElement", ")", "entry", ".", "getKey", "(", ")", ",", "(", "char", "[", "]", "[", "]", ")", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "return", "info", ";", "}", "protected", "void", "acceptTypeParameter", "(", "TypeParameterInfo", "typeParameterInfo", ",", "JavaElementInfo", "parentInfo", ")", "{", "JavaElement", "parentHandle", "=", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "String", "nameString", "=", "new", "String", "(", "typeParameterInfo", ".", "name", ")", ";", "TypeParameter", "handle", "=", "createTypeParameter", "(", "parentHandle", ",", "nameString", ")", ";", "resolveDuplicates", "(", "handle", ")", ";", "TypeParameterElementInfo", "info", "=", "new", "TypeParameterElementInfo", "(", ")", ";", "info", ".", "setSourceRangeStart", "(", "typeParameterInfo", ".", "declarationStart", ")", ";", "info", ".", "nameStart", "=", "typeParameterInfo", ".", "nameSourceStart", ";", "info", ".", "nameEnd", "=", "typeParameterInfo", ".", "nameSourceEnd", ";", "info", ".", "bounds", "=", "typeParameterInfo", ".", "bounds", ";", "if", "(", "parentInfo", "instanceof", "SourceTypeElementInfo", ")", "{", "SourceTypeElementInfo", "elementInfo", "=", "(", "SourceTypeElementInfo", ")", "parentInfo", ";", "ITypeParameter", "[", "]", "typeParameters", "=", "elementInfo", ".", "typeParameters", ";", "int", "length", "=", "typeParameters", ".", "length", ";", "System", ".", "arraycopy", "(", "typeParameters", ",", "0", ",", "typeParameters", "=", "new", "ITypeParameter", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "typeParameters", "[", "length", "]", "=", "handle", ";", "elementInfo", ".", "typeParameters", "=", "typeParameters", ";", "}", "else", "{", "SourceMethodElementInfo", "elementInfo", "=", "(", "SourceMethodElementInfo", ")", "parentInfo", ";", "ITypeParameter", "[", "]", "typeParameters", "=", "elementInfo", ".", "typeParameters", ";", "int", "length", "=", "typeParameters", ".", "length", ";", "System", ".", "arraycopy", "(", "typeParameters", ",", "0", ",", "typeParameters", "=", "new", "ITypeParameter", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "typeParameters", "[", "length", "]", "=", "handle", ";", "elementInfo", ".", "typeParameters", "=", "typeParameters", ";", "}", "this", ".", "newElements", ".", "put", "(", "handle", ",", "info", ")", ";", "info", ".", "setSourceRangeEnd", "(", "typeParameterInfo", ".", "declarationEnd", ")", ";", "}", "public", "void", "exitCompilationUnit", "(", "int", "declarationEnd", ")", "{", "if", "(", "this", ".", "importContainerInfo", "!=", "null", ")", "{", "this", ".", "importContainerInfo", ".", "children", "=", "getChildren", "(", "this", ".", "importContainerInfo", ")", ";", "}", "this", ".", "unitInfo", ".", "children", "=", "getChildren", "(", "this", ".", "unitInfo", ")", ";", "this", ".", "unitInfo", ".", "setSourceLength", "(", "declarationEnd", "+", "1", ")", ";", "this", ".", "unitInfo", ".", "setIsStructureKnown", "(", "!", "this", ".", "hasSyntaxErrors", ")", ";", "}", "public", "void", "exitConstructor", "(", "int", "declarationEnd", ")", "{", "exitMethod", "(", "declarationEnd", ",", "null", ")", ";", "}", "public", "void", "exitField", "(", "int", "initializationStart", ",", "int", "declarationEnd", ",", "int", "declarationSourceEnd", ")", "{", "JavaElement", "handle", "=", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "FieldInfo", "fieldInfo", "=", "(", "FieldInfo", ")", "this", ".", "infoStack", ".", "peek", "(", ")", ";", "IJavaElement", "[", "]", "elements", "=", "getChildren", "(", "fieldInfo", ")", ";", "SourceFieldElementInfo", "info", "=", "elements", ".", "length", "==", "0", "?", "new", "SourceFieldElementInfo", "(", ")", ":", "new", "SourceFieldWithChildrenInfo", "(", "elements", ")", ";", "info", ".", "setNameSourceStart", "(", "fieldInfo", ".", "nameSourceStart", ")", ";", "info", ".", "setNameSourceEnd", "(", "fieldInfo", ".", "nameSourceEnd", ")", ";", "info", ".", "setSourceRangeStart", "(", "fieldInfo", ".", "declarationStart", ")", ";", "info", ".", "setFlags", "(", "fieldInfo", ".", "modifiers", ")", ";", "char", "[", "]", "typeName", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "intern", "(", "fieldInfo", ".", "type", ")", ";", "info", ".", "setTypeName", "(", "typeName", ")", ";", "this", ".", "newElements", ".", "put", "(", "handle", ",", "info", ")", ";", "if", "(", "fieldInfo", ".", "annotations", "!=", "null", ")", "{", "int", "length", "=", "fieldInfo", ".", "annotations", ".", "length", ";", "this", ".", "unitInfo", ".", "annotationNumber", "+=", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", "annotation", "=", "fieldInfo", ".", "annotations", "[", "i", "]", ";", "acceptAnnotation", "(", "annotation", ",", "info", ",", "handle", ")", ";", "}", "}", "info", ".", "setSourceRangeEnd", "(", "declarationSourceEnd", ")", ";", "this", ".", "handleStack", ".", "pop", "(", ")", ";", "this", ".", "infoStack", ".", "pop", "(", ")", ";", "if", "(", "initializationStart", "!=", "-", "1", ")", "{", "int", "flags", "=", "info", ".", "flags", ";", "Object", "typeInfo", ";", "if", "(", "Flags", ".", "isStatic", "(", "flags", ")", "&&", "Flags", ".", "isFinal", "(", "flags", ")", "||", "(", "(", "typeInfo", "=", "this", ".", "infoStack", ".", "peek", "(", ")", ")", "instanceof", "TypeInfo", "&&", "(", "Flags", ".", "isInterface", "(", "(", "(", "TypeInfo", ")", "typeInfo", ")", ".", "modifiers", ")", ")", ")", ")", "{", "int", "length", "=", "declarationEnd", "-", "initializationStart", ";", "if", "(", "length", ">", "0", ")", "{", "char", "[", "]", "initializer", "=", "new", "char", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "parser", ".", "scanner", ".", "source", ",", "initializationStart", ",", "initializer", ",", "0", ",", "length", ")", ";", "info", ".", "initializationSource", "=", "initializer", ";", "}", "}", "}", "}", "public", "void", "exitInitializer", "(", "int", "declarationEnd", ")", "{", "JavaElement", "handle", "=", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "int", "[", "]", "initializerInfo", "=", "(", "int", "[", "]", ")", "this", ".", "infoStack", ".", "peek", "(", ")", ";", "IJavaElement", "[", "]", "elements", "=", "getChildren", "(", "initializerInfo", ")", ";", "InitializerElementInfo", "info", "=", "elements", ".", "length", "==", "0", "?", "new", "InitializerElementInfo", "(", ")", ":", "new", "InitializerWithChildrenInfo", "(", "elements", ")", ";", "info", ".", "setSourceRangeStart", "(", "initializerInfo", "[", "0", "]", ")", ";", "info", ".", "setFlags", "(", "initializerInfo", "[", "1", "]", ")", ";", "info", ".", "setSourceRangeEnd", "(", "declarationEnd", ")", ";", "this", ".", "newElements", ".", "put", "(", "handle", ",", "info", ")", ";", "this", ".", "handleStack", ".", "pop", "(", ")", ";", "this", ".", "infoStack", ".", "pop", "(", ")", ";", "}", "public", "void", "exitMethod", "(", "int", "declarationEnd", ",", "Expression", "defaultValue", ")", "{", "SourceMethod", "handle", "=", "(", "SourceMethod", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "MethodInfo", "methodInfo", "=", "(", "MethodInfo", ")", "this", ".", "infoStack", ".", "peek", "(", ")", ";", "SourceMethodElementInfo", "info", "=", "createMethodInfo", "(", "methodInfo", ",", "handle", ")", ";", "info", ".", "setSourceRangeEnd", "(", "declarationEnd", ")", ";", "if", "(", "info", ".", "isAnnotationMethod", "(", ")", "&&", "defaultValue", "!=", "null", ")", "{", "SourceAnnotationMethodInfo", "annotationMethodInfo", "=", "(", "SourceAnnotationMethodInfo", ")", "info", ";", "annotationMethodInfo", ".", "defaultValueStart", "=", "defaultValue", ".", "sourceStart", ";", "annotationMethodInfo", ".", "defaultValueEnd", "=", "defaultValue", ".", "sourceEnd", ";", "JavaElement", "element", "=", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "MemberValuePair", "defaultMemberValuePair", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "MemberValuePair", "(", "element", ".", "getElementName", "(", ")", ")", ";", "defaultMemberValuePair", ".", "value", "=", "getMemberValue", "(", "defaultMemberValuePair", ",", "defaultValue", ")", ";", "annotationMethodInfo", ".", "defaultValue", "=", "defaultMemberValuePair", ";", "}", "this", ".", "handleStack", ".", "pop", "(", ")", ";", "this", ".", "infoStack", ".", "pop", "(", ")", ";", "}", "public", "void", "exitType", "(", "int", "declarationEnd", ")", "{", "SourceType", "handle", "=", "(", "SourceType", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ";", "TypeInfo", "typeInfo", "=", "(", "TypeInfo", ")", "this", ".", "infoStack", ".", "peek", "(", ")", ";", "SourceTypeElementInfo", "info", "=", "createTypeInfo", "(", "typeInfo", ",", "handle", ")", ";", "info", ".", "setSourceRangeEnd", "(", "declarationEnd", ")", ";", "info", ".", "children", "=", "getChildren", "(", "typeInfo", ")", ";", "this", ".", "handleStack", ".", "pop", "(", ")", ";", "this", ".", "infoStack", ".", "pop", "(", ")", ";", "}", "protected", "void", "resolveDuplicates", "(", "SourceRefElement", "handle", ")", "{", "int", "occurenceCount", "=", "this", ".", "occurenceCounts", ".", "get", "(", "handle", ")", ";", "if", "(", "occurenceCount", "==", "-", "1", ")", "this", ".", "occurenceCounts", ".", "put", "(", "handle", ",", "1", ")", ";", "else", "{", "this", ".", "occurenceCounts", ".", "put", "(", "handle", ",", "++", "occurenceCount", ")", ";", "handle", ".", "occurrenceCount", "=", "occurenceCount", ";", "}", "}", "protected", "IMemberValuePair", "getMemberValuePair", "(", "MemberValuePair", "memberValuePair", ")", "{", "String", "memberName", "=", "new", "String", "(", "memberValuePair", ".", "name", ")", ";", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "MemberValuePair", "result", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "MemberValuePair", "(", "memberName", ")", ";", "result", ".", "value", "=", "getMemberValue", "(", "result", ",", "memberValuePair", ".", "value", ")", ";", "return", "result", ";", "}", "protected", "IMemberValuePair", "[", "]", "getMemberValuePairs", "(", "MemberValuePair", "[", "]", "memberValuePairs", ")", "{", "int", "membersLength", "=", "memberValuePairs", ".", "length", ";", "IMemberValuePair", "[", "]", "members", "=", "new", "IMemberValuePair", "[", "membersLength", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "membersLength", ";", "j", "++", ")", "{", "members", "[", "j", "]", "=", "getMemberValuePair", "(", "memberValuePairs", "[", "j", "]", ")", ";", "}", "return", "members", ";", "}", "private", "IJavaElement", "[", "]", "getChildren", "(", "Object", "info", ")", "{", "ArrayList", "childrenList", "=", "(", "ArrayList", ")", "this", ".", "children", ".", "get", "(", "info", ")", ";", "if", "(", "childrenList", "!=", "null", ")", "{", "return", "(", "IJavaElement", "[", "]", ")", "childrenList", ".", "toArray", "(", "new", "IJavaElement", "[", "childrenList", ".", "size", "(", ")", "]", ")", ";", "}", "return", "JavaElement", ".", "NO_ELEMENTS", ";", "}", "protected", "Object", "getMemberValue", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "MemberValuePair", "memberValuePair", ",", "Expression", "expression", ")", "{", "if", "(", "expression", "instanceof", "NullLiteral", ")", "{", "return", "null", ";", "}", "else", "if", "(", "expression", "instanceof", "Literal", ")", "{", "(", "(", "Literal", ")", "expression", ")", ".", "computeConstant", "(", ")", ";", "return", "Util", ".", "getAnnotationMemberValue", "(", "memberValuePair", ",", "expression", ".", "constant", ")", ";", "}", "else", "if", "(", "expression", "instanceof", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", ")", "{", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", "annotation", "=", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", ")", "expression", ";", "Object", "handle", "=", "acceptAnnotation", "(", "annotation", ",", "null", ",", "(", "JavaElement", ")", "this", ".", "handleStack", ".", "peek", "(", ")", ")", ";", "memberValuePair", ".", "valueKind", "=", "IMemberValuePair", ".", "K_ANNOTATION", ";", "return", "handle", ";", "}", "else", "if", "(", "expression", "instanceof", "ClassLiteralAccess", ")", "{", "ClassLiteralAccess", "classLiteral", "=", "(", "ClassLiteralAccess", ")", "expression", ";", "char", "[", "]", "name", "=", "CharOperation", ".", "concatWith", "(", "classLiteral", ".", "type", ".", "getTypeName", "(", ")", ",", "'.'", ")", ";", "memberValuePair", ".", "valueKind", "=", "IMemberValuePair", ".", "K_CLASS", ";", "return", "new", "String", "(", "name", ")", ";", "}", "else", "if", "(", "expression", "instanceof", "QualifiedNameReference", ")", "{", "char", "[", "]", "qualifiedName", "=", "CharOperation", ".", "concatWith", "(", "(", "(", "QualifiedNameReference", ")", "expression", ")", ".", "tokens", ",", "'.'", ")", ";", "memberValuePair", ".", "valueKind", "=", "IMemberValuePair", ".", "K_QUALIFIED_NAME", ";", "return", "new", "String", "(", "qualifiedName", ")", ";", "}", "else", "if", "(", "expression", "instanceof", "SingleNameReference", ")", "{", "char", "[", "]", "simpleName", "=", "(", "(", "SingleNameReference", ")", "expression", ")", ".", "token", ";", "if", "(", "simpleName", "==", "RecoveryScanner", ".", "FAKE_IDENTIFIER", ")", "{", "memberValuePair", ".", "valueKind", "=", "IMemberValuePair", ".", "K_UNKNOWN", ";", "return", "null", ";", "}", "memberValuePair", ".", "valueKind", "=", "IMemberValuePair", ".", "K_SIMPLE_NAME", ";", "return", "new", "String", "(", "simpleName", ")", ";", "}", "else", "if", "(", "expression", "instanceof", "ArrayInitializer", ")", "{", "memberValuePair", ".", "valueKind", "=", "-", "1", ";", "Expression", "[", "]", "expressions", "=", "(", "(", "ArrayInitializer", ")", "expression", ")", ".", "expressions", ";", "int", "length", "=", "expressions", "==", "null", "?", "0", ":", "expressions", ".", "length", ";", "Object", "[", "]", "values", "=", "new", "Object", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "int", "previousValueKind", "=", "memberValuePair", ".", "valueKind", ";", "Object", "value", "=", "getMemberValue", "(", "memberValuePair", ",", "expressions", "[", "i", "]", ")", ";", "if", "(", "previousValueKind", "!=", "-", "1", "&&", "memberValuePair", ".", "valueKind", "!=", "previousValueKind", ")", "{", "memberValuePair", ".", "valueKind", "=", "IMemberValuePair", ".", "K_UNKNOWN", ";", "}", "values", "[", "i", "]", "=", "value", ";", "}", "if", "(", "memberValuePair", ".", "valueKind", "==", "-", "1", ")", "memberValuePair", ".", "valueKind", "=", "IMemberValuePair", ".", "K_UNKNOWN", ";", "return", "values", ";", "}", "else", "if", "(", "expression", "instanceof", "UnaryExpression", ")", "{", "UnaryExpression", "unaryExpression", "=", "(", "UnaryExpression", ")", "expression", ";", "if", "(", "(", "unaryExpression", ".", "bits", "&", "ASTNode", ".", "OperatorMASK", ")", ">>", "ASTNode", ".", "OperatorSHIFT", "==", "OperatorIds", ".", "MINUS", ")", "{", "if", "(", "unaryExpression", ".", "expression", "instanceof", "Literal", ")", "{", "Literal", "subExpression", "=", "(", "Literal", ")", "unaryExpression", ".", "expression", ";", "subExpression", ".", "computeConstant", "(", ")", ";", "return", "Util", ".", "getNegativeAnnotationMemberValue", "(", "memberValuePair", ",", "subExpression", ".", "constant", ")", ";", "}", "}", "memberValuePair", ".", "valueKind", "=", "IMemberValuePair", ".", "K_UNKNOWN", ";", "return", "null", ";", "}", "else", "{", "memberValuePair", ".", "valueKind", "=", "IMemberValuePair", ".", "K_UNKNOWN", ";", "return", "null", ";", "}", "}", "}", "</s>" ]
3,927
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "net", ".", "URL", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ".", "LanguageSupportFactory", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IContainer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFolder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IParent", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ISourceManipulation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "WorkingCopyOwner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ".", "PerProjectInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "MementoTokenizer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "PackageFragment", "extends", "Openable", "implements", "IPackageFragment", ",", "SuffixConstants", "{", "protected", "static", "final", "IClassFile", "[", "]", "NO_CLASSFILES", "=", "new", "IClassFile", "[", "]", "{", "}", ";", "protected", "static", "final", "ICompilationUnit", "[", "]", "NO_COMPILATION_UNITS", "=", "new", "ICompilationUnit", "[", "]", "{", "}", ";", "public", "String", "[", "]", "names", ";", "protected", "PackageFragment", "(", "PackageFragmentRoot", "root", ",", "String", "[", "]", "names", ")", "{", "super", "(", "root", ")", ";", "this", ".", "names", "=", "names", ";", "}", "protected", "boolean", "buildStructure", "(", "OpenableElementInfo", "info", ",", "IProgressMonitor", "pm", ",", "Map", "newElements", ",", "IResource", "underlyingResource", ")", "throws", "JavaModelException", "{", "HashSet", "vChildren", "=", "new", "HashSet", "(", ")", ";", "int", "kind", "=", "getKind", "(", ")", ";", "try", "{", "PackageFragmentRoot", "root", "=", "getPackageFragmentRoot", "(", ")", ";", "char", "[", "]", "[", "]", "inclusionPatterns", "=", "root", ".", "fullInclusionPatternChars", "(", ")", ";", "char", "[", "]", "[", "]", "exclusionPatterns", "=", "root", ".", "fullExclusionPatternChars", "(", ")", ";", "IResource", "[", "]", "members", "=", "(", "(", "IContainer", ")", "underlyingResource", ")", ".", "members", "(", ")", ";", "int", "length", "=", "members", ".", "length", ";", "if", "(", "length", ">", "0", ")", "{", "IJavaProject", "project", "=", "getJavaProject", "(", ")", ";", "String", "sourceLevel", "=", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ";", "String", "complianceLevel", "=", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IResource", "child", "=", "members", "[", "i", "]", ";", "if", "(", "child", ".", "getType", "(", ")", "!=", "IResource", ".", "FOLDER", "&&", "!", "Util", ".", "isExcluded", "(", "child", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ")", "{", "IJavaElement", "childElement", ";", "if", "(", "kind", "==", "IPackageFragmentRoot", ".", "K_SOURCE", "&&", "Util", ".", "isValidCompilationUnitName", "(", "child", ".", "getName", "(", ")", ",", "sourceLevel", ",", "complianceLevel", ")", ")", "{", "childElement", "=", "LanguageSupportFactory", ".", "newCompilationUnit", "(", "this", ",", "child", ".", "getName", "(", ")", ",", "DefaultWorkingCopyOwner", ".", "PRIMARY", ")", ";", "vChildren", ".", "add", "(", "childElement", ")", ";", "}", "else", "if", "(", "kind", "==", "IPackageFragmentRoot", ".", "K_BINARY", "&&", "Util", ".", "isValidClassFileName", "(", "child", ".", "getName", "(", ")", ",", "sourceLevel", ",", "complianceLevel", ")", ")", "{", "childElement", "=", "getClassFile", "(", "child", ".", "getName", "(", ")", ")", ";", "vChildren", ".", "add", "(", "childElement", ")", ";", "}", "}", "}", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "if", "(", "kind", "==", "IPackageFragmentRoot", ".", "K_SOURCE", ")", "{", "ICompilationUnit", "[", "]", "primaryCompilationUnits", "=", "getCompilationUnits", "(", "DefaultWorkingCopyOwner", ".", "PRIMARY", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "primaryCompilationUnits", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ICompilationUnit", "primary", "=", "primaryCompilationUnits", "[", "i", "]", ";", "vChildren", ".", "add", "(", "primary", ")", ";", "}", "}", "IJavaElement", "[", "]", "children", "=", "new", "IJavaElement", "[", "vChildren", ".", "size", "(", ")", "]", ";", "vChildren", ".", "toArray", "(", "children", ")", ";", "info", ".", "setChildren", "(", "children", ")", ";", "return", "true", ";", "}", "public", "boolean", "containsJavaResources", "(", ")", "throws", "JavaModelException", "{", "return", "(", "(", "PackageFragmentInfo", ")", "getElementInfo", "(", ")", ")", ".", "containsJavaResources", "(", ")", ";", "}", "public", "void", "copy", "(", "IJavaElement", "container", ",", "IJavaElement", "sibling", ",", "String", "rename", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "container", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "operation_nullContainer", ")", ";", "}", "IJavaElement", "[", "]", "elements", "=", "new", "IJavaElement", "[", "]", "{", "this", "}", ";", "IJavaElement", "[", "]", "containers", "=", "new", "IJavaElement", "[", "]", "{", "container", "}", ";", "IJavaElement", "[", "]", "siblings", "=", "null", ";", "if", "(", "sibling", "!=", "null", ")", "{", "siblings", "=", "new", "IJavaElement", "[", "]", "{", "sibling", "}", ";", "}", "String", "[", "]", "renamings", "=", "null", ";", "if", "(", "rename", "!=", "null", ")", "{", "renamings", "=", "new", "String", "[", "]", "{", "rename", "}", ";", "}", "getJavaModel", "(", ")", ".", "copy", "(", "elements", ",", "containers", ",", "siblings", ",", "renamings", ",", "force", ",", "monitor", ")", ";", "}", "public", "ICompilationUnit", "createCompilationUnit", "(", "String", "cuName", ",", "String", "contents", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "CreateCompilationUnitOperation", "op", "=", "new", "CreateCompilationUnitOperation", "(", "this", ",", "cuName", ",", "contents", ",", "force", ")", ";", "op", ".", "runOperation", "(", "monitor", ")", ";", "return", "LanguageSupportFactory", ".", "newCompilationUnit", "(", "this", ",", "cuName", ",", "DefaultWorkingCopyOwner", ".", "PRIMARY", ")", ";", "}", "protected", "Object", "createElementInfo", "(", ")", "{", "return", "new", "PackageFragmentInfo", "(", ")", ";", "}", "public", "void", "delete", "(", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "IJavaElement", "[", "]", "elements", "=", "new", "IJavaElement", "[", "]", "{", "this", "}", ";", "getJavaModel", "(", ")", ".", "delete", "(", "elements", ",", "force", ",", "monitor", ")", ";", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "this", "==", "o", ")", "return", "true", ";", "if", "(", "!", "(", "o", "instanceof", "PackageFragment", ")", ")", "return", "false", ";", "PackageFragment", "other", "=", "(", "PackageFragment", ")", "o", ";", "return", "Util", ".", "equalArraysOrNull", "(", "this", ".", "names", ",", "other", ".", "names", ")", "&&", "this", ".", "parent", ".", "equals", "(", "other", ".", "parent", ")", ";", "}", "public", "boolean", "exists", "(", ")", "{", "return", "super", ".", "exists", "(", ")", "&&", "!", "Util", ".", "isExcluded", "(", "this", ")", "&&", "isValidPackageName", "(", ")", ";", "}", "public", "IClassFile", "getClassFile", "(", "String", "classFileName", ")", "{", "if", "(", "!", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "isClassFileName", "(", "classFileName", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "bind", "(", "Messages", ".", "element_invalidClassFileName", ",", "classFileName", ")", ")", ";", "}", "int", "length", "=", "classFileName", ".", "length", "(", ")", "-", "6", ";", "char", "[", "]", "nameWithoutExtension", "=", "new", "char", "[", "length", "]", ";", "classFileName", ".", "getChars", "(", "0", ",", "length", ",", "nameWithoutExtension", ",", "0", ")", ";", "return", "new", "ClassFile", "(", "this", ",", "new", "String", "(", "nameWithoutExtension", ")", ")", ";", "}", "public", "IClassFile", "[", "]", "getClassFiles", "(", ")", "throws", "JavaModelException", "{", "if", "(", "getKind", "(", ")", "==", "IPackageFragmentRoot", ".", "K_SOURCE", ")", "{", "return", "NO_CLASSFILES", ";", "}", "ArrayList", "list", "=", "getChildrenOfType", "(", "CLASS_FILE", ")", ";", "IClassFile", "[", "]", "array", "=", "new", "IClassFile", "[", "list", ".", "size", "(", ")", "]", ";", "list", ".", "toArray", "(", "array", ")", ";", "return", "array", ";", "}", "public", "ICompilationUnit", "getCompilationUnit", "(", "String", "cuName", ")", "{", "if", "(", "!", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "isJavaLikeFileName", "(", "cuName", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "convention_unit_notJavaName", ")", ";", "}", "return", "LanguageSupportFactory", ".", "newCompilationUnit", "(", "this", ",", "cuName", ",", "DefaultWorkingCopyOwner", ".", "PRIMARY", ")", ";", "}", "public", "ICompilationUnit", "[", "]", "getCompilationUnits", "(", ")", "throws", "JavaModelException", "{", "if", "(", "getKind", "(", ")", "==", "IPackageFragmentRoot", ".", "K_BINARY", ")", "{", "return", "NO_COMPILATION_UNITS", ";", "}", "ArrayList", "list", "=", "getChildrenOfType", "(", "COMPILATION_UNIT", ")", ";", "ICompilationUnit", "[", "]", "array", "=", "new", "ICompilationUnit", "[", "list", ".", "size", "(", ")", "]", ";", "list", ".", "toArray", "(", "array", ")", ";", "return", "array", ";", "}", "public", "ICompilationUnit", "[", "]", "getCompilationUnits", "(", "WorkingCopyOwner", "owner", ")", "{", "ICompilationUnit", "[", "]", "workingCopies", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getWorkingCopies", "(", "owner", ",", "false", ")", ";", "if", "(", "workingCopies", "==", "null", ")", "return", "JavaModelManager", ".", "NO_WORKING_COPY", ";", "int", "length", "=", "workingCopies", ".", "length", ";", "ICompilationUnit", "[", "]", "result", "=", "new", "ICompilationUnit", "[", "length", "]", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ICompilationUnit", "wc", "=", "workingCopies", "[", "i", "]", ";", "if", "(", "equals", "(", "wc", ".", "getParent", "(", ")", ")", "&&", "!", "Util", ".", "isExcluded", "(", "wc", ")", ")", "{", "result", "[", "index", "++", "]", "=", "wc", ";", "}", "}", "if", "(", "index", "!=", "length", ")", "{", "System", ".", "arraycopy", "(", "result", ",", "0", ",", "result", "=", "new", "ICompilationUnit", "[", "index", "]", ",", "0", ",", "index", ")", ";", "}", "return", "result", ";", "}", "public", "String", "getElementName", "(", ")", "{", "if", "(", "this", ".", "names", ".", "length", "==", "0", ")", "return", "DEFAULT_PACKAGE_NAME", ";", "return", "Util", ".", "concatWith", "(", "this", ".", "names", ",", "'.'", ")", ";", "}", "public", "int", "getElementType", "(", ")", "{", "return", "PACKAGE_FRAGMENT", ";", "}", "public", "IJavaElement", "getHandleFromMemento", "(", "String", "token", ",", "MementoTokenizer", "memento", ",", "WorkingCopyOwner", "owner", ")", "{", "switch", "(", "token", ".", "charAt", "(", "0", ")", ")", "{", "case", "JEM_CLASSFILE", ":", "if", "(", "!", "memento", ".", "hasMoreTokens", "(", ")", ")", "return", "this", ";", "String", "classFileName", "=", "memento", ".", "nextToken", "(", ")", ";", "JavaElement", "classFile", "=", "(", "JavaElement", ")", "getClassFile", "(", "classFileName", ")", ";", "return", "classFile", ".", "getHandleFromMemento", "(", "memento", ",", "owner", ")", ";", "case", "JEM_COMPILATIONUNIT", ":", "if", "(", "!", "memento", ".", "hasMoreTokens", "(", ")", ")", "return", "this", ";", "String", "cuName", "=", "memento", ".", "nextToken", "(", ")", ";", "JavaElement", "cu", "=", "LanguageSupportFactory", ".", "newCompilationUnit", "(", "this", ",", "cuName", ",", "owner", ")", ";", "return", "cu", ".", "getHandleFromMemento", "(", "memento", ",", "owner", ")", ";", "}", "return", "null", ";", "}", "protected", "char", "getHandleMementoDelimiter", "(", ")", "{", "return", "JavaElement", ".", "JEM_PACKAGEFRAGMENT", ";", "}", "public", "int", "getKind", "(", ")", "throws", "JavaModelException", "{", "return", "(", "(", "IPackageFragmentRoot", ")", "getParent", "(", ")", ")", ".", "getKind", "(", ")", ";", "}", "public", "Object", "[", "]", "getNonJavaResources", "(", ")", "throws", "JavaModelException", "{", "if", "(", "isDefaultPackage", "(", ")", ")", "{", "return", "JavaElementInfo", ".", "NO_NON_JAVA_RESOURCES", ";", "}", "else", "{", "return", "(", "(", "PackageFragmentInfo", ")", "getElementInfo", "(", ")", ")", ".", "getNonJavaResources", "(", "resource", "(", ")", ",", "getPackageFragmentRoot", "(", ")", ")", ";", "}", "}", "public", "IPath", "getPath", "(", ")", "{", "PackageFragmentRoot", "root", "=", "getPackageFragmentRoot", "(", ")", ";", "if", "(", "root", ".", "isArchive", "(", ")", ")", "{", "return", "root", ".", "getPath", "(", ")", ";", "}", "else", "{", "IPath", "path", "=", "root", ".", "getPath", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "names", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "name", "=", "this", ".", "names", "[", "i", "]", ";", "path", "=", "path", ".", "append", "(", "name", ")", ";", "}", "return", "path", ";", "}", "}", "public", "IResource", "resource", "(", "PackageFragmentRoot", "root", ")", "{", "int", "length", "=", "this", ".", "names", ".", "length", ";", "if", "(", "length", "==", "0", ")", "{", "return", "root", ".", "resource", "(", "root", ")", ";", "}", "else", "{", "IPath", "path", "=", "new", "Path", "(", "this", ".", "names", "[", "0", "]", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "length", ";", "i", "++", ")", "path", "=", "path", ".", "append", "(", "this", ".", "names", "[", "i", "]", ")", ";", "return", "(", "(", "IContainer", ")", "root", ".", "resource", "(", "root", ")", ")", ".", "getFolder", "(", "path", ")", ";", "}", "}", "public", "IResource", "getUnderlyingResource", "(", ")", "throws", "JavaModelException", "{", "IResource", "rootResource", "=", "this", ".", "parent", ".", "getUnderlyingResource", "(", ")", ";", "if", "(", "rootResource", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "rootResource", ".", "getType", "(", ")", "==", "IResource", ".", "FOLDER", "||", "rootResource", ".", "getType", "(", ")", "==", "IResource", ".", "PROJECT", ")", "{", "IContainer", "folder", "=", "(", "IContainer", ")", "rootResource", ";", "String", "[", "]", "segs", "=", "this", ".", "names", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "segs", ".", "length", ";", "++", "i", ")", "{", "IResource", "child", "=", "folder", ".", "findMember", "(", "segs", "[", "i", "]", ")", ";", "if", "(", "child", "==", "null", "||", "child", ".", "getType", "(", ")", "!=", "IResource", ".", "FOLDER", ")", "{", "throw", "newNotPresentException", "(", ")", ";", "}", "folder", "=", "(", "IFolder", ")", "child", ";", "}", "return", "folder", ";", "}", "else", "{", "return", "rootResource", ";", "}", "}", "public", "int", "hashCode", "(", ")", "{", "int", "hash", "=", "this", ".", "parent", ".", "hashCode", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "names", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "hash", "=", "Util", ".", "combineHashCodes", "(", "this", ".", "names", "[", "i", "]", ".", "hashCode", "(", ")", ",", "hash", ")", ";", "return", "hash", ";", "}", "public", "boolean", "hasChildren", "(", ")", "throws", "JavaModelException", "{", "return", "getChildren", "(", ")", ".", "length", ">", "0", ";", "}", "public", "boolean", "hasSubpackages", "(", ")", "throws", "JavaModelException", "{", "IJavaElement", "[", "]", "packages", "=", "(", "(", "IPackageFragmentRoot", ")", "getParent", "(", ")", ")", ".", "getChildren", "(", ")", ";", "int", "namesLength", "=", "this", ".", "names", ".", "length", ";", "nextPackage", ":", "for", "(", "int", "i", "=", "0", ",", "length", "=", "packages", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "[", "]", "otherNames", "=", "(", "(", "PackageFragment", ")", "packages", "[", "i", "]", ")", ".", "names", ";", "if", "(", "otherNames", ".", "length", "<=", "namesLength", ")", "continue", "nextPackage", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "namesLength", ";", "j", "++", ")", "if", "(", "!", "this", ".", "names", "[", "j", "]", ".", "equals", "(", "otherNames", "[", "j", "]", ")", ")", "continue", "nextPackage", ";", "return", "true", ";", "}", "return", "false", ";", "}", "public", "boolean", "isDefaultPackage", "(", ")", "{", "return", "this", ".", "names", ".", "length", "==", "0", ";", "}", "private", "boolean", "isValidPackageName", "(", ")", "{", "JavaProject", "javaProject", "=", "(", "JavaProject", ")", "getJavaProject", "(", ")", ";", "String", "sourceLevel", "=", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ";", "String", "complianceLevel", "=", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "names", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "!", "Util", ".", "isValidFolderNameForPackage", "(", "this", ".", "names", "[", "i", "]", ",", "sourceLevel", ",", "complianceLevel", ")", ")", "return", "false", ";", "}", "return", "true", ";", "}", "public", "void", "move", "(", "IJavaElement", "container", ",", "IJavaElement", "sibling", ",", "String", "rename", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "container", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "operation_nullContainer", ")", ";", "}", "IJavaElement", "[", "]", "elements", "=", "new", "IJavaElement", "[", "]", "{", "this", "}", ";", "IJavaElement", "[", "]", "containers", "=", "new", "IJavaElement", "[", "]", "{", "container", "}", ";", "IJavaElement", "[", "]", "siblings", "=", "null", ";", "if", "(", "sibling", "!=", "null", ")", "{", "siblings", "=", "new", "IJavaElement", "[", "]", "{", "sibling", "}", ";", "}", "String", "[", "]", "renamings", "=", "null", ";", "if", "(", "rename", "!=", "null", ")", "{", "renamings", "=", "new", "String", "[", "]", "{", "rename", "}", ";", "}", "getJavaModel", "(", ")", ".", "move", "(", "elements", ",", "containers", ",", "siblings", ",", "renamings", ",", "force", ",", "monitor", ")", ";", "}", "public", "void", "rename", "(", "String", "newName", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "newName", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "element_nullName", ")", ";", "}", "IJavaElement", "[", "]", "elements", "=", "new", "IJavaElement", "[", "]", "{", "this", "}", ";", "IJavaElement", "[", "]", "dests", "=", "new", "IJavaElement", "[", "]", "{", "getParent", "(", ")", "}", ";", "String", "[", "]", "renamings", "=", "new", "String", "[", "]", "{", "newName", "}", ";", "getJavaModel", "(", ")", ".", "rename", "(", "elements", ",", "dests", ",", "renamings", ",", "force", ",", "monitor", ")", ";", "}", "protected", "void", "toStringChildren", "(", "int", "tab", ",", "StringBuffer", "buffer", ",", "Object", "info", ")", "{", "if", "(", "tab", "==", "0", ")", "{", "super", ".", "toStringChildren", "(", "tab", ",", "buffer", ",", "info", ")", ";", "}", "}", "protected", "void", "toStringInfo", "(", "int", "tab", ",", "StringBuffer", "buffer", ",", "Object", "info", ",", "boolean", "showResolvedInfo", ")", "{", "buffer", ".", "append", "(", "tabString", "(", "tab", ")", ")", ";", "if", "(", "this", ".", "names", ".", "length", "==", "0", ")", "{", "buffer", ".", "append", "(", "\"<default>\"", ")", ";", "}", "else", "{", "toStringName", "(", "buffer", ")", ";", "}", "if", "(", "info", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"", "(not", "open)\"", ")", ";", "}", "else", "{", "if", "(", "tab", ">", "0", ")", "{", "buffer", ".", "append", "(", "\"", "(...)\"", ")", ";", "}", "}", "}", "public", "String", "getAttachedJavadoc", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "PerProjectInfo", "projectInfo", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getPerProjectInfoCheckExistence", "(", "getJavaProject", "(", ")", ".", "getProject", "(", ")", ")", ";", "String", "cachedJavadoc", "=", "null", ";", "synchronized", "(", "projectInfo", ".", "javadocCache", ")", "{", "cachedJavadoc", "=", "(", "String", ")", "projectInfo", ".", "javadocCache", ".", "get", "(", "this", ")", ";", "}", "if", "(", "cachedJavadoc", "!=", "null", ")", "{", "return", "cachedJavadoc", ";", "}", "URL", "baseLocation", "=", "getJavadocBaseLocation", "(", ")", ";", "if", "(", "baseLocation", "==", "null", ")", "{", "return", "null", ";", "}", "StringBuffer", "pathBuffer", "=", "new", "StringBuffer", "(", "baseLocation", ".", "toExternalForm", "(", ")", ")", ";", "if", "(", "!", "(", "pathBuffer", ".", "charAt", "(", "pathBuffer", ".", "length", "(", ")", "-", "1", ")", "==", "'/'", ")", ")", "{", "pathBuffer", ".", "append", "(", "'/'", ")", ";", "}", "String", "packPath", "=", "getElementName", "(", ")", ".", "replace", "(", "'.'", ",", "'/'", ")", ";", "pathBuffer", ".", "append", "(", "packPath", ")", ".", "append", "(", "'/'", ")", ".", "append", "(", "JavadocConstants", ".", "PACKAGE_FILE_NAME", ")", ";", "if", "(", "monitor", "!=", "null", "&&", "monitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", ")", ";", "final", "String", "contents", "=", "getURLContents", "(", "String", ".", "valueOf", "(", "pathBuffer", ")", ")", ";", "if", "(", "monitor", "!=", "null", "&&", "monitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", ")", ";", "if", "(", "contents", "==", "null", ")", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "CANNOT_RETRIEVE_ATTACHED_JAVADOC", ",", "this", ")", ")", ";", "synchronized", "(", "projectInfo", ".", "javadocCache", ")", "{", "projectInfo", ".", "javadocCache", ".", "put", "(", "this", ",", "contents", ")", ";", "}", "return", "contents", ";", "}", "protected", "IStatus", "validateExistence", "(", "IResource", "underlyingResource", ")", "{", "if", "(", "!", "isValidPackageName", "(", ")", ")", "return", "newDoesNotExistStatus", "(", ")", ";", "if", "(", "underlyingResource", "!=", "null", "&&", "!", "resourceExists", "(", "underlyingResource", ")", ")", "return", "newDoesNotExistStatus", "(", ")", ";", "int", "kind", ";", "try", "{", "kind", "=", "getKind", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "e", ".", "getStatus", "(", ")", ";", "}", "if", "(", "kind", "==", "IPackageFragmentRoot", ".", "K_SOURCE", "&&", "Util", ".", "isExcluded", "(", "this", ")", ")", "return", "newDoesNotExistStatus", "(", ")", ";", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,928
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Flags", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IImportDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaConventions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "AST", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ImportDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "Name", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "StructuralPropertyDescriptor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "rewrite", ".", "ASTRewrite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "CreateImportOperation", "extends", "CreateElementInCUOperation", "{", "protected", "String", "importName", ";", "protected", "int", "flags", ";", "public", "CreateImportOperation", "(", "String", "importName", ",", "ICompilationUnit", "parentElement", ",", "int", "flags", ")", "{", "super", "(", "parentElement", ")", ";", "this", ".", "importName", "=", "importName", ";", "this", ".", "flags", "=", "flags", ";", "}", "protected", "StructuralPropertyDescriptor", "getChildPropertyDescriptor", "(", "ASTNode", "parent", ")", "{", "return", "CompilationUnit", ".", "IMPORTS_PROPERTY", ";", "}", "protected", "ASTNode", "generateElementAST", "(", "ASTRewrite", "rewriter", ",", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", "{", "Iterator", "imports", "=", "this", ".", "cuAST", ".", "imports", "(", ")", ".", "iterator", "(", ")", ";", "boolean", "onDemand", "=", "this", ".", "importName", ".", "endsWith", "(", "\".*\"", ")", ";", "String", "importActualName", "=", "this", ".", "importName", ";", "if", "(", "onDemand", ")", "{", "importActualName", "=", "this", ".", "importName", ".", "substring", "(", "0", ",", "this", ".", "importName", ".", "length", "(", ")", "-", "2", ")", ";", "}", "while", "(", "imports", ".", "hasNext", "(", ")", ")", "{", "ImportDeclaration", "importDeclaration", "=", "(", "ImportDeclaration", ")", "imports", ".", "next", "(", ")", ";", "if", "(", "importActualName", ".", "equals", "(", "importDeclaration", ".", "getName", "(", ")", ".", "getFullyQualifiedName", "(", ")", ")", "&&", "(", "onDemand", "==", "importDeclaration", ".", "isOnDemand", "(", ")", ")", "&&", "(", "Flags", ".", "isStatic", "(", "this", ".", "flags", ")", "==", "importDeclaration", ".", "isStatic", "(", ")", ")", ")", "{", "this", ".", "creationOccurred", "=", "false", ";", "return", "null", ";", "}", "}", "AST", "ast", "=", "this", ".", "cuAST", ".", "getAST", "(", ")", ";", "ImportDeclaration", "importDeclaration", "=", "ast", ".", "newImportDeclaration", "(", ")", ";", "importDeclaration", ".", "setStatic", "(", "Flags", ".", "isStatic", "(", "this", ".", "flags", ")", ")", ";", "char", "[", "]", "[", "]", "charFragments", "=", "CharOperation", ".", "splitOn", "(", "'.'", ",", "importActualName", ".", "toCharArray", "(", ")", ",", "0", ",", "importActualName", ".", "length", "(", ")", ")", ";", "int", "length", "=", "charFragments", ".", "length", ";", "String", "[", "]", "strFragments", "=", "new", "String", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "strFragments", "[", "i", "]", "=", "String", ".", "valueOf", "(", "charFragments", "[", "i", "]", ")", ";", "}", "Name", "name", "=", "ast", ".", "newName", "(", "strFragments", ")", ";", "importDeclaration", ".", "setName", "(", "name", ")", ";", "if", "(", "onDemand", ")", "importDeclaration", ".", "setOnDemand", "(", "true", ")", ";", "return", "importDeclaration", ";", "}", "protected", "IJavaElement", "generateResultHandle", "(", ")", "{", "return", "getCompilationUnit", "(", ")", ".", "getImport", "(", "this", ".", "importName", ")", ";", "}", "public", "String", "getMainTaskName", "(", ")", "{", "return", "Messages", ".", "operation_createImportsProgress", ";", "}", "protected", "void", "initializeDefaultPosition", "(", ")", "{", "try", "{", "ICompilationUnit", "cu", "=", "getCompilationUnit", "(", ")", ";", "IImportDeclaration", "[", "]", "imports", "=", "cu", ".", "getImports", "(", ")", ";", "if", "(", "imports", ".", "length", ">", "0", ")", "{", "createAfter", "(", "imports", "[", "imports", ".", "length", "-", "1", "]", ")", ";", "return", ";", "}", "IType", "[", "]", "types", "=", "cu", ".", "getTypes", "(", ")", ";", "if", "(", "types", ".", "length", ">", "0", ")", "{", "createBefore", "(", "types", "[", "0", "]", ")", ";", "return", ";", "}", "IJavaElement", "[", "]", "children", "=", "cu", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "if", "(", "children", "[", "i", "]", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "PACKAGE_DECLARATION", ")", "{", "createAfter", "(", "children", "[", "i", "]", ")", ";", "return", ";", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "public", "IJavaModelStatus", "verify", "(", ")", "{", "IJavaModelStatus", "status", "=", "super", ".", "verify", "(", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "IJavaProject", "project", "=", "getParentElement", "(", ")", ".", "getJavaProject", "(", ")", ";", "if", "(", "JavaConventions", ".", "validateImportDeclaration", "(", "this", ".", "importName", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ")", ".", "getSeverity", "(", ")", "==", "IStatus", ".", "ERROR", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_NAME", ",", "this", ".", "importName", ")", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,929
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFolder", ";", "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", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElementDelta", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "ObjectVector", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "DeltaProcessor", ".", "RootInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ".", "PerProjectInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "indexing", ".", "IndexManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "ClasspathChange", "{", "public", "static", "final", "int", "NO_DELTA", "=", "0x00", ";", "public", "static", "final", "int", "HAS_DELTA", "=", "0x01", ";", "public", "static", "final", "int", "HAS_PROJECT_CHANGE", "=", "0x02", ";", "public", "static", "final", "int", "HAS_LIBRARY_CHANGE", "=", "0x04", ";", "JavaProject", "project", ";", "IClasspathEntry", "[", "]", "oldRawClasspath", ";", "IPath", "oldOutputLocation", ";", "IClasspathEntry", "[", "]", "oldResolvedClasspath", ";", "public", "ClasspathChange", "(", "JavaProject", "project", ",", "IClasspathEntry", "[", "]", "oldRawClasspath", ",", "IPath", "oldOutputLocation", ",", "IClasspathEntry", "[", "]", "oldResolvedClasspath", ")", "{", "this", ".", "project", "=", "project", ";", "this", ".", "oldRawClasspath", "=", "oldRawClasspath", ";", "this", ".", "oldOutputLocation", "=", "oldOutputLocation", ";", "this", ".", "oldResolvedClasspath", "=", "oldResolvedClasspath", ";", "}", "private", "void", "addClasspathDeltas", "(", "JavaElementDelta", "delta", ",", "IPackageFragmentRoot", "[", "]", "roots", ",", "int", "flag", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "roots", ".", "length", ";", "i", "++", ")", "{", "IPackageFragmentRoot", "root", "=", "roots", "[", "i", "]", ";", "delta", ".", "changed", "(", "root", ",", "flag", ")", ";", "if", "(", "(", "flag", "&", "IJavaElementDelta", ".", "F_REMOVED_FROM_CLASSPATH", ")", "!=", "0", "||", "(", "flag", "&", "IJavaElementDelta", ".", "F_SOURCEATTACHED", ")", "!=", "0", "||", "(", "flag", "&", "IJavaElementDelta", ".", "F_SOURCEDETACHED", ")", "!=", "0", ")", "{", "try", "{", "root", ".", "close", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "}", "private", "int", "classpathContains", "(", "IClasspathEntry", "[", "]", "list", ",", "IClasspathEntry", "entry", ")", "{", "IPath", "[", "]", "exclusionPatterns", "=", "entry", ".", "getExclusionPatterns", "(", ")", ";", "IPath", "[", "]", "inclusionPatterns", "=", "entry", ".", "getInclusionPatterns", "(", ")", ";", "int", "listLen", "=", "list", "==", "null", "?", "0", ":", "list", ".", "length", ";", "nextEntry", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<", "listLen", ";", "i", "++", ")", "{", "IClasspathEntry", "other", "=", "list", "[", "i", "]", ";", "if", "(", "other", ".", "getContentKind", "(", ")", "==", "entry", ".", "getContentKind", "(", ")", "&&", "other", ".", "getEntryKind", "(", ")", "==", "entry", ".", "getEntryKind", "(", ")", "&&", "other", ".", "isExported", "(", ")", "==", "entry", ".", "isExported", "(", ")", "&&", "other", ".", "getPath", "(", ")", ".", "equals", "(", "entry", ".", "getPath", "(", ")", ")", ")", "{", "IPath", "entryOutput", "=", "entry", ".", "getOutputLocation", "(", ")", ";", "IPath", "otherOutput", "=", "other", ".", "getOutputLocation", "(", ")", ";", "if", "(", "entryOutput", "==", "null", ")", "{", "if", "(", "otherOutput", "!=", "null", ")", "continue", ";", "}", "else", "{", "if", "(", "!", "entryOutput", ".", "equals", "(", "otherOutput", ")", ")", "continue", ";", "}", "IPath", "[", "]", "otherIncludes", "=", "other", ".", "getInclusionPatterns", "(", ")", ";", "if", "(", "inclusionPatterns", "!=", "otherIncludes", ")", "{", "if", "(", "inclusionPatterns", "==", "null", ")", "continue", ";", "int", "includeLength", "=", "inclusionPatterns", ".", "length", ";", "if", "(", "otherIncludes", "==", "null", "||", "otherIncludes", ".", "length", "!=", "includeLength", ")", "continue", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "includeLength", ";", "j", "++", ")", "{", "if", "(", "!", "inclusionPatterns", "[", "j", "]", ".", "toString", "(", ")", ".", "equals", "(", "otherIncludes", "[", "j", "]", ".", "toString", "(", ")", ")", ")", "continue", "nextEntry", ";", "}", "}", "IPath", "[", "]", "otherExcludes", "=", "other", ".", "getExclusionPatterns", "(", ")", ";", "if", "(", "exclusionPatterns", "!=", "otherExcludes", ")", "{", "if", "(", "exclusionPatterns", "==", "null", ")", "continue", ";", "int", "excludeLength", "=", "exclusionPatterns", ".", "length", ";", "if", "(", "otherExcludes", "==", "null", "||", "otherExcludes", ".", "length", "!=", "excludeLength", ")", "continue", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "excludeLength", ";", "j", "++", ")", "{", "if", "(", "!", "exclusionPatterns", "[", "j", "]", ".", "toString", "(", ")", ".", "equals", "(", "otherExcludes", "[", "j", "]", ".", "toString", "(", ")", ")", ")", "continue", "nextEntry", ";", "}", "}", "return", "i", ";", "}", "}", "return", "-", "1", ";", "}", "private", "void", "collectAllSubfolders", "(", "IFolder", "folder", ",", "ArrayList", "collection", ")", "throws", "JavaModelException", "{", "try", "{", "IResource", "[", "]", "members", "=", "folder", ".", "members", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "members", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "IResource", "r", "=", "members", "[", "i", "]", ";", "if", "(", "r", ".", "getType", "(", ")", "==", "IResource", ".", "FOLDER", ")", "{", "collection", ".", "add", "(", "r", ")", ";", "collectAllSubfolders", "(", "(", "IFolder", ")", "r", ",", "collection", ")", ";", "}", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "private", "ArrayList", "determineAffectedPackageFragments", "(", "IPath", "location", ")", "throws", "JavaModelException", "{", "ArrayList", "fragments", "=", "new", "ArrayList", "(", ")", ";", "IWorkspace", "workspace", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "IResource", "resource", "=", "null", ";", "if", "(", "location", "!=", "null", ")", "{", "resource", "=", "workspace", ".", "getRoot", "(", ")", ".", "findMember", "(", "location", ")", ";", "}", "if", "(", "resource", "!=", "null", "&&", "resource", ".", "getType", "(", ")", "==", "IResource", ".", "FOLDER", ")", "{", "IFolder", "folder", "=", "(", "IFolder", ")", "resource", ";", "IClasspathEntry", "[", "]", "classpath", "=", "this", ".", "project", ".", "getExpandedClasspath", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classpath", ".", "length", ";", "i", "++", ")", "{", "IClasspathEntry", "entry", "=", "classpath", "[", "i", "]", ";", "IPath", "path", "=", "classpath", "[", "i", "]", ".", "getPath", "(", ")", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "!=", "IClasspathEntry", ".", "CPE_PROJECT", "&&", "path", ".", "isPrefixOf", "(", "location", ")", "&&", "!", "path", ".", "equals", "(", "location", ")", ")", "{", "IPackageFragmentRoot", "[", "]", "roots", "=", "this", ".", "project", ".", "computePackageFragmentRoots", "(", "classpath", "[", "i", "]", ")", ";", "PackageFragmentRoot", "root", "=", "(", "PackageFragmentRoot", ")", "roots", "[", "0", "]", ";", "ArrayList", "folders", "=", "new", "ArrayList", "(", ")", ";", "folders", ".", "add", "(", "folder", ")", ";", "collectAllSubfolders", "(", "folder", ",", "folders", ")", ";", "Iterator", "elements", "=", "folders", ".", "iterator", "(", ")", ";", "int", "segments", "=", "path", ".", "segmentCount", "(", ")", ";", "while", "(", "elements", ".", "hasNext", "(", ")", ")", "{", "IFolder", "f", "=", "(", "IFolder", ")", "elements", ".", "next", "(", ")", ";", "IPath", "relativePath", "=", "f", ".", "getFullPath", "(", ")", ".", "removeFirstSegments", "(", "segments", ")", ";", "String", "[", "]", "pkgName", "=", "relativePath", ".", "segments", "(", ")", ";", "IPackageFragment", "pkg", "=", "root", ".", "getPackageFragment", "(", "pkgName", ")", ";", "if", "(", "!", "Util", ".", "isExcluded", "(", "pkg", ")", ")", "fragments", ".", "add", "(", "pkg", ")", ";", "}", "}", "}", "}", "return", "fragments", ";", "}", "public", "boolean", "equals", "(", "Object", "obj", ")", "{", "if", "(", "!", "(", "obj", "instanceof", "ClasspathChange", ")", ")", "return", "false", ";", "return", "this", ".", "project", ".", "equals", "(", "(", "(", "ClasspathChange", ")", "obj", ")", ".", "project", ")", ";", "}", "public", "int", "generateDelta", "(", "JavaElementDelta", "delta", ",", "boolean", "addClasspathChange", ")", "{", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "DeltaProcessingState", "state", "=", "manager", ".", "deltaState", ";", "if", "(", "state", ".", "findJavaProject", "(", "this", ".", "project", ".", "getElementName", "(", ")", ")", "==", "null", ")", "return", "NO_DELTA", ";", "DeltaProcessor", "deltaProcessor", "=", "state", ".", "getDeltaProcessor", "(", ")", ";", "IClasspathEntry", "[", "]", "newResolvedClasspath", "=", "null", ";", "IPath", "newOutputLocation", "=", "null", ";", "int", "result", "=", "NO_DELTA", ";", "try", "{", "PerProjectInfo", "perProjectInfo", "=", "this", ".", "project", ".", "getPerProjectInfo", "(", ")", ";", "this", ".", "project", ".", "resolveClasspath", "(", "perProjectInfo", ",", "false", ",", "addClasspathChange", ")", ";", "IClasspathEntry", "[", "]", "newRawClasspath", ";", "synchronized", "(", "perProjectInfo", ")", "{", "newRawClasspath", "=", "perProjectInfo", ".", "rawClasspath", ";", "newResolvedClasspath", "=", "perProjectInfo", ".", "getResolvedClasspath", "(", ")", ";", "newOutputLocation", "=", "perProjectInfo", ".", "outputLocation", ";", "}", "if", "(", "newResolvedClasspath", "==", "null", ")", "{", "PerProjectInfo", "temporaryInfo", "=", "this", ".", "project", ".", "newTemporaryInfo", "(", ")", ";", "this", ".", "project", ".", "resolveClasspath", "(", "temporaryInfo", ",", "false", ",", "addClasspathChange", ")", ";", "newRawClasspath", "=", "temporaryInfo", ".", "rawClasspath", ";", "newResolvedClasspath", "=", "temporaryInfo", ".", "getResolvedClasspath", "(", ")", ";", "newOutputLocation", "=", "temporaryInfo", ".", "outputLocation", ";", "}", "if", "(", "this", ".", "oldRawClasspath", "!=", "null", "&&", "!", "JavaProject", ".", "areClasspathsEqual", "(", "this", ".", "oldRawClasspath", ",", "newRawClasspath", ",", "this", ".", "oldOutputLocation", ",", "newOutputLocation", ")", ")", "{", "delta", ".", "changed", "(", "this", ".", "project", ",", "IJavaElementDelta", ".", "F_CLASSPATH_CHANGED", ")", ";", "result", "|=", "HAS_DELTA", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "oldRawClasspath", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IClasspathEntry", "entry", "=", "this", ".", "oldRawClasspath", "[", "i", "]", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_CONTAINER", ")", "{", "if", "(", "classpathContains", "(", "newRawClasspath", ",", "entry", ")", "==", "-", "1", ")", "manager", ".", "containerPut", "(", "this", ".", "project", ",", "entry", ".", "getPath", "(", ")", ",", "null", ")", ";", "}", "}", "}", "if", "(", "this", ".", "oldResolvedClasspath", "!=", "null", "&&", "JavaProject", ".", "areClasspathsEqual", "(", "this", ".", "oldResolvedClasspath", ",", "newResolvedClasspath", ",", "this", ".", "oldOutputLocation", ",", "newOutputLocation", ")", ")", "return", "result", ";", "this", ".", "project", ".", "close", "(", ")", ";", "deltaProcessor", ".", "projectCachesToReset", ".", "add", "(", "this", ".", "project", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "if", "(", "DeltaProcessor", ".", "VERBOSE", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "result", ";", "}", "if", "(", "this", ".", "oldResolvedClasspath", "==", "null", ")", "return", "result", ";", "delta", ".", "changed", "(", "this", ".", "project", ",", "IJavaElementDelta", ".", "F_RESOLVED_CLASSPATH_CHANGED", ")", ";", "result", "|=", "HAS_DELTA", ";", "state", ".", "addForRefresh", "(", "this", ".", "project", ")", ";", "Map", "removedRoots", "=", "null", ";", "IPackageFragmentRoot", "[", "]", "roots", "=", "null", ";", "Map", "allOldRoots", ";", "if", "(", "(", "allOldRoots", "=", "deltaProcessor", ".", "oldRoots", ")", "!=", "null", ")", "{", "roots", "=", "(", "IPackageFragmentRoot", "[", "]", ")", "allOldRoots", ".", "get", "(", "this", ".", "project", ")", ";", "}", "if", "(", "roots", "!=", "null", ")", "{", "removedRoots", "=", "new", "HashMap", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "roots", ".", "length", ";", "i", "++", ")", "{", "IPackageFragmentRoot", "root", "=", "roots", "[", "i", "]", ";", "removedRoots", ".", "put", "(", "root", ".", "getPath", "(", ")", ",", "root", ")", ";", "}", "}", "int", "newLength", "=", "newResolvedClasspath", ".", "length", ";", "int", "oldLength", "=", "this", ".", "oldResolvedClasspath", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "oldLength", ";", "i", "++", ")", "{", "int", "index", "=", "classpathContains", "(", "newResolvedClasspath", ",", "this", ".", "oldResolvedClasspath", "[", "i", "]", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "int", "entryKind", "=", "this", ".", "oldResolvedClasspath", "[", "i", "]", ".", "getEntryKind", "(", ")", ";", "if", "(", "entryKind", "==", "IClasspathEntry", ".", "CPE_PROJECT", ")", "{", "result", "|=", "HAS_PROJECT_CHANGE", ";", "continue", ";", "}", "if", "(", "entryKind", "==", "IClasspathEntry", ".", "CPE_LIBRARY", ")", "{", "result", "|=", "HAS_LIBRARY_CHANGE", ";", "}", "IPackageFragmentRoot", "[", "]", "pkgFragmentRoots", "=", "null", ";", "if", "(", "removedRoots", "!=", "null", ")", "{", "PackageFragmentRoot", "oldRoot", "=", "(", "PackageFragmentRoot", ")", "removedRoots", ".", "get", "(", "this", ".", "oldResolvedClasspath", "[", "i", "]", ".", "getPath", "(", ")", ")", ";", "if", "(", "oldRoot", "!=", "null", ")", "{", "pkgFragmentRoots", "=", "new", "PackageFragmentRoot", "[", "]", "{", "oldRoot", "}", ";", "}", "}", "if", "(", "pkgFragmentRoots", "==", "null", ")", "{", "try", "{", "ObjectVector", "accumulatedRoots", "=", "new", "ObjectVector", "(", ")", ";", "HashSet", "rootIDs", "=", "new", "HashSet", "(", "5", ")", ";", "rootIDs", ".", "add", "(", "this", ".", "project", ".", "rootID", "(", ")", ")", ";", "this", ".", "project", ".", "computePackageFragmentRoots", "(", "this", ".", "oldResolvedClasspath", "[", "i", "]", ",", "accumulatedRoots", ",", "rootIDs", ",", "null", ",", "false", ",", "null", ")", ";", "RootInfo", "rootInfo", "=", "(", "RootInfo", ")", "state", ".", "oldRoots", ".", "get", "(", "this", ".", "oldResolvedClasspath", "[", "i", "]", ".", "getPath", "(", ")", ")", ";", "if", "(", "rootInfo", "!=", "null", "&&", "rootInfo", ".", "cache", "!=", "null", ")", "{", "IPackageFragmentRoot", "oldRoot", "=", "rootInfo", ".", "cache", ";", "boolean", "found", "=", "false", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "accumulatedRoots", ".", "size", "(", ")", ";", "j", "++", ")", "{", "IPackageFragmentRoot", "root", "=", "(", "IPackageFragmentRoot", ")", "accumulatedRoots", ".", "elementAt", "(", "j", ")", ";", "if", "(", "!", "root", ".", "getPath", "(", ")", ".", "equals", "(", "oldRoot", ".", "getPath", "(", ")", ")", ")", "{", "found", "=", "true", ";", "break", ";", "}", "}", "if", "(", "!", "found", ")", "accumulatedRoots", ".", "add", "(", "oldRoot", ")", ";", "}", "pkgFragmentRoots", "=", "new", "PackageFragmentRoot", "[", "accumulatedRoots", ".", "size", "(", ")", "]", ";", "accumulatedRoots", ".", "copyInto", "(", "pkgFragmentRoots", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "pkgFragmentRoots", "=", "new", "PackageFragmentRoot", "[", "]", "{", "}", ";", "}", "}", "addClasspathDeltas", "(", "delta", ",", "pkgFragmentRoots", ",", "IJavaElementDelta", ".", "F_REMOVED_FROM_CLASSPATH", ")", ";", "}", "else", "{", "if", "(", "this", ".", "oldResolvedClasspath", "[", "i", "]", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_PROJECT", ")", "{", "result", "|=", "HAS_PROJECT_CHANGE", ";", "continue", ";", "}", "if", "(", "index", "!=", "i", ")", "{", "addClasspathDeltas", "(", "delta", ",", "this", ".", "project", ".", "computePackageFragmentRoots", "(", "this", ".", "oldResolvedClasspath", "[", "i", "]", ")", ",", "IJavaElementDelta", ".", "F_REORDER", ")", ";", "}", "IPath", "newSourcePath", "=", "newResolvedClasspath", "[", "index", "]", ".", "getSourceAttachmentPath", "(", ")", ";", "int", "sourceAttachmentFlags", "=", "getSourceAttachmentDeltaFlag", "(", "this", ".", "oldResolvedClasspath", "[", "i", "]", ".", "getSourceAttachmentPath", "(", ")", ",", "newSourcePath", ")", ";", "IPath", "oldRootPath", "=", "this", ".", "oldResolvedClasspath", "[", "i", "]", ".", "getSourceAttachmentRootPath", "(", ")", ";", "IPath", "newRootPath", "=", "newResolvedClasspath", "[", "index", "]", ".", "getSourceAttachmentRootPath", "(", ")", ";", "int", "sourceAttachmentRootFlags", "=", "getSourceAttachmentDeltaFlag", "(", "oldRootPath", ",", "newRootPath", ")", ";", "int", "flags", "=", "sourceAttachmentFlags", "|", "sourceAttachmentRootFlags", ";", "if", "(", "flags", "!=", "0", ")", "{", "addClasspathDeltas", "(", "delta", ",", "this", ".", "project", ".", "computePackageFragmentRoots", "(", "this", ".", "oldResolvedClasspath", "[", "i", "]", ")", ",", "flags", ")", ";", "}", "else", "{", "if", "(", "oldRootPath", "==", "null", "&&", "newRootPath", "==", "null", ")", "{", "IPackageFragmentRoot", "[", "]", "computedRoots", "=", "this", ".", "project", ".", "computePackageFragmentRoots", "(", "this", ".", "oldResolvedClasspath", "[", "i", "]", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "computedRoots", ".", "length", ";", "j", "++", ")", "{", "IPackageFragmentRoot", "root", "=", "computedRoots", "[", "j", "]", ";", "try", "{", "root", ".", "close", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "}", "}", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "newLength", ";", "i", "++", ")", "{", "int", "index", "=", "classpathContains", "(", "this", ".", "oldResolvedClasspath", ",", "newResolvedClasspath", "[", "i", "]", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "int", "entryKind", "=", "newResolvedClasspath", "[", "i", "]", ".", "getEntryKind", "(", ")", ";", "if", "(", "entryKind", "==", "IClasspathEntry", ".", "CPE_PROJECT", ")", "{", "result", "|=", "HAS_PROJECT_CHANGE", ";", "continue", ";", "}", "if", "(", "entryKind", "==", "IClasspathEntry", ".", "CPE_LIBRARY", ")", "{", "result", "|=", "HAS_LIBRARY_CHANGE", ";", "}", "addClasspathDeltas", "(", "delta", ",", "this", ".", "project", ".", "computePackageFragmentRoots", "(", "newResolvedClasspath", "[", "i", "]", ")", ",", "IJavaElementDelta", ".", "F_ADDED_TO_CLASSPATH", ")", ";", "}", "}", "if", "(", "(", "newOutputLocation", "==", "null", "&&", "this", ".", "oldOutputLocation", "!=", "null", ")", "||", "(", "newOutputLocation", "!=", "null", "&&", "!", "newOutputLocation", ".", "equals", "(", "this", ".", "oldOutputLocation", ")", ")", ")", "{", "try", "{", "ArrayList", "added", "=", "determineAffectedPackageFragments", "(", "this", ".", "oldOutputLocation", ")", ";", "Iterator", "iter", "=", "added", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "IPackageFragment", "frag", "=", "(", "IPackageFragment", ")", "iter", ".", "next", "(", ")", ";", "(", "(", "IPackageFragmentRoot", ")", "frag", ".", "getParent", "(", ")", ")", ".", "close", "(", ")", ";", "delta", ".", "added", "(", "frag", ")", ";", "}", "ArrayList", "removed", "=", "determineAffectedPackageFragments", "(", "newOutputLocation", ")", ";", "iter", "=", "removed", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "IPackageFragment", "frag", "=", "(", "IPackageFragment", ")", "iter", ".", "next", "(", ")", ";", "(", "(", "IPackageFragmentRoot", ")", "frag", ".", "getParent", "(", ")", ")", ".", "close", "(", ")", ";", "delta", ".", "removed", "(", "frag", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "if", "(", "DeltaProcessor", ".", "VERBOSE", ")", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "return", "result", ";", "}", "private", "int", "getSourceAttachmentDeltaFlag", "(", "IPath", "oldPath", ",", "IPath", "newPath", ")", "{", "if", "(", "oldPath", "==", "null", ")", "{", "if", "(", "newPath", "!=", "null", ")", "{", "return", "IJavaElementDelta", ".", "F_SOURCEATTACHED", ";", "}", "else", "{", "return", "0", ";", "}", "}", "else", "if", "(", "newPath", "==", "null", ")", "{", "return", "IJavaElementDelta", ".", "F_SOURCEDETACHED", ";", "}", "else", "if", "(", "!", "oldPath", ".", "equals", "(", "newPath", ")", ")", "{", "return", "IJavaElementDelta", ".", "F_SOURCEATTACHED", "|", "IJavaElementDelta", ".", "F_SOURCEDETACHED", ";", "}", "else", "{", "return", "0", ";", "}", "}", "public", "int", "hashCode", "(", ")", "{", "return", "this", ".", "project", ".", "hashCode", "(", ")", ";", "}", "public", "void", "requestIndexing", "(", ")", "{", "IClasspathEntry", "[", "]", "newResolvedClasspath", "=", "null", ";", "try", "{", "newResolvedClasspath", "=", "this", ".", "project", ".", "getResolvedClasspath", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", ";", "}", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "IndexManager", "indexManager", "=", "manager", ".", "indexManager", ";", "if", "(", "indexManager", "==", "null", ")", "return", ";", "DeltaProcessingState", "state", "=", "manager", ".", "deltaState", ";", "int", "newLength", "=", "newResolvedClasspath", ".", "length", ";", "int", "oldLength", "=", "this", ".", "oldResolvedClasspath", "==", "null", "?", "0", ":", "this", ".", "oldResolvedClasspath", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "oldLength", ";", "i", "++", ")", "{", "int", "index", "=", "classpathContains", "(", "newResolvedClasspath", ",", "this", ".", "oldResolvedClasspath", "[", "i", "]", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "if", "(", "this", ".", "oldResolvedClasspath", "[", "i", "]", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_PROJECT", ")", "{", "continue", ";", "}", "IClasspathEntry", "oldEntry", "=", "this", ".", "oldResolvedClasspath", "[", "i", "]", ";", "final", "IPath", "path", "=", "oldEntry", ".", "getPath", "(", ")", ";", "int", "changeKind", "=", "this", ".", "oldResolvedClasspath", "[", "i", "]", ".", "getEntryKind", "(", ")", ";", "switch", "(", "changeKind", ")", "{", "case", "IClasspathEntry", ".", "CPE_SOURCE", ":", "char", "[", "]", "[", "]", "inclusionPatterns", "=", "(", "(", "ClasspathEntry", ")", "oldEntry", ")", ".", "fullInclusionPatternChars", "(", ")", ";", "char", "[", "]", "[", "]", "exclusionPatterns", "=", "(", "(", "ClasspathEntry", ")", "oldEntry", ")", ".", "fullExclusionPatternChars", "(", ")", ";", "indexManager", ".", "removeSourceFolderFromIndex", "(", "this", ".", "project", ",", "path", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ";", "break", ";", "case", "IClasspathEntry", ".", "CPE_LIBRARY", ":", "if", "(", "state", ".", "otherRoots", ".", "get", "(", "path", ")", "==", "null", ")", "{", "indexManager", ".", "discardJobs", "(", "path", ".", "toString", "(", ")", ")", ";", "indexManager", ".", "removeIndex", "(", "path", ")", ";", "}", "break", ";", "}", "}", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "newLength", ";", "i", "++", ")", "{", "int", "index", "=", "classpathContains", "(", "this", ".", "oldResolvedClasspath", ",", "newResolvedClasspath", "[", "i", "]", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "if", "(", "newResolvedClasspath", "[", "i", "]", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_PROJECT", ")", "{", "continue", ";", "}", "int", "entryKind", "=", "newResolvedClasspath", "[", "i", "]", ".", "getEntryKind", "(", ")", ";", "switch", "(", "entryKind", ")", "{", "case", "IClasspathEntry", ".", "CPE_LIBRARY", ":", "boolean", "pathHasChanged", "=", "true", ";", "IPath", "newPath", "=", "newResolvedClasspath", "[", "i", "]", ".", "getPath", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "oldLength", ";", "j", "++", ")", "{", "IClasspathEntry", "oldEntry", "=", "this", ".", "oldResolvedClasspath", "[", "j", "]", ";", "if", "(", "oldEntry", ".", "getPath", "(", ")", ".", "equals", "(", "newPath", ")", ")", "{", "pathHasChanged", "=", "false", ";", "break", ";", "}", "}", "if", "(", "pathHasChanged", ")", "{", "indexManager", ".", "indexLibrary", "(", "newPath", ",", "this", ".", "project", ".", "getProject", "(", ")", ")", ";", "}", "break", ";", "case", "IClasspathEntry", ".", "CPE_SOURCE", ":", "IClasspathEntry", "entry", "=", "newResolvedClasspath", "[", "i", "]", ";", "IPath", "path", "=", "entry", ".", "getPath", "(", ")", ";", "char", "[", "]", "[", "]", "inclusionPatterns", "=", "(", "(", "ClasspathEntry", ")", "entry", ")", ".", "fullInclusionPatternChars", "(", ")", ";", "char", "[", "]", "[", "]", "exclusionPatterns", "=", "(", "(", "ClasspathEntry", ")", "entry", ")", ".", "fullExclusionPatternChars", "(", ")", ";", "indexManager", ".", "indexSourceFolder", "(", "this", ".", "project", ",", "path", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ";", "break", ";", "}", "}", "}", "}", "public", "String", "toString", "(", ")", "{", "return", "\"\"", "+", "this", ".", "project", ".", "getElementName", "(", ")", ";", "}", "}", "</s>" ]
3,930
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "public", "class", "JavaElementInfo", "implements", "Cloneable", "{", "static", "Object", "[", "]", "NO_NON_JAVA_RESOURCES", "=", "new", "Object", "[", "]", "{", "}", ";", "public", "Object", "clone", "(", ")", "{", "try", "{", "return", "super", ".", "clone", "(", ")", ";", "}", "catch", "(", "CloneNotSupportedException", "e", ")", "{", "throw", "new", "Error", "(", ")", ";", "}", "}", "public", "IJavaElement", "[", "]", "getChildren", "(", ")", "{", "return", "JavaElement", ".", "NO_ELEMENTS", ";", "}", "}", "</s>" ]
3,931
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "PerformanceStats", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "CompletionEngine", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "SelectionEngine", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "abstract", "class", "Openable", "extends", "JavaElement", "implements", "IOpenable", ",", "IBufferChangedListener", "{", "protected", "Openable", "(", "JavaElement", "parent", ")", "{", "super", "(", "parent", ")", ";", "}", "public", "void", "bufferChanged", "(", "BufferChangedEvent", "event", ")", "{", "if", "(", "event", ".", "getBuffer", "(", ")", ".", "isClosed", "(", ")", ")", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getElementsOutOfSynchWithBuffers", "(", ")", ".", "remove", "(", "this", ")", ";", "getBufferManager", "(", ")", ".", "removeBuffer", "(", "event", ".", "getBuffer", "(", ")", ")", ";", "}", "else", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getElementsOutOfSynchWithBuffers", "(", ")", ".", "add", "(", "this", ")", ";", "}", "}", "protected", "abstract", "boolean", "buildStructure", "(", "OpenableElementInfo", "info", ",", "IProgressMonitor", "pm", ",", "Map", "newElements", ",", "IResource", "underlyingResource", ")", "throws", "JavaModelException", ";", "public", "boolean", "canBeRemovedFromCache", "(", ")", "{", "try", "{", "return", "!", "hasUnsavedChanges", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "false", ";", "}", "}", "public", "boolean", "canBufferBeRemovedFromCache", "(", "IBuffer", "buffer", ")", "{", "return", "!", "buffer", ".", "hasUnsavedChanges", "(", ")", ";", "}", "protected", "void", "closeBuffer", "(", ")", "{", "if", "(", "!", "hasBuffer", "(", ")", ")", "return", ";", "IBuffer", "buffer", "=", "getBufferManager", "(", ")", ".", "getBuffer", "(", "this", ")", ";", "if", "(", "buffer", "!=", "null", ")", "{", "buffer", ".", "close", "(", ")", ";", "buffer", ".", "removeBufferChangedListener", "(", "this", ")", ";", "}", "}", "protected", "void", "closing", "(", "Object", "info", ")", "{", "closeBuffer", "(", ")", ";", "}", "protected", "void", "codeComplete", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", "cu", ",", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", "unitToSkip", ",", "int", "position", ",", "CompletionRequestor", "requestor", ",", "WorkingCopyOwner", "owner", ",", "ITypeRoot", "typeRoot", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "requestor", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", ")", ";", "}", "PerformanceStats", "performanceStats", "=", "CompletionEngine", ".", "PERF", "?", "PerformanceStats", ".", "getStats", "(", "JavaModelManager", ".", "COMPLETION_PERF", ",", "this", ")", ":", "null", ";", "if", "(", "performanceStats", "!=", "null", ")", "{", "performanceStats", ".", "startRun", "(", "new", "String", "(", "cu", ".", "getFileName", "(", ")", ")", "+", "\"", "at", "\"", "+", "position", ")", ";", "}", "IBuffer", "buffer", "=", "getBuffer", "(", ")", ";", "if", "(", "buffer", "==", "null", ")", "{", "return", ";", "}", "if", "(", "position", "<", "-", "1", "||", "position", ">", "buffer", ".", "getLength", "(", ")", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INDEX_OUT_OF_BOUNDS", ")", ")", ";", "}", "JavaProject", "project", "=", "(", "JavaProject", ")", "getJavaProject", "(", ")", ";", "SearchableEnvironment", "environment", "=", "project", ".", "newSearchableNameEnvironment", "(", "owner", ")", ";", "environment", ".", "unitToSkip", "=", "unitToSkip", ";", "CompletionEngine", "engine", "=", "new", "CompletionEngine", "(", "environment", ",", "requestor", ",", "project", ".", "getOptions", "(", "true", ")", ",", "project", ",", "owner", ",", "monitor", ")", ";", "engine", ".", "complete", "(", "cu", ",", "position", ",", "0", ",", "typeRoot", ")", ";", "if", "(", "performanceStats", "!=", "null", ")", "{", "performanceStats", ".", "endRun", "(", ")", ";", "}", "if", "(", "NameLookup", ".", "VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "environment", ".", "nameLookup", ".", "timeSpentInSeekTypesInSourcePackage", "+", "\"ms\"", ")", ";", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "environment", ".", "nameLookup", ".", "timeSpentInSeekTypesInBinaryPackage", "+", "\"ms\"", ")", ";", "}", "}", "protected", "IJavaElement", "[", "]", "codeSelect", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", "cu", ",", "int", "offset", ",", "int", "length", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", "{", "PerformanceStats", "performanceStats", "=", "SelectionEngine", ".", "PERF", "?", "PerformanceStats", ".", "getStats", "(", "JavaModelManager", ".", "SELECTION_PERF", ",", "this", ")", ":", "null", ";", "if", "(", "performanceStats", "!=", "null", ")", "{", "performanceStats", ".", "startRun", "(", "new", "String", "(", "cu", ".", "getFileName", "(", ")", ")", "+", "\"", "at", "[\"", "+", "offset", "+", "\",\"", "+", "length", "+", "\"]\"", ")", ";", "}", "JavaProject", "project", "=", "(", "JavaProject", ")", "getJavaProject", "(", ")", ";", "SearchableEnvironment", "environment", "=", "project", ".", "newSearchableNameEnvironment", "(", "owner", ")", ";", "SelectionRequestor", "requestor", "=", "new", "SelectionRequestor", "(", "environment", ".", "nameLookup", ",", "this", ")", ";", "IBuffer", "buffer", "=", "getBuffer", "(", ")", ";", "if", "(", "buffer", "==", "null", ")", "{", "return", "requestor", ".", "getElements", "(", ")", ";", "}", "int", "end", "=", "buffer", ".", "getLength", "(", ")", ";", "if", "(", "offset", "<", "0", "||", "length", "<", "0", "||", "offset", "+", "length", ">", "end", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INDEX_OUT_OF_BOUNDS", ")", ")", ";", "}", "SelectionEngine", "engine", "=", "new", "SelectionEngine", "(", "environment", ",", "requestor", ",", "project", ".", "getOptions", "(", "true", ")", ",", "owner", ")", ";", "engine", ".", "select", "(", "cu", ",", "offset", ",", "offset", "+", "length", "-", "1", ")", ";", "if", "(", "performanceStats", "!=", "null", ")", "{", "performanceStats", ".", "endRun", "(", ")", ";", "}", "if", "(", "NameLookup", ".", "VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "environment", ".", "nameLookup", ".", "timeSpentInSeekTypesInSourcePackage", "+", "\"ms\"", ")", ";", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "environment", ".", "nameLookup", ".", "timeSpentInSeekTypesInBinaryPackage", "+", "\"ms\"", ")", ";", "}", "return", "requestor", ".", "getElements", "(", ")", ";", "}", "protected", "Object", "createElementInfo", "(", ")", "{", "return", "new", "OpenableElementInfo", "(", ")", ";", "}", "public", "boolean", "exists", "(", ")", "{", "if", "(", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getInfo", "(", "this", ")", "!=", "null", ")", "return", "true", ";", "switch", "(", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "PackageFragmentRoot", "root", "=", "getPackageFragmentRoot", "(", ")", ";", "if", "(", "root", ".", "isArchive", "(", ")", ")", "{", "JarPackageFragmentRootInfo", "rootInfo", ";", "try", "{", "rootInfo", "=", "(", "JarPackageFragmentRootInfo", ")", "root", ".", "getElementInfo", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "false", ";", "}", "return", "rootInfo", ".", "rawPackageInfo", ".", "containsKey", "(", "(", "(", "PackageFragment", ")", "this", ")", ".", "names", ")", ";", "}", "break", ";", "case", "IJavaElement", ".", "CLASS_FILE", ":", "if", "(", "getPackageFragmentRoot", "(", ")", ".", "isArchive", "(", ")", ")", "{", "return", "super", ".", "exists", "(", ")", ";", "}", "break", ";", "}", "return", "validateExistence", "(", "resource", "(", ")", ")", ".", "isOK", "(", ")", ";", "}", "public", "String", "findRecommendedLineSeparator", "(", ")", "throws", "JavaModelException", "{", "IBuffer", "buffer", "=", "getBuffer", "(", ")", ";", "String", "source", "=", "buffer", "==", "null", "?", "null", ":", "buffer", ".", "getContents", "(", ")", ";", "return", "Util", ".", "getLineSeparator", "(", "source", ",", "getJavaProject", "(", ")", ")", ";", "}", "protected", "void", "generateInfos", "(", "Object", "info", ",", "HashMap", "newElements", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "JavaModelCache", ".", "VERBOSE", ")", "{", "String", "element", ";", "switch", "(", "getElementType", "(", ")", ")", "{", "case", "JAVA_PROJECT", ":", "element", "=", "\"project\"", ";", "break", ";", "case", "PACKAGE_FRAGMENT_ROOT", ":", "element", "=", "\"root\"", ";", "break", ";", "case", "PACKAGE_FRAGMENT", ":", "element", "=", "\"package\"", ";", "break", ";", "case", "CLASS_FILE", ":", "element", "=", "\"class", "file\"", ";", "break", ";", "case", "COMPILATION_UNIT", ":", "element", "=", "\"\"", ";", "break", ";", "default", ":", "element", "=", "\"element\"", ";", "}", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"", "OPENING", "\"", "+", "element", "+", "\"", "\"", "+", "this", ".", "toStringWithAncestors", "(", ")", ")", ";", "}", "openAncestors", "(", "newElements", ",", "monitor", ")", ";", "IResource", "underlResource", "=", "resource", "(", ")", ";", "IStatus", "status", "=", "validateExistence", "(", "underlResource", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "throw", "newJavaModelException", "(", "status", ")", ";", "if", "(", "monitor", "!=", "null", "&&", "monitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", ")", ";", "newElements", ".", "put", "(", "this", ",", "info", ")", ";", "try", "{", "OpenableElementInfo", "openableElementInfo", "=", "(", "OpenableElementInfo", ")", "info", ";", "boolean", "isStructureKnown", "=", "buildStructure", "(", "openableElementInfo", ",", "monitor", ",", "newElements", ",", "underlResource", ")", ";", "openableElementInfo", ".", "setIsStructureKnown", "(", "isStructureKnown", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "newElements", ".", "remove", "(", "this", ")", ";", "throw", "e", ";", "}", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getElementsOutOfSynchWithBuffers", "(", ")", ".", "remove", "(", "this", ")", ";", "if", "(", "JavaModelCache", ".", "VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "cacheToString", "(", "\"->", "\"", ")", ")", ";", "}", "}", "public", "IBuffer", "getBuffer", "(", ")", "throws", "JavaModelException", "{", "if", "(", "hasBuffer", "(", ")", ")", "{", "Object", "info", "=", "getElementInfo", "(", ")", ";", "IBuffer", "buffer", "=", "getBufferManager", "(", ")", ".", "getBuffer", "(", "this", ")", ";", "if", "(", "buffer", "==", "null", ")", "{", "buffer", "=", "openBuffer", "(", "null", ",", "info", ")", ";", "}", "if", "(", "buffer", "instanceof", "NullBuffer", ")", "{", "return", "null", ";", "}", "return", "buffer", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "IBufferFactory", "getBufferFactory", "(", ")", "{", "return", "getBufferManager", "(", ")", ".", "getDefaultBufferFactory", "(", ")", ";", "}", "protected", "BufferManager", "getBufferManager", "(", ")", "{", "return", "BufferManager", ".", "getDefaultBufferManager", "(", ")", ";", "}", "public", "IResource", "getCorrespondingResource", "(", ")", "throws", "JavaModelException", "{", "return", "getUnderlyingResource", "(", ")", ";", "}", "public", "IOpenable", "getOpenable", "(", ")", "{", "return", "this", ";", "}", "public", "IResource", "getUnderlyingResource", "(", ")", "throws", "JavaModelException", "{", "IResource", "parentResource", "=", "this", ".", "parent", ".", "getUnderlyingResource", "(", ")", ";", "if", "(", "parentResource", "==", "null", ")", "{", "return", "null", ";", "}", "int", "type", "=", "parentResource", ".", "getType", "(", ")", ";", "if", "(", "type", "==", "IResource", ".", "FOLDER", "||", "type", "==", "IResource", ".", "PROJECT", ")", "{", "IContainer", "folder", "=", "(", "IContainer", ")", "parentResource", ";", "IResource", "resource", "=", "folder", ".", "findMember", "(", "getElementName", "(", ")", ")", ";", "if", "(", "resource", "==", "null", ")", "{", "throw", "newNotPresentException", "(", ")", ";", "}", "else", "{", "return", "resource", ";", "}", "}", "else", "{", "return", "parentResource", ";", "}", "}", "protected", "boolean", "hasBuffer", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "hasUnsavedChanges", "(", ")", "throws", "JavaModelException", "{", "if", "(", "isReadOnly", "(", ")", "||", "!", "isOpen", "(", ")", ")", "{", "return", "false", ";", "}", "IBuffer", "buf", "=", "getBuffer", "(", ")", ";", "if", "(", "buf", "!=", "null", "&&", "buf", ".", "hasUnsavedChanges", "(", ")", ")", "{", "return", "true", ";", "}", "int", "elementType", "=", "getElementType", "(", ")", ";", "if", "(", "elementType", "==", "PACKAGE_FRAGMENT", "||", "elementType", "==", "PACKAGE_FRAGMENT_ROOT", "||", "elementType", "==", "JAVA_PROJECT", "||", "elementType", "==", "JAVA_MODEL", ")", "{", "Enumeration", "openBuffers", "=", "getBufferManager", "(", ")", ".", "getOpenBuffers", "(", ")", ";", "while", "(", "openBuffers", ".", "hasMoreElements", "(", ")", ")", "{", "IBuffer", "buffer", "=", "(", "IBuffer", ")", "openBuffers", ".", "nextElement", "(", ")", ";", "if", "(", "buffer", ".", "hasUnsavedChanges", "(", ")", ")", "{", "IJavaElement", "owner", "=", "(", "IJavaElement", ")", "buffer", ".", "getOwner", "(", ")", ";", "if", "(", "isAncestorOf", "(", "owner", ")", ")", "{", "return", "true", ";", "}", "}", "}", "}", "return", "false", ";", "}", "public", "boolean", "isConsistent", "(", ")", "{", "return", "true", ";", "}", "public", "boolean", "isOpen", "(", ")", "{", "return", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getInfo", "(", "this", ")", "!=", "null", ";", "}", "protected", "boolean", "isSourceElement", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isStructureKnown", "(", ")", "throws", "JavaModelException", "{", "return", "(", "(", "OpenableElementInfo", ")", "getElementInfo", "(", ")", ")", ".", "isStructureKnown", "(", ")", ";", "}", "public", "void", "makeConsistent", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "}", "public", "void", "open", "(", "IProgressMonitor", "pm", ")", "throws", "JavaModelException", "{", "getElementInfo", "(", "pm", ")", ";", "}", "protected", "IBuffer", "openBuffer", "(", "IProgressMonitor", "pm", ",", "Object", "info", ")", "throws", "JavaModelException", "{", "return", "null", ";", "}", "public", "IResource", "getResource", "(", ")", "{", "PackageFragmentRoot", "root", "=", "getPackageFragmentRoot", "(", ")", ";", "if", "(", "root", "!=", "null", ")", "{", "if", "(", "root", ".", "isExternal", "(", ")", ")", "return", "null", ";", "if", "(", "root", ".", "isArchive", "(", ")", ")", "return", "root", ".", "resource", "(", "root", ")", ";", "}", "return", "resource", "(", "root", ")", ";", "}", "public", "IResource", "resource", "(", ")", "{", "PackageFragmentRoot", "root", "=", "getPackageFragmentRoot", "(", ")", ";", "if", "(", "root", "!=", "null", "&&", "root", ".", "isArchive", "(", ")", ")", "return", "root", ".", "resource", "(", "root", ")", ";", "return", "resource", "(", "root", ")", ";", "}", "protected", "abstract", "IResource", "resource", "(", "PackageFragmentRoot", "root", ")", ";", "protected", "boolean", "resourceExists", "(", "IResource", "underlyingResource", ")", "{", "return", "underlyingResource", ".", "isAccessible", "(", ")", ";", "}", "public", "void", "save", "(", "IProgressMonitor", "pm", ",", "boolean", "force", ")", "throws", "JavaModelException", "{", "if", "(", "isReadOnly", "(", ")", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "READ_ONLY", ",", "this", ")", ")", ";", "}", "IBuffer", "buf", "=", "getBuffer", "(", ")", ";", "if", "(", "buf", "!=", "null", ")", "{", "buf", ".", "save", "(", "pm", ",", "force", ")", ";", "makeConsistent", "(", "pm", ")", ";", "}", "}", "public", "PackageFragmentRoot", "getPackageFragmentRoot", "(", ")", "{", "return", "(", "PackageFragmentRoot", ")", "getAncestor", "(", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ")", ";", "}", "abstract", "protected", "IStatus", "validateExistence", "(", "IResource", "underlyingResource", ")", ";", "protected", "void", "openAncestors", "(", "HashMap", "newElements", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "Openable", "openableParent", "=", "(", "Openable", ")", "getOpenableParent", "(", ")", ";", "if", "(", "openableParent", "!=", "null", "&&", "!", "openableParent", ".", "isOpen", "(", ")", ")", "{", "openableParent", ".", "generateInfos", "(", "openableParent", ".", "createElementInfo", "(", ")", ",", "newElements", ",", "monitor", ")", ";", "}", "}", "}", "</s>" ]
3,932
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "public", "class", "ResolvedBinaryField", "extends", "BinaryField", "{", "private", "String", "uniqueKey", ";", "public", "ResolvedBinaryField", "(", "JavaElement", "parent", ",", "String", "name", ",", "String", "uniqueKey", ")", "{", "super", "(", "parent", ",", "name", ")", ";", "this", ".", "uniqueKey", "=", "uniqueKey", ";", "}", "public", "String", "getKey", "(", ")", "{", "return", "this", ".", "uniqueKey", ";", "}", "public", "boolean", "isResolved", "(", ")", "{", "return", "true", ";", "}", "protected", "void", "toStringInfo", "(", "int", "tab", ",", "StringBuffer", "buffer", ",", "Object", "info", ",", "boolean", "showResolvedInfo", ")", "{", "super", ".", "toStringInfo", "(", "tab", ",", "buffer", ",", "info", ",", "showResolvedInfo", ")", ";", "if", "(", "showResolvedInfo", ")", "{", "buffer", ".", "append", "(", "\"", "{key=\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "uniqueKey", ")", ";", "buffer", ".", "append", "(", "\"}\"", ")", ";", "}", "}", "public", "JavaElement", "unresolved", "(", ")", "{", "SourceRefElement", "handle", "=", "new", "BinaryField", "(", "this", ".", "parent", ",", "this", ".", "name", ")", ";", "handle", ".", "occurrenceCount", "=", "this", ".", "occurrenceCount", ";", "return", "handle", ";", "}", "}", "</s>" ]
3,933
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Flags", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Signature", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "HashtableOfObjectToIntArray", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "JavadocContents", "{", "private", "static", "final", "int", "[", "]", "UNKNOWN_FORMAT", "=", "new", "int", "[", "0", "]", ";", "private", "BinaryType", "type", ";", "private", "char", "[", "]", "content", ";", "private", "int", "childrenStart", ";", "private", "boolean", "hasComputedChildrenSections", "=", "false", ";", "private", "int", "indexOfFieldDetails", ";", "private", "int", "indexOfConstructorDetails", ";", "private", "int", "indexOfMethodDetails", ";", "private", "int", "indexOfEndOfClassData", ";", "private", "int", "indexOfFieldsBottom", ";", "private", "int", "indexOfAllMethodsTop", ";", "private", "int", "indexOfAllMethodsBottom", ";", "private", "int", "[", "]", "typeDocRange", ";", "private", "HashtableOfObjectToIntArray", "fieldDocRanges", ";", "private", "HashtableOfObjectToIntArray", "methodDocRanges", ";", "private", "int", "[", "]", "fieldAnchorIndexes", ";", "private", "int", "fieldAnchorIndexesCount", ";", "private", "int", "fieldLastAnchorFoundIndex", ";", "private", "int", "[", "]", "methodAnchorIndexes", ";", "private", "int", "methodAnchorIndexesCount", ";", "private", "int", "methodLastAnchorFoundIndex", ";", "private", "int", "[", "]", "unknownFormatAnchorIndexes", ";", "private", "int", "unknownFormatAnchorIndexesCount", ";", "private", "int", "unknownFormatLastAnchorFoundIndex", ";", "private", "int", "[", "]", "tempAnchorIndexes", ";", "private", "int", "tempAnchorIndexesCount", ";", "private", "int", "tempLastAnchorFoundIndex", ";", "public", "JavadocContents", "(", "BinaryType", "type", ",", "String", "content", ")", "{", "this", ".", "type", "=", "type", ";", "this", ".", "content", "=", "content", "!=", "null", "?", "content", ".", "toCharArray", "(", ")", ":", "null", ";", "}", "public", "String", "getTypeDoc", "(", ")", "throws", "JavaModelException", "{", "if", "(", "this", ".", "content", "==", "null", ")", "return", "null", ";", "synchronized", "(", "this", ")", "{", "if", "(", "this", ".", "typeDocRange", "==", "null", ")", "{", "computeTypeRange", "(", ")", ";", "}", "}", "if", "(", "this", ".", "typeDocRange", "!=", "null", ")", "{", "if", "(", "this", ".", "typeDocRange", "==", "UNKNOWN_FORMAT", ")", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "UNKNOWN_JAVADOC_FORMAT", ",", "this", ".", "type", ")", ")", ";", "return", "String", ".", "valueOf", "(", "CharOperation", ".", "subarray", "(", "this", ".", "content", ",", "this", ".", "typeDocRange", "[", "0", "]", ",", "this", ".", "typeDocRange", "[", "1", "]", ")", ")", ";", "}", "return", "null", ";", "}", "public", "String", "getFieldDoc", "(", "IField", "child", ")", "throws", "JavaModelException", "{", "if", "(", "this", ".", "content", "==", "null", ")", "return", "null", ";", "int", "[", "]", "range", "=", "null", ";", "synchronized", "(", "this", ")", "{", "if", "(", "this", ".", "fieldDocRanges", "==", "null", ")", "{", "this", ".", "fieldDocRanges", "=", "new", "HashtableOfObjectToIntArray", "(", ")", ";", "}", "else", "{", "range", "=", "this", ".", "fieldDocRanges", ".", "get", "(", "child", ")", ";", "}", "if", "(", "range", "==", "null", ")", "{", "range", "=", "computeFieldRange", "(", "child", ")", ";", "this", ".", "fieldDocRanges", ".", "put", "(", "child", ",", "range", ")", ";", "}", "}", "if", "(", "range", "!=", "null", ")", "{", "if", "(", "range", "==", "UNKNOWN_FORMAT", ")", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "UNKNOWN_JAVADOC_FORMAT", ",", "child", ")", ")", ";", "return", "String", ".", "valueOf", "(", "CharOperation", ".", "subarray", "(", "this", ".", "content", ",", "range", "[", "0", "]", ",", "range", "[", "1", "]", ")", ")", ";", "}", "return", "null", ";", "}", "public", "String", "getMethodDoc", "(", "IMethod", "child", ")", "throws", "JavaModelException", "{", "if", "(", "this", ".", "content", "==", "null", ")", "return", "null", ";", "int", "[", "]", "range", "=", "null", ";", "synchronized", "(", "this", ")", "{", "if", "(", "this", ".", "methodDocRanges", "==", "null", ")", "{", "this", ".", "methodDocRanges", "=", "new", "HashtableOfObjectToIntArray", "(", ")", ";", "}", "else", "{", "range", "=", "this", ".", "methodDocRanges", ".", "get", "(", "child", ")", ";", "}", "if", "(", "range", "==", "null", ")", "{", "range", "=", "computeMethodRange", "(", "child", ")", ";", "this", ".", "methodDocRanges", ".", "put", "(", "child", ",", "range", ")", ";", "}", "}", "if", "(", "range", "!=", "null", ")", "{", "if", "(", "range", "==", "UNKNOWN_FORMAT", ")", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "UNKNOWN_JAVADOC_FORMAT", ",", "child", ")", ")", ";", "return", "String", ".", "valueOf", "(", "CharOperation", ".", "subarray", "(", "this", ".", "content", ",", "range", "[", "0", "]", ",", "range", "[", "1", "]", ")", ")", ";", "}", "return", "null", ";", "}", "private", "int", "[", "]", "computeChildRange", "(", "char", "[", "]", "anchor", ",", "int", "indexOfSectionBottom", ")", "throws", "JavaModelException", "{", "if", "(", "this", ".", "tempAnchorIndexesCount", ">", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "tempAnchorIndexesCount", ";", "i", "++", ")", "{", "int", "anchorEndStart", "=", "this", ".", "tempAnchorIndexes", "[", "i", "]", ";", "if", "(", "anchorEndStart", "!=", "-", "1", "&&", "CharOperation", ".", "prefixEquals", "(", "anchor", ",", "this", ".", "content", ",", "false", ",", "anchorEndStart", ")", ")", "{", "this", ".", "tempAnchorIndexes", "[", "i", "]", "=", "-", "1", ";", "return", "computeChildRange", "(", "anchorEndStart", ",", "anchor", ",", "indexOfSectionBottom", ")", ";", "}", "}", "}", "int", "fromIndex", "=", "this", ".", "tempLastAnchorFoundIndex", ";", "int", "index", ";", "while", "(", "(", "index", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "ANCHOR_PREFIX_START", ",", "this", ".", "content", ",", "false", ",", "fromIndex", ")", ")", "!=", "-", "1", "&&", "(", "index", "<", "indexOfSectionBottom", "||", "indexOfSectionBottom", "==", "-", "1", ")", ")", "{", "fromIndex", "=", "index", "+", "1", ";", "int", "anchorEndStart", "=", "index", "+", "JavadocConstants", ".", "ANCHOR_PREFIX_START_LENGHT", ";", "this", ".", "tempLastAnchorFoundIndex", "=", "anchorEndStart", ";", "if", "(", "CharOperation", ".", "prefixEquals", "(", "anchor", ",", "this", ".", "content", ",", "false", ",", "anchorEndStart", ")", ")", "{", "return", "computeChildRange", "(", "anchorEndStart", ",", "anchor", ",", "indexOfSectionBottom", ")", ";", "}", "else", "{", "if", "(", "this", ".", "tempAnchorIndexes", ".", "length", "==", "this", ".", "tempAnchorIndexesCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "tempAnchorIndexes", ",", "0", ",", "this", ".", "tempAnchorIndexes", "=", "new", "int", "[", "this", ".", "tempAnchorIndexesCount", "+", "20", "]", ",", "0", ",", "this", ".", "tempAnchorIndexesCount", ")", ";", "}", "this", ".", "tempAnchorIndexes", "[", "this", ".", "tempAnchorIndexesCount", "++", "]", "=", "anchorEndStart", ";", "}", "}", "return", "null", ";", "}", "private", "int", "[", "]", "computeChildRange", "(", "int", "anchorEndStart", ",", "char", "[", "]", "anchor", ",", "int", "indexOfBottom", ")", "{", "int", "[", "]", "range", "=", "null", ";", "if", "(", "indexOfBottom", "!=", "-", "1", ")", "{", "int", "indexOfEndLink", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "ANCHOR_SUFFIX", ",", "this", ".", "content", ",", "false", ",", "anchorEndStart", "+", "anchor", ".", "length", ")", ";", "if", "(", "indexOfEndLink", "!=", "-", "1", ")", "{", "int", "indexOfNextElement", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "ANCHOR_PREFIX_START", ",", "this", ".", "content", ",", "false", ",", "indexOfEndLink", ")", ";", "int", "javadocStart", "=", "indexOfEndLink", "+", "JavadocConstants", ".", "ANCHOR_SUFFIX_LENGTH", ";", "int", "javadocEnd", "=", "indexOfNextElement", "==", "-", "1", "?", "indexOfBottom", ":", "Math", ".", "min", "(", "indexOfNextElement", ",", "indexOfBottom", ")", ";", "range", "=", "new", "int", "[", "]", "{", "javadocStart", ",", "javadocEnd", "}", ";", "}", "else", "{", "range", "=", "UNKNOWN_FORMAT", ";", "}", "}", "else", "{", "range", "=", "UNKNOWN_FORMAT", ";", "}", "return", "range", ";", "}", "private", "void", "computeChildrenSections", "(", ")", "{", "int", "lastIndex", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "SEPARATOR_START", ",", "this", ".", "content", ",", "false", ",", "this", ".", "childrenStart", ")", ";", "lastIndex", "=", "lastIndex", "==", "-", "1", "?", "this", ".", "childrenStart", ":", "lastIndex", ";", "this", ".", "indexOfFieldDetails", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "FIELD_DETAIL", ",", "this", ".", "content", ",", "false", ",", "lastIndex", ")", ";", "lastIndex", "=", "this", ".", "indexOfFieldDetails", "==", "-", "1", "?", "lastIndex", ":", "this", ".", "indexOfFieldDetails", ";", "this", ".", "indexOfConstructorDetails", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "CONSTRUCTOR_DETAIL", ",", "this", ".", "content", ",", "false", ",", "lastIndex", ")", ";", "lastIndex", "=", "this", ".", "indexOfConstructorDetails", "==", "-", "1", "?", "lastIndex", ":", "this", ".", "indexOfConstructorDetails", ";", "this", ".", "indexOfMethodDetails", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "METHOD_DETAIL", ",", "this", ".", "content", ",", "false", ",", "lastIndex", ")", ";", "lastIndex", "=", "this", ".", "indexOfMethodDetails", "==", "-", "1", "?", "lastIndex", ":", "this", ".", "indexOfMethodDetails", ";", "this", ".", "indexOfEndOfClassData", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "END_OF_CLASS_DATA", ",", "this", ".", "content", ",", "false", ",", "lastIndex", ")", ";", "this", ".", "indexOfFieldsBottom", "=", "this", ".", "indexOfConstructorDetails", "!=", "-", "1", "?", "this", ".", "indexOfConstructorDetails", ":", "this", ".", "indexOfMethodDetails", "!=", "-", "1", "?", "this", ".", "indexOfMethodDetails", ":", "this", ".", "indexOfEndOfClassData", ";", "this", ".", "indexOfAllMethodsTop", "=", "this", ".", "indexOfConstructorDetails", "!=", "-", "1", "?", "this", ".", "indexOfConstructorDetails", ":", "this", ".", "indexOfMethodDetails", ";", "this", ".", "indexOfAllMethodsBottom", "=", "this", ".", "indexOfEndOfClassData", ";", "this", ".", "hasComputedChildrenSections", "=", "true", ";", "}", "private", "int", "[", "]", "computeFieldRange", "(", "IField", "field", ")", "throws", "JavaModelException", "{", "if", "(", "!", "this", ".", "hasComputedChildrenSections", ")", "{", "computeChildrenSections", "(", ")", ";", "}", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "field", ".", "getElementName", "(", ")", ")", ";", "buffer", ".", "append", "(", "JavadocConstants", ".", "ANCHOR_PREFIX_END", ")", ";", "char", "[", "]", "anchor", "=", "String", ".", "valueOf", "(", "buffer", ")", ".", "toCharArray", "(", ")", ";", "int", "[", "]", "range", "=", "null", ";", "if", "(", "this", ".", "indexOfFieldDetails", "==", "-", "1", "||", "this", ".", "indexOfFieldsBottom", "==", "-", "1", ")", "{", "if", "(", "this", ".", "unknownFormatAnchorIndexes", "==", "null", ")", "{", "this", ".", "unknownFormatAnchorIndexes", "=", "new", "int", "[", "this", ".", "type", ".", "getChildren", "(", ")", ".", "length", "]", ";", "this", ".", "unknownFormatAnchorIndexesCount", "=", "0", ";", "this", ".", "unknownFormatLastAnchorFoundIndex", "=", "this", ".", "childrenStart", ";", "}", "this", ".", "tempAnchorIndexes", "=", "this", ".", "unknownFormatAnchorIndexes", ";", "this", ".", "tempAnchorIndexesCount", "=", "this", ".", "unknownFormatAnchorIndexesCount", ";", "this", ".", "tempLastAnchorFoundIndex", "=", "this", ".", "unknownFormatLastAnchorFoundIndex", ";", "range", "=", "computeChildRange", "(", "anchor", ",", "this", ".", "indexOfFieldsBottom", ")", ";", "this", ".", "unknownFormatLastAnchorFoundIndex", "=", "this", ".", "tempLastAnchorFoundIndex", ";", "this", ".", "unknownFormatAnchorIndexesCount", "=", "this", ".", "tempAnchorIndexesCount", ";", "this", ".", "unknownFormatAnchorIndexes", "=", "this", ".", "tempAnchorIndexes", ";", "}", "else", "{", "if", "(", "this", ".", "fieldAnchorIndexes", "==", "null", ")", "{", "this", ".", "fieldAnchorIndexes", "=", "new", "int", "[", "this", ".", "type", ".", "getFields", "(", ")", ".", "length", "]", ";", "this", ".", "fieldAnchorIndexesCount", "=", "0", ";", "this", ".", "fieldLastAnchorFoundIndex", "=", "this", ".", "indexOfFieldDetails", ";", "}", "this", ".", "tempAnchorIndexes", "=", "this", ".", "fieldAnchorIndexes", ";", "this", ".", "tempAnchorIndexesCount", "=", "this", ".", "fieldAnchorIndexesCount", ";", "this", ".", "tempLastAnchorFoundIndex", "=", "this", ".", "fieldLastAnchorFoundIndex", ";", "range", "=", "computeChildRange", "(", "anchor", ",", "this", ".", "indexOfFieldsBottom", ")", ";", "this", ".", "fieldLastAnchorFoundIndex", "=", "this", ".", "tempLastAnchorFoundIndex", ";", "this", ".", "fieldAnchorIndexesCount", "=", "this", ".", "tempAnchorIndexesCount", ";", "this", ".", "fieldAnchorIndexes", "=", "this", ".", "tempAnchorIndexes", ";", "}", "return", "range", ";", "}", "private", "int", "[", "]", "computeMethodRange", "(", "IMethod", "method", ")", "throws", "JavaModelException", "{", "if", "(", "!", "this", ".", "hasComputedChildrenSections", ")", "{", "computeChildrenSections", "(", ")", ";", "}", "char", "[", "]", "anchor", "=", "computeMethodAnchorPrefixEnd", "(", "(", "BinaryMethod", ")", "method", ")", ".", "toCharArray", "(", ")", ";", "int", "[", "]", "range", "=", "null", ";", "if", "(", "this", ".", "indexOfAllMethodsTop", "==", "-", "1", "||", "this", ".", "indexOfAllMethodsBottom", "==", "-", "1", ")", "{", "if", "(", "this", ".", "unknownFormatAnchorIndexes", "==", "null", ")", "{", "this", ".", "unknownFormatAnchorIndexes", "=", "new", "int", "[", "this", ".", "type", ".", "getChildren", "(", ")", ".", "length", "]", ";", "this", ".", "unknownFormatAnchorIndexesCount", "=", "0", ";", "this", ".", "unknownFormatLastAnchorFoundIndex", "=", "this", ".", "childrenStart", ";", "}", "this", ".", "tempAnchorIndexes", "=", "this", ".", "unknownFormatAnchorIndexes", ";", "this", ".", "tempAnchorIndexesCount", "=", "this", ".", "unknownFormatAnchorIndexesCount", ";", "this", ".", "tempLastAnchorFoundIndex", "=", "this", ".", "unknownFormatLastAnchorFoundIndex", ";", "range", "=", "computeChildRange", "(", "anchor", ",", "this", ".", "indexOfFieldsBottom", ")", ";", "this", ".", "unknownFormatLastAnchorFoundIndex", "=", "this", ".", "tempLastAnchorFoundIndex", ";", "this", ".", "unknownFormatAnchorIndexesCount", "=", "this", ".", "tempAnchorIndexesCount", ";", "this", ".", "unknownFormatAnchorIndexes", "=", "this", ".", "tempAnchorIndexes", ";", "}", "else", "{", "if", "(", "this", ".", "methodAnchorIndexes", "==", "null", ")", "{", "this", ".", "methodAnchorIndexes", "=", "new", "int", "[", "this", ".", "type", ".", "getFields", "(", ")", ".", "length", "]", ";", "this", ".", "methodAnchorIndexesCount", "=", "0", ";", "this", ".", "methodLastAnchorFoundIndex", "=", "this", ".", "indexOfAllMethodsTop", ";", "}", "this", ".", "tempAnchorIndexes", "=", "this", ".", "methodAnchorIndexes", ";", "this", ".", "tempAnchorIndexesCount", "=", "this", ".", "methodAnchorIndexesCount", ";", "this", ".", "tempLastAnchorFoundIndex", "=", "this", ".", "methodLastAnchorFoundIndex", ";", "range", "=", "computeChildRange", "(", "anchor", ",", "this", ".", "indexOfAllMethodsBottom", ")", ";", "this", ".", "methodLastAnchorFoundIndex", "=", "this", ".", "tempLastAnchorFoundIndex", ";", "this", ".", "methodAnchorIndexesCount", "=", "this", ".", "tempAnchorIndexesCount", ";", "this", ".", "methodAnchorIndexes", "=", "this", ".", "tempAnchorIndexes", ";", "}", "return", "range", ";", "}", "private", "String", "computeMethodAnchorPrefixEnd", "(", "BinaryMethod", "method", ")", "throws", "JavaModelException", "{", "String", "typeQualifiedName", "=", "null", ";", "if", "(", "this", ".", "type", ".", "isMember", "(", ")", ")", "{", "IType", "currentType", "=", "this", ".", "type", ";", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "while", "(", "currentType", "!=", "null", ")", "{", "buffer", ".", "insert", "(", "0", ",", "currentType", ".", "getElementName", "(", ")", ")", ";", "currentType", "=", "currentType", ".", "getDeclaringType", "(", ")", ";", "if", "(", "currentType", "!=", "null", ")", "{", "buffer", ".", "insert", "(", "0", ",", "'.'", ")", ";", "}", "}", "typeQualifiedName", "=", "new", "String", "(", "buffer", ".", "toString", "(", ")", ")", ";", "}", "else", "{", "typeQualifiedName", "=", "this", ".", "type", ".", "getElementName", "(", ")", ";", "}", "String", "methodName", "=", "method", ".", "getElementName", "(", ")", ";", "if", "(", "method", ".", "isConstructor", "(", ")", ")", "{", "methodName", "=", "typeQualifiedName", ";", "}", "IBinaryMethod", "info", "=", "(", "IBinaryMethod", ")", "method", ".", "getElementInfo", "(", ")", ";", "char", "[", "]", "genericSignature", "=", "info", ".", "getGenericSignature", "(", ")", ";", "String", "anchor", "=", "null", ";", "if", "(", "genericSignature", "!=", "null", ")", "{", "genericSignature", "=", "CharOperation", ".", "replaceOnCopy", "(", "genericSignature", ",", "'/'", ",", "'.'", ")", ";", "anchor", "=", "Util", ".", "toAnchor", "(", "0", ",", "genericSignature", ",", "methodName", ",", "Flags", ".", "isVarargs", "(", "method", ".", "getFlags", "(", ")", ")", ")", ";", "if", "(", "anchor", "==", "null", ")", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "UNKNOWN_JAVADOC_FORMAT", ",", "method", ")", ")", ";", "}", "else", "{", "anchor", "=", "Signature", ".", "toString", "(", "method", ".", "getSignature", "(", ")", ".", "replace", "(", "'/'", ",", "'.'", ")", ",", "methodName", ",", "null", ",", "true", ",", "false", ",", "Flags", ".", "isVarargs", "(", "method", ".", "getFlags", "(", ")", ")", ")", ";", "}", "IType", "declaringType", "=", "this", ".", "type", ";", "if", "(", "declaringType", ".", "isMember", "(", ")", ")", "{", "if", "(", "!", "Flags", ".", "isStatic", "(", "declaringType", ".", "getFlags", "(", ")", ")", ")", "{", "int", "indexOfOpeningParen", "=", "anchor", ".", "indexOf", "(", "'('", ")", ";", "if", "(", "indexOfOpeningParen", "==", "-", "1", ")", "return", "null", ";", "int", "index", "=", "indexOfOpeningParen", ";", "indexOfOpeningParen", "++", ";", "int", "indexOfComma", "=", "anchor", ".", "indexOf", "(", "','", ",", "index", ")", ";", "if", "(", "indexOfComma", "!=", "-", "1", ")", "{", "index", "=", "indexOfComma", "+", "2", ";", "}", "else", "{", "index", "=", "anchor", ".", "indexOf", "(", "')'", ",", "index", ")", ";", "}", "anchor", "=", "anchor", ".", "substring", "(", "0", ",", "indexOfOpeningParen", ")", "+", "anchor", ".", "substring", "(", "index", ")", ";", "}", "}", "return", "anchor", "+", "JavadocConstants", ".", "ANCHOR_PREFIX_END", ";", "}", "private", "void", "computeTypeRange", "(", ")", "throws", "JavaModelException", "{", "final", "int", "indexOfStartOfClassData", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "START_OF_CLASS_DATA", ",", "this", ".", "content", ",", "false", ")", ";", "if", "(", "indexOfStartOfClassData", "==", "-", "1", ")", "{", "this", ".", "typeDocRange", "=", "UNKNOWN_FORMAT", ";", "return", ";", "}", "int", "indexOfNextSeparator", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "SEPARATOR_START", ",", "this", ".", "content", ",", "false", ",", "indexOfStartOfClassData", ")", ";", "if", "(", "indexOfNextSeparator", "==", "-", "1", ")", "{", "this", ".", "typeDocRange", "=", "UNKNOWN_FORMAT", ";", "return", ";", "}", "int", "indexOfNextSummary", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "NESTED_CLASS_SUMMARY", ",", "this", ".", "content", ",", "false", ",", "indexOfNextSeparator", ")", ";", "if", "(", "indexOfNextSummary", "==", "-", "1", "&&", "this", ".", "type", ".", "isEnum", "(", ")", ")", "{", "indexOfNextSummary", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "ENUM_CONSTANT_SUMMARY", ",", "this", ".", "content", ",", "false", ",", "indexOfNextSeparator", ")", ";", "}", "if", "(", "indexOfNextSummary", "==", "-", "1", "&&", "this", ".", "type", ".", "isAnnotation", "(", ")", ")", "{", "indexOfNextSummary", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY", ",", "this", ".", "content", ",", "false", ",", "indexOfNextSeparator", ")", ";", "if", "(", "indexOfNextSummary", "==", "-", "1", ")", "{", "indexOfNextSummary", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY", ",", "this", ".", "content", ",", "false", ",", "indexOfNextSeparator", ")", ";", "}", "}", "if", "(", "indexOfNextSummary", "==", "-", "1", ")", "{", "indexOfNextSummary", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "FIELD_SUMMARY", ",", "this", ".", "content", ",", "false", ",", "indexOfNextSeparator", ")", ";", "}", "if", "(", "indexOfNextSummary", "==", "-", "1", ")", "{", "indexOfNextSummary", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "CONSTRUCTOR_SUMMARY", ",", "this", ".", "content", ",", "false", ",", "indexOfNextSeparator", ")", ";", "}", "if", "(", "indexOfNextSummary", "==", "-", "1", ")", "{", "indexOfNextSummary", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "METHOD_SUMMARY", ",", "this", ".", "content", ",", "false", ",", "indexOfNextSeparator", ")", ";", "}", "if", "(", "indexOfNextSummary", "==", "-", "1", ")", "{", "indexOfNextSummary", "=", "CharOperation", ".", "indexOf", "(", "JavadocConstants", ".", "END_OF_CLASS_DATA", ",", "this", ".", "content", ",", "false", ",", "indexOfNextSeparator", ")", ";", "}", "else", "{", "this", ".", "childrenStart", "=", "indexOfNextSummary", "+", "1", ";", "}", "if", "(", "indexOfNextSummary", "==", "-", "1", ")", "{", "this", ".", "typeDocRange", "=", "UNKNOWN_FORMAT", ";", "return", ";", "}", "int", "start", "=", "indexOfStartOfClassData", "+", "JavadocConstants", ".", "START_OF_CLASS_DATA_LENGTH", ";", "int", "indexOfFirstParagraph", "=", "CharOperation", ".", "indexOf", "(", "\"<P>\"", ".", "toCharArray", "(", ")", ",", "this", ".", "content", ",", "false", ",", "start", ")", ";", "if", "(", "indexOfFirstParagraph", "!=", "-", "1", "&&", "indexOfFirstParagraph", "<", "indexOfNextSummary", ")", "{", "start", "=", "indexOfFirstParagraph", ";", "}", "this", ".", "typeDocRange", "=", "new", "int", "[", "]", "{", "start", ",", "indexOfNextSummary", "}", ";", "}", "}", "</s>" ]
3,934
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "BindingKey", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMember", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ITypeParameter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Signature", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "WorkingCopyOwner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "ISelectionRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "SelectionEngine", ";", "public", "abstract", "class", "NamedMember", "extends", "Member", "{", "protected", "String", "name", ";", "public", "NamedMember", "(", "JavaElement", "parent", ",", "String", "name", ")", "{", "super", "(", "parent", ")", ";", "this", ".", "name", "=", "name", ";", "}", "private", "void", "appendTypeParameters", "(", "StringBuffer", "buffer", ")", "throws", "JavaModelException", "{", "ITypeParameter", "[", "]", "typeParameters", "=", "getTypeParameters", "(", ")", ";", "int", "length", "=", "typeParameters", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", ";", "buffer", ".", "append", "(", "'<'", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ITypeParameter", "typeParameter", "=", "typeParameters", "[", "i", "]", ";", "buffer", ".", "append", "(", "typeParameter", ".", "getElementName", "(", ")", ")", ";", "String", "[", "]", "bounds", "=", "typeParameter", ".", "getBounds", "(", ")", ";", "int", "boundsLength", "=", "bounds", ".", "length", ";", "if", "(", "boundsLength", ">", "0", ")", "{", "buffer", ".", "append", "(", "\"", "extends", "\"", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "boundsLength", ";", "j", "++", ")", "{", "buffer", ".", "append", "(", "bounds", "[", "j", "]", ")", ";", "if", "(", "j", "<", "boundsLength", "-", "1", ")", "buffer", ".", "append", "(", "\"", "&", "\"", ")", ";", "}", "}", "if", "(", "i", "<", "length", "-", "1", ")", "buffer", ".", "append", "(", "\",", "\"", ")", ";", "}", "buffer", ".", "append", "(", "'>'", ")", ";", "}", "public", "String", "getElementName", "(", ")", "{", "return", "this", ".", "name", ";", "}", "protected", "String", "getKey", "(", "IField", "field", ",", "boolean", "forceOpen", ")", "throws", "JavaModelException", "{", "StringBuffer", "key", "=", "new", "StringBuffer", "(", ")", ";", "String", "declaringKey", "=", "getKey", "(", "(", "IType", ")", "field", ".", "getParent", "(", ")", ",", "forceOpen", ")", ";", "key", ".", "append", "(", "declaringKey", ")", ";", "key", ".", "append", "(", "'.'", ")", ";", "key", ".", "append", "(", "field", ".", "getElementName", "(", ")", ")", ";", "return", "key", ".", "toString", "(", ")", ";", "}", "protected", "String", "getKey", "(", "IMethod", "method", ",", "boolean", "forceOpen", ")", "throws", "JavaModelException", "{", "StringBuffer", "key", "=", "new", "StringBuffer", "(", ")", ";", "String", "declaringKey", "=", "getKey", "(", "(", "IType", ")", "method", ".", "getParent", "(", ")", ",", "forceOpen", ")", ";", "key", ".", "append", "(", "declaringKey", ")", ";", "key", ".", "append", "(", "'.'", ")", ";", "String", "selector", "=", "method", ".", "getElementName", "(", ")", ";", "key", ".", "append", "(", "selector", ")", ";", "if", "(", "forceOpen", ")", "{", "ITypeParameter", "[", "]", "typeParameters", "=", "method", ".", "getTypeParameters", "(", ")", ";", "int", "length", "=", "typeParameters", ".", "length", ";", "if", "(", "length", ">", "0", ")", "{", "key", ".", "append", "(", "'<'", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ITypeParameter", "typeParameter", "=", "typeParameters", "[", "i", "]", ";", "String", "[", "]", "bounds", "=", "typeParameter", ".", "getBounds", "(", ")", ";", "int", "boundsLength", "=", "bounds", ".", "length", ";", "char", "[", "]", "[", "]", "boundSignatures", "=", "new", "char", "[", "boundsLength", "]", "[", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "boundsLength", ";", "j", "++", ")", "{", "boundSignatures", "[", "j", "]", "=", "Signature", ".", "createCharArrayTypeSignature", "(", "bounds", "[", "j", "]", ".", "toCharArray", "(", ")", ",", "method", ".", "isBinary", "(", ")", ")", ";", "CharOperation", ".", "replace", "(", "boundSignatures", "[", "j", "]", ",", "'.'", ",", "'/'", ")", ";", "}", "char", "[", "]", "sig", "=", "Signature", ".", "createTypeParameterSignature", "(", "typeParameter", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ",", "boundSignatures", ")", ";", "key", ".", "append", "(", "sig", ")", ";", "}", "key", ".", "append", "(", "'>'", ")", ";", "}", "}", "key", ".", "append", "(", "'('", ")", ";", "String", "[", "]", "parameters", "=", "method", ".", "getParameterTypes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "parameters", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "key", ".", "append", "(", "parameters", "[", "i", "]", ".", "replace", "(", "'.'", ",", "'/'", ")", ")", ";", "key", ".", "append", "(", "')'", ")", ";", "if", "(", "forceOpen", ")", "key", ".", "append", "(", "method", ".", "getReturnType", "(", ")", ".", "replace", "(", "'.'", ",", "'/'", ")", ")", ";", "else", "key", ".", "append", "(", "'V'", ")", ";", "return", "key", ".", "toString", "(", ")", ";", "}", "protected", "String", "getKey", "(", "IType", "type", ",", "boolean", "forceOpen", ")", "throws", "JavaModelException", "{", "StringBuffer", "key", "=", "new", "StringBuffer", "(", ")", ";", "key", ".", "append", "(", "'L'", ")", ";", "String", "packageName", "=", "type", ".", "getPackageFragment", "(", ")", ".", "getElementName", "(", ")", ";", "key", ".", "append", "(", "packageName", ".", "replace", "(", "'.'", ",", "'/'", ")", ")", ";", "if", "(", "packageName", ".", "length", "(", ")", ">", "0", ")", "key", ".", "append", "(", "'/'", ")", ";", "String", "typeQualifiedName", "=", "type", ".", "getTypeQualifiedName", "(", "'$'", ")", ";", "ICompilationUnit", "cu", "=", "(", "ICompilationUnit", ")", "type", ".", "getAncestor", "(", "IJavaElement", ".", "COMPILATION_UNIT", ")", ";", "if", "(", "cu", "!=", "null", ")", "{", "String", "cuName", "=", "cu", ".", "getElementName", "(", ")", ";", "String", "mainTypeName", "=", "cuName", ".", "substring", "(", "0", ",", "cuName", ".", "lastIndexOf", "(", "'.'", ")", ")", ";", "int", "end", "=", "typeQualifiedName", ".", "indexOf", "(", "'$'", ")", ";", "if", "(", "end", "==", "-", "1", ")", "end", "=", "typeQualifiedName", ".", "length", "(", ")", ";", "String", "topLevelTypeName", "=", "typeQualifiedName", ".", "substring", "(", "0", ",", "end", ")", ";", "if", "(", "!", "mainTypeName", ".", "equals", "(", "topLevelTypeName", ")", ")", "{", "key", ".", "append", "(", "mainTypeName", ")", ";", "key", ".", "append", "(", "'~'", ")", ";", "}", "}", "key", ".", "append", "(", "typeQualifiedName", ")", ";", "key", ".", "append", "(", "';'", ")", ";", "return", "key", ".", "toString", "(", ")", ";", "}", "protected", "String", "getFullyQualifiedParameterizedName", "(", "String", "fullyQualifiedName", ",", "String", "uniqueKey", ")", "throws", "JavaModelException", "{", "String", "[", "]", "typeArguments", "=", "new", "BindingKey", "(", "uniqueKey", ")", ".", "getTypeArguments", "(", ")", ";", "int", "length", "=", "typeArguments", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", "fullyQualifiedName", ";", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "fullyQualifiedName", ")", ";", "buffer", ".", "append", "(", "'<'", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "typeArgument", "=", "typeArguments", "[", "i", "]", ";", "buffer", ".", "append", "(", "Signature", ".", "toString", "(", "typeArgument", ")", ")", ";", "if", "(", "i", "<", "length", "-", "1", ")", "buffer", ".", "append", "(", "','", ")", ";", "}", "buffer", ".", "append", "(", "'>'", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "protected", "IPackageFragment", "getPackageFragment", "(", ")", "{", "return", "null", ";", "}", "public", "String", "getFullyQualifiedName", "(", "char", "enclosingTypeSeparator", ",", "boolean", "showParameters", ")", "throws", "JavaModelException", "{", "String", "packageName", "=", "getPackageFragment", "(", ")", ".", "getElementName", "(", ")", ";", "if", "(", "packageName", ".", "equals", "(", "IPackageFragment", ".", "DEFAULT_PACKAGE_NAME", ")", ")", "{", "return", "getTypeQualifiedName", "(", "enclosingTypeSeparator", ",", "showParameters", ")", ";", "}", "return", "packageName", "+", "'.'", "+", "getTypeQualifiedName", "(", "enclosingTypeSeparator", ",", "showParameters", ")", ";", "}", "public", "String", "getTypeQualifiedName", "(", "char", "enclosingTypeSeparator", ",", "boolean", "showParameters", ")", "throws", "JavaModelException", "{", "NamedMember", "declaringType", ";", "switch", "(", "this", ".", "parent", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "if", "(", "showParameters", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "this", ".", "name", ")", ";", "appendTypeParameters", "(", "buffer", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "return", "this", ".", "name", ";", "case", "IJavaElement", ".", "CLASS_FILE", ":", "String", "classFileName", "=", "this", ".", "parent", ".", "getElementName", "(", ")", ";", "String", "typeName", ";", "if", "(", "classFileName", ".", "indexOf", "(", "'$'", ")", "==", "-", "1", ")", "{", "typeName", "=", "this", ".", "name", ";", "}", "else", "{", "typeName", "=", "classFileName", ".", "substring", "(", "0", ",", "classFileName", ".", "lastIndexOf", "(", "'.'", ")", ")", ".", "replace", "(", "'$'", ",", "enclosingTypeSeparator", ")", ";", "}", "if", "(", "showParameters", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "typeName", ")", ";", "appendTypeParameters", "(", "buffer", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "return", "typeName", ";", "case", "IJavaElement", ".", "TYPE", ":", "declaringType", "=", "(", "NamedMember", ")", "this", ".", "parent", ";", "break", ";", "case", "IJavaElement", ".", "FIELD", ":", "case", "IJavaElement", ".", "INITIALIZER", ":", "case", "IJavaElement", ".", "METHOD", ":", "declaringType", "=", "(", "NamedMember", ")", "(", "(", "IMember", ")", "this", ".", "parent", ")", ".", "getDeclaringType", "(", ")", ";", "break", ";", "default", ":", "return", "null", ";", "}", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "declaringType", ".", "getTypeQualifiedName", "(", "enclosingTypeSeparator", ",", "showParameters", ")", ")", ";", "buffer", ".", "append", "(", "enclosingTypeSeparator", ")", ";", "String", "simpleName", "=", "this", ".", "name", ".", "length", "(", ")", "==", "0", "?", "Integer", ".", "toString", "(", "this", ".", "occurrenceCount", ")", ":", "this", ".", "name", ";", "buffer", ".", "append", "(", "simpleName", ")", ";", "if", "(", "showParameters", ")", "{", "appendTypeParameters", "(", "buffer", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "protected", "ITypeParameter", "[", "]", "getTypeParameters", "(", ")", "throws", "JavaModelException", "{", "return", "null", ";", "}", "public", "String", "[", "]", "[", "]", "resolveType", "(", "String", "typeName", ")", "throws", "JavaModelException", "{", "return", "resolveType", "(", "typeName", ",", "DefaultWorkingCopyOwner", ".", "PRIMARY", ")", ";", "}", "public", "String", "[", "]", "[", "]", "resolveType", "(", "String", "typeName", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", "{", "JavaProject", "project", "=", "(", "JavaProject", ")", "getJavaProject", "(", ")", ";", "SearchableEnvironment", "environment", "=", "project", ".", "newSearchableNameEnvironment", "(", "owner", ")", ";", "class", "TypeResolveRequestor", "implements", "ISelectionRequestor", "{", "String", "[", "]", "[", "]", "answers", "=", "null", ";", "public", "void", "acceptType", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "tName", ",", "int", "modifiers", ",", "boolean", "isDeclaration", ",", "char", "[", "]", "uniqueKey", ",", "int", "start", ",", "int", "end", ")", "{", "String", "[", "]", "answer", "=", "new", "String", "[", "]", "{", "new", "String", "(", "packageName", ")", ",", "new", "String", "(", "tName", ")", "}", ";", "if", "(", "this", ".", "answers", "==", "null", ")", "{", "this", ".", "answers", "=", "new", "String", "[", "]", "[", "]", "{", "answer", "}", ";", "}", "else", "{", "int", "length", "=", "this", ".", "answers", ".", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "answers", ",", "0", ",", "this", ".", "answers", "=", "new", "String", "[", "length", "+", "1", "]", "[", "]", ",", "0", ",", "length", ")", ";", "this", ".", "answers", "[", "length", "]", "=", "answer", ";", "}", "}", "public", "void", "acceptError", "(", "CategorizedProblem", "error", ")", "{", "}", "public", "void", "acceptField", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "fieldName", ",", "boolean", "isDeclaration", ",", "char", "[", "]", "uniqueKey", ",", "int", "start", ",", "int", "end", ")", "{", "}", "public", "void", "acceptMethod", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "String", "enclosingDeclaringTypeSignature", ",", "char", "[", "]", "selector", ",", "char", "[", "]", "[", "]", "parameterPackageNames", ",", "char", "[", "]", "[", "]", "parameterTypeNames", ",", "String", "[", "]", "parameterSignatures", ",", "char", "[", "]", "[", "]", "typeParameterNames", ",", "char", "[", "]", "[", "]", "[", "]", "typeParameterBoundNames", ",", "boolean", "isConstructor", ",", "boolean", "isDeclaration", ",", "char", "[", "]", "uniqueKey", ",", "int", "start", ",", "int", "end", ")", "{", "}", "public", "void", "acceptPackage", "(", "char", "[", "]", "packageName", ")", "{", "}", "public", "void", "acceptTypeParameter", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "typeParameterName", ",", "boolean", "isDeclaration", ",", "int", "start", ",", "int", "end", ")", "{", "}", "public", "void", "acceptMethodTypeParameter", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "selector", ",", "int", "selectorStart", ",", "int", "selcetorEnd", ",", "char", "[", "]", "typeParameterName", ",", "boolean", "isDeclaration", ",", "int", "start", ",", "int", "end", ")", "{", "}", "}", "TypeResolveRequestor", "requestor", "=", "new", "TypeResolveRequestor", "(", ")", ";", "SelectionEngine", "engine", "=", "new", "SelectionEngine", "(", "environment", ",", "requestor", ",", "project", ".", "getOptions", "(", "true", ")", ",", "owner", ")", ";", "engine", ".", "selectType", "(", "typeName", ".", "toCharArray", "(", ")", ",", "(", "IType", ")", "this", ")", ";", "if", "(", "NameLookup", ".", "VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "environment", ".", "nameLookup", ".", "timeSpentInSeekTypesInSourcePackage", "+", "\"ms\"", ")", ";", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "environment", ".", "nameLookup", ".", "timeSpentInSeekTypesInBinaryPackage", "+", "\"ms\"", ")", ";", "}", "return", "requestor", ".", "answers", ";", "}", "}", "</s>" ]
3,935
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "public", "interface", "IDocumentElementRequestor", "{", "void", "acceptImport", "(", "int", "declarationStart", ",", "int", "declarationEnd", ",", "int", "[", "]", "javaDocPositions", ",", "char", "[", "]", "name", ",", "int", "nameStartPosition", ",", "boolean", "onDemand", ",", "int", "modifiers", ")", ";", "void", "acceptInitializer", "(", "int", "declarationStart", ",", "int", "declarationEnd", ",", "int", "[", "]", "javaDocPositions", ",", "int", "modifiers", ",", "int", "modifiersStart", ",", "int", "bodyStart", ",", "int", "bodyEnd", ")", ";", "void", "acceptLineSeparatorPositions", "(", "int", "[", "]", "positions", ")", ";", "void", "acceptPackage", "(", "int", "declarationStart", ",", "int", "declarationEnd", ",", "int", "[", "]", "javaDocPositions", ",", "char", "[", "]", "name", ",", "int", "nameStartPosition", ")", ";", "void", "acceptProblem", "(", "CategorizedProblem", "problem", ")", ";", "void", "enterClass", "(", "int", "declarationStart", ",", "int", "[", "]", "javaDocPositions", ",", "int", "modifiers", ",", "int", "modifiersStart", ",", "int", "classStart", ",", "char", "[", "]", "name", ",", "int", "nameStart", ",", "int", "nameEnd", ",", "char", "[", "]", "superclass", ",", "int", "superclassStart", ",", "int", "superclassEnd", ",", "char", "[", "]", "[", "]", "superinterfaces", ",", "int", "[", "]", "superinterfaceStarts", ",", "int", "[", "]", "superinterfaceEnds", ",", "int", "bodyStart", ")", ";", "void", "enterCompilationUnit", "(", ")", ";", "void", "enterConstructor", "(", "int", "declarationStart", ",", "int", "[", "]", "javaDocPositions", ",", "int", "modifiers", ",", "int", "modifiersStart", ",", "char", "[", "]", "name", ",", "int", "nameStart", ",", "int", "nameEnd", ",", "char", "[", "]", "[", "]", "parameterTypes", ",", "int", "[", "]", "parameterTypeStarts", ",", "int", "[", "]", "parameterTypeEnds", ",", "char", "[", "]", "[", "]", "parameterNames", ",", "int", "[", "]", "parameterNameStarts", ",", "int", "[", "]", "parameterNameEnds", ",", "int", "parametersEnd", ",", "char", "[", "]", "[", "]", "exceptionTypes", ",", "int", "[", "]", "exceptionTypeStarts", ",", "int", "[", "]", "exceptionTypeEnds", ",", "int", "bodyStart", ")", ";", "void", "enterField", "(", "int", "declarationStart", ",", "int", "[", "]", "javaDocPositions", ",", "int", "modifiers", ",", "int", "modifiersStart", ",", "char", "[", "]", "type", ",", "int", "typeStart", ",", "int", "typeEnd", ",", "int", "typeDimensionCount", ",", "char", "[", "]", "name", ",", "int", "nameStart", ",", "int", "nameEnd", ",", "int", "extendedTypeDimensionCount", ",", "int", "extendedTypeDimensionEnd", ")", ";", "void", "enterInterface", "(", "int", "declarationStart", ",", "int", "[", "]", "javaDocPositions", ",", "int", "modifiers", ",", "int", "modifiersStart", ",", "int", "interfaceStart", ",", "char", "[", "]", "name", ",", "int", "nameStart", ",", "int", "nameEnd", ",", "char", "[", "]", "[", "]", "superinterfaces", ",", "int", "[", "]", "superinterfaceStarts", ",", "int", "[", "]", "superinterfaceEnds", ",", "int", "bodyStart", ")", ";", "void", "enterMethod", "(", "int", "declarationStart", ",", "int", "[", "]", "javaDocPositions", ",", "int", "modifiers", ",", "int", "modifiersStart", ",", "char", "[", "]", "returnType", ",", "int", "returnTypeStart", ",", "int", "returnTypeEnd", ",", "int", "returnTypeDimensionCount", ",", "char", "[", "]", "name", ",", "int", "nameStart", ",", "int", "nameEnd", ",", "char", "[", "]", "[", "]", "parameterTypes", ",", "int", "[", "]", "parameterTypeStarts", ",", "int", "[", "]", "parameterTypeEnds", ",", "char", "[", "]", "[", "]", "parameterNames", ",", "int", "[", "]", "parameterNameStarts", ",", "int", "[", "]", "parameterNameEnds", ",", "int", "parametersEnd", ",", "int", "extendedReturnTypeDimensionCount", ",", "int", "extendedReturnTypeDimensionEnd", ",", "char", "[", "]", "[", "]", "exceptionTypes", ",", "int", "[", "]", "exceptionTypeStarts", ",", "int", "[", "]", "exceptionTypeEnds", ",", "int", "bodyStart", ")", ";", "void", "exitClass", "(", "int", "bodyEnd", ",", "int", "declarationEnd", ")", ";", "void", "exitCompilationUnit", "(", "int", "declarationEnd", ")", ";", "void", "exitConstructor", "(", "int", "bodyEnd", ",", "int", "declarationEnd", ")", ";", "void", "exitField", "(", "int", "bodyEnd", ",", "int", "declarationEnd", ")", ";", "void", "exitInterface", "(", "int", "bodyEnd", ",", "int", "declarationEnd", ")", ";", "void", "exitMethod", "(", "int", "bodyEnd", ",", "int", "declarationEnd", ")", ";", "}", "</s>" ]
3,936
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "JavadocParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Parser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "TerminalTokens", ";", "public", "class", "SourceJavadocParser", "extends", "JavadocParser", "{", "int", "categoriesPtr", "=", "-", "1", ";", "char", "[", "]", "[", "]", "categories", "=", "CharOperation", ".", "NO_CHAR_CHAR", ";", "public", "SourceJavadocParser", "(", "Parser", "sourceParser", ")", "{", "super", "(", "sourceParser", ")", ";", "this", ".", "kind", "=", "SOURCE_PARSER", "|", "TEXT_VERIF", ";", "}", "public", "boolean", "checkDeprecation", "(", "int", "commentPtr", ")", "{", "this", ".", "categoriesPtr", "=", "-", "1", ";", "boolean", "result", "=", "super", ".", "checkDeprecation", "(", "commentPtr", ")", ";", "if", "(", "this", ".", "categoriesPtr", ">", "-", "1", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "categories", ",", "0", ",", "this", ".", "categories", "=", "new", "char", "[", "this", ".", "categoriesPtr", "+", "1", "]", "[", "]", ",", "0", ",", "this", ".", "categoriesPtr", "+", "1", ")", ";", "}", "else", "{", "this", ".", "categories", "=", "CharOperation", ".", "NO_CHAR_CHAR", ";", "}", "return", "result", ";", "}", "protected", "boolean", "parseIdentifierTag", "(", "boolean", "report", ")", "{", "int", "end", "=", "this", ".", "lineEnd", "+", "1", ";", "if", "(", "super", ".", "parseIdentifierTag", "(", "report", ")", "&&", "this", ".", "index", "<=", "end", ")", "{", "if", "(", "this", ".", "tagValue", "==", "TAG_CATEGORY_VALUE", ")", "{", "int", "length", "=", "this", ".", "categories", ".", "length", ";", "if", "(", "++", "this", ".", "categoriesPtr", ">=", "length", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "categories", ",", "0", ",", "this", ".", "categories", "=", "new", "char", "[", "length", "+", "5", "]", "[", "]", ",", "0", ",", "length", ")", ";", "length", "+=", "5", ";", "}", "this", ".", "categories", "[", "this", ".", "categoriesPtr", "]", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "consumeToken", "(", ")", ";", "while", "(", "this", ".", "index", "<", "end", ")", "{", "if", "(", "readTokenSafely", "(", ")", "==", "TerminalTokens", ".", "TokenNameIdentifier", "&&", "(", "this", ".", "scanner", ".", "currentCharacter", "==", "'", "'", "||", "ScannerHelper", ".", "isWhitespace", "(", "this", ".", "scanner", ".", "currentCharacter", ")", ")", ")", "{", "if", "(", "this", ".", "index", ">", "(", "this", ".", "lineEnd", "+", "1", ")", ")", "break", ";", "if", "(", "++", "this", ".", "categoriesPtr", ">=", "length", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "categories", ",", "0", ",", "this", ".", "categories", "=", "new", "char", "[", "length", "+", "5", "]", "[", "]", ",", "0", ",", "length", ")", ";", "length", "+=", "5", ";", "}", "this", ".", "categories", "[", "this", ".", "categoriesPtr", "]", "=", "this", ".", "scanner", ".", "getCurrentIdentifierSource", "(", ")", ";", "consumeToken", "(", ")", ";", "}", "else", "{", "break", ";", "}", "}", "this", ".", "index", "=", "end", ";", "this", ".", "scanner", ".", "currentPosition", "=", "end", ";", "consumeToken", "(", ")", ";", "}", "return", "true", ";", "}", "return", "false", ";", "}", "protected", "void", "parseSimpleTag", "(", ")", "{", "char", "first", "=", "this", ".", "source", "[", "this", ".", "index", "++", "]", ";", "if", "(", "first", "==", "'\\\\'", "&&", "this", ".", "source", "[", "this", ".", "index", "]", "==", "'u'", ")", "{", "int", "c1", ",", "c2", ",", "c3", ",", "c4", ";", "int", "pos", "=", "this", ".", "index", ";", "this", ".", "index", "++", ";", "while", "(", "this", ".", "source", "[", "this", ".", "index", "]", "==", "'u'", ")", "this", ".", "index", "++", ";", "if", "(", "!", "(", "(", "(", "c1", "=", "ScannerHelper", ".", "getNumericValue", "(", "this", ".", "source", "[", "this", ".", "index", "++", "]", ")", ")", ">", "15", "||", "c1", "<", "0", ")", "||", "(", "(", "c2", "=", "ScannerHelper", ".", "getNumericValue", "(", "this", ".", "source", "[", "this", ".", "index", "++", "]", ")", ")", ">", "15", "||", "c2", "<", "0", ")", "||", "(", "(", "c3", "=", "ScannerHelper", ".", "getNumericValue", "(", "this", ".", "source", "[", "this", ".", "index", "++", "]", ")", ")", ">", "15", "||", "c3", "<", "0", ")", "||", "(", "(", "c4", "=", "ScannerHelper", ".", "getNumericValue", "(", "this", ".", "source", "[", "this", ".", "index", "++", "]", ")", ")", ">", "15", "||", "c4", "<", "0", ")", ")", ")", "{", "first", "=", "(", "char", ")", "(", "(", "(", "c1", "*", "16", "+", "c2", ")", "*", "16", "+", "c3", ")", "*", "16", "+", "c4", ")", ";", "}", "else", "{", "this", ".", "index", "=", "pos", ";", "}", "}", "switch", "(", "first", ")", "{", "case", "'d'", ":", "if", "(", "(", "readChar", "(", ")", "==", "'e'", ")", "&&", "(", "readChar", "(", ")", "==", "'p'", ")", "&&", "(", "readChar", "(", ")", "==", "'r'", ")", "&&", "(", "readChar", "(", ")", "==", "'e'", ")", "&&", "(", "readChar", "(", ")", "==", "'c'", ")", "&&", "(", "readChar", "(", ")", "==", "'a'", ")", "&&", "(", "readChar", "(", ")", "==", "'t'", ")", "&&", "(", "readChar", "(", ")", "==", "'e'", ")", "&&", "(", "readChar", "(", ")", "==", "'d'", ")", ")", "{", "char", "c", "=", "readChar", "(", ")", ";", "if", "(", "ScannerHelper", ".", "isWhitespace", "(", "c", ")", "||", "c", "==", "'*'", ")", "{", "this", ".", "tagValue", "=", "TAG_DEPRECATED_VALUE", ";", "this", ".", "deprecated", "=", "true", ";", "}", "}", "break", ";", "case", "'c'", ":", "if", "(", "(", "readChar", "(", ")", "==", "'a'", ")", "&&", "(", "readChar", "(", ")", "==", "'t'", ")", "&&", "(", "readChar", "(", ")", "==", "'e'", ")", "&&", "(", "readChar", "(", ")", "==", "'g'", ")", "&&", "(", "readChar", "(", ")", "==", "'o'", ")", "&&", "(", "readChar", "(", ")", "==", "'r'", ")", "&&", "(", "readChar", "(", ")", "==", "'y'", ")", ")", "{", "char", "c", "=", "readChar", "(", ")", ";", "if", "(", "ScannerHelper", ".", "isWhitespace", "(", "c", ")", "||", "c", "==", "'*'", ")", "{", "this", ".", "tagValue", "=", "TAG_CATEGORY_VALUE", ";", "if", "(", "this", ".", "scanner", ".", "source", "==", "null", ")", "{", "this", ".", "scanner", ".", "setSource", "(", "this", ".", "source", ")", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "index", ",", "this", ".", "scanner", ".", "eofPosition", ")", ";", "parseIdentifierTag", "(", "false", ")", ";", "}", "}", "break", ";", "}", "}", "}", "</s>" ]
3,937
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "HashtableOfObjectToInt", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "CommentRecorderParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "SourceElementParser", "extends", "CommentRecorderParser", "{", "ISourceElementRequestor", "requestor", ";", "boolean", "reportReferenceInfo", ";", "boolean", "reportLocalDeclarations", ";", "HashtableOfObjectToInt", "sourceEnds", "=", "new", "HashtableOfObjectToInt", "(", ")", ";", "HashMap", "nodesToCategories", "=", "new", "HashMap", "(", ")", ";", "boolean", "useSourceJavadocParser", "=", "true", ";", "SourceElementNotifier", "notifier", ";", "public", "SourceElementParser", "(", "final", "ISourceElementRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ",", "CompilerOptions", "options", ",", "boolean", "reportLocalDeclarations", ",", "boolean", "optimizeStringLiterals", ")", "{", "this", "(", "requestor", ",", "problemFactory", ",", "options", ",", "reportLocalDeclarations", ",", "optimizeStringLiterals", ",", "true", ")", ";", "}", "public", "SourceElementParser", "(", "ISourceElementRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ",", "CompilerOptions", "options", ",", "boolean", "reportLocalDeclarations", ",", "boolean", "optimizeStringLiterals", ",", "boolean", "useSourceJavadocParser", ")", "{", "super", "(", "new", "ProblemReporter", "(", "DefaultErrorHandlingPolicies", ".", "exitAfterAllProblems", "(", ")", ",", "options", ",", "problemFactory", ")", ",", "optimizeStringLiterals", ")", ";", "this", ".", "reportLocalDeclarations", "=", "reportLocalDeclarations", ";", "this", ".", "problemReporter", "=", "new", "ProblemReporter", "(", "DefaultErrorHandlingPolicies", ".", "exitAfterAllProblems", "(", ")", ",", "options", ",", "problemFactory", ")", "{", "public", "void", "record", "(", "CategorizedProblem", "problem", ",", "CompilationResult", "unitResult", ",", "ReferenceContext", "context", ")", "{", "unitResult", ".", "record", "(", "problem", ",", "context", ")", ";", "SourceElementParser", ".", "this", ".", "requestor", ".", "acceptProblem", "(", "problem", ")", ";", "}", "}", ";", "this", ".", "requestor", "=", "requestor", ";", "this", ".", "options", "=", "options", ";", "this", ".", "notifier", "=", "new", "SourceElementNotifier", "(", "this", ".", "requestor", ",", "reportLocalDeclarations", ")", ";", "this", ".", "useSourceJavadocParser", "=", "useSourceJavadocParser", ";", "if", "(", "useSourceJavadocParser", ")", "{", "this", ".", "javadocParser", "=", "new", "SourceJavadocParser", "(", "this", ")", ";", "}", "}", "private", "void", "acceptJavadocTypeReference", "(", "Expression", "expression", ")", "{", "if", "(", "expression", "instanceof", "JavadocSingleTypeReference", ")", "{", "JavadocSingleTypeReference", "singleRef", "=", "(", "JavadocSingleTypeReference", ")", "expression", ";", "this", ".", "requestor", ".", "acceptTypeReference", "(", "singleRef", ".", "token", ",", "singleRef", ".", "sourceStart", ")", ";", "}", "else", "if", "(", "expression", "instanceof", "JavadocQualifiedTypeReference", ")", "{", "JavadocQualifiedTypeReference", "qualifiedRef", "=", "(", "JavadocQualifiedTypeReference", ")", "expression", ";", "this", ".", "requestor", ".", "acceptTypeReference", "(", "qualifiedRef", ".", "tokens", ",", "qualifiedRef", ".", "sourceStart", ",", "qualifiedRef", ".", "sourceEnd", ")", ";", "}", "}", "public", "void", "addUnknownRef", "(", "NameReference", "nameRef", ")", "{", "if", "(", "nameRef", "instanceof", "SingleNameReference", ")", "{", "this", ".", "requestor", ".", "acceptUnknownReference", "(", "(", "(", "SingleNameReference", ")", "nameRef", ")", ".", "token", ",", "nameRef", ".", "sourceStart", ")", ";", "}", "else", "{", "this", ".", "requestor", ".", "acceptUnknownReference", "(", "(", "(", "QualifiedNameReference", ")", "nameRef", ")", ".", "tokens", ",", "nameRef", ".", "sourceStart", ",", "nameRef", ".", "sourceEnd", ")", ";", "}", "}", "public", "void", "checkComment", "(", ")", "{", "if", "(", "!", "(", "this", ".", "diet", "&&", "this", ".", "dietInt", "==", "0", ")", "&&", "this", ".", "scanner", ".", "commentPtr", ">=", "0", ")", "{", "flushCommentsDefinedPriorTo", "(", "this", ".", "endStatementPosition", ")", ";", "}", "int", "lastComment", "=", "this", ".", "scanner", ".", "commentPtr", ";", "if", "(", "this", ".", "modifiersSourceStart", ">=", "0", ")", "{", "while", "(", "lastComment", ">=", "0", ")", "{", "int", "commentSourceStart", "=", "this", ".", "scanner", ".", "commentStarts", "[", "lastComment", "]", ";", "if", "(", "commentSourceStart", "<", "0", ")", "commentSourceStart", "=", "-", "commentSourceStart", ";", "if", "(", "commentSourceStart", "<=", "this", ".", "modifiersSourceStart", ")", "break", ";", "lastComment", "--", ";", "}", "}", "if", "(", "lastComment", ">=", "0", ")", "{", "this", ".", "modifiersSourceStart", "=", "this", ".", "scanner", ".", "commentStarts", "[", "0", "]", ";", "if", "(", "this", ".", "modifiersSourceStart", "<", "0", ")", "this", ".", "modifiersSourceStart", "=", "-", "this", ".", "modifiersSourceStart", ";", "while", "(", "lastComment", ">=", "0", "&&", "this", ".", "scanner", ".", "commentStops", "[", "lastComment", "]", "<", "0", ")", "lastComment", "--", ";", "if", "(", "lastComment", ">=", "0", "&&", "this", ".", "javadocParser", "!=", "null", ")", "{", "int", "commentEnd", "=", "this", ".", "scanner", ".", "commentStops", "[", "lastComment", "]", "-", "1", ";", "if", "(", "this", ".", "javadocParser", ".", "shouldReportProblems", ")", "{", "this", ".", "javadocParser", ".", "reportProblems", "=", "this", ".", "currentElement", "==", "null", "||", "commentEnd", ">", "this", ".", "lastJavadocEnd", ";", "}", "else", "{", "this", ".", "javadocParser", ".", "reportProblems", "=", "false", ";", "}", "if", "(", "this", ".", "javadocParser", ".", "checkDeprecation", "(", "lastComment", ")", ")", "{", "checkAndSetModifiers", "(", "ClassFileConstants", ".", "AccDeprecated", ")", ";", "}", "this", ".", "javadoc", "=", "this", ".", "javadocParser", ".", "docComment", ";", "if", "(", "this", ".", "currentElement", "==", "null", ")", "this", ".", "lastJavadocEnd", "=", "commentEnd", ";", "}", "}", "if", "(", "this", ".", "reportReferenceInfo", "&&", "this", ".", "javadocParser", ".", "checkDocComment", "&&", "this", ".", "javadoc", "!=", "null", ")", "{", "TypeReference", "[", "]", "thrownExceptions", "=", "this", ".", "javadoc", ".", "exceptionReferences", ";", "if", "(", "thrownExceptions", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "thrownExceptions", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "TypeReference", "typeRef", "=", "thrownExceptions", "[", "i", "]", ";", "if", "(", "typeRef", "instanceof", "JavadocSingleTypeReference", ")", "{", "JavadocSingleTypeReference", "singleRef", "=", "(", "JavadocSingleTypeReference", ")", "typeRef", ";", "this", ".", "requestor", ".", "acceptTypeReference", "(", "singleRef", ".", "token", ",", "singleRef", ".", "sourceStart", ")", ";", "}", "else", "if", "(", "typeRef", "instanceof", "JavadocQualifiedTypeReference", ")", "{", "JavadocQualifiedTypeReference", "qualifiedRef", "=", "(", "JavadocQualifiedTypeReference", ")", "typeRef", ";", "this", ".", "requestor", ".", "acceptTypeReference", "(", "qualifiedRef", ".", "tokens", ",", "qualifiedRef", ".", "sourceStart", ",", "qualifiedRef", ".", "sourceEnd", ")", ";", "}", "}", "}", "Expression", "[", "]", "references", "=", "this", ".", "javadoc", ".", "seeReferences", ";", "if", "(", "references", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "references", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "Expression", "reference", "=", "references", "[", "i", "]", ";", "acceptJavadocTypeReference", "(", "reference", ")", ";", "if", "(", "reference", "instanceof", "JavadocFieldReference", ")", "{", "JavadocFieldReference", "fieldRef", "=", "(", "JavadocFieldReference", ")", "reference", ";", "this", ".", "requestor", ".", "acceptFieldReference", "(", "fieldRef", ".", "token", ",", "fieldRef", ".", "sourceStart", ")", ";", "if", "(", "fieldRef", ".", "receiver", "!=", "null", "&&", "!", "fieldRef", ".", "receiver", ".", "isThis", "(", ")", ")", "{", "acceptJavadocTypeReference", "(", "fieldRef", ".", "receiver", ")", ";", "}", "}", "else", "if", "(", "reference", "instanceof", "JavadocMessageSend", ")", "{", "JavadocMessageSend", "messageSend", "=", "(", "JavadocMessageSend", ")", "reference", ";", "int", "argCount", "=", "messageSend", ".", "arguments", "==", "null", "?", "0", ":", "messageSend", ".", "arguments", ".", "length", ";", "this", ".", "requestor", ".", "acceptMethodReference", "(", "messageSend", ".", "selector", ",", "argCount", ",", "messageSend", ".", "sourceStart", ")", ";", "this", ".", "requestor", ".", "acceptConstructorReference", "(", "messageSend", ".", "selector", ",", "argCount", ",", "messageSend", ".", "sourceStart", ")", ";", "if", "(", "messageSend", ".", "receiver", "!=", "null", "&&", "!", "messageSend", ".", "receiver", ".", "isThis", "(", ")", ")", "{", "acceptJavadocTypeReference", "(", "messageSend", ".", "receiver", ")", ";", "}", "}", "else", "if", "(", "reference", "instanceof", "JavadocAllocationExpression", ")", "{", "JavadocAllocationExpression", "constructor", "=", "(", "JavadocAllocationExpression", ")", "reference", ";", "int", "argCount", "=", "constructor", ".", "arguments", "==", "null", "?", "0", ":", "constructor", ".", "arguments", ".", "length", ";", "if", "(", "constructor", ".", "type", "!=", "null", ")", "{", "char", "[", "]", "[", "]", "compoundName", "=", "constructor", ".", "type", ".", "getParameterizedTypeName", "(", ")", ";", "this", ".", "requestor", ".", "acceptConstructorReference", "(", "compoundName", "[", "compoundName", ".", "length", "-", "1", "]", ",", "argCount", ",", "constructor", ".", "sourceStart", ")", ";", "if", "(", "!", "constructor", ".", "type", ".", "isThis", "(", ")", ")", "{", "acceptJavadocTypeReference", "(", "constructor", ".", "type", ")", ";", "}", "}", "}", "}", "}", "}", "}", "protected", "void", "classInstanceCreation", "(", "boolean", "alwaysQualified", ")", "{", "boolean", "previousFlag", "=", "this", ".", "reportReferenceInfo", ";", "this", ".", "reportReferenceInfo", "=", "false", ";", "super", ".", "classInstanceCreation", "(", "alwaysQualified", ")", ";", "this", ".", "reportReferenceInfo", "=", "previousFlag", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "AllocationExpression", "alloc", "=", "(", "AllocationExpression", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "TypeReference", "typeRef", "=", "alloc", ".", "type", ";", "this", ".", "requestor", ".", "acceptConstructorReference", "(", "typeRef", "instanceof", "SingleTypeReference", "?", "(", "(", "SingleTypeReference", ")", "typeRef", ")", ".", "token", ":", "CharOperation", ".", "concatWith", "(", "alloc", ".", "type", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ",", "alloc", ".", "arguments", "==", "null", "?", "0", ":", "alloc", ".", "arguments", ".", "length", ",", "alloc", ".", "sourceStart", ")", ";", "}", "}", "protected", "void", "consumeAnnotationAsModifier", "(", ")", "{", "super", ".", "consumeAnnotationAsModifier", "(", ")", ";", "Annotation", "annotation", "=", "(", "Annotation", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptAnnotationTypeReference", "(", "annotation", ".", "type", ".", "getTypeName", "(", ")", ",", "annotation", ".", "sourceStart", ",", "annotation", ".", "sourceEnd", ")", ";", "}", "}", "protected", "void", "consumeClassInstanceCreationExpressionQualifiedWithTypeArguments", "(", ")", "{", "boolean", "previousFlag", "=", "this", ".", "reportReferenceInfo", ";", "this", ".", "reportReferenceInfo", "=", "false", ";", "super", ".", "consumeClassInstanceCreationExpressionQualifiedWithTypeArguments", "(", ")", ";", "this", ".", "reportReferenceInfo", "=", "previousFlag", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "AllocationExpression", "alloc", "=", "(", "AllocationExpression", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "TypeReference", "typeRef", "=", "alloc", ".", "type", ";", "this", ".", "requestor", ".", "acceptConstructorReference", "(", "typeRef", "instanceof", "SingleTypeReference", "?", "(", "(", "SingleTypeReference", ")", "typeRef", ")", ".", "token", ":", "CharOperation", ".", "concatWith", "(", "alloc", ".", "type", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ",", "alloc", ".", "arguments", "==", "null", "?", "0", ":", "alloc", ".", "arguments", ".", "length", ",", "alloc", ".", "sourceStart", ")", ";", "}", "}", "protected", "void", "consumeAnnotationTypeDeclarationHeaderName", "(", ")", "{", "int", "currentAstPtr", "=", "this", ".", "astPtr", ";", "super", ".", "consumeAnnotationTypeDeclarationHeaderName", "(", ")", ";", "if", "(", "this", ".", "astPtr", ">", "currentAstPtr", ")", "rememberCategories", "(", ")", ";", "}", "protected", "void", "consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters", "(", ")", "{", "int", "currentAstPtr", "=", "this", ".", "astPtr", ";", "super", ".", "consumeAnnotationTypeDeclarationHeaderNameWithTypeParameters", "(", ")", ";", "if", "(", "this", ".", "astPtr", ">", "currentAstPtr", ")", "rememberCategories", "(", ")", ";", "}", "protected", "void", "consumeCatchFormalParameter", "(", ")", "{", "super", ".", "consumeCatchFormalParameter", "(", ")", ";", "flushCommentsDefinedPriorTo", "(", "this", ".", "scanner", ".", "currentPosition", ")", ";", "}", "protected", "void", "consumeClassHeaderName1", "(", ")", "{", "int", "currentAstPtr", "=", "this", ".", "astPtr", ";", "super", ".", "consumeClassHeaderName1", "(", ")", ";", "if", "(", "this", ".", "astPtr", ">", "currentAstPtr", ")", "rememberCategories", "(", ")", ";", "}", "protected", "void", "consumeClassInstanceCreationExpressionWithTypeArguments", "(", ")", "{", "boolean", "previousFlag", "=", "this", ".", "reportReferenceInfo", ";", "this", ".", "reportReferenceInfo", "=", "false", ";", "super", ".", "consumeClassInstanceCreationExpressionWithTypeArguments", "(", ")", ";", "this", ".", "reportReferenceInfo", "=", "previousFlag", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "AllocationExpression", "alloc", "=", "(", "AllocationExpression", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "TypeReference", "typeRef", "=", "alloc", ".", "type", ";", "this", ".", "requestor", ".", "acceptConstructorReference", "(", "typeRef", "instanceof", "SingleTypeReference", "?", "(", "(", "SingleTypeReference", ")", "typeRef", ")", ".", "token", ":", "CharOperation", ".", "concatWith", "(", "alloc", ".", "type", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ",", "alloc", ".", "arguments", "==", "null", "?", "0", ":", "alloc", ".", "arguments", ".", "length", ",", "alloc", ".", "sourceStart", ")", ";", "}", "}", "protected", "void", "consumeConstructorHeaderName", "(", ")", "{", "long", "selectorSourcePositions", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ";", "int", "selectorSourceEnd", "=", "(", "int", ")", "selectorSourcePositions", ";", "int", "currentAstPtr", "=", "this", ".", "astPtr", ";", "super", ".", "consumeConstructorHeaderName", "(", ")", ";", "if", "(", "this", ".", "astPtr", ">", "currentAstPtr", ")", "{", "this", ".", "sourceEnds", ".", "put", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ",", "selectorSourceEnd", ")", ";", "rememberCategories", "(", ")", ";", "}", "}", "protected", "void", "consumeConstructorHeaderNameWithTypeParameters", "(", ")", "{", "long", "selectorSourcePositions", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ";", "int", "selectorSourceEnd", "=", "(", "int", ")", "selectorSourcePositions", ";", "int", "currentAstPtr", "=", "this", ".", "astPtr", ";", "super", ".", "consumeConstructorHeaderNameWithTypeParameters", "(", ")", ";", "if", "(", "this", ".", "astPtr", ">", "currentAstPtr", ")", "{", "this", ".", "sourceEnds", ".", "put", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ",", "selectorSourceEnd", ")", ";", "rememberCategories", "(", ")", ";", "}", "}", "protected", "void", "consumeEnumConstantWithClassBody", "(", ")", "{", "super", ".", "consumeEnumConstantWithClassBody", "(", ")", ";", "if", "(", "(", "this", ".", "currentToken", "==", "TokenNameCOMMA", "||", "this", ".", "currentToken", "==", "TokenNameSEMICOLON", ")", "&&", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", "instanceof", "FieldDeclaration", ")", "{", "this", ".", "sourceEnds", ".", "put", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ",", "this", ".", "scanner", ".", "currentPosition", "-", "1", ")", ";", "rememberCategories", "(", ")", ";", "}", "}", "protected", "void", "consumeEnumConstantNoClassBody", "(", ")", "{", "super", ".", "consumeEnumConstantNoClassBody", "(", ")", ";", "if", "(", "(", "this", ".", "currentToken", "==", "TokenNameCOMMA", "||", "this", ".", "currentToken", "==", "TokenNameSEMICOLON", ")", "&&", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", "instanceof", "FieldDeclaration", ")", "{", "this", ".", "sourceEnds", ".", "put", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ",", "this", ".", "scanner", ".", "currentPosition", "-", "1", ")", ";", "rememberCategories", "(", ")", ";", "}", "}", "protected", "void", "consumeEnumHeaderName", "(", ")", "{", "int", "currentAstPtr", "=", "this", ".", "astPtr", ";", "super", ".", "consumeEnumHeaderName", "(", ")", ";", "if", "(", "this", ".", "astPtr", ">", "currentAstPtr", ")", "rememberCategories", "(", ")", ";", "}", "protected", "void", "consumeEnumHeaderNameWithTypeParameters", "(", ")", "{", "int", "currentAstPtr", "=", "this", ".", "astPtr", ";", "super", ".", "consumeEnumHeaderNameWithTypeParameters", "(", ")", ";", "if", "(", "this", ".", "astPtr", ">", "currentAstPtr", ")", "rememberCategories", "(", ")", ";", "}", "protected", "void", "consumeExitVariableWithInitialization", "(", ")", "{", "super", ".", "consumeExitVariableWithInitialization", "(", ")", ";", "if", "(", "(", "this", ".", "currentToken", "==", "TokenNameCOMMA", "||", "this", ".", "currentToken", "==", "TokenNameSEMICOLON", ")", "&&", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", "instanceof", "FieldDeclaration", ")", "{", "this", ".", "sourceEnds", ".", "put", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ",", "this", ".", "scanner", ".", "currentPosition", "-", "1", ")", ";", "rememberCategories", "(", ")", ";", "}", "}", "protected", "void", "consumeExitVariableWithoutInitialization", "(", ")", "{", "super", ".", "consumeExitVariableWithoutInitialization", "(", ")", ";", "if", "(", "(", "this", ".", "currentToken", "==", "TokenNameCOMMA", "||", "this", ".", "currentToken", "==", "TokenNameSEMICOLON", ")", "&&", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", "instanceof", "FieldDeclaration", ")", "{", "this", ".", "sourceEnds", ".", "put", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ",", "this", ".", "scanner", ".", "currentPosition", "-", "1", ")", ";", "rememberCategories", "(", ")", ";", "}", "}", "protected", "void", "consumeFieldAccess", "(", "boolean", "isSuperAccess", ")", "{", "super", ".", "consumeFieldAccess", "(", "isSuperAccess", ")", ";", "FieldReference", "fr", "=", "(", "FieldReference", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptFieldReference", "(", "fr", ".", "token", ",", "fr", ".", "sourceStart", ")", ";", "}", "}", "protected", "void", "consumeFormalParameter", "(", "boolean", "isVarArgs", ")", "{", "super", ".", "consumeFormalParameter", "(", "isVarArgs", ")", ";", "flushCommentsDefinedPriorTo", "(", "this", ".", "scanner", ".", "currentPosition", ")", ";", "}", "protected", "void", "consumeInterfaceHeaderName1", "(", ")", "{", "int", "currentAstPtr", "=", "this", ".", "astPtr", ";", "super", ".", "consumeInterfaceHeaderName1", "(", ")", ";", "if", "(", "this", ".", "astPtr", ">", "currentAstPtr", ")", "rememberCategories", "(", ")", ";", "}", "protected", "void", "consumeMemberValuePair", "(", ")", "{", "super", ".", "consumeMemberValuePair", "(", ")", ";", "MemberValuePair", "memberValuepair", "=", "(", "MemberValuePair", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptMethodReference", "(", "memberValuepair", ".", "name", ",", "0", ",", "memberValuepair", ".", "sourceStart", ")", ";", "}", "}", "protected", "void", "consumeMarkerAnnotation", "(", ")", "{", "super", ".", "consumeMarkerAnnotation", "(", ")", ";", "Annotation", "annotation", "=", "(", "Annotation", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptAnnotationTypeReference", "(", "annotation", ".", "type", ".", "getTypeName", "(", ")", ",", "annotation", ".", "sourceStart", ",", "annotation", ".", "sourceEnd", ")", ";", "}", "}", "protected", "void", "consumeMethodHeaderName", "(", "boolean", "isAnnotationMethod", ")", "{", "long", "selectorSourcePositions", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ";", "int", "selectorSourceEnd", "=", "(", "int", ")", "selectorSourcePositions", ";", "int", "currentAstPtr", "=", "this", ".", "astPtr", ";", "super", ".", "consumeMethodHeaderName", "(", "isAnnotationMethod", ")", ";", "if", "(", "this", ".", "astPtr", ">", "currentAstPtr", ")", "{", "this", ".", "sourceEnds", ".", "put", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ",", "selectorSourceEnd", ")", ";", "rememberCategories", "(", ")", ";", "}", "}", "protected", "void", "consumeMethodHeaderNameWithTypeParameters", "(", "boolean", "isAnnotationMethod", ")", "{", "long", "selectorSourcePositions", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ";", "int", "selectorSourceEnd", "=", "(", "int", ")", "selectorSourcePositions", ";", "int", "currentAstPtr", "=", "this", ".", "astPtr", ";", "super", ".", "consumeMethodHeaderNameWithTypeParameters", "(", "isAnnotationMethod", ")", ";", "if", "(", "this", ".", "astPtr", ">", "currentAstPtr", ")", "this", ".", "sourceEnds", ".", "put", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ",", "selectorSourceEnd", ")", ";", "rememberCategories", "(", ")", ";", "}", "protected", "void", "consumeMethodInvocationName", "(", ")", "{", "super", ".", "consumeMethodInvocationName", "(", ")", ";", "MessageSend", "messageSend", "=", "(", "MessageSend", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "Expression", "[", "]", "args", "=", "messageSend", ".", "arguments", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptMethodReference", "(", "messageSend", ".", "selector", ",", "args", "==", "null", "?", "0", ":", "args", ".", "length", ",", "(", "int", ")", "(", "messageSend", ".", "nameSourcePosition", ">>>", "32", ")", ")", ";", "}", "}", "protected", "void", "consumeMethodInvocationNameWithTypeArguments", "(", ")", "{", "super", ".", "consumeMethodInvocationNameWithTypeArguments", "(", ")", ";", "MessageSend", "messageSend", "=", "(", "MessageSend", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "Expression", "[", "]", "args", "=", "messageSend", ".", "arguments", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptMethodReference", "(", "messageSend", ".", "selector", ",", "args", "==", "null", "?", "0", ":", "args", ".", "length", ",", "(", "int", ")", "(", "messageSend", ".", "nameSourcePosition", ">>>", "32", ")", ")", ";", "}", "}", "protected", "void", "consumeMethodInvocationPrimary", "(", ")", "{", "super", ".", "consumeMethodInvocationPrimary", "(", ")", ";", "MessageSend", "messageSend", "=", "(", "MessageSend", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "Expression", "[", "]", "args", "=", "messageSend", ".", "arguments", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptMethodReference", "(", "messageSend", ".", "selector", ",", "args", "==", "null", "?", "0", ":", "args", ".", "length", ",", "(", "int", ")", "(", "messageSend", ".", "nameSourcePosition", ">>>", "32", ")", ")", ";", "}", "}", "protected", "void", "consumeMethodInvocationPrimaryWithTypeArguments", "(", ")", "{", "super", ".", "consumeMethodInvocationPrimaryWithTypeArguments", "(", ")", ";", "MessageSend", "messageSend", "=", "(", "MessageSend", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "Expression", "[", "]", "args", "=", "messageSend", ".", "arguments", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptMethodReference", "(", "messageSend", ".", "selector", ",", "args", "==", "null", "?", "0", ":", "args", ".", "length", ",", "(", "int", ")", "(", "messageSend", ".", "nameSourcePosition", ">>>", "32", ")", ")", ";", "}", "}", "protected", "void", "consumeMethodInvocationSuper", "(", ")", "{", "super", ".", "consumeMethodInvocationSuper", "(", ")", ";", "MessageSend", "messageSend", "=", "(", "MessageSend", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "Expression", "[", "]", "args", "=", "messageSend", ".", "arguments", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptMethodReference", "(", "messageSend", ".", "selector", ",", "args", "==", "null", "?", "0", ":", "args", ".", "length", ",", "(", "int", ")", "(", "messageSend", ".", "nameSourcePosition", ">>>", "32", ")", ")", ";", "}", "}", "protected", "void", "consumeMethodInvocationSuperWithTypeArguments", "(", ")", "{", "super", ".", "consumeMethodInvocationSuperWithTypeArguments", "(", ")", ";", "MessageSend", "messageSend", "=", "(", "MessageSend", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "Expression", "[", "]", "args", "=", "messageSend", ".", "arguments", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptMethodReference", "(", "messageSend", ".", "selector", ",", "args", "==", "null", "?", "0", ":", "args", ".", "length", ",", "(", "int", ")", "(", "messageSend", ".", "nameSourcePosition", ">>>", "32", ")", ")", ";", "}", "}", "protected", "void", "consumeNormalAnnotation", "(", ")", "{", "super", ".", "consumeNormalAnnotation", "(", ")", ";", "Annotation", "annotation", "=", "(", "Annotation", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptAnnotationTypeReference", "(", "annotation", ".", "type", ".", "getTypeName", "(", ")", ",", "annotation", ".", "sourceStart", ",", "annotation", ".", "sourceEnd", ")", ";", "}", "}", "protected", "void", "consumeSingleMemberAnnotation", "(", ")", "{", "super", ".", "consumeSingleMemberAnnotation", "(", ")", ";", "SingleMemberAnnotation", "member", "=", "(", "SingleMemberAnnotation", ")", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptMethodReference", "(", "TypeConstants", ".", "VALUE", ",", "0", ",", "member", ".", "sourceStart", ")", ";", "}", "}", "protected", "void", "consumeSingleStaticImportDeclarationName", "(", ")", "{", "ImportReference", "impt", ";", "int", "length", ";", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "length", "=", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "--", "]", "]", "[", "]", ";", "this", ".", "identifierPtr", "-=", "length", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "tokens", ",", "0", ",", "length", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "positions", ",", "0", ",", "length", ")", ";", "pushOnAstStack", "(", "impt", "=", "newImportReference", "(", "tokens", ",", "positions", ",", "false", ",", "ClassFileConstants", ".", "AccStatic", ")", ")", ";", "this", ".", "modifiers", "=", "ClassFileConstants", ".", "AccDefault", ";", "this", ".", "modifiersSourceStart", "=", "-", "1", ";", "if", "(", "this", ".", "currentToken", "==", "TokenNameSEMICOLON", ")", "{", "impt", ".", "declarationSourceEnd", "=", "this", ".", "scanner", ".", "currentPosition", "-", "1", ";", "}", "else", "{", "impt", ".", "declarationSourceEnd", "=", "impt", ".", "sourceEnd", ";", "}", "impt", ".", "declarationEnd", "=", "impt", ".", "declarationSourceEnd", ";", "impt", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "if", "(", "!", "this", ".", "statementRecoveryActivated", "&&", "this", ".", "options", ".", "sourceLevel", "<", "ClassFileConstants", ".", "JDK1_5", "&&", "this", ".", "lastErrorEndPositionBeforeRecovery", "<", "this", ".", "scanner", ".", "currentPosition", ")", "{", "impt", ".", "modifiers", "=", "ClassFileConstants", ".", "AccDefault", ";", "problemReporter", "(", ")", ".", "invalidUsageOfStaticImports", "(", "impt", ")", ";", "}", "if", "(", "this", ".", "currentElement", "!=", "null", ")", "{", "this", ".", "lastCheckPoint", "=", "impt", ".", "declarationSourceEnd", "+", "1", ";", "this", ".", "currentElement", "=", "this", ".", "currentElement", ".", "add", "(", "impt", ",", "0", ")", ";", "this", ".", "lastIgnoredToken", "=", "-", "1", ";", "this", ".", "restartRecovery", "=", "true", ";", "}", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "int", "tokensLength", "=", "impt", ".", "tokens", ".", "length", "-", "1", ";", "int", "start", "=", "(", "int", ")", "(", "impt", ".", "sourcePositions", "[", "tokensLength", "]", ">>>", "32", ")", ";", "char", "[", "]", "last", "=", "impt", ".", "tokens", "[", "tokensLength", "]", ";", "this", ".", "requestor", ".", "acceptFieldReference", "(", "last", ",", "start", ")", ";", "this", ".", "requestor", ".", "acceptMethodReference", "(", "last", ",", "0", ",", "start", ")", ";", "this", ".", "requestor", ".", "acceptTypeReference", "(", "last", ",", "start", ")", ";", "if", "(", "tokensLength", ">", "0", ")", "{", "char", "[", "]", "[", "]", "compoundName", "=", "new", "char", "[", "tokensLength", "]", "[", "]", ";", "System", ".", "arraycopy", "(", "impt", ".", "tokens", ",", "0", ",", "compoundName", ",", "0", ",", "tokensLength", ")", ";", "int", "end", "=", "(", "int", ")", "impt", ".", "sourcePositions", "[", "tokensLength", "-", "1", "]", ";", "this", ".", "requestor", ".", "acceptTypeReference", "(", "compoundName", ",", "impt", ".", "sourceStart", ",", "end", ")", ";", "}", "}", "}", "protected", "void", "consumeSingleTypeImportDeclarationName", "(", ")", "{", "ImportReference", "impt", ";", "int", "length", ";", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "length", "=", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "--", "]", "]", "[", "]", ";", "this", ".", "identifierPtr", "-=", "length", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "tokens", ",", "0", ",", "length", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "positions", ",", "0", ",", "length", ")", ";", "pushOnAstStack", "(", "impt", "=", "newImportReference", "(", "tokens", ",", "positions", ",", "false", ",", "ClassFileConstants", ".", "AccDefault", ")", ")", ";", "if", "(", "this", ".", "currentToken", "==", "TokenNameSEMICOLON", ")", "{", "impt", ".", "declarationSourceEnd", "=", "this", ".", "scanner", ".", "currentPosition", "-", "1", ";", "}", "else", "{", "impt", ".", "declarationSourceEnd", "=", "impt", ".", "sourceEnd", ";", "}", "impt", ".", "declarationEnd", "=", "impt", ".", "declarationSourceEnd", ";", "impt", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "if", "(", "this", ".", "currentElement", "!=", "null", ")", "{", "this", ".", "lastCheckPoint", "=", "impt", ".", "declarationSourceEnd", "+", "1", ";", "this", ".", "currentElement", "=", "this", ".", "currentElement", ".", "add", "(", "impt", ",", "0", ")", ";", "this", ".", "lastIgnoredToken", "=", "-", "1", ";", "this", ".", "restartRecovery", "=", "true", ";", "}", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptTypeReference", "(", "impt", ".", "tokens", ",", "impt", ".", "sourceStart", ",", "impt", ".", "sourceEnd", ")", ";", "}", "}", "protected", "void", "consumeStaticImportOnDemandDeclarationName", "(", ")", "{", "ImportReference", "impt", ";", "int", "length", ";", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "length", "=", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "--", "]", "]", "[", "]", ";", "this", ".", "identifierPtr", "-=", "length", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "tokens", ",", "0", ",", "length", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "positions", ",", "0", ",", "length", ")", ";", "pushOnAstStack", "(", "impt", "=", "new", "ImportReference", "(", "tokens", ",", "positions", ",", "true", ",", "ClassFileConstants", ".", "AccStatic", ")", ")", ";", "impt", ".", "trailingStarPosition", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "this", ".", "modifiers", "=", "ClassFileConstants", ".", "AccDefault", ";", "this", ".", "modifiersSourceStart", "=", "-", "1", ";", "if", "(", "this", ".", "currentToken", "==", "TokenNameSEMICOLON", ")", "{", "impt", ".", "declarationSourceEnd", "=", "this", ".", "scanner", ".", "currentPosition", "-", "1", ";", "}", "else", "{", "impt", ".", "declarationSourceEnd", "=", "impt", ".", "sourceEnd", ";", "}", "impt", ".", "declarationEnd", "=", "impt", ".", "declarationSourceEnd", ";", "impt", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "if", "(", "!", "this", ".", "statementRecoveryActivated", "&&", "this", ".", "options", ".", "sourceLevel", "<", "ClassFileConstants", ".", "JDK1_5", "&&", "this", ".", "lastErrorEndPositionBeforeRecovery", "<", "this", ".", "scanner", ".", "currentPosition", ")", "{", "impt", ".", "modifiers", "=", "ClassFileConstants", ".", "AccDefault", ";", "problemReporter", "(", ")", ".", "invalidUsageOfStaticImports", "(", "impt", ")", ";", "}", "if", "(", "this", ".", "currentElement", "!=", "null", ")", "{", "this", ".", "lastCheckPoint", "=", "impt", ".", "declarationSourceEnd", "+", "1", ";", "this", ".", "currentElement", "=", "this", ".", "currentElement", ".", "add", "(", "impt", ",", "0", ")", ";", "this", ".", "lastIgnoredToken", "=", "-", "1", ";", "this", ".", "restartRecovery", "=", "true", ";", "}", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptTypeReference", "(", "impt", ".", "tokens", ",", "impt", ".", "sourceStart", ",", "impt", ".", "sourceEnd", ")", ";", "}", "}", "protected", "void", "consumeTypeImportOnDemandDeclarationName", "(", ")", "{", "ImportReference", "impt", ";", "int", "length", ";", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "length", "=", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "--", "]", "]", "[", "]", ";", "this", ".", "identifierPtr", "-=", "length", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "tokens", ",", "0", ",", "length", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "positions", ",", "0", ",", "length", ")", ";", "pushOnAstStack", "(", "impt", "=", "new", "ImportReference", "(", "tokens", ",", "positions", ",", "true", ",", "ClassFileConstants", ".", "AccDefault", ")", ")", ";", "impt", ".", "trailingStarPosition", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "if", "(", "this", ".", "currentToken", "==", "TokenNameSEMICOLON", ")", "{", "impt", ".", "declarationSourceEnd", "=", "this", ".", "scanner", ".", "currentPosition", "-", "1", ";", "}", "else", "{", "impt", ".", "declarationSourceEnd", "=", "impt", ".", "sourceEnd", ";", "}", "impt", ".", "declarationEnd", "=", "impt", ".", "declarationSourceEnd", ";", "impt", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "if", "(", "this", ".", "currentElement", "!=", "null", ")", "{", "this", ".", "lastCheckPoint", "=", "impt", ".", "declarationSourceEnd", "+", "1", ";", "this", ".", "currentElement", "=", "this", ".", "currentElement", ".", "add", "(", "impt", ",", "0", ")", ";", "this", ".", "lastIgnoredToken", "=", "-", "1", ";", "this", ".", "restartRecovery", "=", "true", ";", "}", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptUnknownReference", "(", "impt", ".", "tokens", ",", "impt", ".", "sourceStart", ",", "impt", ".", "sourceEnd", ")", ";", "}", "}", "public", "MethodDeclaration", "convertToMethodDeclaration", "(", "ConstructorDeclaration", "c", ",", "CompilationResult", "compilationResult", ")", "{", "MethodDeclaration", "methodDeclaration", "=", "super", ".", "convertToMethodDeclaration", "(", "c", ",", "compilationResult", ")", ";", "int", "selectorSourceEnd", "=", "this", ".", "sourceEnds", ".", "removeKey", "(", "c", ")", ";", "if", "(", "selectorSourceEnd", "!=", "-", "1", ")", "this", ".", "sourceEnds", ".", "put", "(", "methodDeclaration", ",", "selectorSourceEnd", ")", ";", "char", "[", "]", "[", "]", "categories", "=", "(", "char", "[", "]", "[", "]", ")", "this", ".", "nodesToCategories", ".", "remove", "(", "c", ")", ";", "if", "(", "categories", "!=", "null", ")", "this", ".", "nodesToCategories", ".", "put", "(", "methodDeclaration", ",", "categories", ")", ";", "return", "methodDeclaration", ";", "}", "protected", "CompilationUnitDeclaration", "endParse", "(", "int", "act", ")", "{", "if", "(", "this", ".", "scanner", ".", "recordLineSeparator", ")", "{", "this", ".", "requestor", ".", "acceptLineSeparatorPositions", "(", "this", ".", "scanner", ".", "getLineEnds", "(", ")", ")", ";", "}", "if", "(", "this", ".", "compilationUnit", "!=", "null", ")", "{", "CompilationUnitDeclaration", "result", "=", "super", ".", "endParse", "(", "act", ")", ";", "return", "result", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "TypeReference", "getTypeReference", "(", "int", "dim", ")", "{", "int", "length", "=", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "--", "]", ";", "if", "(", "length", "<", "0", ")", "{", "TypeReference", "ref", "=", "TypeReference", ".", "baseTypeReference", "(", "-", "length", ",", "dim", ")", ";", "ref", ".", "sourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "if", "(", "dim", "==", "0", ")", "{", "ref", ".", "sourceEnd", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "}", "else", "{", "this", ".", "intPtr", "--", ";", "ref", ".", "sourceEnd", "=", "this", ".", "endPosition", ";", "}", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptTypeReference", "(", "ref", ".", "getParameterizedTypeName", "(", ")", ",", "ref", ".", "sourceStart", ",", "ref", ".", "sourceEnd", ")", ";", "}", "return", "ref", ";", "}", "else", "{", "int", "numberOfIdentifiers", "=", "this", ".", "genericsIdentifiersLengthStack", "[", "this", ".", "genericsIdentifiersLengthPtr", "--", "]", ";", "if", "(", "length", "!=", "numberOfIdentifiers", "||", "this", ".", "genericsLengthStack", "[", "this", ".", "genericsLengthPtr", "]", "!=", "0", ")", "{", "TypeReference", "ref", "=", "getTypeReferenceForGenericType", "(", "dim", ",", "length", ",", "numberOfIdentifiers", ")", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "if", "(", "length", "==", "1", "&&", "numberOfIdentifiers", "==", "1", ")", "{", "ParameterizedSingleTypeReference", "parameterizedSingleTypeReference", "=", "(", "ParameterizedSingleTypeReference", ")", "ref", ";", "this", ".", "requestor", ".", "acceptTypeReference", "(", "parameterizedSingleTypeReference", ".", "token", ",", "parameterizedSingleTypeReference", ".", "sourceStart", ")", ";", "}", "else", "{", "ParameterizedQualifiedTypeReference", "parameterizedQualifiedTypeReference", "=", "(", "ParameterizedQualifiedTypeReference", ")", "ref", ";", "this", ".", "requestor", ".", "acceptTypeReference", "(", "parameterizedQualifiedTypeReference", ".", "tokens", ",", "parameterizedQualifiedTypeReference", ".", "sourceStart", ",", "parameterizedQualifiedTypeReference", ".", "sourceEnd", ")", ";", "}", "}", "return", "ref", ";", "}", "else", "if", "(", "length", "==", "1", ")", "{", "this", ".", "genericsLengthPtr", "--", ";", "if", "(", "dim", "==", "0", ")", "{", "SingleTypeReference", "ref", "=", "new", "SingleTypeReference", "(", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ",", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ")", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptTypeReference", "(", "ref", ".", "token", ",", "ref", ".", "sourceStart", ")", ";", "}", "return", "ref", ";", "}", "else", "{", "ArrayTypeReference", "ref", "=", "new", "ArrayTypeReference", "(", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ",", "dim", ",", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ")", ";", "ref", ".", "sourceEnd", "=", "this", ".", "endPosition", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptTypeReference", "(", "ref", ".", "token", ",", "ref", ".", "sourceStart", ")", ";", "}", "return", "ref", ";", "}", "}", "else", "{", "this", ".", "genericsLengthPtr", "--", ";", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "length", "]", "[", "]", ";", "this", ".", "identifierPtr", "-=", "length", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "tokens", ",", "0", ",", "length", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "positions", ",", "0", ",", "length", ")", ";", "if", "(", "dim", "==", "0", ")", "{", "QualifiedTypeReference", "ref", "=", "new", "QualifiedTypeReference", "(", "tokens", ",", "positions", ")", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptTypeReference", "(", "ref", ".", "tokens", ",", "ref", ".", "sourceStart", ",", "ref", ".", "sourceEnd", ")", ";", "}", "return", "ref", ";", "}", "else", "{", "ArrayQualifiedTypeReference", "ref", "=", "new", "ArrayQualifiedTypeReference", "(", "tokens", ",", "dim", ",", "positions", ")", ";", "ref", ".", "sourceEnd", "=", "this", ".", "endPosition", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "this", ".", "requestor", ".", "acceptTypeReference", "(", "ref", ".", "tokens", ",", "ref", ".", "sourceStart", ",", "ref", ".", "sourceEnd", ")", ";", "}", "return", "ref", ";", "}", "}", "}", "}", "public", "NameReference", "getUnspecifiedReference", "(", ")", "{", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "--", "]", ")", "==", "1", ")", "{", "SingleNameReference", "ref", "=", "newSingleNameReference", "(", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ",", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ")", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "addUnknownRef", "(", "ref", ")", ";", "}", "return", "ref", ";", "}", "else", "{", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "length", "]", "[", "]", ";", "this", ".", "identifierPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "tokens", ",", "0", ",", "length", ")", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "positions", ",", "0", ",", "length", ")", ";", "QualifiedNameReference", "ref", "=", "newQualifiedNameReference", "(", "tokens", ",", "positions", ",", "(", "int", ")", "(", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "+", "1", "]", ">>", "32", ")", ",", "(", "int", ")", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "+", "length", "]", ")", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "addUnknownRef", "(", "ref", ")", ";", "}", "return", "ref", ";", "}", "}", "public", "NameReference", "getUnspecifiedReferenceOptimized", "(", ")", "{", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "--", "]", ")", "==", "1", ")", "{", "SingleNameReference", "ref", "=", "newSingleNameReference", "(", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ",", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ")", ";", "ref", ".", "bits", "&=", "~", "ASTNode", ".", "RestrictiveFlagMASK", ";", "ref", ".", "bits", "|=", "Binding", ".", "LOCAL", "|", "Binding", ".", "FIELD", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "addUnknownRef", "(", "ref", ")", ";", "}", "return", "ref", ";", "}", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "length", "]", "[", "]", ";", "this", ".", "identifierPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "tokens", ",", "0", ",", "length", ")", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "positions", ",", "0", ",", "length", ")", ";", "QualifiedNameReference", "ref", "=", "newQualifiedNameReference", "(", "tokens", ",", "positions", ",", "(", "int", ")", "(", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "+", "1", "]", ">>", "32", ")", ",", "(", "int", ")", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "+", "length", "]", ")", ";", "ref", ".", "bits", "&=", "~", "ASTNode", ".", "RestrictiveFlagMASK", ";", "ref", ".", "bits", "|=", "Binding", ".", "LOCAL", "|", "Binding", ".", "FIELD", ";", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "addUnknownRef", "(", "ref", ")", ";", "}", "return", "ref", ";", "}", "protected", "ImportReference", "newImportReference", "(", "char", "[", "]", "[", "]", "tokens", ",", "long", "[", "]", "positions", ",", "boolean", "onDemand", ",", "int", "mod", ")", "{", "return", "new", "ImportReference", "(", "tokens", ",", "positions", ",", "onDemand", ",", "mod", ")", ";", "}", "protected", "QualifiedNameReference", "newQualifiedNameReference", "(", "char", "[", "]", "[", "]", "tokens", ",", "long", "[", "]", "positions", ",", "int", "sourceStart", ",", "int", "sourceEnd", ")", "{", "return", "new", "QualifiedNameReference", "(", "tokens", ",", "positions", ",", "sourceStart", ",", "sourceEnd", ")", ";", "}", "protected", "SingleNameReference", "newSingleNameReference", "(", "char", "[", "]", "source", ",", "long", "positions", ")", "{", "return", "new", "SingleNameReference", "(", "source", ",", "positions", ")", ";", "}", "public", "CompilationUnitDeclaration", "parseCompilationUnit", "(", "ICompilationUnit", "unit", ",", "boolean", "fullParse", ",", "IProgressMonitor", "pm", ")", "{", "boolean", "old", "=", "this", ".", "diet", ";", "CompilationUnitDeclaration", "parsedUnit", "=", "null", ";", "try", "{", "this", ".", "diet", "=", "true", ";", "this", ".", "reportReferenceInfo", "=", "fullParse", ";", "CompilationResult", "compilationUnitResult", "=", "new", "CompilationResult", "(", "unit", ",", "0", ",", "0", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ";", "parsedUnit", "=", "parse", "(", "unit", ",", "compilationUnitResult", ")", ";", "if", "(", "pm", "!=", "null", "&&", "pm", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", "Messages", ".", "operation_cancelled", ")", ";", "if", "(", "this", ".", "scanner", ".", "recordLineSeparator", ")", "{", "this", ".", "requestor", ".", "acceptLineSeparatorPositions", "(", "compilationUnitResult", ".", "getLineSeparatorPositions", "(", ")", ")", ";", "}", "int", "initialStart", "=", "this", ".", "scanner", ".", "initialPosition", ";", "int", "initialEnd", "=", "this", ".", "scanner", ".", "eofPosition", ";", "if", "(", "this", ".", "reportLocalDeclarations", "||", "fullParse", ")", "{", "this", ".", "diet", "=", "false", ";", "getMethodBodies", "(", "parsedUnit", ")", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "initialStart", ",", "initialEnd", ")", ";", "this", ".", "notifier", ".", "notifySourceElementRequestor", "(", "parsedUnit", ",", "this", ".", "scanner", ".", "initialPosition", ",", "this", ".", "scanner", ".", "eofPosition", ",", "this", ".", "reportReferenceInfo", ",", "this", ".", "sourceEnds", ",", "this", ".", "nodesToCategories", ")", ";", "return", "parsedUnit", ";", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "}", "finally", "{", "this", ".", "diet", "=", "old", ";", "reset", "(", ")", ";", "}", "return", "parsedUnit", ";", "}", "private", "void", "rememberCategories", "(", ")", "{", "if", "(", "this", ".", "useSourceJavadocParser", ")", "{", "SourceJavadocParser", "sourceJavadocParser", "=", "(", "SourceJavadocParser", ")", "this", ".", "javadocParser", ";", "char", "[", "]", "[", "]", "categories", "=", "sourceJavadocParser", ".", "categories", ";", "if", "(", "categories", ".", "length", ">", "0", ")", "{", "this", ".", "nodesToCategories", ".", "put", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ",", "categories", ")", ";", "sourceJavadocParser", ".", "categories", "=", "CharOperation", ".", "NO_CHAR_CHAR", ";", "}", "}", "}", "public", "void", "reset", "(", ")", "{", "this", ".", "sourceEnds", "=", "new", "HashtableOfObjectToInt", "(", ")", ";", "this", ".", "nodesToCategories", "=", "new", "HashMap", "(", ")", ";", "}", "public", "void", "setRequestor", "(", "ISourceElementRequestor", "requestor", ")", "{", "this", ".", "requestor", "=", "requestor", ";", "this", ".", "notifier", ".", "requestor", "=", "requestor", ";", "}", "}", "</s>" ]
3,938
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "*", ";", "public", "class", "DocumentElementParser", "extends", "Parser", "{", "IDocumentElementRequestor", "requestor", ";", "private", "int", "localIntPtr", ";", "private", "int", "lastFieldEndPosition", ";", "private", "int", "lastFieldBodyEndPosition", ";", "private", "int", "typeStartPosition", ";", "private", "long", "selectorSourcePositions", ";", "private", "int", "typeDims", ";", "private", "int", "extendsDim", ";", "private", "int", "declarationSourceStart", ";", "int", "[", "]", "[", "]", "intArrayStack", ";", "int", "intArrayPtr", ";", "public", "DocumentElementParser", "(", "final", "IDocumentElementRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ",", "CompilerOptions", "options", ")", "{", "super", "(", "new", "ProblemReporter", "(", "DefaultErrorHandlingPolicies", ".", "exitAfterAllProblems", "(", ")", ",", "options", ",", "problemFactory", ")", ",", "false", ")", ";", "this", ".", "requestor", "=", "requestor", ";", "this", ".", "intArrayStack", "=", "new", "int", "[", "30", "]", "[", "]", ";", "this", ".", "options", "=", "options", ";", "this", ".", "javadocParser", ".", "checkDocComment", "=", "false", ";", "setMethodsFullRecovery", "(", "false", ")", ";", "setStatementsRecovery", "(", "false", ")", ";", "}", "public", "void", "checkComment", "(", ")", "{", "pushOnIntArrayStack", "(", "getJavaDocPositions", "(", ")", ")", ";", "boolean", "deprecated", "=", "false", ";", "int", "lastCommentIndex", "=", "-", "1", ";", "int", "commentPtr", "=", "this", ".", "scanner", ".", "commentPtr", ";", "nextComment", ":", "for", "(", "lastCommentIndex", "=", "this", ".", "scanner", ".", "commentPtr", ";", "lastCommentIndex", ">=", "0", ";", "lastCommentIndex", "--", ")", "{", "int", "commentSourceStart", "=", "this", ".", "scanner", ".", "commentStarts", "[", "lastCommentIndex", "]", ";", "if", "(", "commentSourceStart", "<", "0", "||", "this", ".", "scanner", ".", "commentStops", "[", "lastCommentIndex", "]", "<", "0", "||", "(", "this", ".", "modifiersSourceStart", "!=", "-", "1", "&&", "this", ".", "modifiersSourceStart", "<", "commentSourceStart", ")", ")", "{", "continue", "nextComment", ";", "}", "deprecated", "=", "this", ".", "javadocParser", ".", "checkDeprecation", "(", "lastCommentIndex", ")", ";", "break", "nextComment", ";", "}", "if", "(", "deprecated", ")", "{", "checkAndSetModifiers", "(", "ClassFileConstants", ".", "AccDeprecated", ")", ";", "}", "if", "(", "commentPtr", ">=", "0", ")", "{", "this", ".", "declarationSourceStart", "=", "this", ".", "scanner", ".", "commentStarts", "[", "0", "]", ";", "if", "(", "this", ".", "declarationSourceStart", "<", "0", ")", "this", ".", "declarationSourceStart", "=", "-", "this", ".", "declarationSourceStart", ";", "}", "}", "protected", "void", "consumeCatchFormalParameter", "(", ")", "{", "this", ".", "identifierLengthPtr", "--", ";", "char", "[", "]", "parameterName", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ";", "long", "namePositions", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "this", ".", "intPtr", "--", ";", "TypeReference", "type", "=", "(", "TypeReference", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "--", "]", ";", "this", ".", "intPtr", "-=", "3", ";", "Argument", "arg", "=", "new", "Argument", "(", "parameterName", ",", "namePositions", ",", "type", ",", "this", ".", "intStack", "[", "this", ".", "intPtr", "+", "1", "]", ")", ";", "arg", ".", "bits", "&=", "~", "ASTNode", ".", "IsArgument", ";", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "(", "this", ".", "expressionPtr", "-=", "length", ")", "+", "1", ",", "arg", ".", "annotations", "=", "new", "Annotation", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "pushOnAstStack", "(", "arg", ")", ";", "this", ".", "intArrayPtr", "--", ";", "}", "protected", "void", "consumeClassBodyDeclaration", "(", ")", "{", "super", ".", "consumeClassBodyDeclaration", "(", ")", ";", "Initializer", "initializer", "=", "(", "Initializer", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "this", ".", "requestor", ".", "acceptInitializer", "(", "initializer", ".", "declarationSourceStart", ",", "initializer", ".", "declarationSourceEnd", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "0", ",", "this", ".", "modifiersSourceStart", ",", "initializer", ".", "block", ".", "sourceStart", ",", "initializer", ".", "block", ".", "sourceEnd", ")", ";", "}", "protected", "void", "consumeClassDeclaration", "(", ")", "{", "super", ".", "consumeClassDeclaration", "(", ")", ";", "if", "(", "isLocalDeclaration", "(", ")", ")", "{", "return", ";", "}", "this", ".", "requestor", ".", "exitClass", "(", "this", ".", "endStatementPosition", ",", "(", "(", "TypeDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ")", ".", "declarationSourceEnd", ")", ";", "}", "protected", "void", "consumeClassHeader", "(", ")", "{", "super", ".", "consumeClassHeader", "(", ")", ";", "if", "(", "isLocalDeclaration", "(", ")", ")", "{", "this", ".", "intArrayPtr", "--", ";", "return", ";", "}", "TypeDeclaration", "typeDecl", "=", "(", "TypeDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "TypeReference", "[", "]", "superInterfaces", "=", "typeDecl", ".", "superInterfaces", ";", "char", "[", "]", "[", "]", "interfaceNames", "=", "null", ";", "int", "[", "]", "interfaceNameStarts", "=", "null", ";", "int", "[", "]", "interfaceNameEnds", "=", "null", ";", "if", "(", "superInterfaces", "!=", "null", ")", "{", "int", "superInterfacesLength", "=", "superInterfaces", ".", "length", ";", "interfaceNames", "=", "new", "char", "[", "superInterfacesLength", "]", "[", "]", ";", "interfaceNameStarts", "=", "new", "int", "[", "superInterfacesLength", "]", ";", "interfaceNameEnds", "=", "new", "int", "[", "superInterfacesLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "superInterfacesLength", ";", "i", "++", ")", "{", "TypeReference", "superInterface", "=", "superInterfaces", "[", "i", "]", ";", "interfaceNames", "[", "i", "]", "=", "CharOperation", ".", "concatWith", "(", "superInterface", ".", "getTypeName", "(", ")", ",", "'.'", ")", ";", "interfaceNameStarts", "[", "i", "]", "=", "superInterface", ".", "sourceStart", ";", "interfaceNameEnds", "[", "i", "]", "=", "superInterface", ".", "sourceEnd", ";", "}", "}", "this", ".", "scanner", ".", "commentPtr", "=", "-", "1", ";", "TypeReference", "superclass", "=", "typeDecl", ".", "superclass", ";", "if", "(", "superclass", "==", "null", ")", "{", "this", ".", "requestor", ".", "enterClass", "(", "typeDecl", ".", "declarationSourceStart", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "typeDecl", ".", "modifiers", ",", "typeDecl", ".", "modifiersSourceStart", ",", "this", ".", "typeStartPosition", ",", "typeDecl", ".", "name", ",", "typeDecl", ".", "sourceStart", ",", "typeDecl", ".", "sourceEnd", ",", "null", ",", "-", "1", ",", "-", "1", ",", "interfaceNames", ",", "interfaceNameStarts", ",", "interfaceNameEnds", ",", "this", ".", "scanner", ".", "currentPosition", "-", "1", ")", ";", "}", "else", "{", "this", ".", "requestor", ".", "enterClass", "(", "typeDecl", ".", "declarationSourceStart", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "typeDecl", ".", "modifiers", ",", "typeDecl", ".", "modifiersSourceStart", ",", "this", ".", "typeStartPosition", ",", "typeDecl", ".", "name", ",", "typeDecl", ".", "sourceStart", ",", "typeDecl", ".", "sourceEnd", ",", "CharOperation", ".", "concatWith", "(", "superclass", ".", "getTypeName", "(", ")", ",", "'.'", ")", ",", "superclass", ".", "sourceStart", ",", "superclass", ".", "sourceEnd", ",", "interfaceNames", ",", "interfaceNameStarts", ",", "interfaceNameEnds", ",", "this", ".", "scanner", ".", "currentPosition", "-", "1", ")", ";", "}", "}", "protected", "void", "consumeClassHeaderName1", "(", ")", "{", "TypeDeclaration", "typeDecl", "=", "new", "TypeDeclaration", "(", "this", ".", "compilationUnit", ".", "compilationResult", ")", ";", "if", "(", "this", ".", "nestedMethod", "[", "this", ".", "nestedType", "]", "==", "0", ")", "{", "if", "(", "this", ".", "nestedType", "!=", "0", ")", "{", "typeDecl", ".", "bits", "|=", "ASTNode", ".", "IsMemberType", ";", "}", "}", "else", "{", "typeDecl", ".", "bits", "|=", "ASTNode", ".", "IsLocalType", ";", "markEnclosingMemberWithLocalType", "(", ")", ";", "blockReal", "(", ")", ";", "}", "long", "pos", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ";", "typeDecl", ".", "sourceEnd", "=", "(", "int", ")", "pos", ";", "typeDecl", ".", "sourceStart", "=", "(", "int", ")", "(", "pos", ">>>", "32", ")", ";", "typeDecl", ".", "name", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "this", ".", "identifierLengthPtr", "--", ";", "this", ".", "typeStartPosition", "=", "typeDecl", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "this", ".", "intPtr", "--", ";", "int", "declSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "typeDecl", ".", "modifiersSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "typeDecl", ".", "modifiers", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "if", "(", "typeDecl", ".", "declarationSourceStart", ">", "declSourceStart", ")", "{", "typeDecl", ".", "declarationSourceStart", "=", "declSourceStart", ";", "}", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "(", "this", ".", "expressionPtr", "-=", "length", ")", "+", "1", ",", "typeDecl", ".", "annotations", "=", "new", "Annotation", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "typeDecl", ".", "bodyStart", "=", "typeDecl", ".", "sourceEnd", "+", "1", ";", "pushOnAstStack", "(", "typeDecl", ")", ";", "typeDecl", ".", "javadoc", "=", "this", ".", "javadoc", ";", "this", ".", "javadoc", "=", "null", ";", "}", "protected", "void", "consumeCompilationUnit", "(", ")", "{", "this", ".", "requestor", ".", "exitCompilationUnit", "(", "this", ".", "scanner", ".", "source", ".", "length", "-", "1", ")", ";", "}", "protected", "void", "consumeConstructorDeclaration", "(", ")", "{", "super", ".", "consumeConstructorDeclaration", "(", ")", ";", "if", "(", "isLocalDeclaration", "(", ")", ")", "{", "return", ";", "}", "ConstructorDeclaration", "cd", "=", "(", "ConstructorDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "this", ".", "requestor", ".", "exitConstructor", "(", "this", ".", "endStatementPosition", ",", "cd", ".", "declarationSourceEnd", ")", ";", "}", "protected", "void", "consumeConstructorHeader", "(", ")", "{", "super", ".", "consumeConstructorHeader", "(", ")", ";", "if", "(", "isLocalDeclaration", "(", ")", ")", "{", "this", ".", "intArrayPtr", "--", ";", "return", ";", "}", "ConstructorDeclaration", "cd", "=", "(", "ConstructorDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "Argument", "[", "]", "arguments", "=", "cd", ".", "arguments", ";", "char", "[", "]", "[", "]", "argumentTypes", "=", "null", ";", "char", "[", "]", "[", "]", "argumentNames", "=", "null", ";", "int", "[", "]", "argumentTypeStarts", "=", "null", ";", "int", "[", "]", "argumentTypeEnds", "=", "null", ";", "int", "[", "]", "argumentNameStarts", "=", "null", ";", "int", "[", "]", "argumentNameEnds", "=", "null", ";", "if", "(", "arguments", "!=", "null", ")", "{", "int", "argumentLength", "=", "arguments", ".", "length", ";", "argumentTypes", "=", "new", "char", "[", "argumentLength", "]", "[", "]", ";", "argumentNames", "=", "new", "char", "[", "argumentLength", "]", "[", "]", ";", "argumentNameStarts", "=", "new", "int", "[", "argumentLength", "]", ";", "argumentNameEnds", "=", "new", "int", "[", "argumentLength", "]", ";", "argumentTypeStarts", "=", "new", "int", "[", "argumentLength", "]", ";", "argumentTypeEnds", "=", "new", "int", "[", "argumentLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentLength", ";", "i", "++", ")", "{", "Argument", "argument", "=", "arguments", "[", "i", "]", ";", "TypeReference", "argumentType", "=", "argument", ".", "type", ";", "argumentTypes", "[", "i", "]", "=", "returnTypeName", "(", "argumentType", ")", ";", "argumentNames", "[", "i", "]", "=", "argument", ".", "name", ";", "argumentNameStarts", "[", "i", "]", "=", "argument", ".", "sourceStart", ";", "argumentNameEnds", "[", "i", "]", "=", "argument", ".", "sourceEnd", ";", "argumentTypeStarts", "[", "i", "]", "=", "argumentType", ".", "sourceStart", ";", "argumentTypeEnds", "[", "i", "]", "=", "argumentType", ".", "sourceEnd", ";", "}", "}", "TypeReference", "[", "]", "thrownExceptions", "=", "cd", ".", "thrownExceptions", ";", "char", "[", "]", "[", "]", "exceptionTypes", "=", "null", ";", "int", "[", "]", "exceptionTypeStarts", "=", "null", ";", "int", "[", "]", "exceptionTypeEnds", "=", "null", ";", "if", "(", "thrownExceptions", "!=", "null", ")", "{", "int", "thrownExceptionLength", "=", "thrownExceptions", ".", "length", ";", "exceptionTypes", "=", "new", "char", "[", "thrownExceptionLength", "]", "[", "]", ";", "exceptionTypeStarts", "=", "new", "int", "[", "thrownExceptionLength", "]", ";", "exceptionTypeEnds", "=", "new", "int", "[", "thrownExceptionLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "thrownExceptionLength", ";", "i", "++", ")", "{", "TypeReference", "exception", "=", "thrownExceptions", "[", "i", "]", ";", "exceptionTypes", "[", "i", "]", "=", "CharOperation", ".", "concatWith", "(", "exception", ".", "getTypeName", "(", ")", ",", "'.'", ")", ";", "exceptionTypeStarts", "[", "i", "]", "=", "exception", ".", "sourceStart", ";", "exceptionTypeEnds", "[", "i", "]", "=", "exception", ".", "sourceEnd", ";", "}", "}", "this", ".", "requestor", ".", "enterConstructor", "(", "cd", ".", "declarationSourceStart", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "cd", ".", "modifiers", ",", "cd", ".", "modifiersSourceStart", ",", "cd", ".", "selector", ",", "cd", ".", "sourceStart", ",", "(", "int", ")", "(", "this", ".", "selectorSourcePositions", "&", "0xFFFFFFFFL", ")", ",", "argumentTypes", ",", "argumentTypeStarts", ",", "argumentTypeEnds", ",", "argumentNames", ",", "argumentNameStarts", ",", "argumentNameEnds", ",", "this", ".", "rParenPos", ",", "exceptionTypes", ",", "exceptionTypeStarts", ",", "exceptionTypeEnds", ",", "this", ".", "scanner", ".", "currentPosition", "-", "1", ")", ";", "}", "protected", "void", "consumeConstructorHeaderName", "(", ")", "{", "ConstructorDeclaration", "cd", "=", "new", "ConstructorDeclaration", "(", "this", ".", "compilationUnit", ".", "compilationResult", ")", ";", "cd", ".", "selector", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ";", "this", ".", "selectorSourcePositions", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "this", ".", "identifierLengthPtr", "--", ";", "cd", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "cd", ".", "modifiersSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "cd", ".", "modifiers", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "(", "this", ".", "expressionPtr", "-=", "length", ")", "+", "1", ",", "cd", ".", "annotations", "=", "new", "Annotation", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "cd", ".", "javadoc", "=", "this", ".", "javadoc", ";", "this", ".", "javadoc", "=", "null", ";", "cd", ".", "sourceStart", "=", "(", "int", ")", "(", "this", ".", "selectorSourcePositions", ">>>", "32", ")", ";", "pushOnAstStack", "(", "cd", ")", ";", "cd", ".", "sourceEnd", "=", "this", ".", "lParenPos", ";", "cd", ".", "bodyStart", "=", "this", ".", "lParenPos", "+", "1", ";", "}", "protected", "void", "consumeDefaultModifiers", "(", ")", "{", "checkComment", "(", ")", ";", "pushOnIntStack", "(", "this", ".", "modifiers", ")", ";", "pushOnIntStack", "(", "-", "1", ")", ";", "pushOnIntStack", "(", "this", ".", "declarationSourceStart", ">=", "0", "?", "this", ".", "declarationSourceStart", ":", "this", ".", "scanner", ".", "startPosition", ")", ";", "resetModifiers", "(", ")", ";", "pushOnExpressionStackLengthStack", "(", "0", ")", ";", "}", "protected", "void", "consumeDiet", "(", ")", "{", "super", ".", "consumeDiet", "(", ")", ";", "pushOnIntArrayStack", "(", "getJavaDocPositions", "(", ")", ")", ";", "}", "protected", "void", "consumeEnterCompilationUnit", "(", ")", "{", "this", ".", "requestor", ".", "enterCompilationUnit", "(", ")", ";", "}", "protected", "void", "consumeEnterVariable", "(", ")", "{", "boolean", "isLocalDeclaration", "=", "isLocalDeclaration", "(", ")", ";", "if", "(", "!", "isLocalDeclaration", "&&", "(", "this", ".", "variablesCounter", "[", "this", ".", "nestedType", "]", "!=", "0", ")", ")", "{", "this", ".", "requestor", ".", "exitField", "(", "this", ".", "lastFieldBodyEndPosition", ",", "this", ".", "lastFieldEndPosition", ")", ";", "}", "char", "[", "]", "varName", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ";", "long", "namePosition", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "int", "extendedTypeDimension", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "AbstractVariableDeclaration", "declaration", ";", "if", "(", "this", ".", "nestedMethod", "[", "this", ".", "nestedType", "]", "!=", "0", ")", "{", "declaration", "=", "new", "LocalDeclaration", "(", "varName", ",", "(", "int", ")", "(", "namePosition", ">>>", "32", ")", ",", "(", "int", ")", "namePosition", ")", ";", "}", "else", "{", "declaration", "=", "new", "FieldDeclaration", "(", "varName", ",", "(", "int", ")", "(", "namePosition", ">>>", "32", ")", ",", "(", "int", ")", "namePosition", ")", ";", "}", "this", ".", "identifierLengthPtr", "--", ";", "TypeReference", "type", ";", "int", "variableIndex", "=", "this", ".", "variablesCounter", "[", "this", ".", "nestedType", "]", ";", "int", "typeDim", "=", "0", ";", "if", "(", "variableIndex", "==", "0", ")", "{", "if", "(", "this", ".", "nestedMethod", "[", "this", ".", "nestedType", "]", "!=", "0", ")", "{", "declaration", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "declaration", ".", "modifiersSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "declaration", ".", "modifiers", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "type", "=", "getTypeReference", "(", "typeDim", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ")", ";", "pushOnAstStack", "(", "type", ")", ";", "}", "else", "{", "type", "=", "getTypeReference", "(", "typeDim", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ")", ";", "pushOnAstStack", "(", "type", ")", ";", "declaration", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "declaration", ".", "modifiersSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "declaration", ".", "modifiers", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "}", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "(", "this", ".", "expressionPtr", "-=", "length", ")", "+", "1", ",", "declaration", ".", "annotations", "=", "new", "Annotation", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "}", "else", "{", "type", "=", "(", "TypeReference", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "-", "variableIndex", "]", ";", "typeDim", "=", "type", ".", "dimensions", "(", ")", ";", "AbstractVariableDeclaration", "previousVariable", "=", "(", "AbstractVariableDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "declaration", ".", "declarationSourceStart", "=", "previousVariable", ".", "declarationSourceStart", ";", "declaration", ".", "modifiers", "=", "previousVariable", ".", "modifiers", ";", "declaration", ".", "modifiersSourceStart", "=", "previousVariable", ".", "modifiersSourceStart", ";", "final", "Annotation", "[", "]", "annotations", "=", "previousVariable", ".", "annotations", ";", "if", "(", "annotations", "!=", "null", ")", "{", "final", "int", "annotationsLength", "=", "annotations", ".", "length", ";", "System", ".", "arraycopy", "(", "annotations", ",", "0", ",", "declaration", ".", "annotations", "=", "new", "Annotation", "[", "annotationsLength", "]", ",", "0", ",", "annotationsLength", ")", ";", "}", "}", "this", ".", "localIntPtr", "=", "this", ".", "intPtr", ";", "if", "(", "extendedTypeDimension", "==", "0", ")", "{", "declaration", ".", "type", "=", "type", ";", "}", "else", "{", "int", "dimension", "=", "typeDim", "+", "extendedTypeDimension", ";", "declaration", ".", "type", "=", "copyDims", "(", "type", ",", "dimension", ")", ";", "}", "this", ".", "variablesCounter", "[", "this", ".", "nestedType", "]", "++", ";", "this", ".", "nestedMethod", "[", "this", ".", "nestedType", "]", "++", ";", "pushOnAstStack", "(", "declaration", ")", ";", "int", "[", "]", "javadocPositions", "=", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "]", ";", "if", "(", "!", "isLocalDeclaration", ")", "{", "this", ".", "requestor", ".", "enterField", "(", "declaration", ".", "declarationSourceStart", ",", "javadocPositions", ",", "declaration", ".", "modifiers", ",", "declaration", ".", "modifiersSourceStart", ",", "returnTypeName", "(", "declaration", ".", "type", ")", ",", "type", ".", "sourceStart", ",", "type", ".", "sourceEnd", ",", "this", ".", "typeDims", ",", "varName", ",", "(", "int", ")", "(", "namePosition", ">>>", "32", ")", ",", "(", "int", ")", "namePosition", ",", "extendedTypeDimension", ",", "extendedTypeDimension", "==", "0", "?", "-", "1", ":", "this", ".", "endPosition", ")", ";", "}", "}", "protected", "void", "consumeExitVariableWithInitialization", "(", ")", "{", "super", ".", "consumeExitVariableWithInitialization", "(", ")", ";", "this", ".", "nestedMethod", "[", "this", ".", "nestedType", "]", "--", ";", "this", ".", "lastFieldEndPosition", "=", "this", ".", "scanner", ".", "currentPosition", "-", "1", ";", "this", ".", "lastFieldBodyEndPosition", "=", "(", "(", "AbstractVariableDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ")", ".", "initialization", ".", "sourceEnd", ";", "}", "protected", "void", "consumeExitVariableWithoutInitialization", "(", ")", "{", "super", ".", "consumeExitVariableWithoutInitialization", "(", ")", ";", "this", ".", "nestedMethod", "[", "this", ".", "nestedType", "]", "--", ";", "this", ".", "lastFieldEndPosition", "=", "this", ".", "scanner", ".", "currentPosition", "-", "1", ";", "this", ".", "lastFieldBodyEndPosition", "=", "this", ".", "scanner", ".", "startPosition", "-", "1", ";", "}", "protected", "void", "consumeFieldDeclaration", "(", ")", "{", "int", "variableIndex", "=", "this", ".", "variablesCounter", "[", "this", ".", "nestedType", "]", ";", "super", ".", "consumeFieldDeclaration", "(", ")", ";", "this", ".", "intArrayPtr", "--", ";", "if", "(", "isLocalDeclaration", "(", ")", ")", "return", ";", "if", "(", "variableIndex", "!=", "0", ")", "{", "this", ".", "requestor", ".", "exitField", "(", "this", ".", "lastFieldBodyEndPosition", ",", "this", ".", "lastFieldEndPosition", ")", ";", "}", "}", "protected", "void", "consumeFormalParameter", "(", "boolean", "isVarArgs", ")", "{", "this", ".", "identifierLengthPtr", "--", ";", "char", "[", "]", "parameterName", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ";", "long", "namePositions", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "int", "extendedDimensions", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "int", "endOfEllipsis", "=", "0", ";", "if", "(", "isVarArgs", ")", "{", "endOfEllipsis", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "}", "int", "firstDimensions", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "final", "int", "typeDimensions", "=", "firstDimensions", "+", "extendedDimensions", ";", "TypeReference", "type", "=", "getTypeReference", "(", "typeDimensions", ")", ";", "if", "(", "isVarArgs", ")", "{", "type", "=", "copyDims", "(", "type", ",", "typeDimensions", "+", "1", ")", ";", "if", "(", "extendedDimensions", "==", "0", ")", "{", "type", ".", "sourceEnd", "=", "endOfEllipsis", ";", "}", "type", ".", "bits", "|=", "ASTNode", ".", "IsVarArgs", ";", "}", "this", ".", "intPtr", "-=", "3", ";", "Argument", "arg", "=", "new", "Argument", "(", "parameterName", ",", "namePositions", ",", "type", ",", "this", ".", "intStack", "[", "this", ".", "intPtr", "+", "1", "]", ")", ";", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "(", "this", ".", "expressionPtr", "-=", "length", ")", "+", "1", ",", "arg", ".", "annotations", "=", "new", "Annotation", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "pushOnAstStack", "(", "arg", ")", ";", "this", ".", "intArrayPtr", "--", ";", "}", "protected", "void", "consumeInterfaceDeclaration", "(", ")", "{", "super", ".", "consumeInterfaceDeclaration", "(", ")", ";", "if", "(", "isLocalDeclaration", "(", ")", ")", "{", "return", ";", "}", "this", ".", "requestor", ".", "exitInterface", "(", "this", ".", "endStatementPosition", ",", "(", "(", "TypeDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ")", ".", "declarationSourceEnd", ")", ";", "}", "protected", "void", "consumeInterfaceHeader", "(", ")", "{", "super", ".", "consumeInterfaceHeader", "(", ")", ";", "if", "(", "isLocalDeclaration", "(", ")", ")", "{", "this", ".", "intArrayPtr", "--", ";", "return", ";", "}", "TypeDeclaration", "typeDecl", "=", "(", "TypeDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "TypeReference", "[", "]", "superInterfaces", "=", "typeDecl", ".", "superInterfaces", ";", "char", "[", "]", "[", "]", "interfaceNames", "=", "null", ";", "int", "[", "]", "interfaceNameStarts", "=", "null", ";", "int", "[", "]", "interfacenameEnds", "=", "null", ";", "int", "superInterfacesLength", "=", "0", ";", "if", "(", "superInterfaces", "!=", "null", ")", "{", "superInterfacesLength", "=", "superInterfaces", ".", "length", ";", "interfaceNames", "=", "new", "char", "[", "superInterfacesLength", "]", "[", "]", ";", "interfaceNameStarts", "=", "new", "int", "[", "superInterfacesLength", "]", ";", "interfacenameEnds", "=", "new", "int", "[", "superInterfacesLength", "]", ";", "}", "if", "(", "superInterfaces", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "superInterfacesLength", ";", "i", "++", ")", "{", "TypeReference", "superInterface", "=", "superInterfaces", "[", "i", "]", ";", "interfaceNames", "[", "i", "]", "=", "CharOperation", ".", "concatWith", "(", "superInterface", ".", "getTypeName", "(", ")", ",", "'.'", ")", ";", "interfaceNameStarts", "[", "i", "]", "=", "superInterface", ".", "sourceStart", ";", "interfacenameEnds", "[", "i", "]", "=", "superInterface", ".", "sourceEnd", ";", "}", "}", "this", ".", "scanner", ".", "commentPtr", "=", "-", "1", ";", "this", ".", "requestor", ".", "enterInterface", "(", "typeDecl", ".", "declarationSourceStart", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "typeDecl", ".", "modifiers", ",", "typeDecl", ".", "modifiersSourceStart", ",", "this", ".", "typeStartPosition", ",", "typeDecl", ".", "name", ",", "typeDecl", ".", "sourceStart", ",", "typeDecl", ".", "sourceEnd", ",", "interfaceNames", ",", "interfaceNameStarts", ",", "interfacenameEnds", ",", "this", ".", "scanner", ".", "currentPosition", "-", "1", ")", ";", "}", "protected", "void", "consumeInterfaceHeaderName1", "(", ")", "{", "TypeDeclaration", "typeDecl", "=", "new", "TypeDeclaration", "(", "this", ".", "compilationUnit", ".", "compilationResult", ")", ";", "if", "(", "this", ".", "nestedMethod", "[", "this", ".", "nestedType", "]", "==", "0", ")", "{", "if", "(", "this", ".", "nestedType", "!=", "0", ")", "{", "typeDecl", ".", "bits", "|=", "ASTNode", ".", "IsMemberType", ";", "}", "}", "else", "{", "typeDecl", ".", "bits", "|=", "ASTNode", ".", "IsLocalType", ";", "markEnclosingMemberWithLocalType", "(", ")", ";", "blockReal", "(", ")", ";", "}", "long", "pos", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ";", "typeDecl", ".", "sourceEnd", "=", "(", "int", ")", "pos", ";", "typeDecl", ".", "sourceStart", "=", "(", "int", ")", "(", "pos", ">>>", "32", ")", ";", "typeDecl", ".", "name", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "this", ".", "identifierLengthPtr", "--", ";", "this", ".", "typeStartPosition", "=", "typeDecl", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "this", ".", "intPtr", "--", ";", "int", "declSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "typeDecl", ".", "modifiersSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "typeDecl", ".", "modifiers", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", "|", "ClassFileConstants", ".", "AccInterface", ";", "if", "(", "typeDecl", ".", "declarationSourceStart", ">", "declSourceStart", ")", "{", "typeDecl", ".", "declarationSourceStart", "=", "declSourceStart", ";", "}", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "(", "this", ".", "expressionPtr", "-=", "length", ")", "+", "1", ",", "typeDecl", ".", "annotations", "=", "new", "Annotation", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "typeDecl", ".", "bodyStart", "=", "typeDecl", ".", "sourceEnd", "+", "1", ";", "pushOnAstStack", "(", "typeDecl", ")", ";", "typeDecl", ".", "javadoc", "=", "this", ".", "javadoc", ";", "this", ".", "javadoc", "=", "null", ";", "}", "protected", "void", "consumeInternalCompilationUnit", "(", ")", "{", "}", "protected", "void", "consumeInternalCompilationUnitWithTypes", "(", ")", "{", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "astLengthStack", "[", "this", ".", "astLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "this", ".", "compilationUnit", ".", "types", "=", "new", "TypeDeclaration", "[", "length", "]", ";", "this", ".", "astPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "astStack", ",", "this", ".", "astPtr", "+", "1", ",", "this", ".", "compilationUnit", ".", "types", ",", "0", ",", "length", ")", ";", "}", "}", "protected", "void", "consumeLocalVariableDeclaration", "(", ")", "{", "super", ".", "consumeLocalVariableDeclaration", "(", ")", ";", "this", ".", "intArrayPtr", "--", ";", "}", "protected", "void", "consumeMethodDeclaration", "(", "boolean", "isNotAbstract", ")", "{", "super", ".", "consumeMethodDeclaration", "(", "isNotAbstract", ")", ";", "if", "(", "isLocalDeclaration", "(", ")", ")", "{", "return", ";", "}", "MethodDeclaration", "md", "=", "(", "MethodDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "this", ".", "requestor", ".", "exitMethod", "(", "this", ".", "endStatementPosition", ",", "md", ".", "declarationSourceEnd", ")", ";", "}", "protected", "void", "consumeMethodHeader", "(", ")", "{", "super", ".", "consumeMethodHeader", "(", ")", ";", "if", "(", "isLocalDeclaration", "(", ")", ")", "{", "this", ".", "intArrayPtr", "--", ";", "return", ";", "}", "MethodDeclaration", "md", "=", "(", "MethodDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "TypeReference", "returnType", "=", "md", ".", "returnType", ";", "char", "[", "]", "returnTypeName", "=", "returnTypeName", "(", "returnType", ")", ";", "Argument", "[", "]", "arguments", "=", "md", ".", "arguments", ";", "char", "[", "]", "[", "]", "argumentTypes", "=", "null", ";", "char", "[", "]", "[", "]", "argumentNames", "=", "null", ";", "int", "[", "]", "argumentTypeStarts", "=", "null", ";", "int", "[", "]", "argumentTypeEnds", "=", "null", ";", "int", "[", "]", "argumentNameStarts", "=", "null", ";", "int", "[", "]", "argumentNameEnds", "=", "null", ";", "if", "(", "arguments", "!=", "null", ")", "{", "int", "argumentLength", "=", "arguments", ".", "length", ";", "argumentTypes", "=", "new", "char", "[", "argumentLength", "]", "[", "]", ";", "argumentNames", "=", "new", "char", "[", "argumentLength", "]", "[", "]", ";", "argumentNameStarts", "=", "new", "int", "[", "argumentLength", "]", ";", "argumentNameEnds", "=", "new", "int", "[", "argumentLength", "]", ";", "argumentTypeStarts", "=", "new", "int", "[", "argumentLength", "]", ";", "argumentTypeEnds", "=", "new", "int", "[", "argumentLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentLength", ";", "i", "++", ")", "{", "Argument", "argument", "=", "arguments", "[", "i", "]", ";", "TypeReference", "argumentType", "=", "argument", ".", "type", ";", "argumentTypes", "[", "i", "]", "=", "returnTypeName", "(", "argumentType", ")", ";", "argumentNames", "[", "i", "]", "=", "argument", ".", "name", ";", "argumentNameStarts", "[", "i", "]", "=", "argument", ".", "sourceStart", ";", "argumentNameEnds", "[", "i", "]", "=", "argument", ".", "sourceEnd", ";", "argumentTypeStarts", "[", "i", "]", "=", "argumentType", ".", "sourceStart", ";", "argumentTypeEnds", "[", "i", "]", "=", "argumentType", ".", "sourceEnd", ";", "}", "}", "TypeReference", "[", "]", "thrownExceptions", "=", "md", ".", "thrownExceptions", ";", "char", "[", "]", "[", "]", "exceptionTypes", "=", "null", ";", "int", "[", "]", "exceptionTypeStarts", "=", "null", ";", "int", "[", "]", "exceptionTypeEnds", "=", "null", ";", "if", "(", "thrownExceptions", "!=", "null", ")", "{", "int", "thrownExceptionLength", "=", "thrownExceptions", ".", "length", ";", "exceptionTypeStarts", "=", "new", "int", "[", "thrownExceptionLength", "]", ";", "exceptionTypeEnds", "=", "new", "int", "[", "thrownExceptionLength", "]", ";", "exceptionTypes", "=", "new", "char", "[", "thrownExceptionLength", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "thrownExceptionLength", ";", "i", "++", ")", "{", "TypeReference", "exception", "=", "thrownExceptions", "[", "i", "]", ";", "exceptionTypes", "[", "i", "]", "=", "CharOperation", ".", "concatWith", "(", "exception", ".", "getTypeName", "(", ")", ",", "'.'", ")", ";", "exceptionTypeStarts", "[", "i", "]", "=", "exception", ".", "sourceStart", ";", "exceptionTypeEnds", "[", "i", "]", "=", "exception", ".", "sourceEnd", ";", "}", "}", "this", ".", "requestor", ".", "enterMethod", "(", "md", ".", "declarationSourceStart", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "md", ".", "modifiers", ",", "md", ".", "modifiersSourceStart", ",", "returnTypeName", ",", "returnType", ".", "sourceStart", ",", "returnType", ".", "sourceEnd", ",", "this", ".", "typeDims", ",", "md", ".", "selector", ",", "md", ".", "sourceStart", ",", "(", "int", ")", "(", "this", ".", "selectorSourcePositions", "&", "0xFFFFFFFFL", ")", ",", "argumentTypes", ",", "argumentTypeStarts", ",", "argumentTypeEnds", ",", "argumentNames", ",", "argumentNameStarts", ",", "argumentNameEnds", ",", "this", ".", "rParenPos", ",", "this", ".", "extendsDim", ",", "this", ".", "extendsDim", "==", "0", "?", "-", "1", ":", "this", ".", "endPosition", ",", "exceptionTypes", ",", "exceptionTypeStarts", ",", "exceptionTypeEnds", ",", "this", ".", "scanner", ".", "currentPosition", "-", "1", ")", ";", "}", "protected", "void", "consumeMethodHeaderExtendedDims", "(", ")", "{", "MethodDeclaration", "md", "=", "(", "MethodDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "int", "extendedDims", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "this", ".", "extendsDim", "=", "extendedDims", ";", "if", "(", "extendedDims", "!=", "0", ")", "{", "TypeReference", "returnType", "=", "md", ".", "returnType", ";", "md", ".", "sourceEnd", "=", "this", ".", "endPosition", ";", "int", "dims", "=", "returnType", ".", "dimensions", "(", ")", "+", "extendedDims", ";", "md", ".", "returnType", "=", "copyDims", "(", "returnType", ",", "dims", ")", ";", "if", "(", "this", ".", "currentToken", "==", "TokenNameLBRACE", ")", "{", "md", ".", "bodyStart", "=", "this", ".", "endPosition", "+", "1", ";", "}", "}", "}", "protected", "void", "consumeMethodHeaderName", "(", "boolean", "isAnnotationMethod", ")", "{", "MethodDeclaration", "md", "=", "null", ";", "if", "(", "isAnnotationMethod", ")", "{", "md", "=", "new", "AnnotationMethodDeclaration", "(", "this", ".", "compilationUnit", ".", "compilationResult", ")", ";", "}", "else", "{", "md", "=", "new", "MethodDeclaration", "(", "this", ".", "compilationUnit", ".", "compilationResult", ")", ";", "}", "md", ".", "selector", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ";", "this", ".", "selectorSourcePositions", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "this", ".", "identifierLengthPtr", "--", ";", "md", ".", "returnType", "=", "getTypeReference", "(", "this", ".", "typeDims", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ")", ";", "md", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "md", ".", "modifiersSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "md", ".", "modifiers", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "(", "this", ".", "expressionPtr", "-=", "length", ")", "+", "1", ",", "md", ".", "annotations", "=", "new", "Annotation", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "md", ".", "javadoc", "=", "this", ".", "javadoc", ";", "this", ".", "javadoc", "=", "null", ";", "md", ".", "sourceStart", "=", "(", "int", ")", "(", "this", ".", "selectorSourcePositions", ">>>", "32", ")", ";", "pushOnAstStack", "(", "md", ")", ";", "md", ".", "bodyStart", "=", "this", ".", "scanner", ".", "currentPosition", "-", "1", ";", "}", "protected", "void", "consumeModifiers", "(", ")", "{", "checkComment", "(", ")", ";", "pushOnIntStack", "(", "this", ".", "modifiers", ")", ";", "pushOnIntStack", "(", "this", ".", "modifiersSourceStart", ")", ";", "pushOnIntStack", "(", "this", ".", "declarationSourceStart", ">=", "0", "?", "this", ".", "declarationSourceStart", ":", "this", ".", "modifiersSourceStart", ")", ";", "resetModifiers", "(", ")", ";", "}", "protected", "void", "consumePackageComment", "(", ")", "{", "if", "(", "this", ".", "options", ".", "sourceLevel", ">=", "ClassFileConstants", ".", "JDK1_5", ")", "{", "checkComment", "(", ")", ";", "}", "else", "{", "pushOnIntArrayStack", "(", "getJavaDocPositions", "(", ")", ")", ";", "}", "resetModifiers", "(", ")", ";", "}", "protected", "void", "consumePackageDeclarationName", "(", ")", "{", "super", ".", "consumePackageDeclarationName", "(", ")", ";", "ImportReference", "importReference", "=", "this", ".", "compilationUnit", ".", "currentPackage", ";", "this", ".", "requestor", ".", "acceptPackage", "(", "importReference", ".", "declarationSourceStart", ",", "importReference", ".", "declarationSourceEnd", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "CharOperation", ".", "concatWith", "(", "importReference", ".", "getImportName", "(", ")", ",", "'.'", ")", ",", "importReference", ".", "sourceStart", ")", ";", "}", "protected", "void", "consumePackageDeclarationNameWithModifiers", "(", ")", "{", "super", ".", "consumePackageDeclarationNameWithModifiers", "(", ")", ";", "ImportReference", "importReference", "=", "this", ".", "compilationUnit", ".", "currentPackage", ";", "this", ".", "requestor", ".", "acceptPackage", "(", "importReference", ".", "declarationSourceStart", ",", "importReference", ".", "declarationSourceEnd", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "CharOperation", ".", "concatWith", "(", "importReference", ".", "getImportName", "(", ")", ",", "'.'", ")", ",", "importReference", ".", "sourceStart", ")", ";", "}", "protected", "void", "consumePushModifiers", "(", ")", "{", "checkComment", "(", ")", ";", "pushOnIntStack", "(", "this", ".", "modifiers", ")", ";", "if", "(", "this", ".", "modifiersSourceStart", "<", "0", ")", "{", "pushOnIntStack", "(", "-", "1", ")", ";", "pushOnIntStack", "(", "this", ".", "declarationSourceStart", ">=", "0", "?", "this", ".", "declarationSourceStart", ":", "this", ".", "scanner", ".", "startPosition", ")", ";", "}", "else", "{", "pushOnIntStack", "(", "this", ".", "modifiersSourceStart", ")", ";", "pushOnIntStack", "(", "this", ".", "declarationSourceStart", ">=", "0", "?", "this", ".", "declarationSourceStart", ":", "this", ".", "modifiersSourceStart", ")", ";", "}", "resetModifiers", "(", ")", ";", "pushOnExpressionStackLengthStack", "(", "0", ")", ";", "}", "protected", "void", "consumePushRealModifiers", "(", ")", "{", "checkComment", "(", ")", ";", "pushOnIntStack", "(", "this", ".", "modifiers", ")", ";", "if", "(", "this", ".", "modifiersSourceStart", "<", "0", ")", "{", "pushOnIntStack", "(", "-", "1", ")", ";", "pushOnIntStack", "(", "this", ".", "declarationSourceStart", ">=", "0", "?", "this", ".", "declarationSourceStart", ":", "this", ".", "scanner", ".", "startPosition", ")", ";", "}", "else", "{", "pushOnIntStack", "(", "this", ".", "modifiersSourceStart", ")", ";", "pushOnIntStack", "(", "this", ".", "declarationSourceStart", ">=", "0", "?", "this", ".", "declarationSourceStart", ":", "this", ".", "modifiersSourceStart", ")", ";", "}", "resetModifiers", "(", ")", ";", "}", "protected", "void", "consumeSingleStaticImportDeclarationName", "(", ")", "{", "pushOnIntArrayStack", "(", "getJavaDocPositions", "(", ")", ")", ";", "super", ".", "consumeSingleStaticImportDeclarationName", "(", ")", ";", "ImportReference", "importReference", "=", "(", "ImportReference", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "this", ".", "requestor", ".", "acceptImport", "(", "importReference", ".", "declarationSourceStart", ",", "importReference", ".", "declarationSourceEnd", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "CharOperation", ".", "concatWith", "(", "importReference", ".", "getImportName", "(", ")", ",", "'.'", ")", ",", "importReference", ".", "sourceStart", ",", "false", ",", "ClassFileConstants", ".", "AccStatic", ")", ";", "}", "protected", "void", "consumeSingleTypeImportDeclarationName", "(", ")", "{", "pushOnIntArrayStack", "(", "getJavaDocPositions", "(", ")", ")", ";", "super", ".", "consumeSingleTypeImportDeclarationName", "(", ")", ";", "ImportReference", "importReference", "=", "(", "ImportReference", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "this", ".", "requestor", ".", "acceptImport", "(", "importReference", ".", "declarationSourceStart", ",", "importReference", ".", "declarationSourceEnd", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "CharOperation", ".", "concatWith", "(", "importReference", ".", "getImportName", "(", ")", ",", "'.'", ")", ",", "importReference", ".", "sourceStart", ",", "false", ",", "ClassFileConstants", ".", "AccDefault", ")", ";", "}", "protected", "void", "consumeStaticImportOnDemandDeclarationName", "(", ")", "{", "pushOnIntArrayStack", "(", "getJavaDocPositions", "(", ")", ")", ";", "super", ".", "consumeStaticImportOnDemandDeclarationName", "(", ")", ";", "ImportReference", "importReference", "=", "(", "ImportReference", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "this", ".", "requestor", ".", "acceptImport", "(", "importReference", ".", "declarationSourceStart", ",", "importReference", ".", "declarationSourceEnd", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "CharOperation", ".", "concatWith", "(", "importReference", ".", "getImportName", "(", ")", ",", "'.'", ")", ",", "importReference", ".", "sourceStart", ",", "true", ",", "ClassFileConstants", ".", "AccStatic", ")", ";", "}", "protected", "void", "consumeStaticInitializer", "(", ")", "{", "super", ".", "consumeStaticInitializer", "(", ")", ";", "Initializer", "initializer", "=", "(", "Initializer", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "this", ".", "requestor", ".", "acceptInitializer", "(", "initializer", ".", "declarationSourceStart", ",", "initializer", ".", "declarationSourceEnd", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "ClassFileConstants", ".", "AccStatic", ",", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ",", "initializer", ".", "block", ".", "sourceStart", ",", "initializer", ".", "declarationSourceEnd", ")", ";", "}", "protected", "void", "consumeStaticOnly", "(", ")", "{", "checkComment", "(", ")", ";", "pushOnIntStack", "(", "this", ".", "modifiersSourceStart", ")", ";", "pushOnIntStack", "(", "this", ".", "scanner", ".", "currentPosition", ")", ";", "pushOnIntStack", "(", "this", ".", "declarationSourceStart", ">=", "0", "?", "this", ".", "declarationSourceStart", ":", "this", ".", "modifiersSourceStart", ")", ";", "jumpOverMethodBody", "(", ")", ";", "this", ".", "nestedMethod", "[", "this", ".", "nestedType", "]", "++", ";", "resetModifiers", "(", ")", ";", "}", "protected", "void", "consumeTypeImportOnDemandDeclarationName", "(", ")", "{", "pushOnIntArrayStack", "(", "getJavaDocPositions", "(", ")", ")", ";", "super", ".", "consumeTypeImportOnDemandDeclarationName", "(", ")", ";", "ImportReference", "importReference", "=", "(", "ImportReference", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "this", ".", "requestor", ".", "acceptImport", "(", "importReference", ".", "declarationSourceStart", ",", "importReference", ".", "declarationSourceEnd", ",", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "--", "]", ",", "CharOperation", ".", "concatWith", "(", "importReference", ".", "getImportName", "(", ")", ",", "'.'", ")", ",", "importReference", ".", "sourceStart", ",", "true", ",", "ClassFileConstants", ".", "AccDefault", ")", ";", "}", "public", "int", "flushCommentsDefinedPriorTo", "(", "int", "position", ")", "{", "return", "this", ".", "lastFieldEndPosition", "=", "super", ".", "flushCommentsDefinedPriorTo", "(", "position", ")", ";", "}", "public", "CompilationUnitDeclaration", "endParse", "(", "int", "act", ")", "{", "if", "(", "this", ".", "scanner", ".", "recordLineSeparator", ")", "{", "this", ".", "requestor", ".", "acceptLineSeparatorPositions", "(", "this", ".", "scanner", ".", "getLineEnds", "(", ")", ")", ";", "}", "return", "super", ".", "endParse", "(", "act", ")", ";", "}", "public", "void", "initialize", "(", "boolean", "initializeNLS", ")", "{", "super", ".", "initialize", "(", "initializeNLS", ")", ";", "this", ".", "intArrayPtr", "=", "-", "1", ";", "}", "public", "void", "initialize", "(", ")", "{", "super", ".", "initialize", "(", ")", ";", "this", ".", "intArrayPtr", "=", "-", "1", ";", "}", "private", "boolean", "isLocalDeclaration", "(", ")", "{", "int", "nestedDepth", "=", "this", ".", "nestedType", ";", "while", "(", "nestedDepth", ">=", "0", ")", "{", "if", "(", "this", ".", "nestedMethod", "[", "nestedDepth", "]", "!=", "0", ")", "{", "return", "true", ";", "}", "nestedDepth", "--", ";", "}", "return", "false", ";", "}", "protected", "void", "parse", "(", ")", "{", "this", ".", "diet", "=", "true", ";", "super", ".", "parse", "(", ")", ";", "}", "public", "void", "parseCompilationUnit", "(", "ICompilationUnit", "unit", ")", "{", "char", "[", "]", "regionSource", "=", "unit", ".", "getContents", "(", ")", ";", "try", "{", "initialize", "(", "true", ")", ";", "goForCompilationUnit", "(", ")", ";", "this", ".", "referenceContext", "=", "this", ".", "compilationUnit", "=", "new", "CompilationUnitDeclaration", "(", "problemReporter", "(", ")", ",", "new", "CompilationResult", "(", "unit", ",", "0", ",", "0", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "0", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "setSource", "(", "regionSource", ")", ";", "parse", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "ex", ")", "{", "}", "}", "public", "void", "parseConstructor", "(", "char", "[", "]", "regionSource", ")", "{", "try", "{", "initialize", "(", ")", ";", "goForClassBodyDeclarations", "(", ")", ";", "this", ".", "referenceContext", "=", "this", ".", "compilationUnit", "=", "new", "CompilationUnitDeclaration", "(", "problemReporter", "(", ")", ",", "new", "CompilationResult", "(", "regionSource", ",", "0", ",", "0", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "0", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "setSource", "(", "regionSource", ")", ";", "parse", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "ex", ")", "{", "}", "}", "public", "void", "parseField", "(", "char", "[", "]", "regionSource", ")", "{", "try", "{", "initialize", "(", ")", ";", "goForFieldDeclaration", "(", ")", ";", "this", ".", "referenceContext", "=", "this", ".", "compilationUnit", "=", "new", "CompilationUnitDeclaration", "(", "problemReporter", "(", ")", ",", "new", "CompilationResult", "(", "regionSource", ",", "0", ",", "0", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "0", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "setSource", "(", "regionSource", ")", ";", "parse", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "ex", ")", "{", "}", "}", "public", "void", "parseImport", "(", "char", "[", "]", "regionSource", ")", "{", "try", "{", "initialize", "(", ")", ";", "goForImportDeclaration", "(", ")", ";", "this", ".", "referenceContext", "=", "this", ".", "compilationUnit", "=", "new", "CompilationUnitDeclaration", "(", "problemReporter", "(", ")", ",", "new", "CompilationResult", "(", "regionSource", ",", "0", ",", "0", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "0", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "setSource", "(", "regionSource", ")", ";", "parse", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "ex", ")", "{", "}", "}", "public", "void", "parseInitializer", "(", "char", "[", "]", "regionSource", ")", "{", "try", "{", "initialize", "(", ")", ";", "goForInitializer", "(", ")", ";", "this", ".", "referenceContext", "=", "this", ".", "compilationUnit", "=", "new", "CompilationUnitDeclaration", "(", "problemReporter", "(", ")", ",", "new", "CompilationResult", "(", "regionSource", ",", "0", ",", "0", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "0", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "setSource", "(", "regionSource", ")", ";", "parse", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "ex", ")", "{", "}", "}", "public", "void", "parseMethod", "(", "char", "[", "]", "regionSource", ")", "{", "try", "{", "initialize", "(", ")", ";", "goForGenericMethodDeclaration", "(", ")", ";", "this", ".", "referenceContext", "=", "this", ".", "compilationUnit", "=", "new", "CompilationUnitDeclaration", "(", "problemReporter", "(", ")", ",", "new", "CompilationResult", "(", "regionSource", ",", "0", ",", "0", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "0", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "setSource", "(", "regionSource", ")", ";", "parse", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "ex", ")", "{", "}", "}", "public", "void", "parsePackage", "(", "char", "[", "]", "regionSource", ")", "{", "try", "{", "initialize", "(", ")", ";", "goForPackageDeclaration", "(", ")", ";", "this", ".", "referenceContext", "=", "this", ".", "compilationUnit", "=", "new", "CompilationUnitDeclaration", "(", "problemReporter", "(", ")", ",", "new", "CompilationResult", "(", "regionSource", ",", "0", ",", "0", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "0", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "setSource", "(", "regionSource", ")", ";", "parse", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "ex", ")", "{", "}", "}", "public", "void", "parseType", "(", "char", "[", "]", "regionSource", ")", "{", "try", "{", "initialize", "(", ")", ";", "goForTypeDeclaration", "(", ")", ";", "this", ".", "referenceContext", "=", "this", ".", "compilationUnit", "=", "new", "CompilationUnitDeclaration", "(", "problemReporter", "(", ")", ",", "new", "CompilationResult", "(", "regionSource", ",", "0", ",", "0", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "0", ",", "regionSource", ".", "length", ")", ";", "this", ".", "scanner", ".", "setSource", "(", "regionSource", ")", ";", "parse", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "ex", ")", "{", "}", "}", "public", "ProblemReporter", "problemReporter", "(", ")", "{", "this", ".", "problemReporter", ".", "referenceContext", "=", "this", ".", "referenceContext", ";", "return", "this", ".", "problemReporter", ";", "}", "protected", "void", "pushOnIntArrayStack", "(", "int", "[", "]", "positions", ")", "{", "int", "stackLength", "=", "this", ".", "intArrayStack", ".", "length", ";", "if", "(", "++", "this", ".", "intArrayPtr", ">=", "stackLength", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "intArrayStack", ",", "0", ",", "this", ".", "intArrayStack", "=", "new", "int", "[", "stackLength", "+", "StackIncrement", "]", "[", "]", ",", "0", ",", "stackLength", ")", ";", "}", "this", ".", "intArrayStack", "[", "this", ".", "intArrayPtr", "]", "=", "positions", ";", "}", "protected", "void", "resetModifiers", "(", ")", "{", "super", ".", "resetModifiers", "(", ")", ";", "this", ".", "declarationSourceStart", "=", "-", "1", ";", "}", "protected", "boolean", "resumeOnSyntaxError", "(", ")", "{", "return", "false", ";", "}", "private", "char", "[", "]", "returnTypeName", "(", "TypeReference", "type", ")", "{", "int", "dimension", "=", "type", ".", "dimensions", "(", ")", ";", "if", "(", "dimension", "!=", "0", ")", "{", "char", "[", "]", "dimensionsArray", "=", "new", "char", "[", "dimension", "*", "2", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dimension", ";", "i", "++", ")", "{", "dimensionsArray", "[", "i", "*", "2", "]", "=", "'['", ";", "dimensionsArray", "[", "(", "i", "*", "2", ")", "+", "1", "]", "=", "']'", ";", "}", "return", "CharOperation", ".", "concat", "(", "CharOperation", ".", "concatWith", "(", "type", ".", "getTypeName", "(", ")", ",", "'.'", ")", ",", "dimensionsArray", ")", ";", "}", "return", "CharOperation", ".", "concatWith", "(", "type", ".", "getTypeName", "(", ")", ",", "'.'", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"\"", "+", "this", ".", "intArrayPtr", "+", "\"n\"", ")", ";", "buffer", ".", "append", "(", "super", ".", "toString", "(", ")", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "protected", "TypeReference", "typeReference", "(", "int", "dim", ",", "int", "localIdentifierPtr", ",", "int", "localIdentifierLengthPtr", ")", "{", "int", "length", ";", "TypeReference", "ref", ";", "if", "(", "(", "length", "=", "this", ".", "identifierLengthStack", "[", "localIdentifierLengthPtr", "]", ")", "==", "1", ")", "{", "if", "(", "dim", "==", "0", ")", "{", "ref", "=", "new", "SingleTypeReference", "(", "this", ".", "identifierStack", "[", "localIdentifierPtr", "]", ",", "this", ".", "identifierPositionStack", "[", "localIdentifierPtr", "--", "]", ")", ";", "}", "else", "{", "ref", "=", "new", "ArrayTypeReference", "(", "this", ".", "identifierStack", "[", "localIdentifierPtr", "]", ",", "dim", ",", "this", ".", "identifierPositionStack", "[", "localIdentifierPtr", "--", "]", ")", ";", "ref", ".", "sourceEnd", "=", "this", ".", "endPosition", ";", "}", "}", "else", "{", "if", "(", "length", "<", "0", ")", "{", "ref", "=", "TypeReference", ".", "baseTypeReference", "(", "-", "length", ",", "dim", ")", ";", "ref", ".", "sourceStart", "=", "this", ".", "intStack", "[", "this", ".", "localIntPtr", "--", "]", ";", "if", "(", "dim", "==", "0", ")", "{", "ref", ".", "sourceEnd", "=", "this", ".", "intStack", "[", "this", ".", "localIntPtr", "--", "]", ";", "}", "else", "{", "this", ".", "localIntPtr", "--", ";", "ref", ".", "sourceEnd", "=", "this", ".", "endPosition", ";", "}", "}", "else", "{", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "length", "]", "[", "]", ";", "localIdentifierPtr", "-=", "length", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierStack", ",", "localIdentifierPtr", "+", "1", ",", "tokens", ",", "0", ",", "length", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "localIdentifierPtr", "+", "1", ",", "positions", ",", "0", ",", "length", ")", ";", "if", "(", "dim", "==", "0", ")", "ref", "=", "new", "QualifiedTypeReference", "(", "tokens", ",", "positions", ")", ";", "else", "ref", "=", "new", "ArrayQualifiedTypeReference", "(", "tokens", ",", "dim", ",", "positions", ")", ";", "}", "}", "return", "ref", ";", "}", "}", "</s>" ]
3,939
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryNestedType", ";", "public", "final", "class", "ExtraFlags", "{", "public", "final", "static", "int", "HasNonPrivateStaticMemberTypes", "=", "0x0001", ";", "public", "final", "static", "int", "IsMemberType", "=", "0x0002", ";", "public", "final", "static", "int", "IsLocalType", "=", "0x0004", ";", "public", "final", "static", "int", "ParameterTypesStoredAsSignature", "=", "0x0010", ";", "public", "static", "int", "getExtraFlags", "(", "ClassFileReader", "reader", ")", "{", "int", "extraFlags", "=", "0", ";", "if", "(", "reader", ".", "isNestedType", "(", ")", ")", "{", "extraFlags", "|=", "ExtraFlags", ".", "IsMemberType", ";", "}", "if", "(", "reader", ".", "isLocal", "(", ")", ")", "{", "extraFlags", "|=", "ExtraFlags", ".", "IsLocalType", ";", "}", "IBinaryNestedType", "[", "]", "memberTypes", "=", "reader", ".", "getMemberTypes", "(", ")", ";", "int", "memberTypeCounter", "=", "memberTypes", "==", "null", "?", "0", ":", "memberTypes", ".", "length", ";", "if", "(", "memberTypeCounter", ">", "0", ")", "{", "done", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<", "memberTypeCounter", ";", "i", "++", ")", "{", "int", "modifiers", "=", "memberTypes", "[", "i", "]", ".", "getModifiers", "(", ")", ";", "if", "(", "(", "modifiers", "&", "ClassFileConstants", ".", "AccStatic", ")", "!=", "0", "&&", "(", "modifiers", "&", "ClassFileConstants", ".", "AccPrivate", ")", "==", "0", ")", "{", "extraFlags", "|=", "ExtraFlags", ".", "HasNonPrivateStaticMemberTypes", ";", "break", "done", ";", "}", "}", "}", "return", "extraFlags", ";", "}", "public", "static", "int", "getExtraFlags", "(", "IType", "type", ")", "throws", "JavaModelException", "{", "int", "extraFlags", "=", "0", ";", "if", "(", "type", ".", "isMember", "(", ")", ")", "{", "extraFlags", "|=", "ExtraFlags", ".", "IsMemberType", ";", "}", "if", "(", "type", ".", "isLocal", "(", ")", ")", "{", "extraFlags", "|=", "ExtraFlags", ".", "IsLocalType", ";", "}", "IType", "[", "]", "memberTypes", "=", "type", ".", "getTypes", "(", ")", ";", "int", "memberTypeCounter", "=", "memberTypes", "==", "null", "?", "0", ":", "memberTypes", ".", "length", ";", "if", "(", "memberTypeCounter", ">", "0", ")", "{", "done", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<", "memberTypeCounter", ";", "i", "++", ")", "{", "int", "flags", "=", "memberTypes", "[", "i", "]", ".", "getFlags", "(", ")", ";", "if", "(", "(", "flags", "&", "ClassFileConstants", ".", "AccStatic", ")", "!=", "0", "&&", "(", "flags", "&", "ClassFileConstants", ".", "AccPrivate", ")", "==", "0", ")", "{", "extraFlags", "|=", "ExtraFlags", ".", "HasNonPrivateStaticMemberTypes", ";", "break", "done", ";", "}", "}", "}", "return", "extraFlags", ";", "}", "public", "static", "int", "getExtraFlags", "(", "TypeDeclaration", "typeDeclaration", ")", "{", "int", "extraFlags", "=", "0", ";", "if", "(", "typeDeclaration", ".", "enclosingType", "!=", "null", ")", "{", "extraFlags", "|=", "ExtraFlags", ".", "IsMemberType", ";", "}", "TypeDeclaration", "[", "]", "memberTypes", "=", "typeDeclaration", ".", "memberTypes", ";", "int", "memberTypeCounter", "=", "memberTypes", "==", "null", "?", "0", ":", "memberTypes", ".", "length", ";", "if", "(", "memberTypeCounter", ">", "0", ")", "{", "done", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<", "memberTypeCounter", ";", "i", "++", ")", "{", "int", "modifiers", "=", "memberTypes", "[", "i", "]", ".", "modifiers", ";", "if", "(", "(", "modifiers", "&", "ClassFileConstants", ".", "AccStatic", ")", "!=", "0", "&&", "(", "modifiers", "&", "ClassFileConstants", ".", "AccPrivate", ")", "==", "0", ")", "{", "extraFlags", "|=", "ExtraFlags", ".", "HasNonPrivateStaticMemberTypes", ";", "break", "done", ";", "}", "}", "}", "return", "extraFlags", ";", "}", "}", "</s>" ]
3,940
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ImportReference", ";", "public", "class", "SourceElementRequestorAdapter", "implements", "ISourceElementRequestor", "{", "public", "void", "acceptAnnotationTypeReference", "(", "char", "[", "]", "[", "]", "typeName", ",", "int", "sourceStart", ",", "int", "sourceEnd", ")", "{", "}", "public", "void", "acceptAnnotationTypeReference", "(", "char", "[", "]", "typeName", ",", "int", "sourcePosition", ")", "{", "}", "public", "void", "acceptConstructorReference", "(", "char", "[", "]", "typeName", ",", "int", "argCount", ",", "int", "sourcePosition", ")", "{", "}", "public", "void", "acceptFieldReference", "(", "char", "[", "]", "fieldName", ",", "int", "sourcePosition", ")", "{", "}", "public", "void", "acceptImport", "(", "int", "declarationStart", ",", "int", "declarationEnd", ",", "int", "nameStart", ",", "int", "nameEnd", ",", "char", "[", "]", "[", "]", "tokens", ",", "boolean", "onDemand", ",", "int", "modifiers", ")", "{", "}", "public", "void", "acceptLineSeparatorPositions", "(", "int", "[", "]", "positions", ")", "{", "}", "public", "void", "acceptMethodReference", "(", "char", "[", "]", "methodName", ",", "int", "argCount", ",", "int", "sourcePosition", ")", "{", "}", "public", "void", "acceptPackage", "(", "ImportReference", "importReference", ")", "{", "}", "public", "void", "acceptProblem", "(", "CategorizedProblem", "problem", ")", "{", "}", "public", "void", "acceptTypeReference", "(", "char", "[", "]", "[", "]", "typeName", ",", "int", "sourceStart", ",", "int", "sourceEnd", ")", "{", "}", "public", "void", "acceptTypeReference", "(", "char", "[", "]", "typeName", ",", "int", "sourcePosition", ")", "{", "}", "public", "void", "acceptUnknownReference", "(", "char", "[", "]", "[", "]", "name", ",", "int", "sourceStart", ",", "int", "sourceEnd", ")", "{", "}", "public", "void", "acceptUnknownReference", "(", "char", "[", "]", "name", ",", "int", "sourcePosition", ")", "{", "}", "public", "void", "enterCompilationUnit", "(", ")", "{", "}", "public", "void", "enterConstructor", "(", "MethodInfo", "methodInfo", ")", "{", "}", "public", "void", "enterField", "(", "FieldInfo", "fieldInfo", ")", "{", "}", "public", "void", "enterInitializer", "(", "int", "declarationStart", ",", "int", "modifiers", ")", "{", "}", "public", "void", "enterMethod", "(", "MethodInfo", "methodInfo", ")", "{", "}", "public", "void", "enterType", "(", "TypeInfo", "typeInfo", ")", "{", "}", "public", "void", "exitCompilationUnit", "(", "int", "declarationEnd", ")", "{", "}", "public", "void", "exitConstructor", "(", "int", "declarationEnd", ")", "{", "}", "public", "void", "exitField", "(", "int", "initializationStart", ",", "int", "declarationEnd", ",", "int", "declarationSourceEnd", ")", "{", "}", "public", "void", "exitInitializer", "(", "int", "declarationEnd", ")", "{", "}", "public", "void", "exitMethod", "(", "int", "declarationEnd", ",", "Expression", "defaultValue", ")", "{", "}", "public", "void", "exitType", "(", "int", "declarationEnd", ")", "{", "}", "}", "</s>" ]
3,941
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Signature", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayQualifiedTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ImportReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ParameterizedQualifiedTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ParameterizedSingleTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SingleTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeParameter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Wildcard", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemReporter", ";", "public", "abstract", "class", "TypeConverter", "{", "int", "namePos", ";", "protected", "ProblemReporter", "problemReporter", ";", "protected", "boolean", "has1_5Compliance", ";", "private", "char", "memberTypeSeparator", ";", "protected", "TypeConverter", "(", "ProblemReporter", "problemReporter", ",", "char", "memberTypeSeparator", ")", "{", "this", ".", "problemReporter", "=", "problemReporter", ";", "this", ".", "has1_5Compliance", "=", "problemReporter", ".", "options", ".", "originalComplianceLevel", ">=", "ClassFileConstants", ".", "JDK1_5", ";", "this", ".", "memberTypeSeparator", "=", "memberTypeSeparator", ";", "}", "private", "void", "addIdentifiers", "(", "String", "typeSignature", ",", "int", "start", ",", "int", "endExclusive", ",", "int", "identCount", ",", "ArrayList", "fragments", ")", "{", "if", "(", "identCount", "==", "1", ")", "{", "char", "[", "]", "identifier", ";", "typeSignature", ".", "getChars", "(", "start", ",", "endExclusive", ",", "identifier", "=", "new", "char", "[", "endExclusive", "-", "start", "]", ",", "0", ")", ";", "fragments", ".", "add", "(", "identifier", ")", ";", "}", "else", "fragments", ".", "add", "(", "extractIdentifiers", "(", "typeSignature", ",", "start", ",", "endExclusive", "-", "1", ",", "identCount", ")", ")", ";", "}", "protected", "ImportReference", "createImportReference", "(", "String", "[", "]", "importName", ",", "int", "start", ",", "int", "end", ",", "boolean", "onDemand", ",", "int", "modifiers", ")", "{", "int", "length", "=", "importName", ".", "length", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "long", "position", "=", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ";", "char", "[", "]", "[", "]", "qImportName", "=", "new", "char", "[", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "qImportName", "[", "i", "]", "=", "importName", "[", "i", "]", ".", "toCharArray", "(", ")", ";", "positions", "[", "i", "]", "=", "position", ";", "}", "return", "new", "ImportReference", "(", "qImportName", ",", "positions", ",", "onDemand", ",", "modifiers", ")", ";", "}", "protected", "TypeParameter", "createTypeParameter", "(", "char", "[", "]", "typeParameterName", ",", "char", "[", "]", "[", "]", "typeParameterBounds", ",", "int", "start", ",", "int", "end", ")", "{", "TypeParameter", "parameter", "=", "new", "TypeParameter", "(", ")", ";", "parameter", ".", "name", "=", "typeParameterName", ";", "parameter", ".", "sourceStart", "=", "start", ";", "parameter", ".", "sourceEnd", "=", "end", ";", "if", "(", "typeParameterBounds", "!=", "null", ")", "{", "int", "length", "=", "typeParameterBounds", ".", "length", ";", "if", "(", "length", ">", "0", ")", "{", "parameter", ".", "type", "=", "createTypeReference", "(", "typeParameterBounds", "[", "0", "]", ",", "start", ",", "end", ")", ";", "if", "(", "length", ">", "1", ")", "{", "parameter", ".", "bounds", "=", "new", "TypeReference", "[", "length", "-", "1", "]", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "length", ";", "i", "++", ")", "{", "TypeReference", "bound", "=", "createTypeReference", "(", "typeParameterBounds", "[", "i", "]", ",", "start", ",", "end", ")", ";", "bound", ".", "bits", "|=", "ASTNode", ".", "IsSuperType", ";", "parameter", ".", "bounds", "[", "i", "-", "1", "]", "=", "bound", ";", "}", "}", "}", "}", "return", "parameter", ";", "}", "protected", "TypeReference", "createTypeReference", "(", "char", "[", "]", "typeName", ",", "int", "start", ",", "int", "end", ",", "boolean", "includeGenericsAnyway", ")", "{", "int", "length", "=", "typeName", ".", "length", ";", "this", ".", "namePos", "=", "0", ";", "return", "decodeType", "(", "typeName", ",", "length", ",", "start", ",", "end", ",", "true", ")", ";", "}", "protected", "TypeReference", "createTypeReference", "(", "char", "[", "]", "typeName", ",", "int", "start", ",", "int", "end", ")", "{", "int", "length", "=", "typeName", ".", "length", ";", "this", ".", "namePos", "=", "0", ";", "return", "decodeType", "(", "typeName", ",", "length", ",", "start", ",", "end", ",", "false", ")", ";", "}", "protected", "TypeReference", "createTypeReference", "(", "String", "typeSignature", ",", "int", "start", ",", "int", "end", ")", "{", "int", "length", "=", "typeSignature", ".", "length", "(", ")", ";", "this", ".", "namePos", "=", "0", ";", "return", "decodeType", "(", "typeSignature", ",", "length", ",", "start", ",", "end", ")", ";", "}", "private", "TypeReference", "decodeType", "(", "String", "typeSignature", ",", "int", "length", ",", "int", "start", ",", "int", "end", ")", "{", "int", "identCount", "=", "1", ";", "int", "dim", "=", "0", ";", "int", "nameFragmentStart", "=", "this", ".", "namePos", ",", "nameFragmentEnd", "=", "-", "1", ";", "boolean", "nameStarted", "=", "false", ";", "ArrayList", "fragments", "=", "null", ";", "typeLoop", ":", "while", "(", "this", ".", "namePos", "<", "length", ")", "{", "char", "currentChar", "=", "typeSignature", ".", "charAt", "(", "this", ".", "namePos", ")", ";", "switch", "(", "currentChar", ")", "{", "case", "Signature", ".", "C_BOOLEAN", ":", "if", "(", "!", "nameStarted", ")", "{", "this", ".", "namePos", "++", ";", "if", "(", "dim", "==", "0", ")", "return", "new", "SingleTypeReference", "(", "TypeBinding", ".", "BOOLEAN", ".", "simpleName", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "else", "return", "new", "ArrayTypeReference", "(", "TypeBinding", ".", "BOOLEAN", ".", "simpleName", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "break", ";", "case", "Signature", ".", "C_BYTE", ":", "if", "(", "!", "nameStarted", ")", "{", "this", ".", "namePos", "++", ";", "if", "(", "dim", "==", "0", ")", "return", "new", "SingleTypeReference", "(", "TypeBinding", ".", "BYTE", ".", "simpleName", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "else", "return", "new", "ArrayTypeReference", "(", "TypeBinding", ".", "BYTE", ".", "simpleName", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "break", ";", "case", "Signature", ".", "C_CHAR", ":", "if", "(", "!", "nameStarted", ")", "{", "this", ".", "namePos", "++", ";", "if", "(", "dim", "==", "0", ")", "return", "new", "SingleTypeReference", "(", "TypeBinding", ".", "CHAR", ".", "simpleName", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "else", "return", "new", "ArrayTypeReference", "(", "TypeBinding", ".", "CHAR", ".", "simpleName", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "break", ";", "case", "Signature", ".", "C_DOUBLE", ":", "if", "(", "!", "nameStarted", ")", "{", "this", ".", "namePos", "++", ";", "if", "(", "dim", "==", "0", ")", "return", "new", "SingleTypeReference", "(", "TypeBinding", ".", "DOUBLE", ".", "simpleName", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "else", "return", "new", "ArrayTypeReference", "(", "TypeBinding", ".", "DOUBLE", ".", "simpleName", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "break", ";", "case", "Signature", ".", "C_FLOAT", ":", "if", "(", "!", "nameStarted", ")", "{", "this", ".", "namePos", "++", ";", "if", "(", "dim", "==", "0", ")", "return", "new", "SingleTypeReference", "(", "TypeBinding", ".", "FLOAT", ".", "simpleName", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "else", "return", "new", "ArrayTypeReference", "(", "TypeBinding", ".", "FLOAT", ".", "simpleName", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "break", ";", "case", "Signature", ".", "C_INT", ":", "if", "(", "!", "nameStarted", ")", "{", "this", ".", "namePos", "++", ";", "if", "(", "dim", "==", "0", ")", "return", "new", "SingleTypeReference", "(", "TypeBinding", ".", "INT", ".", "simpleName", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "else", "return", "new", "ArrayTypeReference", "(", "TypeBinding", ".", "INT", ".", "simpleName", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "break", ";", "case", "Signature", ".", "C_LONG", ":", "if", "(", "!", "nameStarted", ")", "{", "this", ".", "namePos", "++", ";", "if", "(", "dim", "==", "0", ")", "return", "new", "SingleTypeReference", "(", "TypeBinding", ".", "LONG", ".", "simpleName", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "else", "return", "new", "ArrayTypeReference", "(", "TypeBinding", ".", "LONG", ".", "simpleName", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "break", ";", "case", "Signature", ".", "C_SHORT", ":", "if", "(", "!", "nameStarted", ")", "{", "this", ".", "namePos", "++", ";", "if", "(", "dim", "==", "0", ")", "return", "new", "SingleTypeReference", "(", "TypeBinding", ".", "SHORT", ".", "simpleName", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "else", "return", "new", "ArrayTypeReference", "(", "TypeBinding", ".", "SHORT", ".", "simpleName", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "break", ";", "case", "Signature", ".", "C_VOID", ":", "if", "(", "!", "nameStarted", ")", "{", "this", ".", "namePos", "++", ";", "return", "new", "SingleTypeReference", "(", "TypeBinding", ".", "VOID", ".", "simpleName", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "break", ";", "case", "Signature", ".", "C_RESOLVED", ":", "case", "Signature", ".", "C_UNRESOLVED", ":", "case", "Signature", ".", "C_TYPE_VARIABLE", ":", "if", "(", "!", "nameStarted", ")", "{", "nameFragmentStart", "=", "this", ".", "namePos", "+", "1", ";", "nameStarted", "=", "true", ";", "}", "break", ";", "case", "Signature", ".", "C_STAR", ":", "this", ".", "namePos", "++", ";", "Wildcard", "result", "=", "new", "Wildcard", "(", "Wildcard", ".", "UNBOUND", ")", ";", "result", ".", "sourceStart", "=", "start", ";", "result", ".", "sourceEnd", "=", "end", ";", "return", "result", ";", "case", "Signature", ".", "C_EXTENDS", ":", "this", ".", "namePos", "++", ";", "result", "=", "new", "Wildcard", "(", "Wildcard", ".", "EXTENDS", ")", ";", "result", ".", "bound", "=", "decodeType", "(", "typeSignature", ",", "length", ",", "start", ",", "end", ")", ";", "result", ".", "sourceStart", "=", "start", ";", "result", ".", "sourceEnd", "=", "end", ";", "return", "result", ";", "case", "Signature", ".", "C_SUPER", ":", "this", ".", "namePos", "++", ";", "result", "=", "new", "Wildcard", "(", "Wildcard", ".", "SUPER", ")", ";", "result", ".", "bound", "=", "decodeType", "(", "typeSignature", ",", "length", ",", "start", ",", "end", ")", ";", "result", ".", "sourceStart", "=", "start", ";", "result", ".", "sourceEnd", "=", "end", ";", "return", "result", ";", "case", "Signature", ".", "C_ARRAY", ":", "dim", "++", ";", "break", ";", "case", "Signature", ".", "C_GENERIC_END", ":", "case", "Signature", ".", "C_SEMICOLON", ":", "nameFragmentEnd", "=", "this", ".", "namePos", "-", "1", ";", "this", ".", "namePos", "++", ";", "break", "typeLoop", ";", "case", "Signature", ".", "C_DOLLAR", ":", "if", "(", "this", ".", "memberTypeSeparator", "!=", "Signature", ".", "C_DOLLAR", ")", "break", ";", "case", "Signature", ".", "C_DOT", ":", "if", "(", "!", "nameStarted", ")", "{", "nameFragmentStart", "=", "this", ".", "namePos", "+", "1", ";", "nameStarted", "=", "true", ";", "}", "else", "if", "(", "this", ".", "namePos", ">", "nameFragmentStart", ")", "identCount", "++", ";", "break", ";", "case", "Signature", ".", "C_GENERIC_START", ":", "nameFragmentEnd", "=", "this", ".", "namePos", "-", "1", ";", "if", "(", "!", "this", ".", "has1_5Compliance", ")", "break", "typeLoop", ";", "if", "(", "fragments", "==", "null", ")", "fragments", "=", "new", "ArrayList", "(", "2", ")", ";", "addIdentifiers", "(", "typeSignature", ",", "nameFragmentStart", ",", "nameFragmentEnd", "+", "1", ",", "identCount", ",", "fragments", ")", ";", "this", ".", "namePos", "++", ";", "TypeReference", "[", "]", "arguments", "=", "decodeTypeArguments", "(", "typeSignature", ",", "length", ",", "start", ",", "end", ")", ";", "fragments", ".", "add", "(", "arguments", ")", ";", "identCount", "=", "1", ";", "nameStarted", "=", "false", ";", "break", ";", "}", "this", ".", "namePos", "++", ";", "}", "if", "(", "fragments", "==", "null", ")", "{", "if", "(", "identCount", "==", "1", ")", "{", "if", "(", "dim", "==", "0", ")", "{", "char", "[", "]", "nameFragment", "=", "new", "char", "[", "nameFragmentEnd", "-", "nameFragmentStart", "+", "1", "]", ";", "typeSignature", ".", "getChars", "(", "nameFragmentStart", ",", "nameFragmentEnd", "+", "1", ",", "nameFragment", ",", "0", ")", ";", "return", "new", "SingleTypeReference", "(", "nameFragment", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "else", "{", "char", "[", "]", "nameFragment", "=", "new", "char", "[", "nameFragmentEnd", "-", "nameFragmentStart", "+", "1", "]", ";", "typeSignature", ".", "getChars", "(", "nameFragmentStart", ",", "nameFragmentEnd", "+", "1", ",", "nameFragment", ",", "0", ")", ";", "return", "new", "ArrayTypeReference", "(", "nameFragment", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "}", "else", "{", "long", "[", "]", "positions", "=", "new", "long", "[", "identCount", "]", ";", "long", "pos", "=", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "identCount", ";", "i", "++", ")", "{", "positions", "[", "i", "]", "=", "pos", ";", "}", "char", "[", "]", "[", "]", "identifiers", "=", "extractIdentifiers", "(", "typeSignature", ",", "nameFragmentStart", ",", "nameFragmentEnd", ",", "identCount", ")", ";", "if", "(", "dim", "==", "0", ")", "{", "return", "new", "QualifiedTypeReference", "(", "identifiers", ",", "positions", ")", ";", "}", "else", "{", "return", "new", "ArrayQualifiedTypeReference", "(", "identifiers", ",", "dim", ",", "positions", ")", ";", "}", "}", "}", "else", "{", "if", "(", "nameStarted", ")", "{", "addIdentifiers", "(", "typeSignature", ",", "nameFragmentStart", ",", "nameFragmentEnd", "+", "1", ",", "identCount", ",", "fragments", ")", ";", "}", "int", "fragmentLength", "=", "fragments", ".", "size", "(", ")", ";", "if", "(", "fragmentLength", "==", "2", ")", "{", "Object", "firstFragment", "=", "fragments", ".", "get", "(", "0", ")", ";", "if", "(", "firstFragment", "instanceof", "char", "[", "]", ")", "{", "return", "new", "ParameterizedSingleTypeReference", "(", "(", "char", "[", "]", ")", "firstFragment", ",", "(", "TypeReference", "[", "]", ")", "fragments", ".", "get", "(", "1", ")", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "}", "identCount", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fragmentLength", ";", "i", "++", ")", "{", "Object", "element", "=", "fragments", ".", "get", "(", "i", ")", ";", "if", "(", "element", "instanceof", "char", "[", "]", "[", "]", ")", "{", "identCount", "+=", "(", "(", "char", "[", "]", "[", "]", ")", "element", ")", ".", "length", ";", "}", "else", "if", "(", "element", "instanceof", "char", "[", "]", ")", "identCount", "++", ";", "}", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "identCount", "]", "[", "]", ";", "TypeReference", "[", "]", "[", "]", "arguments", "=", "new", "TypeReference", "[", "identCount", "]", "[", "]", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fragmentLength", ";", "i", "++", ")", "{", "Object", "element", "=", "fragments", ".", "get", "(", "i", ")", ";", "if", "(", "element", "instanceof", "char", "[", "]", "[", "]", ")", "{", "char", "[", "]", "[", "]", "fragmentTokens", "=", "(", "char", "[", "]", "[", "]", ")", "element", ";", "int", "fragmentTokenLength", "=", "fragmentTokens", ".", "length", ";", "System", ".", "arraycopy", "(", "fragmentTokens", ",", "0", ",", "tokens", ",", "index", ",", "fragmentTokenLength", ")", ";", "index", "+=", "fragmentTokenLength", ";", "}", "else", "if", "(", "element", "instanceof", "char", "[", "]", ")", "{", "tokens", "[", "index", "++", "]", "=", "(", "char", "[", "]", ")", "element", ";", "}", "else", "{", "arguments", "[", "index", "-", "1", "]", "=", "(", "TypeReference", "[", "]", ")", "element", ";", "}", "}", "long", "[", "]", "positions", "=", "new", "long", "[", "identCount", "]", ";", "long", "pos", "=", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "identCount", ";", "i", "++", ")", "{", "positions", "[", "i", "]", "=", "pos", ";", "}", "return", "new", "ParameterizedQualifiedTypeReference", "(", "tokens", ",", "arguments", ",", "dim", ",", "positions", ")", ";", "}", "}", "private", "TypeReference", "decodeType", "(", "char", "[", "]", "typeName", ",", "int", "length", ",", "int", "start", ",", "int", "end", ",", "boolean", "includeGenericsAnyway", ")", "{", "int", "identCount", "=", "1", ";", "int", "dim", "=", "0", ";", "int", "nameFragmentStart", "=", "this", ".", "namePos", ",", "nameFragmentEnd", "=", "-", "1", ";", "ArrayList", "fragments", "=", "null", ";", "typeLoop", ":", "while", "(", "this", ".", "namePos", "<", "length", ")", "{", "char", "currentChar", "=", "typeName", "[", "this", ".", "namePos", "]", ";", "switch", "(", "currentChar", ")", "{", "case", "'?'", ":", "this", ".", "namePos", "++", ";", "while", "(", "typeName", "[", "this", ".", "namePos", "]", "==", "'", "'", ")", "this", ".", "namePos", "++", ";", "switch", "(", "typeName", "[", "this", ".", "namePos", "]", ")", "{", "case", "'s'", ":", "checkSuper", ":", "{", "int", "max", "=", "TypeConstants", ".", "WILDCARD_SUPER", ".", "length", "-", "1", ";", "for", "(", "int", "ahead", "=", "1", ";", "ahead", "<", "max", ";", "ahead", "++", ")", "{", "if", "(", "typeName", "[", "this", ".", "namePos", "+", "ahead", "]", "!=", "TypeConstants", ".", "WILDCARD_SUPER", "[", "ahead", "+", "1", "]", ")", "{", "break", "checkSuper", ";", "}", "}", "this", ".", "namePos", "+=", "max", ";", "Wildcard", "result", "=", "new", "Wildcard", "(", "Wildcard", ".", "SUPER", ")", ";", "result", ".", "bound", "=", "decodeType", "(", "typeName", ",", "length", ",", "start", ",", "end", ",", "includeGenericsAnyway", ")", ";", "result", ".", "sourceStart", "=", "start", ";", "result", ".", "sourceEnd", "=", "end", ";", "return", "result", ";", "}", "break", ";", "case", "'e'", ":", "checkExtends", ":", "{", "int", "max", "=", "TypeConstants", ".", "WILDCARD_EXTENDS", ".", "length", "-", "1", ";", "for", "(", "int", "ahead", "=", "1", ";", "ahead", "<", "max", ";", "ahead", "++", ")", "{", "if", "(", "typeName", "[", "this", ".", "namePos", "+", "ahead", "]", "!=", "TypeConstants", ".", "WILDCARD_EXTENDS", "[", "ahead", "+", "1", "]", ")", "{", "break", "checkExtends", ";", "}", "}", "this", ".", "namePos", "+=", "max", ";", "Wildcard", "result", "=", "new", "Wildcard", "(", "Wildcard", ".", "EXTENDS", ")", ";", "result", ".", "bound", "=", "decodeType", "(", "typeName", ",", "length", ",", "start", ",", "end", ",", "includeGenericsAnyway", ")", ";", "result", ".", "sourceStart", "=", "start", ";", "result", ".", "sourceEnd", "=", "end", ";", "return", "result", ";", "}", "break", ";", "}", "Wildcard", "result", "=", "new", "Wildcard", "(", "Wildcard", ".", "UNBOUND", ")", ";", "result", ".", "sourceStart", "=", "start", ";", "result", ".", "sourceEnd", "=", "end", ";", "return", "result", ";", "case", "'['", ":", "if", "(", "dim", "==", "0", "&&", "nameFragmentEnd", "<", "0", ")", "nameFragmentEnd", "=", "this", ".", "namePos", "-", "1", ";", "dim", "++", ";", "break", ";", "case", "']'", ":", "break", ";", "case", "'>'", ":", "case", "','", ":", "break", "typeLoop", ";", "case", "'.'", ":", "if", "(", "nameFragmentStart", "<", "0", ")", "nameFragmentStart", "=", "this", ".", "namePos", "+", "1", ";", "identCount", "++", ";", "break", ";", "case", "'<'", ":", "if", "(", "this", ".", "has1_5Compliance", "||", "includeGenericsAnyway", ")", "{", "if", "(", "fragments", "==", "null", ")", "fragments", "=", "new", "ArrayList", "(", "2", ")", ";", "}", "nameFragmentEnd", "=", "this", ".", "namePos", "-", "1", ";", "if", "(", "this", ".", "has1_5Compliance", "||", "includeGenericsAnyway", ")", "{", "char", "[", "]", "[", "]", "identifiers", "=", "CharOperation", ".", "splitOn", "(", "'.'", ",", "typeName", ",", "nameFragmentStart", ",", "this", ".", "namePos", ")", ";", "fragments", ".", "add", "(", "identifiers", ")", ";", "}", "this", ".", "namePos", "++", ";", "TypeReference", "[", "]", "arguments", "=", "decodeTypeArguments", "(", "typeName", ",", "length", ",", "start", ",", "end", ",", "includeGenericsAnyway", ")", ";", "if", "(", "this", ".", "has1_5Compliance", "||", "includeGenericsAnyway", ")", "{", "fragments", ".", "add", "(", "arguments", ")", ";", "identCount", "=", "0", ";", "nameFragmentStart", "=", "-", "1", ";", "nameFragmentEnd", "=", "-", "1", ";", "}", "break", ";", "}", "this", ".", "namePos", "++", ";", "}", "if", "(", "nameFragmentEnd", "<", "0", ")", "nameFragmentEnd", "=", "this", ".", "namePos", "-", "1", ";", "if", "(", "fragments", "==", "null", ")", "{", "if", "(", "identCount", "==", "1", ")", "{", "if", "(", "dim", "==", "0", ")", "{", "char", "[", "]", "nameFragment", ";", "if", "(", "nameFragmentStart", "!=", "0", "||", "nameFragmentEnd", ">=", "0", ")", "{", "int", "nameFragmentLength", "=", "nameFragmentEnd", "-", "nameFragmentStart", "+", "1", ";", "System", ".", "arraycopy", "(", "typeName", ",", "nameFragmentStart", ",", "nameFragment", "=", "new", "char", "[", "nameFragmentLength", "]", ",", "0", ",", "nameFragmentLength", ")", ";", "}", "else", "{", "nameFragment", "=", "typeName", ";", "}", "return", "new", "SingleTypeReference", "(", "nameFragment", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "else", "{", "int", "nameFragmentLength", "=", "nameFragmentEnd", "-", "nameFragmentStart", "+", "1", ";", "char", "[", "]", "nameFragment", "=", "new", "char", "[", "nameFragmentLength", "]", ";", "System", ".", "arraycopy", "(", "typeName", ",", "nameFragmentStart", ",", "nameFragment", ",", "0", ",", "nameFragmentLength", ")", ";", "return", "new", "ArrayTypeReference", "(", "nameFragment", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "}", "else", "{", "long", "[", "]", "positions", "=", "new", "long", "[", "identCount", "]", ";", "long", "pos", "=", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "identCount", ";", "i", "++", ")", "{", "positions", "[", "i", "]", "=", "pos", ";", "}", "char", "[", "]", "[", "]", "identifiers", "=", "CharOperation", ".", "splitOn", "(", "'.'", ",", "typeName", ",", "nameFragmentStart", ",", "nameFragmentEnd", "+", "1", ")", ";", "if", "(", "dim", "==", "0", ")", "{", "return", "new", "QualifiedTypeReference", "(", "identifiers", ",", "positions", ")", ";", "}", "else", "{", "return", "new", "ArrayQualifiedTypeReference", "(", "identifiers", ",", "dim", ",", "positions", ")", ";", "}", "}", "}", "else", "{", "if", "(", "nameFragmentStart", ">", "0", "&&", "nameFragmentStart", "<", "length", ")", "{", "char", "[", "]", "[", "]", "identifiers", "=", "CharOperation", ".", "splitOn", "(", "'.'", ",", "typeName", ",", "nameFragmentStart", ",", "nameFragmentEnd", "+", "1", ")", ";", "fragments", ".", "add", "(", "identifiers", ")", ";", "}", "int", "fragmentLength", "=", "fragments", ".", "size", "(", ")", ";", "if", "(", "fragmentLength", "==", "2", ")", "{", "char", "[", "]", "[", "]", "firstFragment", "=", "(", "char", "[", "]", "[", "]", ")", "fragments", ".", "get", "(", "0", ")", ";", "if", "(", "firstFragment", ".", "length", "==", "1", ")", "{", "return", "new", "ParameterizedSingleTypeReference", "(", "firstFragment", "[", "0", "]", ",", "(", "TypeReference", "[", "]", ")", "fragments", ".", "get", "(", "1", ")", ",", "dim", ",", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ")", ";", "}", "}", "identCount", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fragmentLength", ";", "i", "++", ")", "{", "Object", "element", "=", "fragments", ".", "get", "(", "i", ")", ";", "if", "(", "element", "instanceof", "char", "[", "]", "[", "]", ")", "{", "identCount", "+=", "(", "(", "char", "[", "]", "[", "]", ")", "element", ")", ".", "length", ";", "}", "}", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "identCount", "]", "[", "]", ";", "TypeReference", "[", "]", "[", "]", "arguments", "=", "new", "TypeReference", "[", "identCount", "]", "[", "]", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fragmentLength", ";", "i", "++", ")", "{", "Object", "element", "=", "fragments", ".", "get", "(", "i", ")", ";", "if", "(", "element", "instanceof", "char", "[", "]", "[", "]", ")", "{", "char", "[", "]", "[", "]", "fragmentTokens", "=", "(", "char", "[", "]", "[", "]", ")", "element", ";", "int", "fragmentTokenLength", "=", "fragmentTokens", ".", "length", ";", "System", ".", "arraycopy", "(", "fragmentTokens", ",", "0", ",", "tokens", ",", "index", ",", "fragmentTokenLength", ")", ";", "index", "+=", "fragmentTokenLength", ";", "}", "else", "{", "arguments", "[", "index", "-", "1", "]", "=", "(", "TypeReference", "[", "]", ")", "element", ";", "}", "}", "long", "[", "]", "positions", "=", "new", "long", "[", "identCount", "]", ";", "long", "pos", "=", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "identCount", ";", "i", "++", ")", "{", "positions", "[", "i", "]", "=", "pos", ";", "}", "return", "new", "ParameterizedQualifiedTypeReference", "(", "tokens", ",", "arguments", ",", "dim", ",", "positions", ")", ";", "}", "}", "private", "TypeReference", "[", "]", "decodeTypeArguments", "(", "char", "[", "]", "typeName", ",", "int", "length", ",", "int", "start", ",", "int", "end", ",", "boolean", "includeGenericsAnyway", ")", "{", "ArrayList", "argumentList", "=", "new", "ArrayList", "(", "1", ")", ";", "int", "count", "=", "0", ";", "argumentsLoop", ":", "while", "(", "this", ".", "namePos", "<", "length", ")", "{", "TypeReference", "argument", "=", "decodeType", "(", "typeName", ",", "length", ",", "start", ",", "end", ",", "includeGenericsAnyway", ")", ";", "count", "++", ";", "argumentList", ".", "add", "(", "argument", ")", ";", "if", "(", "this", ".", "namePos", ">=", "length", ")", "break", "argumentsLoop", ";", "if", "(", "typeName", "[", "this", ".", "namePos", "]", "==", "'>'", ")", "{", "break", "argumentsLoop", ";", "}", "this", ".", "namePos", "++", ";", "}", "TypeReference", "[", "]", "typeArguments", "=", "new", "TypeReference", "[", "count", "]", ";", "argumentList", ".", "toArray", "(", "typeArguments", ")", ";", "return", "typeArguments", ";", "}", "private", "TypeReference", "[", "]", "decodeTypeArguments", "(", "String", "typeSignature", ",", "int", "length", ",", "int", "start", ",", "int", "end", ")", "{", "ArrayList", "argumentList", "=", "new", "ArrayList", "(", "1", ")", ";", "int", "count", "=", "0", ";", "argumentsLoop", ":", "while", "(", "this", ".", "namePos", "<", "length", ")", "{", "TypeReference", "argument", "=", "decodeType", "(", "typeSignature", ",", "length", ",", "start", ",", "end", ")", ";", "count", "++", ";", "argumentList", ".", "add", "(", "argument", ")", ";", "if", "(", "this", ".", "namePos", ">=", "length", ")", "break", "argumentsLoop", ";", "if", "(", "typeSignature", ".", "charAt", "(", "this", ".", "namePos", ")", "==", "Signature", ".", "C_GENERIC_END", ")", "{", "break", "argumentsLoop", ";", "}", "}", "TypeReference", "[", "]", "typeArguments", "=", "new", "TypeReference", "[", "count", "]", ";", "argumentList", ".", "toArray", "(", "typeArguments", ")", ";", "return", "typeArguments", ";", "}", "private", "char", "[", "]", "[", "]", "extractIdentifiers", "(", "String", "typeSignature", ",", "int", "start", ",", "int", "endInclusive", ",", "int", "identCount", ")", "{", "char", "[", "]", "[", "]", "result", "=", "new", "char", "[", "identCount", "]", "[", "]", ";", "int", "charIndex", "=", "start", ";", "int", "i", "=", "0", ";", "while", "(", "charIndex", "<", "endInclusive", ")", "{", "char", "currentChar", ";", "if", "(", "(", "currentChar", "=", "typeSignature", ".", "charAt", "(", "charIndex", ")", ")", "==", "this", ".", "memberTypeSeparator", "||", "currentChar", "==", "Signature", ".", "C_DOT", ")", "{", "typeSignature", ".", "getChars", "(", "start", ",", "charIndex", ",", "result", "[", "i", "++", "]", "=", "new", "char", "[", "charIndex", "-", "start", "]", ",", "0", ")", ";", "start", "=", "++", "charIndex", ";", "}", "else", "charIndex", "++", ";", "}", "typeSignature", ".", "getChars", "(", "start", ",", "charIndex", "+", "1", ",", "result", "[", "i", "++", "]", "=", "new", "char", "[", "charIndex", "-", "start", "+", "1", "]", ",", "0", ")", ";", "return", "result", ";", "}", "}", "</s>" ]
3,942
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ".", "LanguageSupportFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IAnnotatable", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IAnnotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IImportDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ISourceRange", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Signature", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "CompilationResult", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AbstractMethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AnnotationMethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Argument", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayInitializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Block", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompilationUnitDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ConstructorDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FieldDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ImportReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Initializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedAllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Statement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeParameter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ISourceImport", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ISourceType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ExtraCompilerModifiers", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemReporter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "CompilationUnitElementInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "ImportDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "InitializerElementInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "PackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SourceAnnotationMethodInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SourceField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SourceFieldElementInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SourceMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SourceMethodElementInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SourceType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SourceTypeElementInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "SourceTypeConverter", "extends", "TypeConverter", "{", "static", "class", "AnonymousMemberFound", "extends", "RuntimeException", "{", "private", "static", "final", "long", "serialVersionUID", "=", "1L", ";", "}", "public", "static", "final", "int", "FIELD", "=", "0x01", ";", "public", "static", "final", "int", "CONSTRUCTOR", "=", "0x02", ";", "public", "static", "final", "int", "METHOD", "=", "0x04", ";", "public", "static", "final", "int", "MEMBER_TYPE", "=", "0x08", ";", "public", "static", "final", "int", "FIELD_INITIALIZATION", "=", "0x10", ";", "public", "static", "final", "int", "FIELD_AND_METHOD", "=", "FIELD", "|", "CONSTRUCTOR", "|", "METHOD", ";", "public", "static", "final", "int", "LOCAL_TYPE", "=", "0x20", ";", "public", "static", "final", "int", "NONE", "=", "0", ";", "private", "int", "flags", ";", "private", "CompilationUnitDeclaration", "unit", ";", "private", "Parser", "parser", ";", "private", "ICompilationUnit", "cu", ";", "private", "char", "[", "]", "source", ";", "private", "SourceTypeConverter", "(", "int", "flags", ",", "ProblemReporter", "problemReporter", ")", "{", "super", "(", "problemReporter", ",", "Signature", ".", "C_DOT", ")", ";", "this", ".", "flags", "=", "flags", ";", "}", "public", "static", "CompilationUnitDeclaration", "buildCompilationUnit", "(", "ISourceType", "[", "]", "sourceTypes", ",", "int", "flags", ",", "ProblemReporter", "problemReporter", ",", "CompilationResult", "compilationResult", ")", "{", "SourceTypeConverter", "converter", "=", "new", "SourceTypeConverter", "(", "flags", ",", "problemReporter", ")", ";", "try", "{", "return", "converter", ".", "convert", "(", "sourceTypes", ",", "compilationResult", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "null", ";", "}", "}", "private", "CompilationUnitDeclaration", "convert", "(", "ISourceType", "[", "]", "sourceTypes", ",", "CompilationResult", "compilationResult", ")", "throws", "JavaModelException", "{", "this", ".", "unit", "=", "LanguageSupportFactory", ".", "newCompilationUnitDeclaration", "(", "(", "ICompilationUnit", ")", "(", "(", "SourceTypeElementInfo", ")", "sourceTypes", "[", "0", "]", ")", ".", "getHandle", "(", ")", ".", "getCompilationUnit", "(", ")", ",", "this", ".", "problemReporter", ",", "compilationResult", ",", "0", ")", ";", "if", "(", "sourceTypes", ".", "length", "==", "0", ")", "return", "this", ".", "unit", ";", "SourceTypeElementInfo", "topLevelTypeInfo", "=", "(", "SourceTypeElementInfo", ")", "sourceTypes", "[", "0", "]", ";", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "cuHandle", "=", "topLevelTypeInfo", ".", "getHandle", "(", ")", ".", "getCompilationUnit", "(", ")", ";", "this", ".", "cu", "=", "(", "ICompilationUnit", ")", "cuHandle", ";", "if", "(", "LanguageSupportFactory", ".", "isInterestingSourceFile", "(", "new", "String", "(", "compilationResult", ".", "getFileName", "(", ")", ")", ")", ")", "{", "try", "{", "return", "LanguageSupportFactory", ".", "getParser", "(", "this", ",", "this", ".", "problemReporter", ".", "options", ",", "this", ".", "problemReporter", ",", "true", ",", "3", ")", ".", "dietParse", "(", "this", ".", "cu", ",", "compilationResult", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "t", ".", "printStackTrace", "(", ")", ";", "}", "}", "if", "(", "this", ".", "has1_5Compliance", "&&", "(", "(", "CompilationUnitElementInfo", ")", "(", "(", "JavaElement", ")", "this", ".", "cu", ")", ".", "getElementInfo", "(", ")", ")", ".", "annotationNumber", ">", "10", ")", "{", "if", "(", "(", "this", ".", "flags", "&", "LOCAL_TYPE", ")", "==", "0", ")", "{", "return", "new", "Parser", "(", "this", ".", "problemReporter", ",", "true", ")", ".", "dietParse", "(", "this", ".", "cu", ",", "compilationResult", ")", ";", "}", "}", "int", "start", "=", "topLevelTypeInfo", ".", "getNameSourceStart", "(", ")", ";", "int", "end", "=", "topLevelTypeInfo", ".", "getNameSourceEnd", "(", ")", ";", "String", "[", "]", "packageName", "=", "(", "(", "PackageFragment", ")", "cuHandle", ".", "getParent", "(", ")", ")", ".", "names", ";", "if", "(", "packageName", ".", "length", ">", "0", ")", "this", ".", "unit", ".", "currentPackage", "=", "createImportReference", "(", "packageName", ",", "start", ",", "end", ",", "false", ",", "ClassFileConstants", ".", "AccDefault", ")", ";", "IImportDeclaration", "[", "]", "importDeclarations", "=", "topLevelTypeInfo", ".", "getHandle", "(", ")", ".", "getCompilationUnit", "(", ")", ".", "getImports", "(", ")", ";", "int", "importCount", "=", "importDeclarations", ".", "length", ";", "this", ".", "unit", ".", "imports", "=", "new", "ImportReference", "[", "importCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "importCount", ";", "i", "++", ")", "{", "ImportDeclaration", "importDeclaration", "=", "(", "ImportDeclaration", ")", "importDeclarations", "[", "i", "]", ";", "ISourceImport", "sourceImport", "=", "(", "ISourceImport", ")", "importDeclaration", ".", "getElementInfo", "(", ")", ";", "String", "nameWithoutStar", "=", "importDeclaration", ".", "getNameWithoutStar", "(", ")", ";", "this", ".", "unit", ".", "imports", "[", "i", "]", "=", "createImportReference", "(", "Util", ".", "splitOn", "(", "'.'", ",", "nameWithoutStar", ",", "0", ",", "nameWithoutStar", ".", "length", "(", ")", ")", ",", "sourceImport", ".", "getDeclarationSourceStart", "(", ")", ",", "sourceImport", ".", "getDeclarationSourceEnd", "(", ")", ",", "importDeclaration", ".", "isOnDemand", "(", ")", ",", "sourceImport", ".", "getModifiers", "(", ")", ")", ";", "}", "try", "{", "int", "typeCount", "=", "sourceTypes", ".", "length", ";", "final", "TypeDeclaration", "[", "]", "types", "=", "new", "TypeDeclaration", "[", "typeCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "typeCount", ";", "i", "++", ")", "{", "SourceTypeElementInfo", "typeInfo", "=", "(", "SourceTypeElementInfo", ")", "sourceTypes", "[", "i", "]", ";", "types", "[", "i", "]", "=", "convert", "(", "(", "SourceType", ")", "typeInfo", ".", "getHandle", "(", ")", ",", "compilationResult", ")", ";", "}", "this", ".", "unit", ".", "types", "=", "types", ";", "return", "this", ".", "unit", ";", "}", "catch", "(", "AnonymousMemberFound", "e", ")", "{", "return", "new", "Parser", "(", "this", ".", "problemReporter", ",", "true", ")", ".", "parse", "(", "this", ".", "cu", ",", "compilationResult", ")", ";", "}", "}", "private", "Initializer", "convert", "(", "InitializerElementInfo", "initializerInfo", ",", "CompilationResult", "compilationResult", ")", "throws", "JavaModelException", "{", "Block", "block", "=", "new", "Block", "(", "0", ")", ";", "Initializer", "initializer", "=", "new", "Initializer", "(", "block", ",", "ClassFileConstants", ".", "AccDefault", ")", ";", "int", "start", "=", "initializerInfo", ".", "getDeclarationSourceStart", "(", ")", ";", "int", "end", "=", "initializerInfo", ".", "getDeclarationSourceEnd", "(", ")", ";", "initializer", ".", "sourceStart", "=", "initializer", ".", "declarationSourceStart", "=", "start", ";", "initializer", ".", "sourceEnd", "=", "initializer", ".", "declarationSourceEnd", "=", "end", ";", "initializer", ".", "modifiers", "=", "initializerInfo", ".", "getModifiers", "(", ")", ";", "IJavaElement", "[", "]", "children", "=", "initializerInfo", ".", "getChildren", "(", ")", ";", "int", "typesLength", "=", "children", ".", "length", ";", "if", "(", "typesLength", ">", "0", ")", "{", "Statement", "[", "]", "statements", "=", "new", "Statement", "[", "typesLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "typesLength", ";", "i", "++", ")", "{", "SourceType", "type", "=", "(", "SourceType", ")", "children", "[", "i", "]", ";", "TypeDeclaration", "localType", "=", "convert", "(", "type", ",", "compilationResult", ")", ";", "if", "(", "(", "localType", ".", "bits", "&", "ASTNode", ".", "IsAnonymousType", ")", "!=", "0", ")", "{", "QualifiedAllocationExpression", "expression", "=", "new", "QualifiedAllocationExpression", "(", "localType", ")", ";", "expression", ".", "type", "=", "localType", ".", "superclass", ";", "localType", ".", "superclass", "=", "null", ";", "localType", ".", "superInterfaces", "=", "null", ";", "localType", ".", "allocation", "=", "expression", ";", "statements", "[", "i", "]", "=", "expression", ";", "}", "else", "{", "statements", "[", "i", "]", "=", "localType", ";", "}", "}", "block", ".", "statements", "=", "statements", ";", "}", "return", "initializer", ";", "}", "private", "FieldDeclaration", "convert", "(", "SourceField", "fieldHandle", ",", "TypeDeclaration", "type", ",", "CompilationResult", "compilationResult", ")", "throws", "JavaModelException", "{", "SourceFieldElementInfo", "fieldInfo", "=", "(", "SourceFieldElementInfo", ")", "fieldHandle", ".", "getElementInfo", "(", ")", ";", "FieldDeclaration", "field", "=", "new", "FieldDeclaration", "(", ")", ";", "int", "start", "=", "fieldInfo", ".", "getNameSourceStart", "(", ")", ";", "int", "end", "=", "fieldInfo", ".", "getNameSourceEnd", "(", ")", ";", "field", ".", "name", "=", "fieldHandle", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "field", ".", "sourceStart", "=", "start", ";", "field", ".", "sourceEnd", "=", "end", ";", "field", ".", "declarationSourceStart", "=", "fieldInfo", ".", "getDeclarationSourceStart", "(", ")", ";", "field", ".", "declarationSourceEnd", "=", "fieldInfo", ".", "getDeclarationSourceEnd", "(", ")", ";", "int", "modifiers", "=", "fieldInfo", ".", "getModifiers", "(", ")", ";", "boolean", "isEnumConstant", "=", "(", "modifiers", "&", "ClassFileConstants", ".", "AccEnum", ")", "!=", "0", ";", "if", "(", "isEnumConstant", ")", "{", "field", ".", "modifiers", "=", "modifiers", "&", "~", "ClassFileConstants", ".", "AccEnum", ";", "}", "else", "{", "field", ".", "modifiers", "=", "modifiers", ";", "field", ".", "type", "=", "createTypeReference", "(", "fieldInfo", ".", "getTypeName", "(", ")", ",", "start", ",", "end", ")", ";", "}", "if", "(", "this", ".", "has1_5Compliance", ")", "{", "field", ".", "annotations", "=", "convertAnnotations", "(", "fieldHandle", ")", ";", "}", "if", "(", "(", "this", ".", "flags", "&", "FIELD_INITIALIZATION", ")", "!=", "0", ")", "{", "char", "[", "]", "initializationSource", "=", "fieldInfo", ".", "getInitializationSource", "(", ")", ";", "if", "(", "initializationSource", "!=", "null", ")", "{", "if", "(", "this", ".", "parser", "==", "null", ")", "{", "this", ".", "parser", "=", "new", "Parser", "(", "this", ".", "problemReporter", ",", "true", ")", ";", "}", "this", ".", "parser", ".", "parse", "(", "field", ",", "type", ",", "this", ".", "unit", ",", "initializationSource", ")", ";", "}", "}", "if", "(", "(", "this", ".", "flags", "&", "LOCAL_TYPE", ")", "!=", "0", ")", "{", "IJavaElement", "[", "]", "children", "=", "fieldInfo", ".", "getChildren", "(", ")", ";", "int", "childrenLength", "=", "children", ".", "length", ";", "if", "(", "childrenLength", "==", "1", ")", "{", "field", ".", "initialization", "=", "convert", "(", "children", "[", "0", "]", ",", "isEnumConstant", "?", "field", ":", "null", ",", "compilationResult", ")", ";", "}", "else", "if", "(", "childrenLength", ">", "1", ")", "{", "ArrayInitializer", "initializer", "=", "new", "ArrayInitializer", "(", ")", ";", "field", ".", "initialization", "=", "initializer", ";", "Expression", "[", "]", "expressions", "=", "new", "Expression", "[", "childrenLength", "]", ";", "initializer", ".", "expressions", "=", "expressions", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "childrenLength", ";", "i", "++", ")", "{", "expressions", "[", "i", "]", "=", "convert", "(", "children", "[", "i", "]", ",", "isEnumConstant", "?", "field", ":", "null", ",", "compilationResult", ")", ";", "}", "}", "}", "return", "field", ";", "}", "private", "QualifiedAllocationExpression", "convert", "(", "IJavaElement", "localType", ",", "FieldDeclaration", "enumConstant", ",", "CompilationResult", "compilationResult", ")", "throws", "JavaModelException", "{", "TypeDeclaration", "anonymousLocalTypeDeclaration", "=", "convert", "(", "(", "SourceType", ")", "localType", ",", "compilationResult", ")", ";", "QualifiedAllocationExpression", "expression", "=", "new", "QualifiedAllocationExpression", "(", "anonymousLocalTypeDeclaration", ")", ";", "expression", ".", "type", "=", "anonymousLocalTypeDeclaration", ".", "superclass", ";", "anonymousLocalTypeDeclaration", ".", "superclass", "=", "null", ";", "anonymousLocalTypeDeclaration", ".", "superInterfaces", "=", "null", ";", "anonymousLocalTypeDeclaration", ".", "allocation", "=", "expression", ";", "if", "(", "enumConstant", "!=", "null", ")", "{", "anonymousLocalTypeDeclaration", ".", "modifiers", "&=", "~", "ClassFileConstants", ".", "AccEnum", ";", "expression", ".", "enumConstant", "=", "enumConstant", ";", "expression", ".", "type", "=", "null", ";", "}", "return", "expression", ";", "}", "private", "AbstractMethodDeclaration", "convert", "(", "SourceMethod", "methodHandle", ",", "SourceMethodElementInfo", "methodInfo", ",", "CompilationResult", "compilationResult", ")", "throws", "JavaModelException", "{", "AbstractMethodDeclaration", "method", ";", "int", "start", "=", "methodInfo", ".", "getNameSourceStart", "(", ")", ";", "int", "end", "=", "methodInfo", ".", "getNameSourceEnd", "(", ")", ";", "TypeParameter", "[", "]", "typeParams", "=", "null", ";", "char", "[", "]", "[", "]", "typeParameterNames", "=", "methodInfo", ".", "getTypeParameterNames", "(", ")", ";", "if", "(", "typeParameterNames", "!=", "null", ")", "{", "int", "parameterCount", "=", "typeParameterNames", ".", "length", ";", "if", "(", "parameterCount", ">", "0", ")", "{", "char", "[", "]", "[", "]", "[", "]", "typeParameterBounds", "=", "methodInfo", ".", "getTypeParameterBounds", "(", ")", ";", "typeParams", "=", "new", "TypeParameter", "[", "parameterCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameterCount", ";", "i", "++", ")", "{", "typeParams", "[", "i", "]", "=", "createTypeParameter", "(", "typeParameterNames", "[", "i", "]", ",", "typeParameterBounds", "[", "i", "]", ",", "start", ",", "end", ")", ";", "}", "}", "}", "int", "modifiers", "=", "methodInfo", ".", "getModifiers", "(", ")", ";", "if", "(", "methodInfo", ".", "isConstructor", "(", ")", ")", "{", "ConstructorDeclaration", "decl", "=", "new", "ConstructorDeclaration", "(", "compilationResult", ")", ";", "decl", ".", "bits", "&=", "~", "ASTNode", ".", "IsDefaultConstructor", ";", "method", "=", "decl", ";", "decl", ".", "typeParameters", "=", "typeParams", ";", "}", "else", "{", "MethodDeclaration", "decl", ";", "if", "(", "methodInfo", ".", "isAnnotationMethod", "(", ")", ")", "{", "AnnotationMethodDeclaration", "annotationMethodDeclaration", "=", "new", "AnnotationMethodDeclaration", "(", "compilationResult", ")", ";", "SourceAnnotationMethodInfo", "annotationMethodInfo", "=", "(", "SourceAnnotationMethodInfo", ")", "methodInfo", ";", "boolean", "hasDefaultValue", "=", "annotationMethodInfo", ".", "defaultValueStart", "!=", "-", "1", "||", "annotationMethodInfo", ".", "defaultValueEnd", "!=", "-", "1", ";", "if", "(", "(", "this", ".", "flags", "&", "FIELD_INITIALIZATION", ")", "!=", "0", ")", "{", "if", "(", "hasDefaultValue", ")", "{", "char", "[", "]", "defaultValueSource", "=", "CharOperation", ".", "subarray", "(", "getSource", "(", ")", ",", "annotationMethodInfo", ".", "defaultValueStart", ",", "annotationMethodInfo", ".", "defaultValueEnd", "+", "1", ")", ";", "if", "(", "defaultValueSource", "!=", "null", ")", "{", "Expression", "expression", "=", "parseMemberValue", "(", "defaultValueSource", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "annotationMethodDeclaration", ".", "defaultValue", "=", "expression", ";", "}", "}", "else", "{", "hasDefaultValue", "=", "false", ";", "}", "}", "}", "if", "(", "hasDefaultValue", ")", "modifiers", "|=", "ClassFileConstants", ".", "AccAnnotationDefault", ";", "decl", "=", "annotationMethodDeclaration", ";", "}", "else", "{", "decl", "=", "new", "MethodDeclaration", "(", "compilationResult", ")", ";", "}", "decl", ".", "returnType", "=", "createTypeReference", "(", "methodInfo", ".", "getReturnTypeName", "(", ")", ",", "start", ",", "end", ")", ";", "decl", ".", "typeParameters", "=", "typeParams", ";", "method", "=", "decl", ";", "}", "method", ".", "selector", "=", "methodHandle", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "boolean", "isVarargs", "=", "(", "modifiers", "&", "ClassFileConstants", ".", "AccVarargs", ")", "!=", "0", ";", "method", ".", "modifiers", "=", "modifiers", "&", "~", "ClassFileConstants", ".", "AccVarargs", ";", "method", ".", "sourceStart", "=", "start", ";", "method", ".", "sourceEnd", "=", "end", ";", "method", ".", "declarationSourceStart", "=", "methodInfo", ".", "getDeclarationSourceStart", "(", ")", ";", "method", ".", "declarationSourceEnd", "=", "methodInfo", ".", "getDeclarationSourceEnd", "(", ")", ";", "if", "(", "this", ".", "has1_5Compliance", ")", "{", "method", ".", "annotations", "=", "convertAnnotations", "(", "methodHandle", ")", ";", "}", "String", "[", "]", "argumentTypeSignatures", "=", "methodHandle", ".", "getParameterTypes", "(", ")", ";", "char", "[", "]", "[", "]", "argumentNames", "=", "methodInfo", ".", "getArgumentNames", "(", ")", ";", "int", "argumentCount", "=", "argumentTypeSignatures", "==", "null", "?", "0", ":", "argumentTypeSignatures", ".", "length", ";", "if", "(", "argumentCount", ">", "0", ")", "{", "long", "position", "=", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ";", "method", ".", "arguments", "=", "new", "Argument", "[", "argumentCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentCount", ";", "i", "++", ")", "{", "TypeReference", "typeReference", "=", "createTypeReference", "(", "argumentTypeSignatures", "[", "i", "]", ",", "start", ",", "end", ")", ";", "if", "(", "isVarargs", "&&", "i", "==", "argumentCount", "-", "1", ")", "{", "typeReference", ".", "bits", "|=", "ASTNode", ".", "IsVarArgs", ";", "}", "method", ".", "arguments", "[", "i", "]", "=", "new", "Argument", "(", "argumentNames", "[", "i", "]", ",", "position", ",", "typeReference", ",", "ClassFileConstants", ".", "AccDefault", ")", ";", "}", "}", "char", "[", "]", "[", "]", "exceptionTypeNames", "=", "methodInfo", ".", "getExceptionTypeNames", "(", ")", ";", "int", "exceptionCount", "=", "exceptionTypeNames", "==", "null", "?", "0", ":", "exceptionTypeNames", ".", "length", ";", "if", "(", "exceptionCount", ">", "0", ")", "{", "method", ".", "thrownExceptions", "=", "new", "TypeReference", "[", "exceptionCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "exceptionCount", ";", "i", "++", ")", "{", "method", ".", "thrownExceptions", "[", "i", "]", "=", "createTypeReference", "(", "exceptionTypeNames", "[", "i", "]", ",", "start", ",", "end", ")", ";", "}", "}", "if", "(", "(", "this", ".", "flags", "&", "LOCAL_TYPE", ")", "!=", "0", ")", "{", "IJavaElement", "[", "]", "children", "=", "methodInfo", ".", "getChildren", "(", ")", ";", "int", "typesLength", "=", "children", ".", "length", ";", "if", "(", "typesLength", "!=", "0", ")", "{", "Statement", "[", "]", "statements", "=", "new", "Statement", "[", "typesLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "typesLength", ";", "i", "++", ")", "{", "SourceType", "type", "=", "(", "SourceType", ")", "children", "[", "i", "]", ";", "TypeDeclaration", "localType", "=", "convert", "(", "type", ",", "compilationResult", ")", ";", "if", "(", "(", "localType", ".", "bits", "&", "ASTNode", ".", "IsAnonymousType", ")", "!=", "0", ")", "{", "QualifiedAllocationExpression", "expression", "=", "new", "QualifiedAllocationExpression", "(", "localType", ")", ";", "expression", ".", "type", "=", "localType", ".", "superclass", ";", "localType", ".", "superclass", "=", "null", ";", "localType", ".", "superInterfaces", "=", "null", ";", "localType", ".", "allocation", "=", "expression", ";", "statements", "[", "i", "]", "=", "expression", ";", "}", "else", "{", "statements", "[", "i", "]", "=", "localType", ";", "}", "}", "method", ".", "statements", "=", "statements", ";", "}", "}", "return", "method", ";", "}", "private", "TypeDeclaration", "convert", "(", "SourceType", "typeHandle", ",", "CompilationResult", "compilationResult", ")", "throws", "JavaModelException", "{", "SourceTypeElementInfo", "typeInfo", "=", "(", "SourceTypeElementInfo", ")", "typeHandle", ".", "getElementInfo", "(", ")", ";", "if", "(", "typeInfo", ".", "isAnonymousMember", "(", ")", ")", "throw", "new", "AnonymousMemberFound", "(", ")", ";", "TypeDeclaration", "type", "=", "new", "TypeDeclaration", "(", "compilationResult", ")", ";", "if", "(", "typeInfo", ".", "getEnclosingType", "(", ")", "==", "null", ")", "{", "if", "(", "typeHandle", ".", "isAnonymous", "(", ")", ")", "{", "type", ".", "name", "=", "CharOperation", ".", "NO_CHAR", ";", "type", ".", "bits", "|=", "(", "ASTNode", ".", "IsAnonymousType", "|", "ASTNode", ".", "IsLocalType", ")", ";", "}", "else", "{", "if", "(", "typeHandle", ".", "isLocal", "(", ")", ")", "{", "type", ".", "bits", "|=", "ASTNode", ".", "IsLocalType", ";", "}", "}", "}", "else", "{", "type", ".", "bits", "|=", "ASTNode", ".", "IsMemberType", ";", "}", "if", "(", "(", "type", ".", "bits", "&", "ASTNode", ".", "IsAnonymousType", ")", "==", "0", ")", "{", "type", ".", "name", "=", "typeInfo", ".", "getName", "(", ")", ";", "}", "type", ".", "name", "=", "typeInfo", ".", "getName", "(", ")", ";", "int", "start", ",", "end", ";", "type", ".", "sourceStart", "=", "start", "=", "typeInfo", ".", "getNameSourceStart", "(", ")", ";", "type", ".", "sourceEnd", "=", "end", "=", "typeInfo", ".", "getNameSourceEnd", "(", ")", ";", "type", ".", "modifiers", "=", "typeInfo", ".", "getModifiers", "(", ")", ";", "type", ".", "declarationSourceStart", "=", "typeInfo", ".", "getDeclarationSourceStart", "(", ")", ";", "type", ".", "declarationSourceEnd", "=", "typeInfo", ".", "getDeclarationSourceEnd", "(", ")", ";", "type", ".", "bodyEnd", "=", "type", ".", "declarationSourceEnd", ";", "if", "(", "this", ".", "has1_5Compliance", ")", "{", "type", ".", "annotations", "=", "convertAnnotations", "(", "typeHandle", ")", ";", "}", "char", "[", "]", "[", "]", "typeParameterNames", "=", "typeInfo", ".", "getTypeParameterNames", "(", ")", ";", "if", "(", "typeParameterNames", ".", "length", ">", "0", ")", "{", "int", "parameterCount", "=", "typeParameterNames", ".", "length", ";", "char", "[", "]", "[", "]", "[", "]", "typeParameterBounds", "=", "typeInfo", ".", "getTypeParameterBounds", "(", ")", ";", "type", ".", "typeParameters", "=", "new", "TypeParameter", "[", "parameterCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameterCount", ";", "i", "++", ")", "{", "type", ".", "typeParameters", "[", "i", "]", "=", "createTypeParameter", "(", "typeParameterNames", "[", "i", "]", ",", "typeParameterBounds", "[", "i", "]", ",", "start", ",", "end", ")", ";", "}", "}", "if", "(", "typeInfo", ".", "getSuperclassName", "(", ")", "!=", "null", ")", "{", "type", ".", "superclass", "=", "createTypeReference", "(", "typeInfo", ".", "getSuperclassName", "(", ")", ",", "start", ",", "end", ",", "true", ")", ";", "type", ".", "superclass", ".", "bits", "|=", "ASTNode", ".", "IsSuperType", ";", "}", "char", "[", "]", "[", "]", "interfaceNames", "=", "typeInfo", ".", "getInterfaceNames", "(", ")", ";", "int", "interfaceCount", "=", "interfaceNames", "==", "null", "?", "0", ":", "interfaceNames", ".", "length", ";", "if", "(", "interfaceCount", ">", "0", ")", "{", "type", ".", "superInterfaces", "=", "new", "TypeReference", "[", "interfaceCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaceCount", ";", "i", "++", ")", "{", "type", ".", "superInterfaces", "[", "i", "]", "=", "createTypeReference", "(", "interfaceNames", "[", "i", "]", ",", "start", ",", "end", ",", "true", ")", ";", "type", ".", "superInterfaces", "[", "i", "]", ".", "bits", "|=", "ASTNode", ".", "IsSuperType", ";", "}", "}", "if", "(", "(", "this", ".", "flags", "&", "MEMBER_TYPE", ")", "!=", "0", ")", "{", "SourceType", "[", "]", "sourceMemberTypes", "=", "typeInfo", ".", "getMemberTypeHandles", "(", ")", ";", "int", "sourceMemberTypeCount", "=", "sourceMemberTypes", ".", "length", ";", "type", ".", "memberTypes", "=", "new", "TypeDeclaration", "[", "sourceMemberTypeCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "sourceMemberTypeCount", ";", "i", "++", ")", "{", "type", ".", "memberTypes", "[", "i", "]", "=", "convert", "(", "sourceMemberTypes", "[", "i", "]", ",", "compilationResult", ")", ";", "type", ".", "memberTypes", "[", "i", "]", ".", "enclosingType", "=", "type", ";", "}", "}", "InitializerElementInfo", "[", "]", "initializers", "=", "null", ";", "int", "initializerCount", "=", "0", ";", "if", "(", "(", "this", ".", "flags", "&", "LOCAL_TYPE", ")", "!=", "0", ")", "{", "initializers", "=", "typeInfo", ".", "getInitializers", "(", ")", ";", "initializerCount", "=", "initializers", ".", "length", ";", "}", "SourceField", "[", "]", "sourceFields", "=", "null", ";", "int", "sourceFieldCount", "=", "0", ";", "if", "(", "(", "this", ".", "flags", "&", "FIELD", ")", "!=", "0", ")", "{", "sourceFields", "=", "typeInfo", ".", "getFieldHandles", "(", ")", ";", "sourceFieldCount", "=", "sourceFields", ".", "length", ";", "}", "int", "length", "=", "initializerCount", "+", "sourceFieldCount", ";", "if", "(", "length", ">", "0", ")", "{", "type", ".", "fields", "=", "new", "FieldDeclaration", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "initializerCount", ";", "i", "++", ")", "{", "type", ".", "fields", "[", "i", "]", "=", "convert", "(", "initializers", "[", "i", "]", ",", "compilationResult", ")", ";", "}", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "initializerCount", ";", "i", "<", "length", ";", "i", "++", ")", "{", "type", ".", "fields", "[", "i", "]", "=", "convert", "(", "sourceFields", "[", "index", "++", "]", ",", "type", ",", "compilationResult", ")", ";", "}", "}", "boolean", "needConstructor", "=", "(", "this", ".", "flags", "&", "CONSTRUCTOR", ")", "!=", "0", ";", "boolean", "needMethod", "=", "(", "this", ".", "flags", "&", "METHOD", ")", "!=", "0", ";", "if", "(", "needConstructor", "||", "needMethod", ")", "{", "SourceMethod", "[", "]", "sourceMethods", "=", "typeInfo", ".", "getMethodHandles", "(", ")", ";", "int", "sourceMethodCount", "=", "sourceMethods", ".", "length", ";", "int", "extraConstructor", "=", "0", ";", "int", "methodCount", "=", "0", ";", "int", "kind", "=", "TypeDeclaration", ".", "kind", "(", "type", ".", "modifiers", ")", ";", "boolean", "isAbstract", "=", "kind", "==", "TypeDeclaration", ".", "INTERFACE_DECL", "||", "kind", "==", "TypeDeclaration", ".", "ANNOTATION_TYPE_DECL", ";", "if", "(", "!", "isAbstract", ")", "{", "extraConstructor", "=", "needConstructor", "?", "1", ":", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "sourceMethodCount", ";", "i", "++", ")", "{", "if", "(", "sourceMethods", "[", "i", "]", ".", "isConstructor", "(", ")", ")", "{", "if", "(", "needConstructor", ")", "{", "extraConstructor", "=", "0", ";", "methodCount", "++", ";", "}", "}", "else", "if", "(", "needMethod", ")", "{", "methodCount", "++", ";", "}", "}", "}", "else", "{", "methodCount", "=", "needMethod", "?", "sourceMethodCount", ":", "0", ";", "}", "type", ".", "methods", "=", "new", "AbstractMethodDeclaration", "[", "methodCount", "+", "extraConstructor", "]", ";", "if", "(", "extraConstructor", "!=", "0", ")", "{", "type", ".", "methods", "[", "0", "]", "=", "type", ".", "createDefaultConstructor", "(", "false", ",", "false", ")", ";", "}", "int", "index", "=", "0", ";", "boolean", "hasAbstractMethods", "=", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "sourceMethodCount", ";", "i", "++", ")", "{", "SourceMethod", "sourceMethod", "=", "sourceMethods", "[", "i", "]", ";", "SourceMethodElementInfo", "methodInfo", "=", "(", "SourceMethodElementInfo", ")", "sourceMethod", ".", "getElementInfo", "(", ")", ";", "boolean", "isConstructor", "=", "methodInfo", ".", "isConstructor", "(", ")", ";", "if", "(", "(", "methodInfo", ".", "getModifiers", "(", ")", "&", "ClassFileConstants", ".", "AccAbstract", ")", "!=", "0", ")", "{", "hasAbstractMethods", "=", "true", ";", "}", "if", "(", "(", "isConstructor", "&&", "needConstructor", ")", "||", "(", "!", "isConstructor", "&&", "needMethod", ")", ")", "{", "AbstractMethodDeclaration", "method", "=", "convert", "(", "sourceMethod", ",", "methodInfo", ",", "compilationResult", ")", ";", "if", "(", "isAbstract", "||", "method", ".", "isAbstract", "(", ")", ")", "{", "method", ".", "modifiers", "|=", "ExtraCompilerModifiers", ".", "AccSemicolonBody", ";", "}", "type", ".", "methods", "[", "extraConstructor", "+", "index", "++", "]", "=", "method", ";", "}", "}", "if", "(", "hasAbstractMethods", ")", "type", ".", "bits", "|=", "ASTNode", ".", "HasAbstractMethods", ";", "}", "return", "type", ";", "}", "private", "Annotation", "[", "]", "convertAnnotations", "(", "IAnnotatable", "element", ")", "throws", "JavaModelException", "{", "IAnnotation", "[", "]", "annotations", "=", "element", ".", "getAnnotations", "(", ")", ";", "int", "length", "=", "annotations", ".", "length", ";", "Annotation", "[", "]", "astAnnotations", "=", "new", "Annotation", "[", "length", "]", ";", "if", "(", "length", ">", "0", ")", "{", "char", "[", "]", "cuSource", "=", "getSource", "(", ")", ";", "int", "recordedAnnotations", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ISourceRange", "positions", "=", "annotations", "[", "i", "]", ".", "getSourceRange", "(", ")", ";", "int", "start", "=", "positions", ".", "getOffset", "(", ")", ";", "int", "end", "=", "start", "+", "positions", ".", "getLength", "(", ")", ";", "char", "[", "]", "annotationSource", "=", "CharOperation", ".", "subarray", "(", "cuSource", ",", "start", ",", "end", ")", ";", "if", "(", "annotationSource", "!=", "null", ")", "{", "Expression", "expression", "=", "parseMemberValue", "(", "annotationSource", ")", ";", "if", "(", "expression", "instanceof", "Annotation", ")", "{", "astAnnotations", "[", "recordedAnnotations", "++", "]", "=", "(", "Annotation", ")", "expression", ";", "}", "}", "}", "if", "(", "length", "!=", "recordedAnnotations", ")", "{", "System", ".", "arraycopy", "(", "astAnnotations", ",", "0", ",", "(", "astAnnotations", "=", "new", "Annotation", "[", "recordedAnnotations", "]", ")", ",", "0", ",", "recordedAnnotations", ")", ";", "}", "}", "return", "astAnnotations", ";", "}", "private", "char", "[", "]", "getSource", "(", ")", "{", "if", "(", "this", ".", "source", "==", "null", ")", "this", ".", "source", "=", "this", ".", "cu", ".", "getContents", "(", ")", ";", "return", "this", ".", "source", ";", "}", "private", "Expression", "parseMemberValue", "(", "char", "[", "]", "memberValue", ")", "{", "if", "(", "this", ".", "parser", "==", "null", ")", "{", "this", ".", "parser", "=", "new", "Parser", "(", "this", ".", "problemReporter", ",", "true", ")", ";", "}", "return", "this", ".", "parser", ".", "parseMemberValue", "(", "memberValue", ",", "0", ",", "memberValue", ".", "length", ",", "this", ".", "unit", ")", ";", "}", "}", "</s>" ]
3,943
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AbstractMethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FieldDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ImportReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "public", "interface", "ISourceElementRequestor", "{", "public", "static", "class", "TypeInfo", "{", "public", "int", "declarationStart", ";", "public", "int", "modifiers", ";", "public", "char", "[", "]", "name", ";", "public", "int", "nameSourceStart", ";", "public", "int", "nameSourceEnd", ";", "public", "char", "[", "]", "superclass", ";", "public", "char", "[", "]", "[", "]", "superinterfaces", ";", "public", "TypeParameterInfo", "[", "]", "typeParameters", ";", "public", "char", "[", "]", "[", "]", "categories", ";", "public", "boolean", "secondary", ";", "public", "boolean", "anonymousMember", ";", "public", "Annotation", "[", "]", "annotations", ";", "public", "int", "extraFlags", ";", "public", "TypeDeclaration", "node", ";", "public", "HashMap", "childrenCategories", "=", "new", "HashMap", "(", ")", ";", "}", "public", "static", "class", "TypeParameterInfo", "{", "public", "int", "declarationStart", ";", "public", "int", "declarationEnd", ";", "public", "char", "[", "]", "name", ";", "public", "int", "nameSourceStart", ";", "public", "int", "nameSourceEnd", ";", "public", "char", "[", "]", "[", "]", "bounds", ";", "}", "public", "static", "class", "MethodInfo", "{", "public", "boolean", "isConstructor", ";", "public", "boolean", "isAnnotation", ";", "public", "int", "declarationStart", ";", "public", "int", "modifiers", ";", "public", "char", "[", "]", "returnType", ";", "public", "char", "[", "]", "name", ";", "public", "int", "nameSourceStart", ";", "public", "int", "nameSourceEnd", ";", "public", "char", "[", "]", "[", "]", "parameterTypes", ";", "public", "char", "[", "]", "[", "]", "parameterNames", ";", "public", "char", "[", "]", "[", "]", "exceptionTypes", ";", "public", "TypeParameterInfo", "[", "]", "typeParameters", ";", "public", "char", "[", "]", "[", "]", "categories", ";", "public", "Annotation", "[", "]", "annotations", ";", "public", "char", "[", "]", "declaringPackageName", ";", "public", "int", "declaringTypeModifiers", ";", "public", "int", "extraFlags", ";", "public", "AbstractMethodDeclaration", "node", ";", "public", "ParameterInfo", "[", "]", "parameterInfos", ";", "}", "public", "static", "class", "ParameterInfo", "{", "public", "int", "modifiers", ";", "public", "int", "declarationStart", ";", "public", "int", "declarationEnd", ";", "public", "int", "nameSourceStart", ";", "public", "int", "nameSourceEnd", ";", "public", "char", "[", "]", "name", ";", "}", "public", "static", "class", "FieldInfo", "{", "public", "int", "declarationStart", ";", "public", "int", "modifiers", ";", "public", "char", "[", "]", "type", ";", "public", "char", "[", "]", "name", ";", "public", "int", "nameSourceStart", ";", "public", "int", "nameSourceEnd", ";", "public", "char", "[", "]", "[", "]", "categories", ";", "public", "Annotation", "[", "]", "annotations", ";", "public", "FieldDeclaration", "node", ";", "}", "void", "acceptAnnotationTypeReference", "(", "char", "[", "]", "[", "]", "annotation", ",", "int", "sourceStart", ",", "int", "sourceEnd", ")", ";", "void", "acceptAnnotationTypeReference", "(", "char", "[", "]", "annotation", ",", "int", "sourcePosition", ")", ";", "void", "acceptConstructorReference", "(", "char", "[", "]", "typeName", ",", "int", "argCount", ",", "int", "sourcePosition", ")", ";", "void", "acceptFieldReference", "(", "char", "[", "]", "fieldName", ",", "int", "sourcePosition", ")", ";", "void", "acceptImport", "(", "int", "declarationStart", ",", "int", "declarationEnd", ",", "int", "nameStart", ",", "int", "nameEnd", ",", "char", "[", "]", "[", "]", "tokens", ",", "boolean", "onDemand", ",", "int", "modifiers", ")", ";", "void", "acceptLineSeparatorPositions", "(", "int", "[", "]", "positions", ")", ";", "void", "acceptMethodReference", "(", "char", "[", "]", "methodName", ",", "int", "argCount", ",", "int", "sourcePosition", ")", ";", "void", "acceptPackage", "(", "ImportReference", "importReference", ")", ";", "void", "acceptProblem", "(", "CategorizedProblem", "problem", ")", ";", "void", "acceptTypeReference", "(", "char", "[", "]", "[", "]", "typeName", ",", "int", "sourceStart", ",", "int", "sourceEnd", ")", ";", "void", "acceptTypeReference", "(", "char", "[", "]", "typeName", ",", "int", "sourcePosition", ")", ";", "void", "acceptUnknownReference", "(", "char", "[", "]", "[", "]", "name", ",", "int", "sourceStart", ",", "int", "sourceEnd", ")", ";", "void", "acceptUnknownReference", "(", "char", "[", "]", "name", ",", "int", "sourcePosition", ")", ";", "void", "enterCompilationUnit", "(", ")", ";", "void", "enterConstructor", "(", "MethodInfo", "methodInfo", ")", ";", "void", "enterField", "(", "FieldInfo", "fieldInfo", ")", ";", "void", "enterInitializer", "(", "int", "declarationStart", ",", "int", "modifiers", ")", ";", "void", "enterMethod", "(", "MethodInfo", "methodInfo", ")", ";", "void", "enterType", "(", "TypeInfo", "typeInfo", ")", ";", "void", "exitCompilationUnit", "(", "int", "declarationEnd", ")", ";", "void", "exitConstructor", "(", "int", "declarationEnd", ")", ";", "void", "exitField", "(", "int", "initializationStart", ",", "int", "declarationEnd", ",", "int", "declarationSourceEnd", ")", ";", "void", "exitInitializer", "(", "int", "declarationEnd", ")", ";", "void", "exitMethod", "(", "int", "declarationEnd", ",", "Expression", "defaultValue", ")", ";", "void", "exitType", "(", "int", "declarationEnd", ")", ";", "}", "</s>" ]
3,944
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ISourceElementRequestor", ".", "ParameterInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ISourceElementRequestor", ".", "TypeParameterInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AbstractMethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AbstractVariableDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AnnotationMethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Argument", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayAllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayInitializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Assignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ClassLiteralAccess", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompilationUnitDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ConstructorDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ExplicitConstructorCall", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FieldDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ImportReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Initializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MessageSend", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedAllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ThisReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeParameter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ClassScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ExtraCompilerModifiers", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "HashtableOfObjectToInt", ";", "public", "class", "SourceElementNotifier", "{", "public", "class", "LocalDeclarationVisitor", "extends", "ASTVisitor", "{", "public", "ImportReference", "currentPackage", ";", "ArrayList", "declaringTypes", ";", "public", "void", "pushDeclaringType", "(", "TypeDeclaration", "declaringType", ")", "{", "if", "(", "this", ".", "declaringTypes", "==", "null", ")", "{", "this", ".", "declaringTypes", "=", "new", "ArrayList", "(", ")", ";", "}", "this", ".", "declaringTypes", ".", "add", "(", "declaringType", ")", ";", "}", "public", "void", "popDeclaringType", "(", ")", "{", "this", ".", "declaringTypes", ".", "remove", "(", "this", ".", "declaringTypes", ".", "size", "(", ")", "-", "1", ")", ";", "}", "public", "TypeDeclaration", "peekDeclaringType", "(", ")", "{", "if", "(", "this", ".", "declaringTypes", "==", "null", ")", "return", "null", ";", "int", "size", "=", "this", ".", "declaringTypes", ".", "size", "(", ")", ";", "if", "(", "size", "==", "0", ")", "return", "null", ";", "return", "(", "TypeDeclaration", ")", "this", ".", "declaringTypes", ".", "get", "(", "size", "-", "1", ")", ";", "}", "public", "boolean", "visit", "(", "TypeDeclaration", "typeDeclaration", ",", "BlockScope", "scope", ")", "{", "notifySourceElementRequestor", "(", "typeDeclaration", ",", "true", ",", "peekDeclaringType", "(", ")", ",", "this", ".", "currentPackage", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "TypeDeclaration", "typeDeclaration", ",", "ClassScope", "scope", ")", "{", "notifySourceElementRequestor", "(", "typeDeclaration", ",", "true", ",", "peekDeclaringType", "(", ")", ",", "this", ".", "currentPackage", ")", ";", "return", "false", ";", "}", "}", "ISourceElementRequestor", "requestor", ";", "boolean", "reportReferenceInfo", ";", "char", "[", "]", "[", "]", "typeNames", ";", "char", "[", "]", "[", "]", "superTypeNames", ";", "int", "nestedTypeIndex", ";", "LocalDeclarationVisitor", "localDeclarationVisitor", "=", "null", ";", "HashtableOfObjectToInt", "sourceEnds", ";", "Map", "nodesToCategories", ";", "int", "initialPosition", ";", "int", "eofPosition", ";", "public", "SourceElementNotifier", "(", "ISourceElementRequestor", "requestor", ",", "boolean", "reportLocalDeclarations", ")", "{", "this", ".", "requestor", "=", "requestor", ";", "if", "(", "reportLocalDeclarations", ")", "{", "this", ".", "localDeclarationVisitor", "=", "new", "LocalDeclarationVisitor", "(", ")", ";", "}", "this", ".", "typeNames", "=", "new", "char", "[", "4", "]", "[", "]", ";", "this", ".", "superTypeNames", "=", "new", "char", "[", "4", "]", "[", "]", ";", "this", ".", "nestedTypeIndex", "=", "0", ";", "}", "protected", "Object", "[", "]", "[", "]", "getArgumentInfos", "(", "Argument", "[", "]", "arguments", ")", "{", "int", "argumentLength", "=", "arguments", ".", "length", ";", "char", "[", "]", "[", "]", "argumentTypes", "=", "new", "char", "[", "argumentLength", "]", "[", "]", ";", "char", "[", "]", "[", "]", "argumentNames", "=", "new", "char", "[", "argumentLength", "]", "[", "]", ";", "ParameterInfo", "[", "]", "parameterInfos", "=", "new", "ParameterInfo", "[", "argumentLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentLength", ";", "i", "++", ")", "{", "Argument", "argument", "=", "arguments", "[", "i", "]", ";", "argumentTypes", "[", "i", "]", "=", "CharOperation", ".", "concatWith", "(", "argument", ".", "type", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ";", "char", "[", "]", "name", "=", "argument", ".", "name", ";", "argumentNames", "[", "i", "]", "=", "name", ";", "ParameterInfo", "parameterInfo", "=", "new", "ParameterInfo", "(", ")", ";", "parameterInfo", ".", "declarationStart", "=", "argument", ".", "declarationSourceStart", ";", "parameterInfo", ".", "declarationEnd", "=", "argument", ".", "declarationSourceEnd", ";", "parameterInfo", ".", "nameSourceStart", "=", "argument", ".", "sourceStart", ";", "parameterInfo", ".", "nameSourceEnd", "=", "argument", ".", "sourceEnd", ";", "parameterInfo", ".", "modifiers", "=", "argument", ".", "modifiers", ";", "parameterInfo", ".", "name", "=", "name", ";", "parameterInfos", "[", "i", "]", "=", "parameterInfo", ";", "}", "return", "new", "Object", "[", "]", "[", "]", "{", "parameterInfos", ",", "new", "char", "[", "]", "[", "]", "[", "]", "{", "argumentTypes", ",", "argumentNames", "}", "}", ";", "}", "protected", "char", "[", "]", "[", "]", "getInterfaceNames", "(", "TypeDeclaration", "typeDeclaration", ")", "{", "char", "[", "]", "[", "]", "interfaceNames", "=", "null", ";", "int", "superInterfacesLength", "=", "0", ";", "TypeReference", "[", "]", "superInterfaces", "=", "typeDeclaration", ".", "superInterfaces", ";", "if", "(", "superInterfaces", "!=", "null", ")", "{", "superInterfacesLength", "=", "superInterfaces", ".", "length", ";", "interfaceNames", "=", "new", "char", "[", "superInterfacesLength", "]", "[", "]", ";", "}", "else", "{", "if", "(", "(", "typeDeclaration", ".", "bits", "&", "ASTNode", ".", "IsAnonymousType", ")", "!=", "0", ")", "{", "QualifiedAllocationExpression", "alloc", "=", "typeDeclaration", ".", "allocation", ";", "if", "(", "alloc", "!=", "null", "&&", "alloc", ".", "type", "!=", "null", ")", "{", "superInterfaces", "=", "new", "TypeReference", "[", "]", "{", "alloc", ".", "type", "}", ";", "superInterfacesLength", "=", "1", ";", "interfaceNames", "=", "new", "char", "[", "1", "]", "[", "]", ";", "}", "}", "}", "if", "(", "superInterfaces", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "superInterfacesLength", ";", "i", "++", ")", "{", "interfaceNames", "[", "i", "]", "=", "CharOperation", ".", "concatWith", "(", "superInterfaces", "[", "i", "]", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ";", "}", "}", "return", "interfaceNames", ";", "}", "protected", "char", "[", "]", "getSuperclassName", "(", "TypeDeclaration", "typeDeclaration", ")", "{", "TypeReference", "superclass", "=", "typeDeclaration", ".", "superclass", ";", "return", "superclass", "!=", "null", "?", "CharOperation", ".", "concatWith", "(", "superclass", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ":", "null", ";", "}", "protected", "char", "[", "]", "[", "]", "getThrownExceptions", "(", "AbstractMethodDeclaration", "methodDeclaration", ")", "{", "char", "[", "]", "[", "]", "thrownExceptionTypes", "=", "null", ";", "TypeReference", "[", "]", "thrownExceptions", "=", "methodDeclaration", ".", "thrownExceptions", ";", "if", "(", "thrownExceptions", "!=", "null", ")", "{", "int", "thrownExceptionLength", "=", "thrownExceptions", ".", "length", ";", "thrownExceptionTypes", "=", "new", "char", "[", "thrownExceptionLength", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "thrownExceptionLength", ";", "i", "++", ")", "{", "thrownExceptionTypes", "[", "i", "]", "=", "CharOperation", ".", "concatWith", "(", "thrownExceptions", "[", "i", "]", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ";", "}", "}", "return", "thrownExceptionTypes", ";", "}", "protected", "char", "[", "]", "[", "]", "getTypeParameterBounds", "(", "TypeParameter", "typeParameter", ")", "{", "TypeReference", "firstBound", "=", "typeParameter", ".", "type", ";", "TypeReference", "[", "]", "otherBounds", "=", "typeParameter", ".", "bounds", ";", "char", "[", "]", "[", "]", "typeParameterBounds", "=", "null", ";", "if", "(", "firstBound", "!=", "null", ")", "{", "if", "(", "otherBounds", "!=", "null", ")", "{", "int", "otherBoundsLength", "=", "otherBounds", ".", "length", ";", "char", "[", "]", "[", "]", "boundNames", "=", "new", "char", "[", "otherBoundsLength", "+", "1", "]", "[", "]", ";", "boundNames", "[", "0", "]", "=", "CharOperation", ".", "concatWith", "(", "firstBound", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "otherBoundsLength", ";", "j", "++", ")", "{", "boundNames", "[", "j", "+", "1", "]", "=", "CharOperation", ".", "concatWith", "(", "otherBounds", "[", "j", "]", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ";", "}", "typeParameterBounds", "=", "boundNames", ";", "}", "else", "{", "typeParameterBounds", "=", "new", "char", "[", "]", "[", "]", "{", "CharOperation", ".", "concatWith", "(", "firstBound", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", "}", ";", "}", "}", "else", "{", "typeParameterBounds", "=", "CharOperation", ".", "NO_CHAR_CHAR", ";", "}", "return", "typeParameterBounds", ";", "}", "private", "TypeParameterInfo", "[", "]", "getTypeParameterInfos", "(", "TypeParameter", "[", "]", "typeParameters", ")", "{", "if", "(", "typeParameters", "==", "null", ")", "return", "null", ";", "int", "typeParametersLength", "=", "typeParameters", ".", "length", ";", "TypeParameterInfo", "[", "]", "result", "=", "new", "TypeParameterInfo", "[", "typeParametersLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "typeParametersLength", ";", "i", "++", ")", "{", "TypeParameter", "typeParameter", "=", "typeParameters", "[", "i", "]", ";", "char", "[", "]", "[", "]", "typeParameterBounds", "=", "getTypeParameterBounds", "(", "typeParameter", ")", ";", "ISourceElementRequestor", ".", "TypeParameterInfo", "typeParameterInfo", "=", "new", "ISourceElementRequestor", ".", "TypeParameterInfo", "(", ")", ";", "typeParameterInfo", ".", "declarationStart", "=", "typeParameter", ".", "declarationSourceStart", ";", "typeParameterInfo", ".", "declarationEnd", "=", "typeParameter", ".", "declarationSourceEnd", ";", "typeParameterInfo", ".", "name", "=", "typeParameter", ".", "name", ";", "typeParameterInfo", ".", "nameSourceStart", "=", "typeParameter", ".", "sourceStart", ";", "typeParameterInfo", ".", "nameSourceEnd", "=", "typeParameter", ".", "sourceEnd", ";", "typeParameterInfo", ".", "bounds", "=", "typeParameterBounds", ";", "result", "[", "i", "]", "=", "typeParameterInfo", ";", "}", "return", "result", ";", "}", "private", "boolean", "hasDeprecatedAnnotation", "(", "Annotation", "[", "]", "annotations", ")", "{", "if", "(", "annotations", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "annotations", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "Annotation", "annotation", "=", "annotations", "[", "i", "]", ";", "if", "(", "CharOperation", ".", "equals", "(", "annotation", ".", "type", ".", "getLastToken", "(", ")", ",", "TypeConstants", ".", "JAVA_LANG_DEPRECATED", "[", "2", "]", ")", ")", "{", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}", "protected", "void", "notifySourceElementRequestor", "(", "AbstractMethodDeclaration", "methodDeclaration", ",", "TypeDeclaration", "declaringType", ",", "ImportReference", "currentPackage", ")", "{", "boolean", "isInRange", "=", "this", ".", "initialPosition", "<=", "methodDeclaration", ".", "declarationSourceStart", "&&", "this", ".", "eofPosition", ">=", "methodDeclaration", ".", "declarationSourceEnd", ";", "if", "(", "methodDeclaration", ".", "isClinit", "(", ")", ")", "{", "this", ".", "visitIfNeeded", "(", "methodDeclaration", ")", ";", "return", ";", "}", "if", "(", "methodDeclaration", ".", "isDefaultConstructor", "(", ")", ")", "{", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "ConstructorDeclaration", "constructorDeclaration", "=", "(", "ConstructorDeclaration", ")", "methodDeclaration", ";", "ExplicitConstructorCall", "constructorCall", "=", "constructorDeclaration", ".", "constructorCall", ";", "if", "(", "constructorCall", "!=", "null", ")", "{", "switch", "(", "constructorCall", ".", "accessMode", ")", "{", "case", "ExplicitConstructorCall", ".", "This", ":", "this", ".", "requestor", ".", "acceptConstructorReference", "(", "this", ".", "typeNames", "[", "this", ".", "nestedTypeIndex", "-", "1", "]", ",", "constructorCall", ".", "arguments", "==", "null", "?", "0", ":", "constructorCall", ".", "arguments", ".", "length", ",", "constructorCall", ".", "sourceStart", ")", ";", "break", ";", "case", "ExplicitConstructorCall", ".", "Super", ":", "case", "ExplicitConstructorCall", ".", "ImplicitSuper", ":", "this", ".", "requestor", ".", "acceptConstructorReference", "(", "this", ".", "superTypeNames", "[", "this", ".", "nestedTypeIndex", "-", "1", "]", ",", "constructorCall", ".", "arguments", "==", "null", "?", "0", ":", "constructorCall", ".", "arguments", ".", "length", ",", "constructorCall", ".", "sourceStart", ")", ";", "break", ";", "}", "}", "}", "return", ";", "}", "char", "[", "]", "[", "]", "argumentTypes", "=", "null", ";", "char", "[", "]", "[", "]", "argumentNames", "=", "null", ";", "boolean", "isVarArgs", "=", "false", ";", "Argument", "[", "]", "arguments", "=", "methodDeclaration", ".", "arguments", ";", "ParameterInfo", "[", "]", "parameterInfos", "=", "null", ";", "if", "(", "arguments", "!=", "null", ")", "{", "Object", "[", "]", "[", "]", "argumentInfos", "=", "getArgumentInfos", "(", "arguments", ")", ";", "parameterInfos", "=", "(", "ParameterInfo", "[", "]", ")", "argumentInfos", "[", "0", "]", ";", "argumentTypes", "=", "(", "char", "[", "]", "[", "]", ")", "argumentInfos", "[", "1", "]", "[", "0", "]", ";", "argumentNames", "=", "(", "char", "[", "]", "[", "]", ")", "argumentInfos", "[", "1", "]", "[", "1", "]", ";", "isVarArgs", "=", "arguments", "[", "arguments", ".", "length", "-", "1", "]", ".", "isVarArgs", "(", ")", ";", "}", "char", "[", "]", "[", "]", "thrownExceptionTypes", "=", "getThrownExceptions", "(", "methodDeclaration", ")", ";", "int", "selectorSourceEnd", "=", "-", "1", ";", "if", "(", "methodDeclaration", ".", "isConstructor", "(", ")", ")", "{", "selectorSourceEnd", "=", "this", ".", "sourceEnds", ".", "get", "(", "methodDeclaration", ")", ";", "if", "(", "isInRange", ")", "{", "int", "currentModifiers", "=", "methodDeclaration", ".", "modifiers", ";", "if", "(", "isVarArgs", ")", "currentModifiers", "|=", "ClassFileConstants", ".", "AccVarargs", ";", "boolean", "deprecated", "=", "(", "currentModifiers", "&", "ClassFileConstants", ".", "AccDeprecated", ")", "!=", "0", "||", "hasDeprecatedAnnotation", "(", "methodDeclaration", ".", "annotations", ")", ";", "ISourceElementRequestor", ".", "MethodInfo", "methodInfo", "=", "new", "ISourceElementRequestor", ".", "MethodInfo", "(", ")", ";", "methodInfo", ".", "isConstructor", "=", "true", ";", "methodInfo", ".", "declarationStart", "=", "methodDeclaration", ".", "declarationSourceStart", ";", "methodInfo", ".", "modifiers", "=", "deprecated", "?", "(", "currentModifiers", "&", "ExtraCompilerModifiers", ".", "AccJustFlag", ")", "|", "ClassFileConstants", ".", "AccDeprecated", ":", "currentModifiers", "&", "ExtraCompilerModifiers", ".", "AccJustFlag", ";", "methodInfo", ".", "name", "=", "methodDeclaration", ".", "selector", ";", "methodInfo", ".", "nameSourceStart", "=", "methodDeclaration", ".", "sourceStart", ";", "methodInfo", ".", "nameSourceEnd", "=", "selectorSourceEnd", ";", "methodInfo", ".", "parameterTypes", "=", "argumentTypes", ";", "methodInfo", ".", "parameterNames", "=", "argumentNames", ";", "methodInfo", ".", "exceptionTypes", "=", "thrownExceptionTypes", ";", "methodInfo", ".", "typeParameters", "=", "getTypeParameterInfos", "(", "methodDeclaration", ".", "typeParameters", "(", ")", ")", ";", "methodInfo", ".", "parameterInfos", "=", "parameterInfos", ";", "methodInfo", ".", "categories", "=", "(", "char", "[", "]", "[", "]", ")", "this", ".", "nodesToCategories", ".", "get", "(", "methodDeclaration", ")", ";", "methodInfo", ".", "annotations", "=", "methodDeclaration", ".", "annotations", ";", "methodInfo", ".", "declaringPackageName", "=", "currentPackage", "==", "null", "?", "CharOperation", ".", "NO_CHAR", ":", "CharOperation", ".", "concatWith", "(", "currentPackage", ".", "tokens", ",", "'.'", ")", ";", "methodInfo", ".", "declaringTypeModifiers", "=", "declaringType", ".", "modifiers", ";", "methodInfo", ".", "extraFlags", "=", "ExtraFlags", ".", "getExtraFlags", "(", "declaringType", ")", ";", "methodInfo", ".", "node", "=", "methodDeclaration", ";", "this", ".", "requestor", ".", "enterConstructor", "(", "methodInfo", ")", ";", "}", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "ConstructorDeclaration", "constructorDeclaration", "=", "(", "ConstructorDeclaration", ")", "methodDeclaration", ";", "ExplicitConstructorCall", "constructorCall", "=", "constructorDeclaration", ".", "constructorCall", ";", "if", "(", "constructorCall", "!=", "null", ")", "{", "switch", "(", "constructorCall", ".", "accessMode", ")", "{", "case", "ExplicitConstructorCall", ".", "This", ":", "this", ".", "requestor", ".", "acceptConstructorReference", "(", "this", ".", "typeNames", "[", "this", ".", "nestedTypeIndex", "-", "1", "]", ",", "constructorCall", ".", "arguments", "==", "null", "?", "0", ":", "constructorCall", ".", "arguments", ".", "length", ",", "constructorCall", ".", "sourceStart", ")", ";", "break", ";", "case", "ExplicitConstructorCall", ".", "Super", ":", "case", "ExplicitConstructorCall", ".", "ImplicitSuper", ":", "this", ".", "requestor", ".", "acceptConstructorReference", "(", "this", ".", "superTypeNames", "[", "this", ".", "nestedTypeIndex", "-", "1", "]", ",", "constructorCall", ".", "arguments", "==", "null", "?", "0", ":", "constructorCall", ".", "arguments", ".", "length", ",", "constructorCall", ".", "sourceStart", ")", ";", "break", ";", "}", "}", "}", "this", ".", "visitIfNeeded", "(", "methodDeclaration", ")", ";", "if", "(", "isInRange", ")", "{", "this", ".", "requestor", ".", "exitConstructor", "(", "methodDeclaration", ".", "declarationSourceEnd", ")", ";", "}", "return", ";", "}", "selectorSourceEnd", "=", "this", ".", "sourceEnds", ".", "get", "(", "methodDeclaration", ")", ";", "if", "(", "isInRange", ")", "{", "int", "currentModifiers", "=", "methodDeclaration", ".", "modifiers", ";", "if", "(", "isVarArgs", ")", "currentModifiers", "|=", "ClassFileConstants", ".", "AccVarargs", ";", "boolean", "deprecated", "=", "(", "currentModifiers", "&", "ClassFileConstants", ".", "AccDeprecated", ")", "!=", "0", "||", "hasDeprecatedAnnotation", "(", "methodDeclaration", ".", "annotations", ")", ";", "TypeReference", "returnType", "=", "methodDeclaration", "instanceof", "MethodDeclaration", "?", "(", "(", "MethodDeclaration", ")", "methodDeclaration", ")", ".", "returnType", ":", "null", ";", "ISourceElementRequestor", ".", "MethodInfo", "methodInfo", "=", "new", "ISourceElementRequestor", ".", "MethodInfo", "(", ")", ";", "methodInfo", ".", "isAnnotation", "=", "methodDeclaration", "instanceof", "AnnotationMethodDeclaration", ";", "methodInfo", ".", "declarationStart", "=", "methodDeclaration", ".", "declarationSourceStart", ";", "methodInfo", ".", "modifiers", "=", "deprecated", "?", "(", "currentModifiers", "&", "ExtraCompilerModifiers", ".", "AccJustFlag", ")", "|", "ClassFileConstants", ".", "AccDeprecated", ":", "currentModifiers", "&", "ExtraCompilerModifiers", ".", "AccJustFlag", ";", "methodInfo", ".", "returnType", "=", "returnType", "==", "null", "?", "null", ":", "CharOperation", ".", "concatWith", "(", "returnType", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ";", "methodInfo", ".", "name", "=", "methodDeclaration", ".", "selector", ";", "methodInfo", ".", "nameSourceStart", "=", "methodDeclaration", ".", "sourceStart", ";", "methodInfo", ".", "nameSourceEnd", "=", "selectorSourceEnd", ";", "methodInfo", ".", "parameterTypes", "=", "argumentTypes", ";", "methodInfo", ".", "parameterNames", "=", "argumentNames", ";", "methodInfo", ".", "exceptionTypes", "=", "thrownExceptionTypes", ";", "methodInfo", ".", "typeParameters", "=", "getTypeParameterInfos", "(", "methodDeclaration", ".", "typeParameters", "(", ")", ")", ";", "methodInfo", ".", "parameterInfos", "=", "parameterInfos", ";", "methodInfo", ".", "categories", "=", "(", "char", "[", "]", "[", "]", ")", "this", ".", "nodesToCategories", ".", "get", "(", "methodDeclaration", ")", ";", "methodInfo", ".", "annotations", "=", "methodDeclaration", ".", "annotations", ";", "methodInfo", ".", "node", "=", "methodDeclaration", ";", "this", ".", "requestor", ".", "enterMethod", "(", "methodInfo", ")", ";", "}", "this", ".", "visitIfNeeded", "(", "methodDeclaration", ")", ";", "if", "(", "isInRange", ")", "{", "if", "(", "methodDeclaration", "instanceof", "AnnotationMethodDeclaration", ")", "{", "AnnotationMethodDeclaration", "annotationMethodDeclaration", "=", "(", "AnnotationMethodDeclaration", ")", "methodDeclaration", ";", "Expression", "expression", "=", "annotationMethodDeclaration", ".", "defaultValue", ";", "if", "(", "expression", "!=", "null", ")", "{", "this", ".", "requestor", ".", "exitMethod", "(", "methodDeclaration", ".", "declarationSourceEnd", ",", "expression", ")", ";", "return", ";", "}", "}", "this", ".", "requestor", ".", "exitMethod", "(", "methodDeclaration", ".", "declarationSourceEnd", ",", "null", ")", ";", "}", "}", "public", "void", "notifySourceElementRequestor", "(", "CompilationUnitDeclaration", "parsedUnit", ",", "int", "sourceStart", ",", "int", "sourceEnd", ",", "boolean", "reportReference", ",", "HashtableOfObjectToInt", "sourceEndsMap", ",", "Map", "nodesToCategoriesMap", ")", "{", "this", ".", "initialPosition", "=", "sourceStart", ";", "this", ".", "eofPosition", "=", "sourceEnd", ";", "this", ".", "reportReferenceInfo", "=", "reportReference", ";", "this", ".", "sourceEnds", "=", "sourceEndsMap", ";", "this", ".", "nodesToCategories", "=", "nodesToCategoriesMap", ";", "try", "{", "boolean", "isInRange", "=", "this", ".", "initialPosition", "<=", "parsedUnit", ".", "sourceStart", "&&", "this", ".", "eofPosition", ">=", "parsedUnit", ".", "sourceEnd", ";", "int", "length", "=", "0", ";", "ASTNode", "[", "]", "nodes", "=", "null", ";", "if", "(", "isInRange", ")", "{", "this", ".", "requestor", ".", "enterCompilationUnit", "(", ")", ";", "}", "ImportReference", "currentPackage", "=", "parsedUnit", ".", "currentPackage", ";", "if", "(", "this", ".", "localDeclarationVisitor", "!=", "null", ")", "{", "this", ".", "localDeclarationVisitor", ".", "currentPackage", "=", "currentPackage", ";", "}", "ImportReference", "[", "]", "imports", "=", "parsedUnit", ".", "imports", ";", "TypeDeclaration", "[", "]", "types", "=", "parsedUnit", ".", "types", ";", "length", "=", "(", "currentPackage", "==", "null", "?", "0", ":", "1", ")", "+", "(", "imports", "==", "null", "?", "0", ":", "imports", ".", "length", ")", "+", "(", "types", "==", "null", "?", "0", ":", "types", ".", "length", ")", ";", "nodes", "=", "new", "ASTNode", "[", "length", "]", ";", "int", "index", "=", "0", ";", "if", "(", "currentPackage", "!=", "null", ")", "{", "nodes", "[", "index", "++", "]", "=", "currentPackage", ";", "}", "if", "(", "imports", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "imports", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "nodes", "[", "index", "++", "]", "=", "imports", "[", "i", "]", ";", "}", "}", "if", "(", "types", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "types", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "nodes", "[", "index", "++", "]", "=", "types", "[", "i", "]", ";", "}", "}", "if", "(", "length", ">", "0", ")", "{", "quickSort", "(", "nodes", ",", "0", ",", "length", "-", "1", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ASTNode", "node", "=", "nodes", "[", "i", "]", ";", "if", "(", "node", "instanceof", "ImportReference", ")", "{", "ImportReference", "importRef", "=", "(", "ImportReference", ")", "node", ";", "if", "(", "node", "==", "parsedUnit", ".", "currentPackage", ")", "{", "notifySourceElementRequestor", "(", "importRef", ",", "true", ")", ";", "}", "else", "{", "notifySourceElementRequestor", "(", "importRef", ",", "false", ")", ";", "}", "}", "else", "{", "notifySourceElementRequestor", "(", "(", "TypeDeclaration", ")", "node", ",", "true", ",", "null", ",", "currentPackage", ")", ";", "}", "}", "}", "if", "(", "isInRange", ")", "{", "this", ".", "requestor", ".", "exitCompilationUnit", "(", "parsedUnit", ".", "sourceEnd", ")", ";", "}", "}", "finally", "{", "reset", "(", ")", ";", "}", "}", "protected", "void", "notifySourceElementRequestor", "(", "FieldDeclaration", "fieldDeclaration", ",", "TypeDeclaration", "declaringType", ")", "{", "boolean", "isInRange", "=", "this", ".", "initialPosition", "<=", "fieldDeclaration", ".", "declarationSourceStart", "&&", "this", ".", "eofPosition", ">=", "fieldDeclaration", ".", "declarationSourceEnd", ";", "switch", "(", "fieldDeclaration", ".", "getKind", "(", ")", ")", "{", "case", "AbstractVariableDeclaration", ".", "ENUM_CONSTANT", ":", "if", "(", "this", ".", "reportReferenceInfo", ")", "{", "if", "(", "fieldDeclaration", ".", "initialization", "instanceof", "AllocationExpression", ")", "{", "AllocationExpression", "alloc", "=", "(", "AllocationExpression", ")", "fieldDeclaration", ".", "initialization", ";", "this", ".", "requestor", ".", "acceptConstructorReference", "(", "declaringType", ".", "name", ",", "alloc", ".", "arguments", "==", "null", "?", "0", ":", "alloc", ".", "arguments", ".", "length", ",", "alloc", ".", "sourceStart", ")", ";", "}", "}", "case", "AbstractVariableDeclaration", ".", "FIELD", ":", "int", "fieldEndPosition", "=", "this", ".", "sourceEnds", ".", "get", "(", "fieldDeclaration", ")", ";", "if", "(", "fieldEndPosition", "==", "-", "1", ")", "{", "fieldEndPosition", "=", "fieldDeclaration", ".", "declarationSourceEnd", ";", "}", "if", "(", "isInRange", ")", "{", "int", "currentModifiers", "=", "fieldDeclaration", ".", "modifiers", ";", "boolean", "deprecated", "=", "(", "currentModifiers", "&", "ClassFileConstants", ".", "AccDeprecated", ")", "!=", "0", "||", "hasDeprecatedAnnotation", "(", "fieldDeclaration", ".", "annotations", ")", ";", "char", "[", "]", "typeName", "=", "null", ";", "if", "(", "fieldDeclaration", ".", "type", "==", "null", ")", "{", "typeName", "=", "declaringType", ".", "name", ";", "currentModifiers", "|=", "ClassFileConstants", ".", "AccEnum", ";", "}", "else", "{", "typeName", "=", "CharOperation", ".", "concatWith", "(", "fieldDeclaration", ".", "type", ".", "getParameterizedTypeName", "(", ")", ",", "'.'", ")", ";", "}", "ISourceElementRequestor", ".", "FieldInfo", "fieldInfo", "=", "new", "ISourceElementRequestor", ".", "FieldInfo", "(", ")", ";", "fieldInfo", ".", "declarationStart", "=", "fieldDeclaration", ".", "declarationSourceStart", ";", "fieldInfo", ".", "name", "=", "fieldDeclaration", ".", "name", ";", "fieldInfo", ".", "modifiers", "=", "deprecated", "?", "(", "currentModifiers", "&", "ExtraCompilerModifiers", ".", "AccJustFlag", ")", "|", "ClassFileConstants", ".", "AccDeprecated", ":", "currentModifiers", "&", "ExtraCompilerModifiers", ".", "AccJustFlag", ";", "fieldInfo", ".", "type", "=", "typeName", ";", "fieldInfo", ".", "nameSourceStart", "=", "fieldDeclaration", ".", "sourceStart", ";", "fieldInfo", ".", "nameSourceEnd", "=", "fieldDeclaration", ".", "sourceEnd", ";", "fieldInfo", ".", "categories", "=", "(", "char", "[", "]", "[", "]", ")", "this", ".", "nodesToCategories", ".", "get", "(", "fieldDeclaration", ")", ";", "fieldInfo", ".", "annotations", "=", "fieldDeclaration", ".", "annotations", ";", "fieldInfo", ".", "node", "=", "fieldDeclaration", ";", "this", ".", "requestor", ".", "enterField", "(", "fieldInfo", ")", ";", "}", "this", ".", "visitIfNeeded", "(", "fieldDeclaration", ",", "declaringType", ")", ";", "if", "(", "isInRange", ")", "{", "this", ".", "requestor", ".", "exitField", "(", "(", "fieldDeclaration", ".", "initialization", "==", "null", "||", "fieldDeclaration", ".", "initialization", "instanceof", "ArrayInitializer", "||", "fieldDeclaration", ".", "initialization", "instanceof", "AllocationExpression", "||", "fieldDeclaration", ".", "initialization", "instanceof", "ArrayAllocationExpression", "||", "fieldDeclaration", ".", "initialization", "instanceof", "Assignment", "||", "fieldDeclaration", ".", "initialization", "instanceof", "ClassLiteralAccess", "||", "fieldDeclaration", ".", "initialization", "instanceof", "MessageSend", "||", "fieldDeclaration", ".", "initialization", "instanceof", "ArrayReference", "||", "fieldDeclaration", ".", "initialization", "instanceof", "ThisReference", ")", "?", "-", "1", ":", "fieldDeclaration", ".", "initialization", ".", "sourceStart", ",", "fieldEndPosition", ",", "fieldDeclaration", ".", "declarationSourceEnd", ")", ";", "}", "break", ";", "case", "AbstractVariableDeclaration", ".", "INITIALIZER", ":", "if", "(", "isInRange", ")", "{", "this", ".", "requestor", ".", "enterInitializer", "(", "fieldDeclaration", ".", "declarationSourceStart", ",", "fieldDeclaration", ".", "modifiers", ")", ";", "}", "this", ".", "visitIfNeeded", "(", "(", "Initializer", ")", "fieldDeclaration", ")", ";", "if", "(", "isInRange", ")", "{", "this", ".", "requestor", ".", "exitInitializer", "(", "fieldDeclaration", ".", "declarationSourceEnd", ")", ";", "}", "break", ";", "}", "}", "protected", "void", "notifySourceElementRequestor", "(", "ImportReference", "importReference", ",", "boolean", "isPackage", ")", "{", "if", "(", "isPackage", ")", "{", "this", ".", "requestor", ".", "acceptPackage", "(", "importReference", ")", ";", "}", "else", "{", "final", "boolean", "onDemand", "=", "(", "importReference", ".", "bits", "&", "ASTNode", ".", "OnDemand", ")", "!=", "0", ";", "this", ".", "requestor", ".", "acceptImport", "(", "importReference", ".", "declarationSourceStart", ",", "importReference", ".", "declarationSourceEnd", ",", "importReference", ".", "sourceStart", ",", "onDemand", "?", "importReference", ".", "trailingStarPosition", ":", "importReference", ".", "sourceEnd", ",", "importReference", ".", "tokens", ",", "onDemand", ",", "importReference", ".", "modifiers", ")", ";", "}", "}", "protected", "void", "notifySourceElementRequestor", "(", "TypeDeclaration", "typeDeclaration", ",", "boolean", "notifyTypePresence", ",", "TypeDeclaration", "declaringType", ",", "ImportReference", "currentPackage", ")", "{", "if", "(", "CharOperation", ".", "equals", "(", "TypeConstants", ".", "PACKAGE_INFO_NAME", ",", "typeDeclaration", ".", "name", ")", ")", "return", ";", "boolean", "isInRange", "=", "this", ".", "initialPosition", "<=", "typeDeclaration", ".", "declarationSourceStart", "&&", "this", ".", "eofPosition", ">=", "typeDeclaration", ".", "declarationSourceEnd", ";", "FieldDeclaration", "[", "]", "fields", "=", "typeDeclaration", ".", "fields", ";", "AbstractMethodDeclaration", "[", "]", "methods", "=", "typeDeclaration", ".", "methods", ";", "TypeDeclaration", "[", "]", "memberTypes", "=", "typeDeclaration", ".", "memberTypes", ";", "int", "fieldCounter", "=", "fields", "==", "null", "?", "0", ":", "fields", ".", "length", ";", "int", "methodCounter", "=", "methods", "==", "null", "?", "0", ":", "methods", ".", "length", ";", "int", "memberTypeCounter", "=", "memberTypes", "==", "null", "?", "0", ":", "memberTypes", ".", "length", ";", "int", "fieldIndex", "=", "0", ";", "int", "methodIndex", "=", "0", ";", "int", "memberTypeIndex", "=", "0", ";", "if", "(", "notifyTypePresence", ")", "{", "char", "[", "]", "[", "]", "interfaceNames", "=", "getInterfaceNames", "(", "typeDeclaration", ")", ";", "int", "kind", "=", "TypeDeclaration", ".", "kind", "(", "typeDeclaration", ".", "modifiers", ")", ";", "char", "[", "]", "implicitSuperclassName", "=", "TypeConstants", ".", "CharArray_JAVA_LANG_OBJECT", ";", "if", "(", "isInRange", ")", "{", "int", "currentModifiers", "=", "typeDeclaration", ".", "modifiers", ";", "boolean", "deprecated", "=", "(", "currentModifiers", "&", "ClassFileConstants", ".", "AccDeprecated", ")", "!=", "0", "||", "hasDeprecatedAnnotation", "(", "typeDeclaration", ".", "annotations", ")", ";", "boolean", "isEnumInit", "=", "typeDeclaration", ".", "allocation", "!=", "null", "&&", "typeDeclaration", ".", "allocation", ".", "enumConstant", "!=", "null", ";", "char", "[", "]", "superclassName", ";", "if", "(", "isEnumInit", ")", "{", "currentModifiers", "|=", "ClassFileConstants", ".", "AccEnum", ";", "superclassName", "=", "declaringType", ".", "name", ";", "}", "else", "{", "superclassName", "=", "getSuperclassName", "(", "typeDeclaration", ")", ";", "}", "ISourceElementRequestor", ".", "TypeInfo", "typeInfo", "=", "new", "ISourceElementRequestor", ".", "TypeInfo", "(", ")", ";", "if", "(", "typeDeclaration", ".", "allocation", "==", "null", ")", "{", "typeInfo", ".", "declarationStart", "=", "typeDeclaration", ".", "declarationSourceStart", ";", "}", "else", "if", "(", "isEnumInit", ")", "{", "typeInfo", ".", "declarationStart", "=", "typeDeclaration", ".", "allocation", ".", "enumConstant", ".", "sourceStart", ";", "}", "else", "{", "typeInfo", ".", "declarationStart", "=", "typeDeclaration", ".", "allocation", ".", "sourceStart", ";", "}", "typeInfo", ".", "modifiers", "=", "deprecated", "?", "(", "currentModifiers", "&", "ExtraCompilerModifiers", ".", "AccJustFlag", ")", "|", "ClassFileConstants", ".", "AccDeprecated", ":", "currentModifiers", "&", "ExtraCompilerModifiers", ".", "AccJustFlag", ";", "typeInfo", ".", "name", "=", "typeDeclaration", ".", "name", ";", "typeInfo", ".", "nameSourceStart", "=", "isEnumInit", "?", "typeDeclaration", ".", "allocation", ".", "enumConstant", ".", "sourceStart", ":", "typeDeclaration", ".", "sourceStart", ";", "typeInfo", ".", "nameSourceEnd", "=", "sourceEnd", "(", "typeDeclaration", ")", ";", "typeInfo", ".", "superclass", "=", "superclassName", ";", "typeInfo", ".", "superinterfaces", "=", "interfaceNames", ";", "typeInfo", ".", "typeParameters", "=", "getTypeParameterInfos", "(", "typeDeclaration", ".", "typeParameters", ")", ";", "typeInfo", ".", "categories", "=", "(", "char", "[", "]", "[", "]", ")", "this", ".", "nodesToCategories", ".", "get", "(", "typeDeclaration", ")", ";", "typeInfo", ".", "secondary", "=", "typeDeclaration", ".", "isSecondary", "(", ")", ";", "typeInfo", ".", "anonymousMember", "=", "typeDeclaration", ".", "allocation", "!=", "null", "&&", "typeDeclaration", ".", "allocation", ".", "enclosingInstance", "!=", "null", ";", "typeInfo", ".", "annotations", "=", "typeDeclaration", ".", "annotations", ";", "typeInfo", ".", "extraFlags", "=", "ExtraFlags", ".", "getExtraFlags", "(", "typeDeclaration", ")", ";", "typeInfo", ".", "node", "=", "typeDeclaration", ";", "this", ".", "requestor", ".", "enterType", "(", "typeInfo", ")", ";", "switch", "(", "kind", ")", "{", "case", "TypeDeclaration", ".", "CLASS_DECL", ":", "if", "(", "superclassName", "!=", "null", ")", "implicitSuperclassName", "=", "superclassName", ";", "break", ";", "case", "TypeDeclaration", ".", "INTERFACE_DECL", ":", "implicitSuperclassName", "=", "TypeConstants", ".", "CharArray_JAVA_LANG_OBJECT", ";", "break", ";", "case", "TypeDeclaration", ".", "ENUM_DECL", ":", "implicitSuperclassName", "=", "TypeConstants", ".", "CharArray_JAVA_LANG_ENUM", ";", "break", ";", "case", "TypeDeclaration", ".", "ANNOTATION_TYPE_DECL", ":", "implicitSuperclassName", "=", "TypeConstants", ".", "CharArray_JAVA_LANG_ANNOTATION_ANNOTATION", ";", "break", ";", "}", "}", "if", "(", "this", ".", "nestedTypeIndex", "==", "this", ".", "typeNames", ".", "length", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "typeNames", ",", "0", ",", "(", "this", ".", "typeNames", "=", "new", "char", "[", "this", ".", "nestedTypeIndex", "*", "2", "]", "[", "]", ")", ",", "0", ",", "this", ".", "nestedTypeIndex", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "superTypeNames", ",", "0", ",", "(", "this", ".", "superTypeNames", "=", "new", "char", "[", "this", ".", "nestedTypeIndex", "*", "2", "]", "[", "]", ")", ",", "0", ",", "this", ".", "nestedTypeIndex", ")", ";", "}", "this", ".", "typeNames", "[", "this", ".", "nestedTypeIndex", "]", "=", "typeDeclaration", ".", "name", ";", "this", ".", "superTypeNames", "[", "this", ".", "nestedTypeIndex", "++", "]", "=", "implicitSuperclassName", ";", "}", "while", "(", "(", "fieldIndex", "<", "fieldCounter", ")", "||", "(", "memberTypeIndex", "<", "memberTypeCounter", ")", "||", "(", "methodIndex", "<", "methodCounter", ")", ")", "{", "FieldDeclaration", "nextFieldDeclaration", "=", "null", ";", "AbstractMethodDeclaration", "nextMethodDeclaration", "=", "null", ";", "TypeDeclaration", "nextMemberDeclaration", "=", "null", ";", "int", "position", "=", "Integer", ".", "MAX_VALUE", ";", "int", "nextDeclarationType", "=", "-", "1", ";", "if", "(", "fieldIndex", "<", "fieldCounter", ")", "{", "nextFieldDeclaration", "=", "fields", "[", "fieldIndex", "]", ";", "if", "(", "nextFieldDeclaration", ".", "declarationSourceStart", "<", "position", ")", "{", "position", "=", "nextFieldDeclaration", ".", "declarationSourceStart", ";", "nextDeclarationType", "=", "0", ";", "}", "}", "if", "(", "methodIndex", "<", "methodCounter", ")", "{", "nextMethodDeclaration", "=", "methods", "[", "methodIndex", "]", ";", "if", "(", "nextMethodDeclaration", ".", "declarationSourceStart", "<", "position", ")", "{", "position", "=", "nextMethodDeclaration", ".", "declarationSourceStart", ";", "nextDeclarationType", "=", "1", ";", "}", "}", "if", "(", "memberTypeIndex", "<", "memberTypeCounter", ")", "{", "nextMemberDeclaration", "=", "memberTypes", "[", "memberTypeIndex", "]", ";", "if", "(", "nextMemberDeclaration", ".", "declarationSourceStart", "<", "position", ")", "{", "position", "=", "nextMemberDeclaration", ".", "declarationSourceStart", ";", "nextDeclarationType", "=", "2", ";", "}", "}", "switch", "(", "nextDeclarationType", ")", "{", "case", "0", ":", "fieldIndex", "++", ";", "notifySourceElementRequestor", "(", "nextFieldDeclaration", ",", "typeDeclaration", ")", ";", "break", ";", "case", "1", ":", "methodIndex", "++", ";", "notifySourceElementRequestor", "(", "nextMethodDeclaration", ",", "typeDeclaration", ",", "currentPackage", ")", ";", "break", ";", "case", "2", ":", "memberTypeIndex", "++", ";", "notifySourceElementRequestor", "(", "nextMemberDeclaration", ",", "true", ",", "null", ",", "currentPackage", ")", ";", "}", "}", "if", "(", "notifyTypePresence", ")", "{", "if", "(", "isInRange", ")", "{", "this", ".", "requestor", ".", "exitType", "(", "typeDeclaration", ".", "declarationSourceEnd", ")", ";", "}", "this", ".", "nestedTypeIndex", "--", ";", "}", "}", "private", "static", "void", "quickSort", "(", "ASTNode", "[", "]", "sortedCollection", ",", "int", "left", ",", "int", "right", ")", "{", "int", "original_left", "=", "left", ";", "int", "original_right", "=", "right", ";", "ASTNode", "mid", "=", "sortedCollection", "[", "left", "+", "(", "right", "-", "left", ")", "/", "2", "]", ";", "do", "{", "while", "(", "sortedCollection", "[", "left", "]", ".", "sourceStart", "<", "mid", ".", "sourceStart", ")", "{", "left", "++", ";", "}", "while", "(", "mid", ".", "sourceStart", "<", "sortedCollection", "[", "right", "]", ".", "sourceStart", ")", "{", "right", "--", ";", "}", "if", "(", "left", "<=", "right", ")", "{", "ASTNode", "tmp", "=", "sortedCollection", "[", "left", "]", ";", "sortedCollection", "[", "left", "]", "=", "sortedCollection", "[", "right", "]", ";", "sortedCollection", "[", "right", "]", "=", "tmp", ";", "left", "++", ";", "right", "--", ";", "}", "}", "while", "(", "left", "<=", "right", ")", ";", "if", "(", "original_left", "<", "right", ")", "{", "quickSort", "(", "sortedCollection", ",", "original_left", ",", "right", ")", ";", "}", "if", "(", "left", "<", "original_right", ")", "{", "quickSort", "(", "sortedCollection", ",", "left", ",", "original_right", ")", ";", "}", "}", "private", "void", "reset", "(", ")", "{", "this", ".", "typeNames", "=", "new", "char", "[", "4", "]", "[", "]", ";", "this", ".", "superTypeNames", "=", "new", "char", "[", "4", "]", "[", "]", ";", "this", ".", "nestedTypeIndex", "=", "0", ";", "this", ".", "sourceEnds", "=", "null", ";", "}", "private", "int", "sourceEnd", "(", "TypeDeclaration", "typeDeclaration", ")", "{", "if", "(", "(", "typeDeclaration", ".", "bits", "&", "ASTNode", ".", "IsAnonymousType", ")", "!=", "0", ")", "{", "QualifiedAllocationExpression", "allocation", "=", "typeDeclaration", ".", "allocation", ";", "if", "(", "allocation", ".", "enumConstant", "!=", "null", ")", "return", "allocation", ".", "enumConstant", ".", "sourceEnd", ";", "return", "allocation", ".", "type", ".", "sourceEnd", ";", "}", "else", "{", "return", "typeDeclaration", ".", "sourceEnd", ";", "}", "}", "private", "void", "visitIfNeeded", "(", "AbstractMethodDeclaration", "method", ")", "{", "if", "(", "this", ".", "localDeclarationVisitor", "!=", "null", "&&", "(", "method", ".", "bits", "&", "ASTNode", ".", "HasLocalType", ")", "!=", "0", ")", "{", "if", "(", "method", "instanceof", "ConstructorDeclaration", ")", "{", "ConstructorDeclaration", "constructorDeclaration", "=", "(", "ConstructorDeclaration", ")", "method", ";", "if", "(", "constructorDeclaration", ".", "constructorCall", "!=", "null", ")", "{", "constructorDeclaration", ".", "constructorCall", ".", "traverse", "(", "this", ".", "localDeclarationVisitor", ",", "method", ".", "scope", ")", ";", "}", "}", "if", "(", "method", ".", "statements", "!=", "null", ")", "{", "int", "statementsLength", "=", "method", ".", "statements", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "statementsLength", ";", "i", "++", ")", "method", ".", "statements", "[", "i", "]", ".", "traverse", "(", "this", ".", "localDeclarationVisitor", ",", "method", ".", "scope", ")", ";", "}", "}", "}", "private", "void", "visitIfNeeded", "(", "FieldDeclaration", "field", ",", "TypeDeclaration", "declaringType", ")", "{", "if", "(", "this", ".", "localDeclarationVisitor", "!=", "null", "&&", "(", "field", ".", "bits", "&", "ASTNode", ".", "HasLocalType", ")", "!=", "0", ")", "{", "if", "(", "field", ".", "initialization", "!=", "null", ")", "{", "try", "{", "this", ".", "localDeclarationVisitor", ".", "pushDeclaringType", "(", "declaringType", ")", ";", "field", ".", "initialization", ".", "traverse", "(", "this", ".", "localDeclarationVisitor", ",", "(", "MethodScope", ")", "null", ")", ";", "}", "finally", "{", "this", ".", "localDeclarationVisitor", ".", "popDeclaringType", "(", ")", ";", "}", "}", "}", "}", "private", "void", "visitIfNeeded", "(", "Initializer", "initializer", ")", "{", "if", "(", "this", ".", "localDeclarationVisitor", "!=", "null", "&&", "(", "initializer", ".", "bits", "&", "ASTNode", ".", "HasLocalType", ")", "!=", "0", ")", "{", "if", "(", "initializer", ".", "block", "!=", "null", ")", "{", "initializer", ".", "block", ".", "traverse", "(", "this", ".", "localDeclarationVisitor", ",", "null", ")", ";", "}", "}", "}", "}", "</s>" ]
3,945
[ "<s>", "package", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "internal", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "InternalExtendedCompletionContext", ";", "public", "class", "SimplifiedExtendedCompletionContext", "extends", "InternalExtendedCompletionContext", "{", "public", "SimplifiedExtendedCompletionContext", "(", ")", "{", "super", "(", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ",", "null", ")", ";", "}", "}", "</s>" ]
3,946
[ "<s>", "package", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaProject", ";", "public", "interface", "EventHandler", "{", "void", "handle", "(", "JavaProject", "javaProject", ",", "String", "string", ")", ";", "}", "</s>" ]
3,947
[ "<s>", "package", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Platform", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "WorkingCopyOwner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "IJavaSearchScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchPattern", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "CompilationResult", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "IProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ISourceElementRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "SourceElementParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompilationUnitDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Parser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemReporter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "BinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "PackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "indexing", ".", "IndexingParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "ImportMatchLocatorParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "MatchLocator", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "MatchLocatorParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "PossibleMatch", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "import", "org", ".", "osgi", ".", "framework", ".", "Bundle", ";", "public", "class", "LanguageSupportFactory", "{", "private", "static", "LanguageSupport", "languageSupport", ";", "public", "static", "final", "int", "CommentRecorderParserVariant", "=", "2", ";", "public", "static", "Parser", "getParser", "(", "Object", "requestor", ",", "CompilerOptions", "compilerOptions", ",", "ProblemReporter", "problemReporter", ",", "boolean", "parseLiteralExpressionsAsConstants", ",", "int", "variant", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "getParser", "(", "requestor", ",", "compilerOptions", ",", "problemReporter", ",", "parseLiteralExpressionsAsConstants", ",", "variant", ")", ";", "}", "public", "static", "IndexingParser", "getIndexingParser", "(", "ISourceElementRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ",", "CompilerOptions", "options", ",", "boolean", "reportLocalDeclarations", ",", "boolean", "optimizeStringLiterals", ",", "boolean", "useSourceJavadocParser", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "getIndexingParser", "(", "requestor", ",", "problemFactory", ",", "options", ",", "reportLocalDeclarations", ",", "optimizeStringLiterals", ",", "useSourceJavadocParser", ")", ";", "}", "public", "static", "SourceElementParser", "getSourceElementParser", "(", "ISourceElementRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ",", "CompilerOptions", "options", ",", "boolean", "reportLocalDeclarations", ",", "boolean", "optimizeStringLiterals", ",", "boolean", "useSourceJavadocParser", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "getSourceElementParser", "(", "requestor", ",", "problemFactory", ",", "options", ",", "reportLocalDeclarations", ",", "optimizeStringLiterals", ",", "useSourceJavadocParser", ")", ";", "}", "public", "static", "MatchLocatorParser", "getMatchLocatorParser", "(", "ProblemReporter", "problemReporter", ",", "MatchLocator", "locator", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "getMatchLocatorParserParser", "(", "problemReporter", ",", "locator", ")", ";", "}", "public", "static", "ImportMatchLocatorParser", "getImportMatchLocatorParser", "(", "ProblemReporter", "problemReporter", ",", "MatchLocator", "locator", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "getImportMatchLocatorParserParser", "(", "problemReporter", ",", "locator", ")", ";", "}", "public", "static", "CompilationUnit", "newCompilationUnit", "(", "PackageFragment", "parent", ",", "String", "name", ",", "WorkingCopyOwner", "owner", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "newCompilationUnit", "(", "parent", ",", "name", ",", "owner", ")", ";", "}", "public", "static", "CompilationUnitDeclaration", "newCompilationUnitDeclaration", "(", "ICompilationUnit", "unit", ",", "ProblemReporter", "problemReporter", ",", "CompilationResult", "compilationResult", ",", "int", "sourceLength", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "newCompilationUnitDeclaration", "(", "unit", ",", "problemReporter", ",", "compilationResult", ",", "sourceLength", ")", ";", "}", "public", "static", "boolean", "isInterestingProject", "(", "IProject", "project", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "isInterestingProject", "(", "project", ")", ";", "}", "public", "static", "boolean", "isSourceFile", "(", "String", "fileName", ",", "boolean", "isInterestingProject", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "isSourceFile", "(", "fileName", ",", "isInterestingProject", ")", ";", "}", "public", "static", "boolean", "isInterestingSourceFile", "(", "String", "fileName", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "isInterestingSourceFile", "(", "fileName", ")", ";", "}", "public", "static", "boolean", "maybePerformDelegatedSearch", "(", "PossibleMatch", "possibleMatch", ",", "SearchPattern", "pattern", ",", "SearchRequestor", "requestor", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "maybePerformDelegatedSearch", "(", "possibleMatch", ",", "pattern", ",", "requestor", ")", ";", "}", "public", "static", "void", "filterNonSourceMembers", "(", "BinaryType", "binaryType", ")", "{", "getLanguageSupport", "(", ")", ".", "filterNonSourceMembers", "(", "binaryType", ")", ";", "}", "private", "static", "LanguageSupport", "getLanguageSupport", "(", ")", "{", "if", "(", "languageSupport", "==", "null", ")", "{", "languageSupport", "=", "tryInstantiate", "(", "\"\"", ")", ";", "if", "(", "languageSupport", "==", "null", ")", "{", "languageSupport", "=", "new", "DefaultLanguageSupport", "(", ")", ";", "}", "}", "return", "languageSupport", ";", "}", "private", "static", "LanguageSupport", "tryInstantiate", "(", "String", "className", ")", "{", "LanguageSupport", "instance", "=", "null", ";", "if", "(", "className", "!=", "null", "&&", "className", ".", "length", "(", ")", ">", "0", ")", "{", "try", "{", "int", "separator", "=", "className", ".", "indexOf", "(", "':'", ")", ";", "Bundle", "bundle", "=", "null", ";", "if", "(", "separator", "==", "-", "1", ")", "{", "JavaCore", "javaCore", "=", "JavaCore", ".", "getJavaCore", "(", ")", ";", "if", "(", "javaCore", "==", "null", ")", "{", "Class", "clazz", "=", "Class", ".", "forName", "(", "className", ")", ";", "return", "(", "LanguageSupport", ")", "clazz", ".", "newInstance", "(", ")", ";", "}", "else", "{", "bundle", "=", "javaCore", ".", "getBundle", "(", ")", ";", "}", "}", "else", "{", "String", "bundleName", "=", "className", ".", "substring", "(", "0", ",", "separator", ")", ";", "className", "=", "className", ".", "substring", "(", "separator", "+", "1", ")", ";", "bundle", "=", "Platform", ".", "getBundle", "(", "bundleName", ")", ";", "}", "Class", "c", "=", "bundle", ".", "loadClass", "(", "className", ")", ";", "instance", "=", "(", "LanguageSupport", ")", "c", ".", "newInstance", "(", ")", ";", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "log", "(", "e", ")", ";", "}", "catch", "(", "InstantiationException", "e", ")", "{", "log", "(", "e", ")", ";", "}", "catch", "(", "IllegalAccessException", "e", ")", "{", "log", "(", "e", ")", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "log", "(", "e", ")", ";", "}", "}", "return", "instance", ";", "}", "private", "static", "void", "log", "(", "Exception", "e", ")", "{", "if", "(", "JavaCore", ".", "getPlugin", "(", ")", "==", "null", "||", "JavaCore", ".", "getPlugin", "(", ")", ".", "getLog", "(", ")", "==", "null", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", ")", ";", "e", ".", "printStackTrace", "(", "System", ".", "err", ")", ";", "}", "else", "{", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "}", "}", "public", "static", "EventHandler", "getEventHandler", "(", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "getEventHandler", "(", ")", ";", "}", "public", "static", "IJavaSearchScope", "expandSearchScope", "(", "IJavaSearchScope", "scope", ",", "SearchPattern", "pattern", ",", "SearchRequestor", "requestor", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "expandSearchScope", "(", "scope", ",", "pattern", ",", "requestor", ")", ";", "}", "public", "static", "boolean", "isGroovyLanguageSupportInstalled", "(", ")", "{", "return", "getLanguageSupport", "(", ")", ".", "getClass", "(", ")", ".", "getName", "(", ")", ".", "endsWith", "(", "\"\"", ")", ";", "}", "}", "</s>" ]
3,948
[ "<s>", "package", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "WorkingCopyOwner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "IJavaSearchScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchPattern", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "CompilationResult", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "IProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ISourceElementRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "SourceElementParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompilationUnitDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Parser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemReporter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "BinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "PackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "indexing", ".", "IndexingParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "ImportMatchLocatorParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "MatchLocator", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "MatchLocatorParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "PossibleMatch", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "CommentRecorderParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "class", "DefaultLanguageSupport", "implements", "LanguageSupport", "{", "public", "Parser", "getParser", "(", "Object", "requestor", ",", "CompilerOptions", "compilerOptions", ",", "ProblemReporter", "problemReporter", ",", "boolean", "parseLiteralExpressionsAsConstants", ",", "int", "variant", ")", "{", "if", "(", "variant", "==", "1", ")", "{", "return", "new", "Parser", "(", "problemReporter", ",", "parseLiteralExpressionsAsConstants", ")", ";", "}", "else", "{", "return", "new", "CommentRecorderParser", "(", "problemReporter", ",", "parseLiteralExpressionsAsConstants", ")", ";", "}", "}", "public", "IndexingParser", "getIndexingParser", "(", "ISourceElementRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ",", "CompilerOptions", "options", ",", "boolean", "reportLocalDeclarations", ",", "boolean", "optimizeStringLiterals", ",", "boolean", "useSourceJavadocParser", ")", "{", "return", "new", "IndexingParser", "(", "requestor", ",", "problemFactory", ",", "options", ",", "reportLocalDeclarations", ",", "optimizeStringLiterals", ",", "useSourceJavadocParser", ")", ";", "}", "public", "ImportMatchLocatorParser", "getImportMatchLocatorParserParser", "(", "ProblemReporter", "problemReporter", ",", "MatchLocator", "locator", ")", "{", "return", "new", "ImportMatchLocatorParser", "(", "problemReporter", ",", "locator", ")", ";", "}", "public", "SourceElementParser", "getSourceElementParser", "(", "ISourceElementRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ",", "CompilerOptions", "options", ",", "boolean", "reportLocalDeclarations", ",", "boolean", "optimizeStringLiterals", ",", "boolean", "useSourceJavadocParser", ")", "{", "return", "new", "SourceElementParser", "(", "requestor", ",", "problemFactory", ",", "options", ",", "reportLocalDeclarations", ",", "optimizeStringLiterals", ",", "useSourceJavadocParser", ")", ";", "}", "public", "MatchLocatorParser", "getMatchLocatorParserParser", "(", "ProblemReporter", "problemReporter", ",", "MatchLocator", "locator", ")", "{", "return", "new", "MatchLocatorParser", "(", "problemReporter", ",", "locator", ")", ";", "}", "public", "CompilationUnit", "newCompilationUnit", "(", "PackageFragment", "parent", ",", "String", "name", ",", "WorkingCopyOwner", "owner", ")", "{", "return", "new", "CompilationUnit", "(", "parent", ",", "name", ",", "owner", ")", ";", "}", "public", "CompilationUnitDeclaration", "newCompilationUnitDeclaration", "(", "ICompilationUnit", "unit", ",", "ProblemReporter", "problemReporter", ",", "CompilationResult", "compilationResult", ",", "int", "sourceLength", ")", "{", "return", "new", "CompilationUnitDeclaration", "(", "problemReporter", ",", "compilationResult", ",", "sourceLength", ")", ";", "}", "public", "boolean", "isInterestingProject", "(", "IProject", "project", ")", "{", "return", "true", ";", "}", "public", "boolean", "isSourceFile", "(", "String", "fileName", ",", "boolean", "isInterestingProject", ")", "{", "return", "Util", ".", "isJavaLikeFileName", "(", "fileName", ")", ";", "}", "public", "boolean", "isInterestingSourceFile", "(", "String", "fileName", ")", "{", "return", "false", ";", "}", "public", "boolean", "maybePerformDelegatedSearch", "(", "PossibleMatch", "possibleMatch", ",", "SearchPattern", "pattern", ",", "SearchRequestor", "requestor", ")", "{", "return", "false", ";", "}", "public", "EventHandler", "getEventHandler", "(", ")", "{", "return", "DefaultEventHandler", ".", "instance", ";", "}", "static", "class", "DefaultEventHandler", "implements", "EventHandler", "{", "static", "DefaultEventHandler", "instance", "=", "new", "DefaultEventHandler", "(", ")", ";", "private", "DefaultEventHandler", "(", ")", "{", "}", "public", "void", "handle", "(", "JavaProject", "javaProject", ",", "String", "string", ")", "{", "}", "}", "public", "void", "filterNonSourceMembers", "(", "BinaryType", "binaryType", ")", "{", "}", "public", "IJavaSearchScope", "expandSearchScope", "(", "IJavaSearchScope", "scope", ",", "SearchPattern", "pattern", ",", "SearchRequestor", "requestor", ")", "{", "return", "scope", ";", "}", "}", "</s>" ]
3,949
[ "<s>", "package", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "WorkingCopyOwner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "IJavaSearchScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchPattern", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "CompilationResult", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "IProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ISourceElementRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "SourceElementParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompilationUnitDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Parser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemReporter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "BinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "PackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "indexing", ".", "IndexingParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "ImportMatchLocatorParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "MatchLocator", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "MatchLocatorParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "PossibleMatch", ";", "public", "interface", "LanguageSupport", "{", "Parser", "getParser", "(", "Object", "requestor", ",", "CompilerOptions", "compilerOptions", ",", "ProblemReporter", "problemReporter", ",", "boolean", "parseLiteralExpressionsAsConstants", ",", "int", "variant", ")", ";", "IndexingParser", "getIndexingParser", "(", "ISourceElementRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ",", "CompilerOptions", "options", ",", "boolean", "reportLocalDeclarations", ",", "boolean", "optimizeStringLiterals", ",", "boolean", "useSourceJavadocParser", ")", ";", "MatchLocatorParser", "getMatchLocatorParserParser", "(", "ProblemReporter", "problemReporter", ",", "MatchLocator", "locator", ")", ";", "SourceElementParser", "getSourceElementParser", "(", "ISourceElementRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ",", "CompilerOptions", "options", ",", "boolean", "reportLocalDeclarations", ",", "boolean", "optimizeStringLiterals", ",", "boolean", "useSourceJavadocParser", ")", ";", "ImportMatchLocatorParser", "getImportMatchLocatorParserParser", "(", "ProblemReporter", "problemReporter", ",", "MatchLocator", "locator", ")", ";", "CompilationUnit", "newCompilationUnit", "(", "PackageFragment", "parent", ",", "String", "name", ",", "WorkingCopyOwner", "owner", ")", ";", "CompilationUnitDeclaration", "newCompilationUnitDeclaration", "(", "ICompilationUnit", "unit", ",", "ProblemReporter", "problemReporter", ",", "CompilationResult", "compilationResult", ",", "int", "sourceLength", ")", ";", "boolean", "isInterestingProject", "(", "IProject", "project", ")", ";", "boolean", "isSourceFile", "(", "String", "fileName", ",", "boolean", "isInterestingProject", ")", ";", "boolean", "isInterestingSourceFile", "(", "String", "fileName", ")", ";", "boolean", "maybePerformDelegatedSearch", "(", "PossibleMatch", "possibleMatch", ",", "SearchPattern", "pattern", ",", "SearchRequestor", "requestor", ")", ";", "EventHandler", "getEventHandler", "(", ")", ";", "void", "filterNonSourceMembers", "(", "BinaryType", "binaryType", ")", ";", "IJavaSearchScope", "expandSearchScope", "(", "IJavaSearchScope", "scope", ",", "SearchPattern", "pattern", ",", "SearchRequestor", "requestor", ")", ";", "}", "</s>" ]
3,950
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "*", ";", "public", "class", "Java2HTMLEntityReader", "extends", "SubstitutionTextReader", "{", "private", "static", "final", "int", "BEGIN_LINE", "=", "0x01", ";", "private", "static", "final", "Map", "fgEntityLookup", ";", "private", "int", "bits", "=", "BEGIN_LINE", ";", "static", "{", "fgEntityLookup", "=", "new", "HashMap", "(", "7", ")", ";", "fgEntityLookup", ".", "put", "(", "\"<\"", ",", "\"&lt;\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\">\"", ",", "\"&gt;\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\"&\"", ",", "\"&amp;\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\"^\"", ",", "\"&circ;\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\"~\"", ",", "\"&tilde;\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\"\\\"\"", ",", "\"&quot;\"", ")", ";", "}", "public", "Java2HTMLEntityReader", "(", "Reader", "reader", ")", "{", "super", "(", "reader", ")", ";", "setSkipWhitespace", "(", "false", ")", ";", "}", "protected", "String", "computeSubstitution", "(", "int", "c", ")", "throws", "IOException", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "while", "(", "c", "==", "'*'", ")", "{", "this", ".", "bits", "&=", "~", "BEGIN_LINE", ";", "c", "=", "nextChar", "(", ")", ";", "buf", ".", "append", "(", "'*'", ")", ";", "}", "if", "(", "c", "==", "-", "1", ")", "return", "buf", ".", "toString", "(", ")", ";", "if", "(", "c", "==", "'/'", "&&", "buf", ".", "length", "(", ")", ">", "0", ")", "{", "buf", ".", "setLength", "(", "buf", ".", "length", "(", ")", "-", "1", ")", ";", "buf", ".", "append", "(", "\"&#42;/\"", ")", ";", "}", "else", "if", "(", "c", "==", "'@'", "&&", "(", "this", ".", "bits", "&", "BEGIN_LINE", ")", "!=", "0", ")", "{", "buf", ".", "append", "(", "\"&#064;\"", ")", ";", "}", "else", "{", "String", "entity", "=", "(", "String", ")", "fgEntityLookup", ".", "get", "(", "String", ".", "valueOf", "(", "(", "char", ")", "c", ")", ")", ";", "if", "(", "entity", "!=", "null", ")", "buf", ".", "append", "(", "entity", ")", ";", "else", "buf", ".", "append", "(", "(", "char", ")", "c", ")", ";", "}", "if", "(", "c", "==", "'\\n'", "||", "c", "==", "'\\r'", ")", "{", "this", ".", "bits", "|=", "BEGIN_LINE", ";", "}", "else", "if", "(", "!", "ScannerHelper", ".", "isWhitespace", "(", "(", "char", ")", "c", ")", ")", "{", "this", ".", "bits", "&=", "~", "BEGIN_LINE", ";", "}", "return", "buf", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,951
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadLocationException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadPositionCategoryException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "DefaultPositionUpdater", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Document", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Position", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ToolFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "CommentFormatterUtil", "{", "public", "static", "String", "evaluateFormatterEdit", "(", "String", "string", ",", "TextEdit", "edit", ",", "Position", "[", "]", "positions", ")", "{", "try", "{", "Document", "doc", "=", "createDocument", "(", "string", ",", "positions", ")", ";", "edit", ".", "apply", "(", "doc", ",", "0", ")", ";", "if", "(", "positions", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "positions", ".", "length", ";", "i", "++", ")", "{", "Assert", ".", "isTrue", "(", "!", "positions", "[", "i", "]", ".", "isDeleted", ",", "\"\"", ")", ";", "}", "}", "return", "doc", ".", "get", "(", ")", ";", "}", "catch", "(", "BadLocationException", "e", ")", "{", "log", "(", "e", ")", ";", "Assert", ".", "isTrue", "(", "false", ",", "\"\"", "+", "e", ".", "getMessage", "(", ")", ")", ";", "}", "return", "null", ";", "}", "public", "static", "TextEdit", "format2", "(", "int", "kind", ",", "String", "string", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ",", "Map", "options", ")", "{", "int", "length", "=", "string", ".", "length", "(", ")", ";", "if", "(", "0", "<", "0", "||", "length", "<", "0", "||", "0", "+", "length", ">", "string", ".", "length", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "0", "+", "\",", "length:", "\"", "+", "length", "+", "\"\"", "+", "string", ".", "length", "(", ")", ")", ";", "}", "return", "ToolFactory", ".", "createCodeFormatter", "(", "options", ")", ".", "format", "(", "kind", ",", "string", ",", "0", ",", "length", ",", "indentationLevel", ",", "lineSeparator", ")", ";", "}", "private", "static", "Document", "createDocument", "(", "String", "content", ",", "Position", "[", "]", "positions", ")", "throws", "IllegalArgumentException", "{", "Document", "doc", "=", "new", "Document", "(", "content", ")", ";", "try", "{", "if", "(", "positions", "!=", "null", ")", "{", "final", "String", "POS_CATEGORY", "=", "\"myCategory\"", ";", "doc", ".", "addPositionCategory", "(", "POS_CATEGORY", ")", ";", "doc", ".", "addPositionUpdater", "(", "new", "DefaultPositionUpdater", "(", "POS_CATEGORY", ")", "{", "protected", "boolean", "notDeleted", "(", ")", "{", "if", "(", "this", ".", "fOffset", "<", "this", ".", "fPosition", ".", "offset", "&&", "(", "this", ".", "fPosition", ".", "offset", "+", "this", ".", "fPosition", ".", "length", "<", "this", ".", "fOffset", "+", "this", ".", "fLength", ")", ")", "{", "this", ".", "fPosition", ".", "offset", "=", "this", ".", "fOffset", "+", "this", ".", "fLength", ";", "return", "false", ";", "}", "return", "true", ";", "}", "}", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "positions", ".", "length", ";", "i", "++", ")", "{", "try", "{", "doc", ".", "addPosition", "(", "POS_CATEGORY", ",", "positions", "[", "i", "]", ")", ";", "}", "catch", "(", "BadLocationException", "e", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "positions", "[", "i", "]", ".", "offset", "+", "\",", "length:", "\"", "+", "positions", "[", "i", "]", ".", "length", "+", "\"\"", "+", "content", ".", "length", "(", ")", ")", ";", "}", "}", "}", "}", "catch", "(", "BadPositionCategoryException", "cannotHappen", ")", "{", "}", "return", "doc", ";", "}", "public", "static", "void", "log", "(", "Throwable", "t", ")", "{", "Util", ".", "log", "(", "t", ",", "\"\"", ")", ";", "}", "}", "</s>" ]
3,952
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ";", "public", "interface", "IJavaDocTagConstants", "{", "public", "static", "final", "char", "[", "]", "[", "]", "JAVADOC_SINGLE_BREAK_TAG", "=", "new", "char", "[", "]", "[", "]", "{", "\"br\"", ".", "toCharArray", "(", ")", "}", ";", "public", "static", "final", "char", "[", "]", "[", "]", "JAVADOC_CODE_TAGS", "=", "new", "char", "[", "]", "[", "]", "{", "\"pre\"", ".", "toCharArray", "(", ")", "}", ";", "public", "static", "final", "char", "[", "]", "[", "]", "JAVADOC_BREAK_TAGS", "=", "new", "char", "[", "]", "[", "]", "{", "\"dd\"", ".", "toCharArray", "(", ")", ",", "\"dt\"", ".", "toCharArray", "(", ")", ",", "\"li\"", ".", "toCharArray", "(", ")", ",", "\"td\"", ".", "toCharArray", "(", ")", ",", "\"th\"", ".", "toCharArray", "(", ")", ",", "\"h1\"", ".", "toCharArray", "(", ")", ",", "\"h2\"", ".", "toCharArray", "(", ")", ",", "\"h3\"", ".", "toCharArray", "(", ")", ",", "\"h4\"", ".", "toCharArray", "(", ")", ",", "\"h5\"", ".", "toCharArray", "(", ")", ",", "\"h6\"", ".", "toCharArray", "(", ")", ",", "\"q\"", ".", "toCharArray", "(", ")", "}", ";", "public", "static", "final", "char", "[", "]", "[", "]", "JAVADOC_IMMUTABLE_TAGS", "=", "new", "char", "[", "]", "[", "]", "{", "\"code\"", ".", "toCharArray", "(", ")", ",", "\"em\"", ".", "toCharArray", "(", ")", ",", "\"pre\"", ".", "toCharArray", "(", ")", ",", "\"q\"", ".", "toCharArray", "(", ")", ",", "\"tt\"", ".", "toCharArray", "(", ")", "}", ";", "public", "static", "final", "char", "[", "]", "[", "]", "JAVADOC_NEWLINE_TAGS", "=", "new", "char", "[", "]", "[", "]", "{", "\"dd\"", ".", "toCharArray", "(", ")", ",", "\"dt\"", ".", "toCharArray", "(", ")", ",", "\"li\"", ".", "toCharArray", "(", ")", ",", "\"td\"", ".", "toCharArray", "(", ")", ",", "\"th\"", ".", "toCharArray", "(", ")", ",", "\"tr\"", ".", "toCharArray", "(", ")", ",", "\"h1\"", ".", "toCharArray", "(", ")", ",", "\"h2\"", ".", "toCharArray", "(", ")", ",", "\"h3\"", ".", "toCharArray", "(", ")", ",", "\"h4\"", ".", "toCharArray", "(", ")", ",", "\"h5\"", ".", "toCharArray", "(", ")", ",", "\"h6\"", ".", "toCharArray", "(", ")", ",", "\"q\"", ".", "toCharArray", "(", ")", "}", ";", "public", "static", "final", "char", "[", "]", "[", "]", "JAVADOC_PARAM_TAGS", "=", "new", "char", "[", "]", "[", "]", "{", "\"@exception\"", ".", "toCharArray", "(", ")", ",", "\"@param\"", ".", "toCharArray", "(", ")", ",", "\"@serialField\"", ".", "toCharArray", "(", ")", ",", "\"@throws\"", ".", "toCharArray", "(", ")", "}", ";", "public", "static", "final", "char", "[", "]", "[", "]", "JAVADOC_SEPARATOR_TAGS", "=", "new", "char", "[", "]", "[", "]", "{", "\"dl\"", ".", "toCharArray", "(", ")", ",", "\"hr\"", ".", "toCharArray", "(", ")", ",", "\"nl\"", ".", "toCharArray", "(", ")", ",", "\"p\"", ".", "toCharArray", "(", ")", ",", "\"pre\"", ".", "toCharArray", "(", ")", ",", "\"ul\"", ".", "toCharArray", "(", ")", ",", "\"ol\"", ".", "toCharArray", "(", ")", ",", "\"table\"", ".", "toCharArray", "(", ")", ",", "\"tr\"", ".", "toCharArray", "(", ")", ",", "}", ";", "public", "static", "final", "char", "JAVADOC_TAG_PREFIX", "=", "'@'", ";", "public", "static", "final", "char", "LINK_TAG_POSTFIX", "=", "'}'", ";", "public", "static", "final", "String", "LINK_TAG_PREFIX_STRING", "=", "\"{@\"", ";", "public", "static", "final", "char", "[", "]", "LINK_TAG_PREFIX", "=", "LINK_TAG_PREFIX_STRING", ".", "toCharArray", "(", ")", ";", "public", "static", "final", "char", "[", "]", "[", "]", "COMMENT_ROOT_TAGS", "=", "new", "char", "[", "]", "[", "]", "{", "\"@deprecated\"", ".", "toCharArray", "(", ")", ",", "\"@see\"", ".", "toCharArray", "(", ")", ",", "\"@since\"", ".", "toCharArray", "(", ")", ",", "\"@version\"", ".", "toCharArray", "(", ")", "}", ";", "public", "static", "final", "char", "COMMENT_TAG_PREFIX", "=", "'@'", ";", "public", "static", "final", "String", "BLOCK_HEADER", "=", "\"/*\"", ";", "public", "static", "final", "int", "BLOCK_HEADER_LENGTH", "=", "BLOCK_HEADER", ".", "length", "(", ")", ";", "public", "static", "final", "String", "JAVADOC_HEADER", "=", "\"/**\"", ";", "public", "static", "final", "int", "JAVADOC_HEADER_LENGTH", "=", "JAVADOC_HEADER", ".", "length", "(", ")", ";", "public", "static", "final", "String", "BLOCK_LINE_PREFIX", "=", "\"", "*", "\"", ";", "public", "static", "final", "int", "BLOCK_LINE_PREFIX_LENGTH", "=", "BLOCK_LINE_PREFIX", ".", "length", "(", ")", ";", "public", "static", "final", "String", "BLOCK_FOOTER", "=", "\"*/\"", ";", "public", "static", "final", "int", "BLOCK_FOOTER_LENGTH", "=", "BLOCK_FOOTER", ".", "length", "(", ")", ";", "public", "static", "final", "String", "LINE_COMMENT_PREFIX", "=", "\"//", "\"", ";", "public", "static", "final", "int", "LINE_COMMENT_PREFIX_LENGTH", "=", "LINE_COMMENT_PREFIX", ".", "length", "(", ")", ";", "public", "static", "final", "String", "JAVADOC_STAR", "=", "\"*\"", ";", "static", "final", "int", "JAVADOC_TAGS_INDEX_MASK", "=", "0xFFFF", ";", "static", "final", "int", "JAVADOC_TAGS_ID_MASK", "=", "0xFF00", ";", "static", "final", "int", "JAVADOC_SINGLE_BREAK_TAG_ID", "=", "0x100", ";", "static", "final", "int", "JAVADOC_CODE_TAGS_ID", "=", "0x200", ";", "static", "final", "int", "JAVADOC_BREAK_TAGS_ID", "=", "0x400", ";", "static", "final", "int", "JAVADOC_IMMUTABLE_TAGS_ID", "=", "0x800", ";", "static", "final", "int", "JAVADOC_SEPARATOR_TAGS_ID", "=", "0x1000", ";", "static", "final", "int", "JAVADOC_SINGLE_TAGS_ID", "=", "JAVADOC_SINGLE_BREAK_TAG_ID", ";", "static", "final", "int", "JAVADOC_CLOSED_TAG", "=", "0x10000", ";", "}", "</s>" ]
3,953
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "public", "class", "HTMLEntity2JavaReader", "extends", "SubstitutionTextReader", "{", "private", "static", "final", "Map", "fgEntityLookup", ";", "static", "{", "fgEntityLookup", "=", "new", "HashMap", "(", "7", ")", ";", "fgEntityLookup", ".", "put", "(", "\"lt\"", ",", "\"<\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\"gt\"", ",", "\">\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\"nbsp\"", ",", "\"", "\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\"amp\"", ",", "\"&\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\"circ\"", ",", "\"^\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\"tilde\"", ",", "\"~\"", ")", ";", "fgEntityLookup", ".", "put", "(", "\"quot\"", ",", "\"\\\"\"", ")", ";", "}", "public", "HTMLEntity2JavaReader", "(", "Reader", "reader", ")", "{", "super", "(", "reader", ")", ";", "setSkipWhitespace", "(", "false", ")", ";", "}", "protected", "String", "computeSubstitution", "(", "int", "c", ")", "throws", "IOException", "{", "if", "(", "c", "==", "'&'", ")", "return", "processEntity", "(", ")", ";", "return", "null", ";", "}", "protected", "String", "entity2Text", "(", "String", "symbol", ")", "{", "if", "(", "symbol", ".", "length", "(", ")", ">", "1", "&&", "symbol", ".", "charAt", "(", "0", ")", "==", "'#'", ")", "{", "int", "ch", ";", "try", "{", "if", "(", "symbol", ".", "charAt", "(", "1", ")", "==", "'x'", ")", "{", "ch", "=", "Integer", ".", "parseInt", "(", "symbol", ".", "substring", "(", "2", ")", ",", "16", ")", ";", "}", "else", "{", "ch", "=", "Integer", ".", "parseInt", "(", "symbol", ".", "substring", "(", "1", ")", ",", "10", ")", ";", "}", "return", "String", ".", "valueOf", "(", "(", "char", ")", "ch", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "}", "}", "else", "{", "String", "str", "=", "(", "String", ")", "fgEntityLookup", ".", "get", "(", "symbol", ")", ";", "if", "(", "str", "!=", "null", ")", "{", "return", "str", ";", "}", "}", "return", "\"&\"", "+", "symbol", ";", "}", "private", "String", "processEntity", "(", ")", "throws", "IOException", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "int", "ch", "=", "nextChar", "(", ")", ";", "while", "(", "ScannerHelper", ".", "isLetterOrDigit", "(", "(", "char", ")", "ch", ")", "||", "ch", "==", "'#'", ")", "{", "buf", ".", "append", "(", "(", "char", ")", "ch", ")", ";", "ch", "=", "nextChar", "(", ")", ";", "}", "if", "(", "ch", "==", "';'", ")", "return", "entity2Text", "(", "buf", ".", "toString", "(", ")", ")", ";", "buf", ".", "insert", "(", "0", ",", "'&'", ")", ";", "if", "(", "ch", "!=", "-", "1", ")", "buf", ".", "append", "(", "(", "char", ")", "ch", ")", ";", "return", "buf", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,954
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "public", "abstract", "class", "SubstitutionTextReader", "extends", "Reader", "{", "private", "Reader", "fReader", ";", "private", "boolean", "fWasWhiteSpace", ";", "private", "int", "fCharAfterWhiteSpace", ";", "private", "boolean", "fSkipWhiteSpace", "=", "true", ";", "private", "boolean", "fReadFromBuffer", ";", "private", "StringBuffer", "fBuffer", ";", "private", "int", "fIndex", ";", "protected", "SubstitutionTextReader", "(", "Reader", "reader", ")", "{", "this", ".", "fReader", "=", "reader", ";", "this", ".", "fBuffer", "=", "new", "StringBuffer", "(", ")", ";", "this", ".", "fIndex", "=", "0", ";", "this", ".", "fReadFromBuffer", "=", "false", ";", "this", ".", "fCharAfterWhiteSpace", "=", "-", "1", ";", "this", ".", "fWasWhiteSpace", "=", "true", ";", "}", "public", "String", "getString", "(", ")", "throws", "IOException", "{", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "int", "ch", ";", "while", "(", "(", "ch", "=", "read", "(", ")", ")", "!=", "-", "1", ")", "{", "buf", ".", "append", "(", "(", "char", ")", "ch", ")", ";", "}", "return", "buf", ".", "toString", "(", ")", ";", "}", "protected", "abstract", "String", "computeSubstitution", "(", "int", "c", ")", "throws", "IOException", ";", "protected", "Reader", "getReader", "(", ")", "{", "return", "this", ".", "fReader", ";", "}", "protected", "int", "nextChar", "(", ")", "throws", "IOException", "{", "this", ".", "fReadFromBuffer", "=", "(", "this", ".", "fBuffer", ".", "length", "(", ")", ">", "0", ")", ";", "if", "(", "this", ".", "fReadFromBuffer", ")", "{", "char", "ch", "=", "this", ".", "fBuffer", ".", "charAt", "(", "this", ".", "fIndex", "++", ")", ";", "if", "(", "this", ".", "fIndex", ">=", "this", ".", "fBuffer", ".", "length", "(", ")", ")", "{", "this", ".", "fBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "fIndex", "=", "0", ";", "}", "return", "ch", ";", "}", "else", "{", "int", "ch", "=", "this", ".", "fCharAfterWhiteSpace", ";", "if", "(", "ch", "==", "-", "1", ")", "{", "ch", "=", "this", ".", "fReader", ".", "read", "(", ")", ";", "}", "if", "(", "this", ".", "fSkipWhiteSpace", "&&", "ScannerHelper", ".", "isWhitespace", "(", "(", "char", ")", "ch", ")", ")", "{", "do", "{", "ch", "=", "this", ".", "fReader", ".", "read", "(", ")", ";", "}", "while", "(", "ScannerHelper", ".", "isWhitespace", "(", "(", "char", ")", "ch", ")", ")", ";", "if", "(", "ch", "!=", "-", "1", ")", "{", "this", ".", "fCharAfterWhiteSpace", "=", "ch", ";", "return", "'", "'", ";", "}", "}", "else", "{", "this", ".", "fCharAfterWhiteSpace", "=", "-", "1", ";", "}", "return", "ch", ";", "}", "}", "public", "int", "read", "(", ")", "throws", "IOException", "{", "int", "c", ";", "do", "{", "c", "=", "nextChar", "(", ")", ";", "while", "(", "!", "this", ".", "fReadFromBuffer", "&&", "c", "!=", "-", "1", ")", "{", "String", "s", "=", "computeSubstitution", "(", "c", ")", ";", "if", "(", "s", "==", "null", ")", "break", ";", "if", "(", "s", ".", "length", "(", ")", ">", "0", ")", "this", ".", "fBuffer", ".", "insert", "(", "0", ",", "s", ")", ";", "c", "=", "nextChar", "(", ")", ";", "}", "}", "while", "(", "this", ".", "fSkipWhiteSpace", "&&", "this", ".", "fWasWhiteSpace", "&&", "(", "c", "==", "'", "'", ")", ")", ";", "this", ".", "fWasWhiteSpace", "=", "(", "c", "==", "'", "'", "||", "c", "==", "'\\r'", "||", "c", "==", "'\\n'", ")", ";", "return", "c", ";", "}", "public", "int", "read", "(", "char", "cbuf", "[", "]", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "int", "end", "=", "off", "+", "len", ";", "for", "(", "int", "i", "=", "off", ";", "i", "<", "end", ";", "i", "++", ")", "{", "int", "ch", "=", "read", "(", ")", ";", "if", "(", "ch", "==", "-", "1", ")", "{", "if", "(", "i", "==", "off", ")", "{", "return", "-", "1", ";", "}", "else", "{", "return", "i", "-", "off", ";", "}", "}", "cbuf", "[", "i", "]", "=", "(", "char", ")", "ch", ";", "}", "return", "len", ";", "}", "public", "boolean", "ready", "(", ")", "throws", "IOException", "{", "return", "this", ".", "fReader", ".", "ready", "(", ")", ";", "}", "public", "void", "close", "(", ")", "throws", "IOException", "{", "this", ".", "fReader", ".", "close", "(", ")", ";", "}", "public", "void", "reset", "(", ")", "throws", "IOException", "{", "this", ".", "fReader", ".", "reset", "(", ")", ";", "this", ".", "fWasWhiteSpace", "=", "true", ";", "this", ".", "fCharAfterWhiteSpace", "=", "-", "1", ";", "this", ".", "fBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "fIndex", "=", "0", ";", "}", "protected", "final", "void", "setSkipWhitespace", "(", "boolean", "state", ")", "{", "this", ".", "fSkipWhiteSpace", "=", "state", ";", "}", "protected", "final", "boolean", "isSkippingWhitespace", "(", ")", "{", "return", "this", ".", "fSkipWhiteSpace", ";", "}", "}", "</s>" ]
3,955
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "InvalidInputException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "CodeFormatter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "DefaultCodeFormatterConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ASTVisitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AND_AND_Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AbstractMethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AbstractVariableDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AnnotationMethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Argument", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayAllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayInitializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayQualifiedTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AssertStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Assignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "BinaryExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Block", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "BreakStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CaseStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CastExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CharLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ClassLiteralAccess", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Clinit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CombinedBinaryExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompilationUnitDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompoundAssignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ConditionalExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ConstructorDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ContinueStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "UnionTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "DoStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "DoubleLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "EmptyStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "EqualExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ExplicitConstructorCall", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FalseLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FieldDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FieldReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FloatLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ForStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ForeachStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "IfStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ImportReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Initializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "InstanceOfExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "IntLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "LabeledStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "LocalDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "LongLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MarkerAnnotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MemberValuePair", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MessageSend", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "NormalAnnotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "NullLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "OR_OR_Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "OperatorIds", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ParameterizedQualifiedTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ParameterizedSingleTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "PostfixExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "PrefixExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedAllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedNameReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedSuperReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedThisReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ReturnStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SingleMemberAnnotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SingleNameReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SingleTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Statement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "StringLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "StringLiteralConcatenation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SuperReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SwitchStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SynchronizedStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ThisReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ThrowStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TrueLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TryStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeParameter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "UnaryExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "WhileStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Wildcard", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ClassScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "CompilationUnitScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ExtraCompilerModifiers", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Scanner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "TerminalTokens", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "CodeSnippetParsingUtil", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "align", ".", "Alignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "align", ".", "AlignmentException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IRegion", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "public", "class", "CodeFormatterVisitor", "extends", "ASTVisitor", "{", "public", "static", "class", "MultiFieldDeclaration", "extends", "FieldDeclaration", "{", "FieldDeclaration", "[", "]", "declarations", ";", "MultiFieldDeclaration", "(", "FieldDeclaration", "[", "]", "declarations", ")", "{", "this", ".", "declarations", "=", "declarations", ";", "this", ".", "modifiers", "=", "declarations", "[", "0", "]", ".", "modifiers", ";", "}", "}", "public", "final", "static", "boolean", "DEBUG", "=", "false", ";", "private", "static", "final", "int", "NO_MODIFIERS", "=", "0", ";", "private", "static", "final", "int", "[", "]", "SINGLETYPEREFERENCE_EXPECTEDTOKENS", "=", "new", "int", "[", "]", "{", "TerminalTokens", ".", "TokenNameIdentifier", ",", "TerminalTokens", ".", "TokenNameboolean", ",", "TerminalTokens", ".", "TokenNamebyte", ",", "TerminalTokens", ".", "TokenNamechar", ",", "TerminalTokens", ".", "TokenNamedouble", ",", "TerminalTokens", ".", "TokenNamefloat", ",", "TerminalTokens", ".", "TokenNameint", ",", "TerminalTokens", ".", "TokenNamelong", ",", "TerminalTokens", ".", "TokenNameshort", ",", "TerminalTokens", ".", "TokenNamevoid", "}", ";", "private", "static", "final", "int", "[", "]", "CLOSING_GENERICS_EXPECTEDTOKENS", "=", "new", "int", "[", "]", "{", "TerminalTokens", ".", "TokenNameRIGHT_SHIFT", ",", "TerminalTokens", ".", "TokenNameGREATER", ",", "TerminalTokens", ".", "TokenNameUNSIGNED_RIGHT_SHIFT", ",", "}", ";", "public", "int", "lastLocalDeclarationSourceStart", ";", "int", "lastBinaryExpressionAlignmentBreakIndentation", ";", "private", "Scanner", "localScanner", ";", "public", "DefaultCodeFormatterOptions", "preferences", ";", "public", "Scribe", "scribe", ";", "final", "static", "long", "EXPRESSIONS_POS_ENTER_EQUALITY", "=", "1", ";", "final", "static", "long", "EXPRESSIONS_POS_ENTER_TWO", "=", "2", ";", "final", "static", "long", "EXPRESSIONS_POS_BETWEEN_TWO", "=", "3", ";", "final", "static", "long", "EXPRESSIONS_POS_MASK", "=", "EXPRESSIONS_POS_BETWEEN_TWO", ";", "long", "expressionsPos", ";", "int", "expressionsDepth", "=", "-", "1", ";", "int", "arrayInitializersDepth", "=", "-", "1", ";", "public", "CodeFormatterVisitor", "(", "DefaultCodeFormatterOptions", "preferences", ",", "Map", "settings", ",", "IRegion", "[", "]", "regions", ",", "CodeSnippetParsingUtil", "codeSnippetParsingUtil", ",", "boolean", "includeComments", ")", "{", "long", "sourceLevel", "=", "settings", "==", "null", "?", "ClassFileConstants", ".", "JDK1_3", ":", "CompilerOptions", ".", "versionToJdkLevel", "(", "settings", ".", "get", "(", "JavaCore", ".", "COMPILER_SOURCE", ")", ")", ";", "this", ".", "localScanner", "=", "new", "Scanner", "(", "true", ",", "false", ",", "false", ",", "sourceLevel", ",", "null", ",", "null", ",", "true", ")", ";", "this", ".", "preferences", "=", "preferences", ";", "this", ".", "scribe", "=", "new", "Scribe", "(", "this", ",", "sourceLevel", ",", "regions", ",", "codeSnippetParsingUtil", ",", "includeComments", ")", ";", "}", "public", "void", "acceptProblem", "(", "IProblem", "problem", ")", "{", "super", ".", "acceptProblem", "(", "problem", ")", ";", "}", "private", "BinaryExpressionFragmentBuilder", "buildFragments", "(", "BinaryExpression", "binaryExpression", ",", "BlockScope", "scope", ")", "{", "BinaryExpressionFragmentBuilder", "builder", "=", "new", "BinaryExpressionFragmentBuilder", "(", ")", ";", "if", "(", "binaryExpression", "instanceof", "CombinedBinaryExpression", ")", "{", "binaryExpression", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "return", "builder", ";", "}", "switch", "(", "(", "binaryExpression", ".", "bits", "&", "ASTNode", ".", "OperatorMASK", ")", ">>", "ASTNode", ".", "OperatorSHIFT", ")", "{", "case", "OperatorIds", ".", "MULTIPLY", ":", "binaryExpression", ".", "left", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "builder", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameMULTIPLY", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "break", ";", "case", "OperatorIds", ".", "PLUS", ":", "binaryExpression", ".", "left", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "builder", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNamePLUS", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "break", ";", "case", "OperatorIds", ".", "DIVIDE", ":", "binaryExpression", ".", "left", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "builder", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameDIVIDE", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "break", ";", "case", "OperatorIds", ".", "REMAINDER", ":", "binaryExpression", ".", "left", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "builder", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameREMAINDER", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "break", ";", "case", "OperatorIds", ".", "XOR", ":", "binaryExpression", ".", "left", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "builder", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameXOR", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "break", ";", "case", "OperatorIds", ".", "MINUS", ":", "binaryExpression", ".", "left", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "builder", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "break", ";", "case", "OperatorIds", ".", "OR", ":", "binaryExpression", ".", "left", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "builder", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameOR", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "break", ";", "case", "OperatorIds", ".", "AND", ":", "binaryExpression", ".", "left", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "builder", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameAND", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "break", ";", "case", "OperatorIds", ".", "AND_AND", ":", "binaryExpression", ".", "left", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "builder", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameAND_AND", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "break", ";", "case", "OperatorIds", ".", "OR_OR", ":", "binaryExpression", ".", "left", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "builder", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameOR_OR", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "break", ";", "}", "return", "builder", ";", "}", "private", "CascadingMethodInvocationFragmentBuilder", "buildFragments", "(", "MessageSend", "messageSend", ",", "BlockScope", "scope", ")", "{", "CascadingMethodInvocationFragmentBuilder", "builder", "=", "new", "CascadingMethodInvocationFragmentBuilder", "(", ")", ";", "messageSend", ".", "traverse", "(", "builder", ",", "scope", ")", ";", "return", "builder", ";", "}", "private", "boolean", "commentStartsBlock", "(", "int", "start", ",", "int", "end", ")", "{", "this", ".", "localScanner", ".", "resetTo", "(", "start", ",", "end", ")", ";", "try", "{", "if", "(", "this", ".", "localScanner", ".", "getNextToken", "(", ")", "==", "TerminalTokens", ".", "TokenNameLBRACE", ")", "{", "switch", "(", "this", ".", "localScanner", ".", "getNextToken", "(", ")", ")", "{", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "return", "true", ";", "}", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "}", "return", "false", ";", "}", "private", "ASTNode", "[", "]", "computeMergedMemberDeclarations", "(", "ASTNode", "[", "]", "nodes", ")", "{", "ArrayList", "mergedNodes", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "nodes", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "ASTNode", "currentNode", "=", "nodes", "[", "i", "]", ";", "if", "(", "currentNode", "instanceof", "FieldDeclaration", ")", "{", "FieldDeclaration", "currentField", "=", "(", "FieldDeclaration", ")", "currentNode", ";", "if", "(", "mergedNodes", ".", "size", "(", ")", "==", "0", ")", "{", "mergedNodes", ".", "add", "(", "currentNode", ")", ";", "}", "else", "{", "ASTNode", "previousMergedNode", "=", "(", "ASTNode", ")", "mergedNodes", ".", "get", "(", "mergedNodes", ".", "size", "(", ")", "-", "1", ")", ";", "if", "(", "previousMergedNode", "instanceof", "MultiFieldDeclaration", ")", "{", "MultiFieldDeclaration", "multiFieldDeclaration", "=", "(", "MultiFieldDeclaration", ")", "previousMergedNode", ";", "int", "length", "=", "multiFieldDeclaration", ".", "declarations", ".", "length", ";", "System", ".", "arraycopy", "(", "multiFieldDeclaration", ".", "declarations", ",", "0", ",", "multiFieldDeclaration", ".", "declarations", "=", "new", "FieldDeclaration", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "multiFieldDeclaration", ".", "declarations", "[", "length", "]", "=", "currentField", ";", "}", "else", "if", "(", "previousMergedNode", "instanceof", "FieldDeclaration", ")", "{", "final", "FieldDeclaration", "previousFieldDeclaration", "=", "(", "FieldDeclaration", ")", "previousMergedNode", ";", "if", "(", "currentField", ".", "declarationSourceStart", "==", "previousFieldDeclaration", ".", "declarationSourceStart", ")", "{", "final", "MultiFieldDeclaration", "multiFieldDeclaration", "=", "new", "MultiFieldDeclaration", "(", "new", "FieldDeclaration", "[", "]", "{", "previousFieldDeclaration", ",", "currentField", "}", ")", ";", "multiFieldDeclaration", ".", "annotations", "=", "previousFieldDeclaration", ".", "annotations", ";", "mergedNodes", ".", "set", "(", "mergedNodes", ".", "size", "(", ")", "-", "1", ",", "multiFieldDeclaration", ")", ";", "}", "else", "{", "mergedNodes", ".", "add", "(", "currentNode", ")", ";", "}", "}", "else", "{", "mergedNodes", ".", "add", "(", "currentNode", ")", ";", "}", "}", "}", "else", "{", "mergedNodes", ".", "add", "(", "currentNode", ")", ";", "}", "}", "if", "(", "mergedNodes", ".", "size", "(", ")", "!=", "nodes", ".", "length", ")", "{", "ASTNode", "[", "]", "result", "=", "new", "ASTNode", "[", "mergedNodes", ".", "size", "(", ")", "]", ";", "mergedNodes", ".", "toArray", "(", "result", ")", ";", "return", "result", ";", "}", "else", "{", "return", "nodes", ";", "}", "}", "private", "ASTNode", "[", "]", "computeMergedMemberDeclarations", "(", "TypeDeclaration", "typeDeclaration", ")", "{", "int", "fieldIndex", "=", "0", ",", "fieldCount", "=", "(", "typeDeclaration", ".", "fields", "==", "null", ")", "?", "0", ":", "typeDeclaration", ".", "fields", ".", "length", ";", "FieldDeclaration", "field", "=", "fieldCount", "==", "0", "?", "null", ":", "typeDeclaration", ".", "fields", "[", "fieldIndex", "]", ";", "int", "fieldStart", "=", "field", "==", "null", "?", "Integer", ".", "MAX_VALUE", ":", "field", ".", "declarationSourceStart", ";", "int", "methodIndex", "=", "0", ",", "methodCount", "=", "(", "typeDeclaration", ".", "methods", "==", "null", ")", "?", "0", ":", "typeDeclaration", ".", "methods", ".", "length", ";", "AbstractMethodDeclaration", "method", "=", "methodCount", "==", "0", "?", "null", ":", "typeDeclaration", ".", "methods", "[", "methodIndex", "]", ";", "int", "methodStart", "=", "method", "==", "null", "?", "Integer", ".", "MAX_VALUE", ":", "method", ".", "declarationSourceStart", ";", "int", "typeIndex", "=", "0", ",", "typeCount", "=", "(", "typeDeclaration", ".", "memberTypes", "==", "null", ")", "?", "0", ":", "typeDeclaration", ".", "memberTypes", ".", "length", ";", "TypeDeclaration", "type", "=", "typeCount", "==", "0", "?", "null", ":", "typeDeclaration", ".", "memberTypes", "[", "typeIndex", "]", ";", "int", "typeStart", "=", "type", "==", "null", "?", "Integer", ".", "MAX_VALUE", ":", "type", ".", "declarationSourceStart", ";", "final", "int", "memberLength", "=", "fieldCount", "+", "methodCount", "+", "typeCount", ";", "ASTNode", "[", "]", "members", "=", "new", "ASTNode", "[", "memberLength", "]", ";", "if", "(", "memberLength", "!=", "0", ")", "{", "int", "index", "=", "0", ";", "int", "previousFieldStart", "=", "-", "1", ";", "do", "{", "if", "(", "fieldStart", "<", "methodStart", "&&", "fieldStart", "<", "typeStart", ")", "{", "if", "(", "field", ".", "getKind", "(", ")", "==", "AbstractVariableDeclaration", ".", "ENUM_CONSTANT", ")", "{", "previousFieldStart", "=", "fieldStart", ";", "if", "(", "++", "fieldIndex", "<", "fieldCount", ")", "{", "fieldStart", "=", "(", "field", "=", "typeDeclaration", ".", "fields", "[", "fieldIndex", "]", ")", ".", "declarationSourceStart", ";", "}", "else", "{", "fieldStart", "=", "Integer", ".", "MAX_VALUE", ";", "}", "continue", ";", "}", "if", "(", "fieldStart", "==", "previousFieldStart", ")", "{", "ASTNode", "previousMember", "=", "members", "[", "index", "-", "1", "]", ";", "if", "(", "previousMember", "instanceof", "MultiFieldDeclaration", ")", "{", "MultiFieldDeclaration", "multiField", "=", "(", "MultiFieldDeclaration", ")", "previousMember", ";", "int", "length", "=", "multiField", ".", "declarations", ".", "length", ";", "System", ".", "arraycopy", "(", "multiField", ".", "declarations", ",", "0", ",", "multiField", ".", "declarations", "=", "new", "FieldDeclaration", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "multiField", ".", "declarations", "[", "length", "]", "=", "field", ";", "}", "else", "{", "FieldDeclaration", "fieldDeclaration", "=", "(", "FieldDeclaration", ")", "previousMember", ";", "final", "MultiFieldDeclaration", "multiFieldDeclaration", "=", "new", "MultiFieldDeclaration", "(", "new", "FieldDeclaration", "[", "]", "{", "fieldDeclaration", ",", "field", "}", ")", ";", "multiFieldDeclaration", ".", "annotations", "=", "fieldDeclaration", ".", "annotations", ";", "members", "[", "index", "-", "1", "]", "=", "multiFieldDeclaration", ";", "}", "}", "else", "{", "members", "[", "index", "++", "]", "=", "field", ";", "}", "previousFieldStart", "=", "fieldStart", ";", "if", "(", "++", "fieldIndex", "<", "fieldCount", ")", "{", "fieldStart", "=", "(", "field", "=", "typeDeclaration", ".", "fields", "[", "fieldIndex", "]", ")", ".", "declarationSourceStart", ";", "}", "else", "{", "fieldStart", "=", "Integer", ".", "MAX_VALUE", ";", "}", "}", "else", "if", "(", "methodStart", "<", "fieldStart", "&&", "methodStart", "<", "typeStart", ")", "{", "if", "(", "!", "method", ".", "isDefaultConstructor", "(", ")", "&&", "!", "method", ".", "isClinit", "(", ")", ")", "{", "members", "[", "index", "++", "]", "=", "method", ";", "}", "if", "(", "++", "methodIndex", "<", "methodCount", ")", "{", "methodStart", "=", "(", "method", "=", "typeDeclaration", ".", "methods", "[", "methodIndex", "]", ")", ".", "declarationSourceStart", ";", "}", "else", "{", "methodStart", "=", "Integer", ".", "MAX_VALUE", ";", "}", "}", "else", "{", "members", "[", "index", "++", "]", "=", "type", ";", "if", "(", "++", "typeIndex", "<", "typeCount", ")", "{", "typeStart", "=", "(", "type", "=", "typeDeclaration", ".", "memberTypes", "[", "typeIndex", "]", ")", ".", "declarationSourceStart", ";", "}", "else", "{", "typeStart", "=", "Integer", ".", "MAX_VALUE", ";", "}", "}", "}", "while", "(", "(", "fieldIndex", "<", "fieldCount", ")", "||", "(", "typeIndex", "<", "typeCount", ")", "||", "(", "methodIndex", "<", "methodCount", ")", ")", ";", "if", "(", "members", ".", "length", "!=", "index", ")", "{", "System", ".", "arraycopy", "(", "members", ",", "0", ",", "members", "=", "new", "ASTNode", "[", "index", "]", ",", "0", ",", "index", ")", ";", "}", "}", "return", "members", ";", "}", "private", "boolean", "dumpBinaryExpression", "(", "BinaryExpression", "binaryExpression", ",", "int", "operator", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "binaryExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "binaryExpression", ",", "numberOfParens", ")", ";", "}", "BinaryExpressionFragmentBuilder", "builder", "=", "buildFragments", "(", "binaryExpression", ",", "scope", ")", ";", "final", "int", "fragmentsSize", "=", "builder", ".", "size", "(", ")", ";", "if", "(", "this", ".", "expressionsDepth", "<", "0", ")", "{", "this", ".", "expressionsDepth", "=", "0", ";", "}", "else", "{", "this", ".", "expressionsDepth", "++", ";", "this", ".", "expressionsPos", "<<=", "2", ";", "}", "try", "{", "this", ".", "lastBinaryExpressionAlignmentBreakIndentation", "=", "0", ";", "if", "(", "(", "builder", ".", "realFragmentsSize", "(", ")", ">", "1", "||", "fragmentsSize", ">", "4", ")", "&&", "numberOfParens", "==", "0", ")", "{", "int", "scribeLine", "=", "this", ".", "scribe", ".", "line", ";", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "Alignment", "binaryExpressionAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "BINARY_EXPRESSION", ",", "this", ".", "preferences", ".", "alignment_for_binary_expression", ",", "Alignment", ".", "R_OUTERMOST", ",", "fragmentsSize", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "binaryExpressionAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "ASTNode", "[", "]", "fragments", "=", "builder", ".", "fragments", "(", ")", ";", "int", "[", "]", "operators", "=", "builder", ".", "operators", "(", ")", ";", "do", "{", "try", "{", "final", "int", "max", "=", "fragmentsSize", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "max", ";", "i", "++", ")", "{", "ASTNode", "fragment", "=", "fragments", "[", "i", "]", ";", "fragment", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "this", ".", "scribe", ".", "lastNumberOfNewLines", "==", "1", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "binaryExpressionAlignment", ".", "breakIndentationLevel", ";", "}", "if", "(", "this", ".", "preferences", ".", "wrap_before_binary_operator", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "binaryExpressionAlignment", ",", "i", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "operators", "[", "i", "]", ",", "this", ".", "preferences", ".", "insert_space_before_binary_operator", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "operators", "[", "i", "]", ",", "this", ".", "preferences", ".", "insert_space_before_binary_operator", ")", ";", "this", ".", "scribe", ".", "alignFragment", "(", "binaryExpressionAlignment", ",", "i", ")", ";", "}", "if", "(", "operators", "[", "i", "]", "==", "TerminalTokens", ".", "TokenNameMINUS", "&&", "isNextToken", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_binary_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "fragments", "[", "max", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "binaryExpressionAlignment", ",", "true", ")", ";", "if", "(", "this", ".", "scribe", ".", "line", "==", "scribeLine", ")", "{", "this", ".", "lastBinaryExpressionAlignmentBreakIndentation", "=", "0", ";", "}", "else", "{", "this", ".", "lastBinaryExpressionAlignmentBreakIndentation", "=", "binaryExpressionAlignment", ".", "breakIndentationLevel", ";", "}", "}", "else", "{", "this", ".", "expressionsPos", "|=", "EXPRESSIONS_POS_ENTER_TWO", ";", "binaryExpression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "expressionsPos", "&=", "~", "EXPRESSIONS_POS_MASK", ";", "this", ".", "expressionsPos", "|=", "EXPRESSIONS_POS_BETWEEN_TWO", ";", "this", ".", "scribe", ".", "printNextToken", "(", "operator", ",", "this", ".", "preferences", ".", "insert_space_before_binary_operator", ",", "Scribe", ".", "PRESERVE_EMPTY_LINES_IN_BINARY_EXPRESSION", ")", ";", "if", "(", "operator", "==", "TerminalTokens", ".", "TokenNameMINUS", "&&", "isNextToken", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_binary_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "binaryExpression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "}", "finally", "{", "this", ".", "expressionsDepth", "--", ";", "this", ".", "expressionsPos", ">>=", "2", ";", "if", "(", "this", ".", "expressionsDepth", "<", "0", ")", "{", "this", ".", "lastBinaryExpressionAlignmentBreakIndentation", "=", "0", ";", "}", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "binaryExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "private", "boolean", "dumpEqualityExpression", "(", "BinaryExpression", "binaryExpression", ",", "int", "operator", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "binaryExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "binaryExpression", ",", "numberOfParens", ")", ";", "}", "if", "(", "this", ".", "expressionsDepth", "<", "0", ")", "{", "this", ".", "expressionsDepth", "=", "0", ";", "}", "else", "{", "this", ".", "expressionsDepth", "++", ";", "this", ".", "expressionsPos", "<<=", "2", ";", "}", "try", "{", "this", ".", "expressionsPos", "|=", "EXPRESSIONS_POS_ENTER_EQUALITY", ";", "binaryExpression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "operator", ",", "this", ".", "preferences", ".", "insert_space_before_binary_operator", ",", "Scribe", ".", "PRESERVE_EMPTY_LINES_IN_EQUALITY_EXPRESSION", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_binary_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "binaryExpression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "finally", "{", "this", ".", "expressionsDepth", "--", ";", "this", ".", "expressionsPos", ">>=", "2", ";", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "binaryExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "private", "final", "TextEdit", "failedToFormat", "(", ")", "{", "if", "(", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "this", ".", "scribe", ".", "scanner", ")", ";", "System", ".", "out", ".", "println", "(", "this", ".", "scribe", ")", ";", "}", "return", "null", ";", "}", "private", "void", "format", "(", "AbstractMethodDeclaration", "methodDeclaration", ",", "ClassScope", "scope", ",", "boolean", "isChunkStart", ",", "boolean", "isFirstClassBodyDeclaration", ")", "{", "if", "(", "isFirstClassBodyDeclaration", ")", "{", "int", "newLinesBeforeFirstClassBodyDeclaration", "=", "this", ".", "preferences", ".", "blank_lines_before_first_class_body_declaration", ";", "if", "(", "newLinesBeforeFirstClassBodyDeclaration", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLinesBeforeFirstClassBodyDeclaration", ")", ";", "}", "}", "else", "{", "final", "int", "newLineBeforeChunk", "=", "isChunkStart", "?", "this", ".", "preferences", ".", "blank_lines_before_new_chunk", ":", "0", ";", "if", "(", "newLineBeforeChunk", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLineBeforeChunk", ")", ";", "}", "}", "final", "int", "newLinesBeforeMethod", "=", "this", ".", "preferences", ".", "blank_lines_before_method", ";", "if", "(", "newLinesBeforeMethod", ">", "0", "&&", "!", "isFirstClassBodyDeclaration", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLinesBeforeMethod", ")", ";", "}", "else", "if", "(", "this", ".", "scribe", ".", "line", "!=", "0", "||", "this", ".", "scribe", ".", "column", "!=", "1", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "methodDeclaration", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "private", "void", "format", "(", "FieldDeclaration", "fieldDeclaration", ",", "ASTVisitor", "visitor", ",", "MethodScope", "scope", ",", "boolean", "isChunkStart", ",", "boolean", "isFirstClassBodyDeclaration", ")", "{", "if", "(", "isFirstClassBodyDeclaration", ")", "{", "int", "newLinesBeforeFirstClassBodyDeclaration", "=", "this", ".", "preferences", ".", "blank_lines_before_first_class_body_declaration", ";", "if", "(", "newLinesBeforeFirstClassBodyDeclaration", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLinesBeforeFirstClassBodyDeclaration", ")", ";", "}", "}", "else", "{", "int", "newLineBeforeChunk", "=", "isChunkStart", "?", "this", ".", "preferences", ".", "blank_lines_before_new_chunk", ":", "0", ";", "if", "(", "newLineBeforeChunk", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLineBeforeChunk", ")", ";", "}", "final", "int", "newLinesBeforeField", "=", "this", ".", "preferences", ".", "blank_lines_before_field", ";", "if", "(", "newLinesBeforeField", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLinesBeforeField", ")", ";", "}", "}", "Alignment", "memberAlignment", "=", "this", ".", "scribe", ".", "getMemberAlignment", "(", ")", ";", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "this", ".", "scribe", ".", "printModifiers", "(", "fieldDeclaration", ".", "annotations", ",", "this", ",", "ICodeFormatterConstants", ".", "ANNOTATION_ON_FIELD", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "fieldDeclaration", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "alignFragment", "(", "memberAlignment", ",", "0", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "true", ")", ";", "int", "extraDimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "extraDimensions", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "extraDimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "final", "Expression", "initialization", "=", "fieldDeclaration", ".", "initialization", ";", "if", "(", "initialization", "!=", "null", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "memberAlignment", ",", "1", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameEQUAL", ",", "this", ".", "preferences", ".", "insert_space_before_assignment_operator", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_assignment_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "Alignment", "assignmentAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "FIELD_DECLARATION_ASSIGNMENT", ",", "this", ".", "preferences", ".", "alignment_for_assignment", ",", "Alignment", ".", "R_INNERMOST", ",", "1", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "assignmentAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "assignmentAlignment", ",", "0", ")", ";", "initialization", ".", "traverse", "(", "this", ",", "scope", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "assignmentAlignment", ",", "true", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "if", "(", "memberAlignment", "!=", "null", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "memberAlignment", ",", "2", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "}", "private", "void", "format", "(", "ImportReference", "importRef", ",", "boolean", "isLast", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameimport", ")", ";", "if", "(", "!", "isLast", ")", "this", ".", "scribe", ".", "blank_lines_between_import_groups", "=", "this", ".", "preferences", ".", "blank_lines_between_import_groups", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "if", "(", "importRef", ".", "isStatic", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamestatic", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "if", "(", "(", "importRef", ".", "bits", "&", "ASTNode", ".", "OnDemand", ")", "!=", "0", ")", "{", "this", ".", "scribe", ".", "printQualifiedReference", "(", "importRef", ".", "sourceEnd", ",", "false", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameMULTIPLY", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printQualifiedReference", "(", "importRef", ".", "sourceEnd", ",", "false", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "}", "if", "(", "isLast", ")", "{", "this", ".", "scribe", ".", "blank_lines_between_import_groups", "=", "-", "1", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "IMPORT_TRAILING_COMMENT", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "NO_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "blank_lines_between_import_groups", "=", "-", "1", ";", "}", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "private", "void", "format", "(", "MultiFieldDeclaration", "multiFieldDeclaration", ",", "ASTVisitor", "visitor", ",", "MethodScope", "scope", ",", "boolean", "isChunkStart", ",", "boolean", "isFirstClassBodyDeclaration", ")", "{", "if", "(", "isFirstClassBodyDeclaration", ")", "{", "int", "newLinesBeforeFirstClassBodyDeclaration", "=", "this", ".", "preferences", ".", "blank_lines_before_first_class_body_declaration", ";", "if", "(", "newLinesBeforeFirstClassBodyDeclaration", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLinesBeforeFirstClassBodyDeclaration", ")", ";", "}", "}", "else", "{", "int", "newLineBeforeChunk", "=", "isChunkStart", "?", "this", ".", "preferences", ".", "blank_lines_before_new_chunk", ":", "0", ";", "if", "(", "newLineBeforeChunk", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLineBeforeChunk", ")", ";", "}", "final", "int", "newLinesBeforeField", "=", "this", ".", "preferences", ".", "blank_lines_before_field", ";", "if", "(", "newLinesBeforeField", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLinesBeforeField", ")", ";", "}", "}", "Alignment", "fieldAlignment", "=", "this", ".", "scribe", ".", "getMemberAlignment", "(", ")", ";", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "this", ".", "scribe", ".", "printModifiers", "(", "multiFieldDeclaration", ".", "annotations", ",", "this", ",", "ICodeFormatterConstants", ".", "ANNOTATION_ON_FIELD", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "multiFieldDeclaration", ".", "declarations", "[", "0", "]", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "final", "int", "multipleFieldDeclarationsLength", "=", "multiFieldDeclaration", ".", "declarations", ".", "length", ";", "Alignment", "multiFieldDeclarationsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "MULTIPLE_FIELD", ",", "this", ".", "preferences", ".", "alignment_for_multiple_fields", ",", "multipleFieldDeclarationsLength", "-", "1", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "multiFieldDeclarationsAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "multipleFieldDeclarationsLength", ";", "i", "<", "length", ";", "i", "++", ")", "{", "FieldDeclaration", "fieldDeclaration", "=", "multiFieldDeclaration", ".", "declarations", "[", "i", "]", ";", "if", "(", "i", "==", "0", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "fieldAlignment", ",", "0", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "true", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "false", ")", ";", "}", "int", "extraDimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "extraDimensions", "!=", "0", ")", "{", "for", "(", "int", "index", "=", "0", ";", "index", "<", "extraDimensions", ";", "index", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "final", "Expression", "initialization", "=", "fieldDeclaration", ".", "initialization", ";", "if", "(", "initialization", "!=", "null", ")", "{", "if", "(", "i", "==", "0", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "fieldAlignment", ",", "1", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameEQUAL", ",", "this", ".", "preferences", ".", "insert_space_before_assignment_operator", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_assignment_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "initialization", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "if", "(", "i", "!=", "length", "-", "1", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_multiple_field_declarations", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "alignFragment", "(", "multiFieldDeclarationsAlignment", ",", "i", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_multiple_field_declarations", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "alignFragment", "(", "fieldAlignment", ",", "2", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "multiFieldDeclarationsAlignment", ",", "true", ")", ";", "}", "public", "TextEdit", "format", "(", "String", "string", ",", "ASTNode", "[", "]", "nodes", ")", "{", "this", ".", "scribe", ".", "reset", "(", ")", ";", "long", "startTime", "=", "0", ";", "if", "(", "DEBUG", ")", "{", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "}", "final", "char", "[", "]", "compilationUnitSource", "=", "string", ".", "toCharArray", "(", ")", ";", "this", ".", "localScanner", ".", "setSource", "(", "compilationUnitSource", ")", ";", "this", ".", "scribe", ".", "resetScanner", "(", "compilationUnitSource", ")", ";", "if", "(", "nodes", "==", "null", ")", "{", "return", "null", ";", "}", "this", ".", "lastLocalDeclarationSourceStart", "=", "-", "1", ";", "try", "{", "formatClassBodyDeclarations", "(", "nodes", ")", ";", "}", "catch", "(", "AbortFormatting", "e", ")", "{", "return", "failedToFormat", "(", ")", ";", "}", "if", "(", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "startTime", ")", ")", ";", "}", "return", "this", ".", "scribe", ".", "getRootEdit", "(", ")", ";", "}", "public", "TextEdit", "format", "(", "String", "string", ",", "CompilationUnitDeclaration", "compilationUnitDeclaration", ")", "{", "this", ".", "scribe", ".", "reset", "(", ")", ";", "if", "(", "compilationUnitDeclaration", "==", "null", "||", "compilationUnitDeclaration", ".", "ignoreFurtherInvestigation", ")", "{", "return", "failedToFormat", "(", ")", ";", "}", "long", "startTime", "=", "0", ";", "if", "(", "DEBUG", ")", "{", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "}", "final", "char", "[", "]", "compilationUnitSource", "=", "string", ".", "toCharArray", "(", ")", ";", "this", ".", "localScanner", ".", "setSource", "(", "compilationUnitSource", ")", ";", "this", ".", "scribe", ".", "resetScanner", "(", "compilationUnitSource", ")", ";", "this", ".", "lastLocalDeclarationSourceStart", "=", "-", "1", ";", "try", "{", "compilationUnitDeclaration", ".", "traverse", "(", "this", ",", "compilationUnitDeclaration", ".", "scope", ")", ";", "}", "catch", "(", "AbortFormatting", "e", ")", "{", "return", "failedToFormat", "(", ")", ";", "}", "if", "(", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "startTime", ")", ")", ";", "}", "return", "this", ".", "scribe", ".", "getRootEdit", "(", ")", ";", "}", "public", "TextEdit", "format", "(", "String", "string", ",", "ConstructorDeclaration", "constructorDeclaration", ")", "{", "this", ".", "scribe", ".", "reset", "(", ")", ";", "long", "startTime", "=", "0", ";", "if", "(", "DEBUG", ")", "{", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "}", "final", "char", "[", "]", "compilationUnitSource", "=", "string", ".", "toCharArray", "(", ")", ";", "this", ".", "localScanner", ".", "setSource", "(", "compilationUnitSource", ")", ";", "this", ".", "scribe", ".", "resetScanner", "(", "compilationUnitSource", ")", ";", "if", "(", "constructorDeclaration", "==", "null", ")", "{", "return", "null", ";", "}", "this", ".", "lastLocalDeclarationSourceStart", "=", "-", "1", ";", "try", "{", "ExplicitConstructorCall", "explicitConstructorCall", "=", "constructorDeclaration", ".", "constructorCall", ";", "if", "(", "explicitConstructorCall", "!=", "null", "&&", "!", "explicitConstructorCall", ".", "isImplicitSuper", "(", ")", ")", "{", "explicitConstructorCall", ".", "traverse", "(", "this", ",", "null", ")", ";", "}", "Statement", "[", "]", "statements", "=", "constructorDeclaration", ".", "statements", ";", "if", "(", "statements", "!=", "null", ")", "{", "formatStatements", "(", "null", ",", "statements", ",", "false", ")", ";", "}", "if", "(", "hasComments", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "}", "catch", "(", "AbortFormatting", "e", ")", "{", "return", "failedToFormat", "(", ")", ";", "}", "if", "(", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "startTime", ")", ")", ";", "}", "return", "this", ".", "scribe", ".", "getRootEdit", "(", ")", ";", "}", "public", "TextEdit", "format", "(", "String", "string", ",", "Expression", "expression", ")", "{", "this", ".", "scribe", ".", "reset", "(", ")", ";", "long", "startTime", "=", "0", ";", "if", "(", "DEBUG", ")", "{", "startTime", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "}", "final", "char", "[", "]", "compilationUnitSource", "=", "string", ".", "toCharArray", "(", ")", ";", "this", ".", "localScanner", ".", "setSource", "(", "compilationUnitSource", ")", ";", "this", ".", "scribe", ".", "resetScanner", "(", "compilationUnitSource", ")", ";", "if", "(", "expression", "==", "null", ")", "{", "return", "null", ";", "}", "this", ".", "lastLocalDeclarationSourceStart", "=", "-", "1", ";", "try", "{", "expression", ".", "traverse", "(", "this", ",", "(", "BlockScope", ")", "null", ")", ";", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "}", "catch", "(", "AbortFormatting", "e", ")", "{", "return", "failedToFormat", "(", ")", ";", "}", "if", "(", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "startTime", ")", ")", ";", "}", "return", "this", ".", "scribe", ".", "getRootEdit", "(", ")", ";", "}", "public", "void", "formatComment", "(", "int", "kind", ",", "String", "source", ",", "int", "start", ",", "int", "end", ",", "int", "indentationLevel", ")", "{", "if", "(", "source", "==", "null", ")", "return", ";", "this", ".", "scribe", ".", "printComment", "(", "kind", ",", "source", ",", "start", ",", "end", ",", "indentationLevel", ")", ";", "}", "private", "void", "format", "(", "TypeDeclaration", "typeDeclaration", ")", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "this", ".", "scribe", ".", "printModifiers", "(", "typeDeclaration", ".", "annotations", ",", "this", ",", "ICodeFormatterConstants", ".", "ANNOTATION_ON_TYPE", ")", ";", "if", "(", "this", ".", "scribe", ".", "line", ">", "line", ")", "{", "line", "=", "this", ".", "scribe", ".", "line", ";", "}", "switch", "(", "TypeDeclaration", ".", "kind", "(", "typeDeclaration", ".", "modifiers", ")", ")", "{", "case", "TypeDeclaration", ".", "CLASS_DECL", ":", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameclass", ",", "true", ")", ";", "break", ";", "case", "TypeDeclaration", ".", "INTERFACE_DECL", ":", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameinterface", ",", "true", ")", ";", "break", ";", "case", "TypeDeclaration", ".", "ENUM_DECL", ":", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameenum", ",", "true", ")", ";", "break", ";", "case", "TypeDeclaration", ".", "ANNOTATION_TYPE_DECL", ":", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameAT", ",", "this", ".", "preferences", ".", "insert_space_before_at_in_annotation_type_declaration", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameinterface", ",", "this", ".", "preferences", ".", "insert_space_after_at_in_annotation_type_declaration", ")", ";", "break", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "true", ")", ";", "TypeParameter", "[", "]", "typeParameters", "=", "typeDeclaration", ".", "typeParameters", ";", "if", "(", "typeParameters", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_type_parameters", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_type_parameters", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "length", "=", "typeParameters", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", "-", "1", ";", "i", "++", ")", "{", "typeParameters", "[", "i", "]", ".", "traverse", "(", "this", ",", "typeDeclaration", ".", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_type_parameters", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_type_parameters", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeParameters", "[", "length", "-", "1", "]", ".", "traverse", "(", "this", ",", "typeDeclaration", ".", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_type_parameters", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_closing_angle_bracket_in_type_parameters", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "final", "TypeReference", "superclass", "=", "typeDeclaration", ".", "superclass", ";", "if", "(", "superclass", "!=", "null", ")", "{", "Alignment", "superclassAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "SUPER_CLASS", ",", "this", ".", "preferences", ".", "alignment_for_superclass_in_type_declaration", ",", "2", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "superclassAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "superclassAlignment", ",", "0", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameextends", ",", "true", ")", ";", "this", ".", "scribe", ".", "alignFragment", "(", "superclassAlignment", ",", "1", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "superclass", ".", "traverse", "(", "this", ",", "typeDeclaration", ".", "scope", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "superclassAlignment", ",", "true", ")", ";", "}", "final", "TypeReference", "[", "]", "superInterfaces", "=", "typeDeclaration", ".", "superInterfaces", ";", "if", "(", "superInterfaces", "!=", "null", ")", "{", "int", "alignment_for_superinterfaces", ";", "int", "kind", "=", "TypeDeclaration", ".", "kind", "(", "typeDeclaration", ".", "modifiers", ")", ";", "switch", "(", "kind", ")", "{", "case", "TypeDeclaration", ".", "ENUM_DECL", ":", "alignment_for_superinterfaces", "=", "this", ".", "preferences", ".", "alignment_for_superinterfaces_in_enum_declaration", ";", "break", ";", "default", ":", "alignment_for_superinterfaces", "=", "this", ".", "preferences", ".", "alignment_for_superinterfaces_in_type_declaration", ";", "break", ";", "}", "int", "superInterfaceLength", "=", "superInterfaces", ".", "length", ";", "Alignment", "interfaceAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "SUPER_INTERFACES", ",", "alignment_for_superinterfaces", ",", "superInterfaceLength", "+", "1", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "interfaceAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "interfaceAlignment", ",", "0", ")", ";", "if", "(", "kind", "==", "TypeDeclaration", ".", "INTERFACE_DECL", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameextends", ",", "true", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameimplements", ",", "true", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "superInterfaceLength", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_superinterfaces", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "alignFragment", "(", "interfaceAlignment", ",", "i", "+", "1", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_superinterfaces", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "superInterfaces", "[", "i", "]", ".", "traverse", "(", "this", ",", "typeDeclaration", ".", "scope", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "alignFragment", "(", "interfaceAlignment", ",", "i", "+", "1", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "superInterfaces", "[", "i", "]", ".", "traverse", "(", "this", ",", "typeDeclaration", ".", "scope", ")", ";", "}", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "interfaceAlignment", ",", "true", ")", ";", "}", "String", "class_declaration_brace", ";", "boolean", "space_before_opening_brace", ";", "int", "kind", "=", "TypeDeclaration", ".", "kind", "(", "typeDeclaration", ".", "modifiers", ")", ";", "switch", "(", "kind", ")", "{", "case", "TypeDeclaration", ".", "ENUM_DECL", ":", "class_declaration_brace", "=", "this", ".", "preferences", ".", "brace_position_for_enum_declaration", ";", "space_before_opening_brace", "=", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_enum_declaration", ";", "break", ";", "case", "TypeDeclaration", ".", "ANNOTATION_TYPE_DECL", ":", "class_declaration_brace", "=", "this", ".", "preferences", ".", "brace_position_for_annotation_type_declaration", ";", "space_before_opening_brace", "=", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_annotation_type_declaration", ";", "break", ";", "default", ":", "class_declaration_brace", "=", "this", ".", "preferences", ".", "brace_position_for_type_declaration", ";", "space_before_opening_brace", "=", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_type_declaration", ";", "break", ";", "}", "formatLeftCurlyBrace", "(", "line", ",", "class_declaration_brace", ")", ";", "formatTypeOpeningBrace", "(", "class_declaration_brace", ",", "space_before_opening_brace", ",", "typeDeclaration", ")", ";", "boolean", "indent_body_declarations_compare_to_header", ";", "switch", "(", "kind", ")", "{", "case", "TypeDeclaration", ".", "ENUM_DECL", ":", "indent_body_declarations_compare_to_header", "=", "this", ".", "preferences", ".", "indent_body_declarations_compare_to_enum_declaration_header", ";", "break", ";", "case", "TypeDeclaration", ".", "ANNOTATION_TYPE_DECL", ":", "indent_body_declarations_compare_to_header", "=", "this", ".", "preferences", ".", "indent_body_declarations_compare_to_annotation_declaration_header", ";", "break", ";", "default", ":", "indent_body_declarations_compare_to_header", "=", "this", ".", "preferences", ".", "indent_body_declarations_compare_to_type_header", ";", "break", ";", "}", "if", "(", "indent_body_declarations_compare_to_header", ")", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "if", "(", "kind", "==", "TypeDeclaration", ".", "ENUM_DECL", ")", "{", "FieldDeclaration", "[", "]", "fieldDeclarations", "=", "typeDeclaration", ".", "fields", ";", "boolean", "hasConstants", "=", "false", ";", "int", "length", "=", "fieldDeclarations", "!=", "null", "?", "fieldDeclarations", ".", "length", ":", "0", ";", "int", "enumConstantsLength", "=", "0", ";", "if", "(", "fieldDeclarations", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "FieldDeclaration", "fieldDeclaration", "=", "fieldDeclarations", "[", "i", "]", ";", "if", "(", "fieldDeclaration", ".", "getKind", "(", ")", "==", "AbstractVariableDeclaration", ".", "ENUM_CONSTANT", ")", "{", "enumConstantsLength", "++", ";", "}", "else", "{", "break", ";", "}", "}", "hasConstants", "=", "enumConstantsLength", "!=", "0", ";", "if", "(", "enumConstantsLength", ">", "1", ")", "{", "Alignment", "enumConstantsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "ENUM_CONSTANTS", ",", "this", ".", "preferences", ".", "alignment_for_enum_constants", ",", "enumConstantsLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ",", "0", ",", "false", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "enumConstantsAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "enumConstantsLength", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "enumConstantsAlignment", ",", "i", ")", ";", "FieldDeclaration", "fieldDeclaration", "=", "fieldDeclarations", "[", "i", "]", ";", "fieldDeclaration", ".", "traverse", "(", "this", ",", "typeDeclaration", ".", "initializerScope", ")", ";", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_enum_declarations", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_enum_declarations", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "fieldDeclaration", ".", "initialization", "instanceof", "QualifiedAllocationExpression", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "enumConstantsAlignment", ",", "true", ")", ";", "}", "else", "if", "(", "hasConstants", ")", "{", "FieldDeclaration", "fieldDeclaration", "=", "fieldDeclarations", "[", "0", "]", ";", "fieldDeclaration", ".", "traverse", "(", "this", ",", "typeDeclaration", ".", "initializerScope", ")", ";", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_enum_declarations", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_enum_declarations", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "fieldDeclaration", ".", "initialization", "instanceof", "QualifiedAllocationExpression", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "}", "}", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "hasConstants", "||", "(", "(", "enumConstantsLength", "-", "length", ")", "!=", "0", ")", "||", "typeDeclaration", ".", "methods", "!=", "null", "||", "typeDeclaration", ".", "memberTypes", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "if", "(", "hasConstants", ")", "{", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "formatTypeMembers", "(", "typeDeclaration", ")", ";", "if", "(", "indent_body_declarations_compare_to_header", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "switch", "(", "kind", ")", "{", "case", "TypeDeclaration", ".", "ENUM_DECL", ":", "if", "(", "this", ".", "preferences", ".", "insert_new_line_in_empty_enum_declaration", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "break", ";", "case", "TypeDeclaration", ".", "ANNOTATION_TYPE_DECL", ":", "if", "(", "this", ".", "preferences", ".", "insert_new_line_in_empty_annotation_declaration", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "break", ";", "default", ":", "if", "(", "this", ".", "preferences", ".", "insert_new_line_in_empty_type_declaration", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "class_declaration_brace", ".", "equals", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_SHIFTED", ")", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "if", "(", "hasComments", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "private", "void", "format", "(", "TypeDeclaration", "memberTypeDeclaration", ",", "ClassScope", "scope", ",", "boolean", "isChunkStart", ",", "boolean", "isFirstClassBodyDeclaration", ")", "{", "if", "(", "isFirstClassBodyDeclaration", ")", "{", "int", "newLinesBeforeFirstClassBodyDeclaration", "=", "this", ".", "preferences", ".", "blank_lines_before_first_class_body_declaration", ";", "if", "(", "newLinesBeforeFirstClassBodyDeclaration", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLinesBeforeFirstClassBodyDeclaration", ")", ";", "}", "}", "else", "{", "int", "newLineBeforeChunk", "=", "isChunkStart", "?", "this", ".", "preferences", ".", "blank_lines_before_new_chunk", ":", "0", ";", "if", "(", "newLineBeforeChunk", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLineBeforeChunk", ")", ";", "}", "final", "int", "newLinesBeforeMember", "=", "this", ".", "preferences", ".", "blank_lines_before_member_type", ";", "if", "(", "newLinesBeforeMember", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLinesBeforeMember", ")", ";", "}", "}", "memberTypeDeclaration", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "private", "void", "formatAnonymousTypeDeclaration", "(", "TypeDeclaration", "typeDeclaration", ")", "{", "String", "anonymous_type_declaration_brace_position", "=", "this", ".", "preferences", ".", "brace_position_for_anonymous_type_declaration", ";", "formatTypeOpeningBrace", "(", "anonymous_type_declaration_brace_position", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_anonymous_type_declaration", ",", "typeDeclaration", ")", ";", "this", ".", "scribe", ".", "indent", "(", ")", ";", "formatTypeMembers", "(", "typeDeclaration", ")", ";", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_new_line_in_empty_anonymous_type_declaration", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ")", ";", "if", "(", "anonymous_type_declaration_brace_position", ".", "equals", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_SHIFTED", ")", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "private", "void", "formatBlock", "(", "Block", "block", ",", "BlockScope", "scope", ",", "String", "block_brace_position", ",", "boolean", "insertSpaceBeforeOpeningBrace", ")", "{", "formatOpeningBrace", "(", "block_brace_position", ",", "insertSpaceBeforeOpeningBrace", ")", ";", "final", "Statement", "[", "]", "statements", "=", "block", ".", "statements", ";", "if", "(", "statements", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_block", ")", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "formatStatements", "(", "scope", ",", "statements", ",", "true", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "Scribe", ".", "PRESERVE_EMPTY_LINES_AT_END_OF_BLOCK", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_block", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "else", "if", "(", "this", ".", "preferences", ".", "insert_new_line_in_empty_block", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_block", ")", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", "Scribe", ".", "PRESERVE_EMPTY_LINES_AT_END_OF_BLOCK", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_block", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "else", "{", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_block", ")", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", "Scribe", ".", "PRESERVE_EMPTY_LINES_AT_END_OF_BLOCK", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_block", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_SHIFTED", ".", "equals", "(", "block_brace_position", ")", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "private", "void", "formatCascadingMessageSends", "(", "CascadingMethodInvocationFragmentBuilder", "builder", ",", "BlockScope", "scope", ")", "{", "int", "size", "=", "builder", ".", "size", "(", ")", ";", "MessageSend", "[", "]", "fragments", "=", "builder", ".", "fragments", "(", ")", ";", "Expression", "fragment", "=", "fragments", "[", "0", "]", ".", "receiver", ";", "int", "startingPositionInCascade", "=", "1", ";", "if", "(", "!", "fragment", ".", "isImplicitThis", "(", ")", ")", "{", "fragment", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "else", "{", "MessageSend", "currentMessageSend", "=", "fragments", "[", "1", "]", ";", "final", "int", "numberOfParens", "=", "(", "currentMessageSend", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "currentMessageSend", ",", "numberOfParens", ")", ";", "}", "ASTNode", "[", "]", "arguments", "=", "currentMessageSend", ".", "arguments", ";", "TypeReference", "[", "]", "typeArguments", "=", "currentMessageSend", ".", "typeArguments", ";", "if", "(", "typeArguments", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "length", "=", "typeArguments", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", "-", "1", ";", "i", "++", ")", "{", "typeArguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeArguments", "[", "length", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_type_arguments", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_closing_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_method_invocation", ")", ";", "if", "(", "arguments", "!=", "null", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_method_invocation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "argumentLength", "=", "arguments", ".", "length", ";", "Alignment", "argumentsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "MESSAGE_ARGUMENTS", ",", "this", ".", "preferences", ".", "alignment_for_arguments_in_method_invocation", ",", "Alignment", ".", "R_OUTERMOST", ",", "argumentLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "argumentsAlignment", ")", ";", "boolean", "okForArguments", "=", "false", ";", "do", "{", "try", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "argumentLength", ";", "j", "++", ")", "{", "if", "(", "j", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_method_invocation_arguments", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "j", ")", ";", "if", "(", "j", ">", "0", "&&", "this", ".", "preferences", ".", "insert_space_after_comma_in_method_invocation_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "arguments", "[", "j", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "okForArguments", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "okForArguments", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "argumentsAlignment", ",", "true", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_method_invocation", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_between_empty_parens_in_method_invocation", ")", ";", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "currentMessageSend", ",", "numberOfParens", ")", ";", "}", "startingPositionInCascade", "=", "2", ";", "}", "int", "tieBreakRule", "=", "this", ".", "preferences", ".", "wrap_outer_expressions_when_nested", "&&", "size", "-", "startingPositionInCascade", ">", "2", "?", "Alignment", ".", "R_OUTERMOST", ":", "Alignment", ".", "R_INNERMOST", ";", "Alignment", "cascadingMessageSendAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "CASCADING_MESSAGE_SEND", ",", "this", ".", "preferences", ".", "alignment_for_selector_in_method_invocation", ",", "tieBreakRule", ",", "size", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "cascadingMessageSendAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "boolean", "setStartingColumn", "=", "true", ";", "switch", "(", "this", ".", "preferences", ".", "alignment_for_arguments_in_method_invocation", "&", "Alignment", ".", "SPLIT_MASK", ")", "{", "case", "Alignment", ".", "M_COMPACT_FIRST_BREAK_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ":", "case", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ":", "setStartingColumn", "=", "false", ";", "break", ";", "}", "do", "{", "if", "(", "setStartingColumn", ")", "{", "cascadingMessageSendAlignment", ".", "startingColumn", "=", "this", ".", "scribe", ".", "column", ";", "}", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "cascadingMessageSendAlignment", ",", "0", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "for", "(", "int", "i", "=", "startingPositionInCascade", ";", "i", "<", "size", ";", "i", "++", ")", "{", "MessageSend", "currentMessageSend", "=", "fragments", "[", "i", "]", ";", "final", "int", "numberOfParens", "=", "(", "currentMessageSend", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "currentMessageSend", ",", "numberOfParens", ")", ";", "}", "TypeReference", "[", "]", "typeArguments", "=", "currentMessageSend", ".", "typeArguments", ";", "if", "(", "typeArguments", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "length", "=", "typeArguments", ".", "length", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "length", "-", "1", ";", "j", "++", ")", "{", "typeArguments", "[", "j", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeArguments", "[", "length", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_type_arguments", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_closing_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "ASTNode", "[", "]", "arguments", "=", "currentMessageSend", ".", "arguments", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_method_invocation", ")", ";", "if", "(", "arguments", "!=", "null", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_method_invocation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "argumentLength", "=", "arguments", ".", "length", ";", "int", "alignmentMode", "=", "this", ".", "preferences", ".", "alignment_for_arguments_in_method_invocation", ";", "Alignment", "argumentsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "MESSAGE_ARGUMENTS", ",", "alignmentMode", ",", "Alignment", ".", "R_OUTERMOST", ",", "argumentLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "argumentsAlignment", ")", ";", "boolean", "okForArguments", "=", "false", ";", "do", "{", "switch", "(", "alignmentMode", "&", "Alignment", ".", "SPLIT_MASK", ")", "{", "case", "Alignment", ".", "M_COMPACT_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ":", "argumentsAlignment", ".", "startingColumn", "=", "this", ".", "scribe", ".", "column", ";", "break", ";", "}", "try", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "argumentLength", ";", "j", "++", ")", "{", "if", "(", "j", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_method_invocation_arguments", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "j", ")", ";", "if", "(", "j", "==", "0", ")", "{", "int", "fragmentIndentation", "=", "argumentsAlignment", ".", "fragmentIndentations", "[", "j", "]", ";", "if", "(", "(", "argumentsAlignment", ".", "mode", "&", "Alignment", ".", "M_INDENT_ON_COLUMN", ")", "!=", "0", "&&", "fragmentIndentation", ">", "0", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "fragmentIndentation", ";", "}", "}", "else", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_method_invocation_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "arguments", "[", "j", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "argumentsAlignment", ".", "startingColumn", "=", "-", "1", ";", "}", "okForArguments", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "okForArguments", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "argumentsAlignment", ",", "true", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_method_invocation", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_between_empty_parens_in_method_invocation", ")", ";", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "currentMessageSend", ",", "numberOfParens", ")", ";", "}", "cascadingMessageSendAlignment", ".", "startingColumn", "=", "-", "1", ";", "if", "(", "i", "<", "size", "-", "1", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "cascadingMessageSendAlignment", ",", "i", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "}", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "cascadingMessageSendAlignment", ",", "true", ")", ";", "}", "private", "void", "formatClassBodyDeclarations", "(", "ASTNode", "[", "]", "nodes", ")", "{", "final", "int", "FIELD", "=", "1", ",", "METHOD", "=", "2", ",", "TYPE", "=", "3", ";", "this", ".", "scribe", ".", "lastNumberOfNewLines", "=", "1", ";", "ASTNode", "[", "]", "mergedNodes", "=", "computeMergedMemberDeclarations", "(", "nodes", ")", ";", "Alignment", "memberAlignment", "=", "this", ".", "scribe", ".", "createMemberAlignment", "(", "Alignment", ".", "TYPE_MEMBERS", ",", "this", ".", "preferences", ".", "align_type_members_on_columns", "?", "Alignment", ".", "M_MULTICOLUMN", ":", "Alignment", ".", "M_NO_ALIGNMENT", ",", "4", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterMemberAlignment", "(", "memberAlignment", ")", ";", "boolean", "isChunkStart", "=", "false", ";", "boolean", "ok", "=", "false", ";", "int", "startIndex", "=", "0", ";", "do", "{", "try", "{", "for", "(", "int", "i", "=", "startIndex", ",", "max", "=", "mergedNodes", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "ASTNode", "member", "=", "mergedNodes", "[", "i", "]", ";", "if", "(", "member", "instanceof", "FieldDeclaration", ")", "{", "isChunkStart", "=", "memberAlignment", ".", "checkChunkStart", "(", "FIELD", ",", "i", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "if", "(", "member", "instanceof", "MultiFieldDeclaration", ")", "{", "MultiFieldDeclaration", "multiField", "=", "(", "MultiFieldDeclaration", ")", "member", ";", "format", "(", "multiField", ",", "this", ",", "null", ",", "isChunkStart", ",", "i", "==", "0", ")", ";", "}", "else", "if", "(", "member", "instanceof", "Initializer", ")", "{", "int", "newLineBeforeChunk", "=", "isChunkStart", "?", "this", ".", "preferences", ".", "blank_lines_before_new_chunk", ":", "0", ";", "if", "(", "newLineBeforeChunk", ">", "0", "&&", "i", "!=", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLineBeforeChunk", ")", ";", "}", "else", "if", "(", "i", "==", "0", ")", "{", "int", "newLinesBeforeFirstClassBodyDeclaration", "=", "this", ".", "preferences", ".", "blank_lines_before_first_class_body_declaration", ";", "if", "(", "newLinesBeforeFirstClassBodyDeclaration", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLinesBeforeFirstClassBodyDeclaration", ")", ";", "}", "}", "Initializer", "initializer", "=", "(", "Initializer", ")", "member", ";", "initializer", ".", "traverse", "(", "this", ",", "null", ")", ";", "}", "else", "{", "FieldDeclaration", "field", "=", "(", "FieldDeclaration", ")", "member", ";", "format", "(", "field", ",", "this", ",", "null", ",", "isChunkStart", ",", "i", "==", "0", ")", ";", "}", "}", "else", "if", "(", "member", "instanceof", "AbstractMethodDeclaration", ")", "{", "isChunkStart", "=", "memberAlignment", ".", "checkChunkStart", "(", "METHOD", ",", "i", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "format", "(", "(", "AbstractMethodDeclaration", ")", "member", ",", "null", ",", "isChunkStart", ",", "i", "==", "0", ")", ";", "}", "else", "{", "isChunkStart", "=", "memberAlignment", ".", "checkChunkStart", "(", "TYPE", ",", "i", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "format", "(", "(", "TypeDeclaration", ")", "member", ",", "null", ",", "isChunkStart", ",", "i", "==", "0", ")", ";", "}", "while", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "if", "(", "i", "!=", "max", "-", "1", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "startIndex", "=", "memberAlignment", ".", "chunkStartIndex", ";", "this", ".", "scribe", ".", "redoMemberAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitMemberAlignment", "(", "memberAlignment", ")", ";", "if", "(", "hasComments", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "}", "private", "void", "formatEmptyTypeDeclaration", "(", "boolean", "isFirst", ")", "{", "boolean", "hasSemiColon", "=", "isNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ")", ";", "while", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ")", ")", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "if", "(", "hasSemiColon", "&&", "isFirst", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "private", "void", "formatGuardClauseBlock", "(", "Block", "block", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACE", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_block", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "final", "Statement", "[", "]", "statements", "=", "block", ".", "statements", ";", "statements", "[", "0", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ",", "true", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "private", "void", "formatLeftCurlyBrace", "(", "final", "int", "line", ",", "final", "String", "bracePosition", ")", "{", "this", ".", "scribe", ".", "printComment", "(", "Scribe", ".", "PRESERVE_EMPTY_LINES_IN_FORMAT_LEFT_CURLY_BRACE", ")", ";", "if", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_ON_WRAP", ".", "equals", "(", "bracePosition", ")", "&&", "(", "this", ".", "scribe", ".", "line", ">", "line", "||", "this", ".", "scribe", ".", "column", ">=", "this", ".", "preferences", ".", "page_width", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "private", "void", "formatLocalDeclaration", "(", "LocalDeclaration", "localDeclaration", ",", "BlockScope", "scope", ",", "boolean", "insertSpaceBeforeComma", ",", "boolean", "insertSpaceAfterComma", ")", "{", "if", "(", "!", "isMultipleLocalDeclaration", "(", "localDeclaration", ")", ")", "{", "if", "(", "localDeclaration", ".", "modifiers", "!=", "NO_MODIFIERS", "||", "localDeclaration", ".", "annotations", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "this", ".", "scribe", ".", "printModifiers", "(", "localDeclaration", ".", "annotations", ",", "this", ",", "ICodeFormatterConstants", ".", "ANNOTATION_ON_LOCAL_VARIABLE", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "if", "(", "localDeclaration", ".", "type", "!=", "null", ")", "{", "localDeclaration", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "true", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "false", ")", ";", "}", "int", "extraDimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "extraDimensions", "!=", "0", ")", "{", "for", "(", "int", "index", "=", "0", ";", "index", "<", "extraDimensions", ";", "index", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "final", "Expression", "initialization", "=", "localDeclaration", ".", "initialization", ";", "if", "(", "initialization", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameEQUAL", ",", "this", ".", "preferences", ".", "insert_space_before_assignment_operator", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_assignment_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "Alignment", "assignmentAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "LOCAL_DECLARATION_ASSIGNMENT", ",", "this", ".", "preferences", ".", "alignment_for_assignment", ",", "Alignment", ".", "R_OUTERMOST", ",", "1", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "assignmentAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "assignmentAlignment", ",", "0", ")", ";", "initialization", ".", "traverse", "(", "this", ",", "scope", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "assignmentAlignment", ",", "true", ")", ";", "}", "if", "(", "isPartOfMultipleLocalDeclaration", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "insertSpaceBeforeComma", ")", ";", "if", "(", "insertSpaceAfterComma", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "}", "private", "void", "formatMessageSend", "(", "MessageSend", "messageSend", ",", "BlockScope", "scope", ",", "Alignment", "messageAlignment", ")", "{", "if", "(", "messageAlignment", "!=", "null", ")", "{", "if", "(", "!", "this", ".", "preferences", ".", "wrap_outer_expressions_when_nested", "||", "messageAlignment", ".", "canAlign", "(", ")", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "messageAlignment", ",", "0", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "}", "TypeReference", "[", "]", "typeArguments", "=", "messageSend", ".", "typeArguments", ";", "if", "(", "typeArguments", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "length", "=", "typeArguments", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", "-", "1", ";", "i", "++", ")", "{", "typeArguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeArguments", "[", "length", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_type_arguments", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_closing_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_method_invocation", ")", ";", "final", "Expression", "[", "]", "arguments", "=", "messageSend", ".", "arguments", ";", "if", "(", "arguments", "!=", "null", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_method_invocation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "argumentsLength", "=", "arguments", ".", "length", ";", "if", "(", "argumentsLength", ">", "1", ")", "{", "int", "alignmentMode", "=", "this", ".", "preferences", ".", "alignment_for_arguments_in_method_invocation", ";", "Alignment", "argumentsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "MESSAGE_ARGUMENTS", ",", "alignmentMode", ",", "argumentsLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "argumentsAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "switch", "(", "alignmentMode", "&", "Alignment", ".", "SPLIT_MASK", ")", "{", "case", "Alignment", ".", "M_COMPACT_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ":", "argumentsAlignment", ".", "startingColumn", "=", "this", ".", "scribe", ".", "column", ";", "break", ";", "}", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentsLength", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_method_invocation_arguments", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "this", ".", "scribe", ".", "lastNumberOfNewLines", "==", "1", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "argumentsAlignment", ".", "breakIndentationLevel", ";", "}", "}", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "i", ")", ";", "if", "(", "i", ">", "0", "&&", "this", ".", "preferences", ".", "insert_space_after_comma_in_method_invocation_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "fragmentIndentation", "=", "0", ";", "if", "(", "i", "==", "0", ")", "{", "int", "wrappedIndex", "=", "argumentsAlignment", ".", "wrappedIndex", "(", ")", ";", "if", "(", "wrappedIndex", ">=", "0", ")", "{", "fragmentIndentation", "=", "argumentsAlignment", ".", "fragmentIndentations", "[", "wrappedIndex", "]", ";", "if", "(", "(", "argumentsAlignment", ".", "mode", "&", "Alignment", ".", "M_INDENT_ON_COLUMN", ")", "!=", "0", "&&", "fragmentIndentation", ">", "0", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "fragmentIndentation", ";", "}", "}", "}", "arguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "argumentsAlignment", ".", "startingColumn", "=", "-", "1", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "argumentsAlignment", ",", "true", ")", ";", "}", "else", "{", "arguments", "[", "0", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_method_invocation", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_between_empty_parens_in_method_invocation", ")", ";", "}", "}", "private", "void", "formatTryResources", "(", "TryStatement", "tryStatement", ",", "boolean", "spaceBeforeOpenParen", ",", "boolean", "spaceBeforeClosingParen", ",", "boolean", "spaceBeforeFirstResource", ",", "boolean", "spaceBeforeSemicolon", ",", "boolean", "spaceAfterSemicolon", ",", "int", "tryResourcesAligment", ")", "{", "LocalDeclaration", "[", "]", "resources", "=", "tryStatement", ".", "resources", ";", "int", "length", "=", "resources", "!=", "null", "?", "resources", ".", "length", ":", "0", ";", "if", "(", "length", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "spaceBeforeOpenParen", ")", ";", "if", "(", "spaceBeforeFirstResource", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "Alignment", "resourcesAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "TRY_RESOURCES", ",", "tryResourcesAligment", ",", "Alignment", ".", "R_OUTERMOST", ",", "length", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "resourcesAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "switch", "(", "tryResourcesAligment", "&", "Alignment", ".", "SPLIT_MASK", ")", "{", "case", "Alignment", ".", "M_COMPACT_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ":", "resourcesAlignment", ".", "startingColumn", "=", "this", ".", "scribe", ".", "column", ";", "break", ";", "}", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "spaceBeforeSemicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "this", ".", "scribe", ".", "lastNumberOfNewLines", "==", "1", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "resourcesAlignment", ".", "breakIndentationLevel", ";", "}", "}", "this", ".", "scribe", ".", "alignFragment", "(", "resourcesAlignment", ",", "i", ")", ";", "if", "(", "i", "==", "0", ")", "{", "int", "fragmentIndentation", "=", "resourcesAlignment", ".", "fragmentIndentations", "[", "0", "]", ";", "if", "(", "(", "resourcesAlignment", ".", "mode", "&", "Alignment", ".", "M_INDENT_ON_COLUMN", ")", "!=", "0", "&&", "fragmentIndentation", ">", "0", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "fragmentIndentation", ";", "}", "}", "else", "if", "(", "spaceAfterSemicolon", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "resources", "[", "i", "]", ".", "traverse", "(", "this", ",", "null", ")", ";", "resourcesAlignment", ".", "startingColumn", "=", "-", "1", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "spaceBeforeSemicolon", ")", ";", "}", "this", ".", "scribe", ".", "exitAlignment", "(", "resourcesAlignment", ",", "true", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "spaceBeforeClosingParen", ")", ";", "}", "}", "private", "void", "formatMethodArguments", "(", "AbstractMethodDeclaration", "methodDeclaration", ",", "boolean", "spaceBeforeOpenParen", ",", "boolean", "spaceBetweenEmptyParameters", ",", "boolean", "spaceBeforeClosingParen", ",", "boolean", "spaceBeforeFirstParameter", ",", "boolean", "spaceBeforeComma", ",", "boolean", "spaceAfterComma", ",", "int", "methodDeclarationParametersAlignment", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "spaceBeforeOpenParen", ")", ";", "final", "Argument", "[", "]", "arguments", "=", "methodDeclaration", ".", "arguments", ";", "if", "(", "arguments", "!=", "null", ")", "{", "if", "(", "spaceBeforeFirstParameter", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "argumentLength", "=", "arguments", ".", "length", ";", "Alignment", "argumentsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "METHOD_ARGUMENTS", ",", "methodDeclarationParametersAlignment", ",", "argumentLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "argumentsAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "switch", "(", "methodDeclarationParametersAlignment", "&", "Alignment", ".", "SPLIT_MASK", ")", "{", "case", "Alignment", ".", "M_COMPACT_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ":", "argumentsAlignment", ".", "startingColumn", "=", "this", ".", "scribe", ".", "column", ";", "break", ";", "}", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentLength", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "spaceBeforeComma", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "this", ".", "scribe", ".", "lastNumberOfNewLines", "==", "1", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "argumentsAlignment", ".", "breakIndentationLevel", ";", "}", "}", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "i", ")", ";", "if", "(", "i", "==", "0", ")", "{", "int", "fragmentIndentation", "=", "argumentsAlignment", ".", "fragmentIndentations", "[", "0", "]", ";", "if", "(", "(", "argumentsAlignment", ".", "mode", "&", "Alignment", ".", "M_INDENT_ON_COLUMN", ")", "!=", "0", "&&", "fragmentIndentation", ">", "0", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "fragmentIndentation", ";", "}", "}", "else", "if", "(", "spaceAfterComma", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "arguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "methodDeclaration", ".", "scope", ")", ";", "argumentsAlignment", ".", "startingColumn", "=", "-", "1", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "argumentsAlignment", ",", "true", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "spaceBeforeClosingParen", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "spaceBetweenEmptyParameters", ")", ";", "}", "}", "private", "void", "formatEnumConstantArguments", "(", "FieldDeclaration", "enumConstant", ",", "boolean", "spaceBeforeOpenParen", ",", "boolean", "spaceBetweenEmptyParameters", ",", "boolean", "spaceBeforeClosingParen", ",", "boolean", "spaceBeforeFirstParameter", ",", "boolean", "spaceBeforeComma", ",", "boolean", "spaceAfterComma", ",", "int", "methodDeclarationParametersAlignment", ")", "{", "if", "(", "!", "isNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ")", ")", "{", "return", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "spaceBeforeOpenParen", ")", ";", "final", "Expression", "[", "]", "arguments", "=", "(", "(", "AllocationExpression", ")", "enumConstant", ".", "initialization", ")", ".", "arguments", ";", "if", "(", "arguments", "!=", "null", ")", "{", "int", "argumentLength", "=", "arguments", ".", "length", ";", "Alignment", "argumentsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "ENUM_CONSTANTS_ARGUMENTS", ",", "methodDeclarationParametersAlignment", ",", "argumentLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "argumentsAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "if", "(", "spaceBeforeFirstParameter", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentLength", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "spaceBeforeComma", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "i", ")", ";", "if", "(", "i", ">", "0", "&&", "spaceAfterComma", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "arguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "(", "BlockScope", ")", "null", ")", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "argumentsAlignment", ",", "true", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "spaceBeforeClosingParen", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "spaceBetweenEmptyParameters", ")", ";", "}", "}", "private", "void", "formatNecessaryEmptyStatement", "(", ")", "{", "if", "(", "this", ".", "preferences", ".", "put_empty_statement_on_new_line", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "this", ".", "scribe", ".", "indent", "(", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "}", "private", "void", "formatOpeningBrace", "(", "String", "bracePosition", ",", "boolean", "insertSpaceBeforeBrace", ")", "{", "if", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE", ".", "equals", "(", "bracePosition", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "else", "if", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_SHIFTED", ".", "equals", "(", "bracePosition", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACE", ",", "insertSpaceBeforeBrace", ",", "Scribe", ".", "PRESERVE_EMPTY_LINES_IN_FORMAT_OPENING_BRACE", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "UNMODIFIABLE_TRAILING_COMMENT", ")", ";", "}", "private", "void", "formatStatements", "(", "BlockScope", "scope", ",", "final", "Statement", "[", "]", "statements", ",", "boolean", "insertNewLineAfterLastStatement", ")", "{", "int", "statementsLength", "=", "statements", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "statementsLength", ";", "i", "++", ")", "{", "final", "Statement", "statement", "=", "statements", "[", "i", "]", ";", "if", "(", "i", ">", "0", "&&", "(", "statements", "[", "i", "-", "1", "]", "instanceof", "EmptyStatement", ")", "&&", "!", "(", "statement", "instanceof", "EmptyStatement", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "statement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "statement", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "i", "!=", "statementsLength", "-", "1", ")", "{", "if", "(", "!", "(", "statement", "instanceof", "EmptyStatement", ")", "&&", "!", "(", "statements", "[", "i", "+", "1", "]", "instanceof", "EmptyStatement", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "if", "(", "i", "==", "statementsLength", "-", "1", "&&", "insertNewLineAfterLastStatement", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "if", "(", "statement", "instanceof", "LocalDeclaration", ")", "{", "LocalDeclaration", "currentLocal", "=", "(", "LocalDeclaration", ")", "statement", ";", "if", "(", "i", "<", "(", "statementsLength", "-", "1", ")", ")", "{", "if", "(", "statements", "[", "i", "+", "1", "]", "instanceof", "LocalDeclaration", ")", "{", "LocalDeclaration", "nextLocal", "=", "(", "LocalDeclaration", ")", "statements", "[", "i", "+", "1", "]", ";", "if", "(", "currentLocal", ".", "declarationSourceStart", "!=", "nextLocal", ".", "declarationSourceStart", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "i", "!=", "statementsLength", "-", "1", ")", "{", "if", "(", "!", "(", "statement", "instanceof", "EmptyStatement", ")", "&&", "!", "(", "statements", "[", "i", "+", "1", "]", "instanceof", "EmptyStatement", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "if", "(", "i", "==", "statementsLength", "-", "1", "&&", "insertNewLineAfterLastStatement", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "i", "!=", "statementsLength", "-", "1", ")", "{", "if", "(", "!", "(", "statement", "instanceof", "EmptyStatement", ")", "&&", "!", "(", "statements", "[", "i", "+", "1", "]", "instanceof", "EmptyStatement", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "if", "(", "i", "==", "statementsLength", "-", "1", "&&", "insertNewLineAfterLastStatement", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "i", "!=", "statementsLength", "-", "1", ")", "{", "if", "(", "!", "(", "statement", "instanceof", "EmptyStatement", ")", "&&", "!", "(", "statements", "[", "i", "+", "1", "]", "instanceof", "EmptyStatement", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "if", "(", "i", "==", "statementsLength", "-", "1", "&&", "insertNewLineAfterLastStatement", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "}", "else", "if", "(", "i", "!=", "statementsLength", "-", "1", ")", "{", "if", "(", "!", "(", "statement", "instanceof", "EmptyStatement", ")", "&&", "!", "(", "statements", "[", "i", "+", "1", "]", "instanceof", "EmptyStatement", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "if", "(", "i", "==", "statementsLength", "-", "1", "&&", "insertNewLineAfterLastStatement", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "}", "private", "void", "formatThrowsClause", "(", "AbstractMethodDeclaration", "methodDeclaration", ",", "boolean", "spaceBeforeComma", ",", "boolean", "spaceAfterComma", ",", "int", "alignmentForThrowsClause", ")", "{", "final", "TypeReference", "[", "]", "thrownExceptions", "=", "methodDeclaration", ".", "thrownExceptions", ";", "if", "(", "thrownExceptions", "!=", "null", ")", "{", "int", "thrownExceptionsLength", "=", "thrownExceptions", ".", "length", ";", "Alignment", "throwsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "THROWS", ",", "alignmentForThrowsClause", ",", "thrownExceptionsLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "throwsAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "throwsAlignment", ",", "0", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamethrows", ",", "true", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "thrownExceptionsLength", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "spaceBeforeComma", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "alignFragment", "(", "throwsAlignment", ",", "i", ")", ";", "if", "(", "spaceAfterComma", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "thrownExceptions", "[", "i", "]", ".", "traverse", "(", "this", ",", "methodDeclaration", ".", "scope", ")", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "throwsAlignment", ",", "true", ")", ";", "}", "}", "private", "void", "formatTypeMembers", "(", "TypeDeclaration", "typeDeclaration", ")", "{", "Alignment", "memberAlignment", "=", "this", ".", "scribe", ".", "createMemberAlignment", "(", "Alignment", ".", "TYPE_MEMBERS", ",", "this", ".", "preferences", ".", "align_type_members_on_columns", "?", "Alignment", ".", "M_MULTICOLUMN", ":", "Alignment", ".", "M_NO_ALIGNMENT", ",", "3", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterMemberAlignment", "(", "memberAlignment", ")", ";", "ASTNode", "[", "]", "members", "=", "computeMergedMemberDeclarations", "(", "typeDeclaration", ")", ";", "boolean", "isChunkStart", "=", "false", ";", "boolean", "ok", "=", "false", ";", "int", "membersLength", "=", "members", ".", "length", ";", "if", "(", "membersLength", ">", "0", ")", "{", "int", "startIndex", "=", "0", ";", "do", "{", "try", "{", "for", "(", "int", "i", "=", "startIndex", ",", "max", "=", "members", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "while", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "ASTNode", "member", "=", "members", "[", "i", "]", ";", "if", "(", "member", "instanceof", "FieldDeclaration", ")", "{", "isChunkStart", "=", "memberAlignment", ".", "checkChunkStart", "(", "Alignment", ".", "CHUNK_FIELD", ",", "i", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "if", "(", "member", "instanceof", "MultiFieldDeclaration", ")", "{", "MultiFieldDeclaration", "multiField", "=", "(", "MultiFieldDeclaration", ")", "member", ";", "if", "(", "multiField", ".", "isStatic", "(", ")", ")", "{", "format", "(", "multiField", ",", "this", ",", "typeDeclaration", ".", "staticInitializerScope", ",", "isChunkStart", ",", "i", "==", "0", ")", ";", "}", "else", "{", "format", "(", "multiField", ",", "this", ",", "typeDeclaration", ".", "initializerScope", ",", "isChunkStart", ",", "i", "==", "0", ")", ";", "}", "}", "else", "if", "(", "member", "instanceof", "Initializer", ")", "{", "int", "newLineBeforeChunk", "=", "isChunkStart", "?", "this", ".", "preferences", ".", "blank_lines_before_new_chunk", ":", "0", ";", "if", "(", "newLineBeforeChunk", ">", "0", "&&", "i", "!=", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLineBeforeChunk", ")", ";", "}", "else", "if", "(", "i", "==", "0", ")", "{", "int", "newLinesBeforeFirstClassBodyDeclaration", "=", "this", ".", "preferences", ".", "blank_lines_before_first_class_body_declaration", ";", "if", "(", "newLinesBeforeFirstClassBodyDeclaration", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "newLinesBeforeFirstClassBodyDeclaration", ")", ";", "}", "}", "Initializer", "initializer", "=", "(", "Initializer", ")", "member", ";", "if", "(", "initializer", ".", "isStatic", "(", ")", ")", "{", "initializer", ".", "traverse", "(", "this", ",", "typeDeclaration", ".", "staticInitializerScope", ")", ";", "}", "else", "{", "initializer", ".", "traverse", "(", "this", ",", "typeDeclaration", ".", "initializerScope", ")", ";", "}", "}", "else", "{", "FieldDeclaration", "field", "=", "(", "FieldDeclaration", ")", "member", ";", "if", "(", "field", ".", "isStatic", "(", ")", ")", "{", "format", "(", "field", ",", "this", ",", "typeDeclaration", ".", "staticInitializerScope", ",", "isChunkStart", ",", "i", "==", "0", ")", ";", "}", "else", "{", "format", "(", "field", ",", "this", ",", "typeDeclaration", ".", "initializerScope", ",", "isChunkStart", ",", "i", "==", "0", ")", ";", "}", "}", "}", "else", "if", "(", "member", "instanceof", "AbstractMethodDeclaration", ")", "{", "isChunkStart", "=", "memberAlignment", ".", "checkChunkStart", "(", "Alignment", ".", "CHUNK_METHOD", ",", "i", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "format", "(", "(", "AbstractMethodDeclaration", ")", "member", ",", "typeDeclaration", ".", "scope", ",", "isChunkStart", ",", "i", "==", "0", ")", ";", "}", "else", "if", "(", "member", "instanceof", "TypeDeclaration", ")", "{", "isChunkStart", "=", "memberAlignment", ".", "checkChunkStart", "(", "Alignment", ".", "CHUNK_TYPE", ",", "i", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "format", "(", "(", "TypeDeclaration", ")", "member", ",", "typeDeclaration", ".", "scope", ",", "isChunkStart", ",", "i", "==", "0", ")", ";", "}", "while", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "if", "(", "this", ".", "scribe", ".", "memberAlignment", "!=", "null", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "this", ".", "scribe", ".", "memberAlignment", ".", "originalIndentationLevel", ";", "}", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "startIndex", "=", "memberAlignment", ".", "chunkStartIndex", ";", "this", ".", "scribe", ".", "redoMemberAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "}", "else", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", "Scribe", ".", "DO_NOT_PRESERVE_EMPTY_LINES", ")", ";", "this", ".", "scribe", ".", "exitMemberAlignment", "(", "memberAlignment", ")", ";", "}", "private", "void", "formatTypeOpeningBraceForEnumConstant", "(", "String", "bracePosition", ",", "boolean", "insertSpaceBeforeBrace", ",", "TypeDeclaration", "typeDeclaration", ")", "{", "int", "fieldCount", "=", "(", "typeDeclaration", ".", "fields", "==", "null", ")", "?", "0", ":", "typeDeclaration", ".", "fields", ".", "length", ";", "int", "methodCount", "=", "(", "typeDeclaration", ".", "methods", "==", "null", ")", "?", "0", ":", "typeDeclaration", ".", "methods", ".", "length", ";", "int", "typeCount", "=", "(", "typeDeclaration", ".", "memberTypes", "==", "null", ")", "?", "0", ":", "typeDeclaration", ".", "memberTypes", ".", "length", ";", "if", "(", "methodCount", "<=", "2", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "methodCount", ";", "i", "<", "max", ";", "i", "++", ")", "{", "final", "AbstractMethodDeclaration", "abstractMethodDeclaration", "=", "typeDeclaration", ".", "methods", "[", "i", "]", ";", "if", "(", "abstractMethodDeclaration", ".", "isDefaultConstructor", "(", ")", ")", "{", "methodCount", "--", ";", "}", "else", "if", "(", "abstractMethodDeclaration", ".", "isClinit", "(", ")", ")", "{", "methodCount", "--", ";", "}", "}", "}", "final", "int", "memberLength", "=", "fieldCount", "+", "methodCount", "+", "typeCount", ";", "boolean", "insertNewLine", "=", "memberLength", ">", "0", ";", "if", "(", "!", "insertNewLine", ")", "{", "if", "(", "(", "typeDeclaration", ".", "bits", "&", "ASTNode", ".", "IsAnonymousType", ")", "!=", "0", ")", "{", "insertNewLine", "=", "this", ".", "preferences", ".", "insert_new_line_in_empty_enum_constant", ";", "}", "}", "formatOpeningBrace", "(", "bracePosition", ",", "insertSpaceBeforeBrace", ")", ";", "if", "(", "insertNewLine", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "private", "void", "formatTypeOpeningBrace", "(", "String", "bracePosition", ",", "boolean", "insertSpaceBeforeBrace", ",", "TypeDeclaration", "typeDeclaration", ")", "{", "int", "fieldCount", "=", "(", "typeDeclaration", ".", "fields", "==", "null", ")", "?", "0", ":", "typeDeclaration", ".", "fields", ".", "length", ";", "int", "methodCount", "=", "(", "typeDeclaration", ".", "methods", "==", "null", ")", "?", "0", ":", "typeDeclaration", ".", "methods", ".", "length", ";", "int", "typeCount", "=", "(", "typeDeclaration", ".", "memberTypes", "==", "null", ")", "?", "0", ":", "typeDeclaration", ".", "memberTypes", ".", "length", ";", "if", "(", "methodCount", "<=", "2", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "methodCount", ";", "i", "<", "max", ";", "i", "++", ")", "{", "final", "AbstractMethodDeclaration", "abstractMethodDeclaration", "=", "typeDeclaration", ".", "methods", "[", "i", "]", ";", "if", "(", "abstractMethodDeclaration", ".", "isDefaultConstructor", "(", ")", ")", "{", "methodCount", "--", ";", "}", "else", "if", "(", "abstractMethodDeclaration", ".", "isClinit", "(", ")", ")", "{", "methodCount", "--", ";", "}", "}", "}", "final", "int", "memberLength", "=", "fieldCount", "+", "methodCount", "+", "typeCount", ";", "boolean", "insertNewLine", "=", "memberLength", ">", "0", ";", "if", "(", "!", "insertNewLine", ")", "{", "if", "(", "TypeDeclaration", ".", "kind", "(", "typeDeclaration", ".", "modifiers", ")", "==", "TypeDeclaration", ".", "ENUM_DECL", ")", "{", "insertNewLine", "=", "this", ".", "preferences", ".", "insert_new_line_in_empty_enum_declaration", ";", "}", "else", "if", "(", "(", "typeDeclaration", ".", "bits", "&", "ASTNode", ".", "IsAnonymousType", ")", "!=", "0", ")", "{", "insertNewLine", "=", "this", ".", "preferences", ".", "insert_new_line_in_empty_anonymous_type_declaration", ";", "}", "else", "if", "(", "TypeDeclaration", ".", "kind", "(", "typeDeclaration", ".", "modifiers", ")", "==", "TypeDeclaration", ".", "ANNOTATION_TYPE_DECL", ")", "{", "insertNewLine", "=", "this", ".", "preferences", ".", "insert_new_line_in_empty_annotation_declaration", ";", "}", "else", "{", "insertNewLine", "=", "this", ".", "preferences", ".", "insert_new_line_in_empty_type_declaration", ";", "}", "}", "formatOpeningBrace", "(", "bracePosition", ",", "insertSpaceBeforeBrace", ")", ";", "if", "(", "insertNewLine", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "private", "int", "getDimensions", "(", ")", "{", "this", ".", "localScanner", ".", "resetTo", "(", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ",", "this", ".", "scribe", ".", "scannerEndPosition", "-", "1", ")", ";", "int", "dimensions", "=", "0", ";", "int", "balance", "=", "0", ";", "try", "{", "int", "token", ";", "loop", ":", "while", "(", "(", "token", "=", "this", ".", "localScanner", ".", "getNextToken", "(", ")", ")", "!=", "TerminalTokens", ".", "TokenNameEOF", ")", "{", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameRBRACKET", ":", "dimensions", "++", ";", "balance", "--", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "break", ";", "case", "TerminalTokens", ".", "TokenNameLBRACKET", ":", "balance", "++", ";", "break", ";", "default", ":", "break", "loop", ";", "}", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "}", "if", "(", "balance", "==", "0", ")", "{", "return", "dimensions", ";", "}", "return", "0", ";", "}", "private", "boolean", "hasComments", "(", ")", "{", "this", ".", "localScanner", ".", "resetTo", "(", "this", ".", "scribe", ".", "scanner", ".", "startPosition", ",", "this", ".", "scribe", ".", "scannerEndPosition", "-", "1", ")", ";", "try", "{", "switch", "(", "this", ".", "localScanner", ".", "getNextToken", "(", ")", ")", "{", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "return", "true", ";", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "}", "return", "false", ";", "}", "private", "boolean", "isNextToken", "(", "int", "tokenName", ")", "{", "this", ".", "localScanner", ".", "resetTo", "(", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ",", "this", ".", "scribe", ".", "scannerEndPosition", "-", "1", ")", ";", "try", "{", "int", "token", "=", "this", ".", "localScanner", ".", "getNextToken", "(", ")", ";", "loop", ":", "while", "(", "true", ")", "{", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "token", "=", "this", ".", "localScanner", ".", "getNextToken", "(", ")", ";", "continue", "loop", ";", "default", ":", "break", "loop", ";", "}", "}", "return", "token", "==", "tokenName", ";", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "}", "return", "false", ";", "}", "private", "boolean", "isClosingGenericToken", "(", ")", "{", "this", ".", "localScanner", ".", "resetTo", "(", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ",", "this", ".", "scribe", ".", "scannerEndPosition", "-", "1", ")", ";", "try", "{", "int", "token", "=", "this", ".", "localScanner", ".", "getNextToken", "(", ")", ";", "loop", ":", "while", "(", "true", ")", "{", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "token", "=", "this", ".", "localScanner", ".", "getNextToken", "(", ")", ";", "continue", "loop", ";", "default", ":", "break", "loop", ";", "}", "}", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameGREATER", ":", "case", "TerminalTokens", ".", "TokenNameRIGHT_SHIFT", ":", "case", "TerminalTokens", ".", "TokenNameUNSIGNED_RIGHT_SHIFT", ":", "return", "true", ";", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "}", "return", "false", ";", "}", "private", "boolean", "isGuardClause", "(", "Block", "block", ")", "{", "return", "!", "commentStartsBlock", "(", "block", ".", "sourceStart", ",", "block", ".", "sourceEnd", ")", "&&", "block", ".", "statements", "!=", "null", "&&", "block", ".", "statements", ".", "length", "==", "1", "&&", "(", "block", ".", "statements", "[", "0", "]", "instanceof", "ReturnStatement", "||", "block", ".", "statements", "[", "0", "]", "instanceof", "ThrowStatement", ")", ";", "}", "private", "boolean", "isMultipleLocalDeclaration", "(", "LocalDeclaration", "localDeclaration", ")", "{", "if", "(", "localDeclaration", ".", "declarationSourceStart", "==", "this", ".", "lastLocalDeclarationSourceStart", ")", "return", "true", ";", "this", ".", "lastLocalDeclarationSourceStart", "=", "localDeclaration", ".", "declarationSourceStart", ";", "return", "false", ";", "}", "private", "boolean", "isPartOfMultipleLocalDeclaration", "(", ")", "{", "this", ".", "localScanner", ".", "resetTo", "(", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ",", "this", ".", "scribe", ".", "scannerEndPosition", "-", "1", ")", ";", "try", "{", "int", "token", ";", "while", "(", "(", "token", "=", "this", ".", "localScanner", ".", "getNextToken", "(", ")", ")", "!=", "TerminalTokens", ".", "TokenNameEOF", ")", "{", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameCOMMA", ":", "return", "true", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "break", ";", "default", ":", "return", "false", ";", "}", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "}", "return", "false", ";", "}", "private", "void", "manageClosingParenthesizedExpression", "(", "Expression", "expression", ",", "int", "numberOfParens", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numberOfParens", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_parenthesized_expression", ")", ";", "}", "}", "private", "void", "manageOpeningParenthesizedExpression", "(", "Expression", "expression", ",", "int", "numberOfParens", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numberOfParens", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_parenthesized_expression", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_parenthesized_expression", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "}", "private", "void", "printComment", "(", ")", "{", "this", ".", "localScanner", ".", "resetTo", "(", "this", ".", "scribe", ".", "scanner", ".", "startPosition", ",", "this", ".", "scribe", ".", "scannerEndPosition", "-", "1", ")", ";", "try", "{", "int", "token", "=", "this", ".", "localScanner", ".", "getNextToken", "(", ")", ";", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "this", ".", "scribe", ".", "printComment", "(", "token", ",", "Scribe", ".", "NO_TRAILING_COMMENT", ")", ";", "break", ";", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "}", "}", "public", "boolean", "visit", "(", "AllocationExpression", "allocationExpression", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "allocationExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "allocationExpression", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamenew", ")", ";", "TypeReference", "[", "]", "typeArguments", "=", "allocationExpression", ".", "typeArguments", ";", "if", "(", "typeArguments", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "length", "=", "typeArguments", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", "-", "1", ";", "i", "++", ")", "{", "typeArguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeArguments", "[", "length", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_type_arguments", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_closing_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "allocationExpression", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_method_invocation", ")", ";", "final", "Expression", "[", "]", "arguments", "=", "allocationExpression", ".", "arguments", ";", "if", "(", "arguments", "!=", "null", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_method_invocation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "argumentLength", "=", "arguments", ".", "length", ";", "Alignment", "argumentsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "ALLOCATION", ",", "this", ".", "preferences", ".", "alignment_for_arguments_in_allocation_expression", ",", "argumentLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "argumentsAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentLength", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_allocation_expression", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "i", ")", ";", "if", "(", "i", ">", "0", "&&", "this", ".", "preferences", ".", "insert_space_after_comma_in_allocation_expression", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "arguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "argumentsAlignment", ",", "true", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_method_invocation", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_between_empty_parens_in_method_invocation", ")", ";", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "allocationExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "AND_AND_Expression", "and_and_Expression", ",", "BlockScope", "scope", ")", "{", "return", "dumpBinaryExpression", "(", "and_and_Expression", ",", "TerminalTokens", ".", "TokenNameAND_AND", ",", "scope", ")", ";", "}", "public", "boolean", "visit", "(", "AnnotationMethodDeclaration", "annotationTypeMemberDeclaration", ",", "ClassScope", "scope", ")", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "this", ".", "scribe", ".", "printModifiers", "(", "annotationTypeMemberDeclaration", ".", "annotations", ",", "this", ",", "ICodeFormatterConstants", ".", "ANNOTATION_ON_METHOD", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "final", "TypeReference", "returnType", "=", "annotationTypeMemberDeclaration", ".", "returnType", ";", "final", "MethodScope", "annotationTypeMemberDeclarationScope", "=", "annotationTypeMemberDeclaration", ".", "scope", ";", "if", "(", "returnType", "!=", "null", ")", "{", "returnType", ".", "traverse", "(", "this", ",", "annotationTypeMemberDeclarationScope", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "true", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_annotation_type_member_declaration", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_between_empty_parens_in_annotation_type_member_declaration", ")", ";", "int", "extraDimensions", "=", "annotationTypeMemberDeclaration", ".", "extendedDimensions", ";", "if", "(", "extraDimensions", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "extraDimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "Expression", "defaultValue", "=", "annotationTypeMemberDeclaration", ".", "defaultValue", ";", "if", "(", "defaultValue", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamedefault", ",", "true", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "defaultValue", ".", "traverse", "(", "this", ",", "(", "BlockScope", ")", "null", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "Argument", "argument", ",", "BlockScope", "scope", ")", "{", "if", "(", "argument", ".", "modifiers", "!=", "NO_MODIFIERS", "||", "argument", ".", "annotations", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "this", ".", "scribe", ".", "printModifiers", "(", "argument", ".", "annotations", ",", "this", ",", "ICodeFormatterConstants", ".", "ANNOTATION_ON_PARAMETER", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "if", "(", "argument", ".", "type", "!=", "null", ")", "{", "if", "(", "argument", ".", "type", "instanceof", "UnionTypeReference", ")", "{", "formatMultiCatchArguments", "(", "argument", ",", "this", ".", "preferences", ".", "insert_space_before_binary_operator", ",", "this", ".", "preferences", ".", "insert_space_after_binary_operator", ",", "this", ".", "preferences", ".", "alignment_for_union_type_in_multicatch", ",", "scope", ")", ";", "}", "else", "{", "argument", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "}", "if", "(", "argument", ".", "isVarArgs", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameELLIPSIS", ",", "this", ".", "preferences", ".", "insert_space_before_ellipsis", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_ellipsis", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "false", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "true", ")", ";", "}", "int", "extraDimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "extraDimensions", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "extraDimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayAllocationExpression", "arrayAllocationExpression", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "arrayAllocationExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "arrayAllocationExpression", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamenew", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "arrayAllocationExpression", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "final", "Expression", "[", "]", "dimensions", "=", "arrayAllocationExpression", ".", "dimensions", ";", "int", "dimensionsLength", "=", "dimensions", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dimensionsLength", ";", "i", "++", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_before_opening_bracket_in_array_allocation_expression", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ",", "false", ")", ";", "if", "(", "dimensions", "[", "i", "]", "!=", "null", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_bracket_in_array_allocation_expression", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "dimensions", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ",", "this", ".", "preferences", ".", "insert_space_before_closing_bracket_in_array_allocation_expression", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ",", "this", ".", "preferences", ".", "insert_space_between_empty_brackets_in_array_allocation_expression", ")", ";", "}", "}", "final", "ArrayInitializer", "initializer", "=", "arrayAllocationExpression", ".", "initializer", ";", "if", "(", "initializer", "!=", "null", ")", "{", "initializer", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "arrayAllocationExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayInitializer", "arrayInitializer", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "arrayInitializer", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "arrayInitializer", ",", "numberOfParens", ")", ";", "}", "if", "(", "this", ".", "arrayInitializersDepth", "<", "0", ")", "{", "this", ".", "arrayInitializersDepth", "=", "0", ";", "}", "else", "{", "this", ".", "arrayInitializersDepth", "++", ";", "}", "int", "arrayInitializerIndentationLevel", "=", "this", ".", "scribe", ".", "indentationLevel", ";", "try", "{", "final", "Expression", "[", "]", "expressions", "=", "arrayInitializer", ".", "expressions", ";", "if", "(", "expressions", "!=", "null", ")", "{", "String", "array_initializer_brace_position", "=", "this", ".", "preferences", ".", "brace_position_for_array_initializer", ";", "formatOpeningBrace", "(", "array_initializer_brace_position", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_array_initializer", ")", ";", "int", "expressionsLength", "=", "expressions", ".", "length", ";", "final", "boolean", "insert_new_line_after_opening_brace", "=", "this", ".", "preferences", ".", "insert_new_line_after_opening_brace_in_array_initializer", ";", "boolean", "ok", "=", "false", ";", "Alignment", "arrayInitializerAlignment", "=", "null", ";", "if", "(", "expressionsLength", ">", "1", ")", "{", "if", "(", "insert_new_line_after_opening_brace", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "arrayInitializerAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "ARRAY_INITIALIZER", ",", "this", ".", "preferences", ".", "alignment_for_expressions_in_array_initializer", ",", "Alignment", ".", "R_OUTERMOST", ",", "expressionsLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ",", "this", ".", "preferences", ".", "continuation_indentation_for_array_initializer", ",", "true", ")", ";", "if", "(", "insert_new_line_after_opening_brace", ")", "{", "arrayInitializerAlignment", ".", "fragmentIndentations", "[", "0", "]", "=", "arrayInitializerAlignment", ".", "breakIndentationLevel", ";", "}", "this", ".", "scribe", ".", "enterAlignment", "(", "arrayInitializerAlignment", ")", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "arrayInitializerAlignment", ",", "0", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_brace_in_array_initializer", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "expressions", "[", "0", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "expressionsLength", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_array_initializer", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "alignFragment", "(", "arrayInitializerAlignment", ",", "i", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_array_initializer", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "expressions", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "i", "==", "expressionsLength", "-", "1", ")", "{", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_array_initializer", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "}", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "arrayInitializerAlignment", ",", "true", ")", ";", "}", "else", "{", "if", "(", "this", ".", "scribe", ".", "currentAlignment", "==", "null", "||", "this", ".", "scribe", ".", "currentAlignment", ".", "kind", "!=", "Alignment", ".", "MESSAGE_ARGUMENTS", ")", "{", "arrayInitializerAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "ARRAY_INITIALIZER", ",", "this", ".", "preferences", ".", "alignment_for_expressions_in_array_initializer", ",", "Alignment", ".", "R_OUTERMOST", ",", "0", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ",", "this", ".", "preferences", ".", "continuation_indentation_for_array_initializer", ",", "true", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "arrayInitializerAlignment", ")", ";", "}", "do", "{", "try", "{", "if", "(", "insert_new_line_after_opening_brace", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_brace_in_array_initializer", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "needSpace", "=", "false", ";", "}", "expressions", "[", "0", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_array_initializer", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "if", "(", "insert_new_line_after_opening_brace", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "if", "(", "arrayInitializerAlignment", "==", "null", ")", "throw", "e", ";", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "if", "(", "arrayInitializerAlignment", "!=", "null", ")", "{", "this", ".", "scribe", ".", "exitAlignment", "(", "arrayInitializerAlignment", ",", "true", ")", ";", "}", "}", "if", "(", "this", ".", "preferences", ".", "insert_new_line_before_closing_brace_in_array_initializer", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "else", "if", "(", "this", ".", "preferences", ".", "insert_space_before_closing_brace_in_array_initializer", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ",", "false", ",", "Scribe", ".", "PRESERVE_EMPTY_LINES_IN_CLOSING_ARRAY_INITIALIZER", "+", "(", "arrayInitializerIndentationLevel", "<<", "16", ")", ")", ";", "if", "(", "array_initializer_brace_position", ".", "equals", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_SHIFTED", ")", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "else", "{", "boolean", "keepEmptyArrayInitializerOnTheSameLine", "=", "this", ".", "preferences", ".", "keep_empty_array_initializer_on_one_line", ";", "String", "array_initializer_brace_position", "=", "this", ".", "preferences", ".", "brace_position_for_array_initializer", ";", "if", "(", "keepEmptyArrayInitializerOnTheSameLine", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACE", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_array_initializer", ")", ";", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_array_initializer", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ",", "this", ".", "preferences", ".", "insert_space_between_empty_braces_in_array_initializer", ")", ";", "}", "else", "{", "formatOpeningBrace", "(", "array_initializer_brace_position", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_array_initializer", ")", ";", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_array_initializer", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ",", "this", ".", "preferences", ".", "insert_space_between_empty_braces_in_array_initializer", ")", ";", "if", "(", "array_initializer_brace_position", ".", "equals", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_SHIFTED", ")", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "}", "}", "finally", "{", "this", ".", "arrayInitializersDepth", "--", ";", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "arrayInitializer", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayQualifiedTypeReference", "arrayQualifiedTypeReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "arrayQualifiedTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "arrayQualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printArrayQualifiedReference", "(", "arrayQualifiedTypeReference", ".", "tokens", ".", "length", ",", "arrayQualifiedTypeReference", ".", "sourceEnd", ")", ";", "int", "dimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "dimensions", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "arrayQualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayQualifiedTypeReference", "arrayQualifiedTypeReference", ",", "ClassScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "arrayQualifiedTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "arrayQualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printArrayQualifiedReference", "(", "arrayQualifiedTypeReference", ".", "tokens", ".", "length", ",", "arrayQualifiedTypeReference", ".", "sourceEnd", ")", ";", "int", "dimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "dimensions", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "arrayQualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayReference", "arrayReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "arrayReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "arrayReference", ",", "numberOfParens", ")", ";", "}", "arrayReference", ".", "receiver", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ",", "this", ".", "preferences", ".", "insert_space_before_opening_bracket_in_array_reference", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_bracket_in_array_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "arrayReference", ".", "position", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ",", "this", ".", "preferences", ".", "insert_space_before_closing_bracket_in_array_reference", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "arrayReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayTypeReference", "arrayTypeReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "arrayTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "arrayTypeReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "SINGLETYPEREFERENCE_EXPECTEDTOKENS", ")", ";", "int", "dimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "dimensions", "!=", "0", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_before_opening_bracket_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_between_brackets_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "arrayTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayTypeReference", "arrayTypeReference", ",", "ClassScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "arrayTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "arrayTypeReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "SINGLETYPEREFERENCE_EXPECTEDTOKENS", ")", ";", "int", "dimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "dimensions", "!=", "0", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_before_opening_bracket_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_between_brackets_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "arrayTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "AssertStatement", "assertStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameassert", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "assertStatement", ".", "assertExpression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "assertStatement", ".", "exceptionArgument", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOLON", ",", "this", ".", "preferences", ".", "insert_space_before_colon_in_assert", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_colon_in_assert", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "assertStatement", ".", "exceptionArgument", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "Assignment", "assignment", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "assignment", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "assignment", ",", "numberOfParens", ")", ";", "}", "assignment", ".", "lhs", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameEQUAL", ",", "this", ".", "preferences", ".", "insert_space_before_assignment_operator", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_assignment_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "Alignment", "assignmentAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "ASSIGNMENT", ",", "this", ".", "preferences", ".", "alignment_for_assignment", ",", "Alignment", ".", "R_OUTERMOST", ",", "1", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "assignmentAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "assignmentAlignment", ",", "0", ")", ";", "assignment", ".", "expression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "assignmentAlignment", ",", "true", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "assignment", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "BinaryExpression", "binaryExpression", ",", "BlockScope", "scope", ")", "{", "switch", "(", "(", "binaryExpression", ".", "bits", "&", "ASTNode", ".", "OperatorMASK", ")", ">>", "ASTNode", ".", "OperatorSHIFT", ")", "{", "case", "OperatorIds", ".", "AND", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameAND", ",", "scope", ")", ";", "case", "OperatorIds", ".", "DIVIDE", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameDIVIDE", ",", "scope", ")", ";", "case", "OperatorIds", ".", "GREATER", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameGREATER", ",", "scope", ")", ";", "case", "OperatorIds", ".", "GREATER_EQUAL", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameGREATER_EQUAL", ",", "scope", ")", ";", "case", "OperatorIds", ".", "LEFT_SHIFT", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameLEFT_SHIFT", ",", "scope", ")", ";", "case", "OperatorIds", ".", "LESS", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameLESS", ",", "scope", ")", ";", "case", "OperatorIds", ".", "LESS_EQUAL", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameLESS_EQUAL", ",", "scope", ")", ";", "case", "OperatorIds", ".", "MINUS", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameMINUS", ",", "scope", ")", ";", "case", "OperatorIds", ".", "MULTIPLY", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameMULTIPLY", ",", "scope", ")", ";", "case", "OperatorIds", ".", "OR", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameOR", ",", "scope", ")", ";", "case", "OperatorIds", ".", "PLUS", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNamePLUS", ",", "scope", ")", ";", "case", "OperatorIds", ".", "REMAINDER", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameREMAINDER", ",", "scope", ")", ";", "case", "OperatorIds", ".", "RIGHT_SHIFT", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameRIGHT_SHIFT", ",", "scope", ")", ";", "case", "OperatorIds", ".", "UNSIGNED_RIGHT_SHIFT", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameUNSIGNED_RIGHT_SHIFT", ",", "scope", ")", ";", "case", "OperatorIds", ".", "XOR", ":", "return", "dumpBinaryExpression", "(", "binaryExpression", ",", "TerminalTokens", ".", "TokenNameXOR", ",", "scope", ")", ";", "default", ":", "throw", "new", "IllegalStateException", "(", ")", ";", "}", "}", "public", "boolean", "visit", "(", "Block", "block", ",", "BlockScope", "scope", ")", "{", "formatBlock", "(", "block", ",", "scope", ",", "this", ".", "preferences", ".", "brace_position_for_block", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_block", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "BreakStatement", "breakStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamebreak", ")", ";", "if", "(", "breakStatement", ".", "label", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "true", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "CaseStatement", "caseStatement", ",", "BlockScope", "scope", ")", "{", "if", "(", "caseStatement", ".", "constantExpression", "==", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamedefault", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOLON", ",", "this", ".", "preferences", ".", "insert_space_before_colon_in_default", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamecase", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "caseStatement", ".", "constantExpression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOLON", ",", "this", ".", "preferences", ".", "insert_space_before_colon_in_case", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "CastExpression", "castExpression", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "castExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "castExpression", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_cast", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "castExpression", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_cast", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_closing_paren_in_cast", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "castExpression", ".", "expression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "castExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "CharLiteral", "charLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "charLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "charLiteral", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCharacterLiteral", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "charLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ClassLiteralAccess", "classLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "classLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "classLiteral", ",", "numberOfParens", ")", ";", "}", "classLiteral", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameclass", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "classLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "Clinit", "clinit", ",", "ClassScope", "scope", ")", "{", "return", "false", ";", "}", "public", "boolean", "visit", "(", "CompilationUnitDeclaration", "compilationUnitDeclaration", ",", "CompilationUnitScope", "scope", ")", "{", "this", ".", "scribe", ".", "lastNumberOfNewLines", "=", "1", ";", "final", "TypeDeclaration", "[", "]", "types", "=", "compilationUnitDeclaration", ".", "types", ";", "int", "headerEndPosition", "=", "types", "==", "null", "?", "compilationUnitDeclaration", ".", "sourceEnd", ":", "types", "[", "0", "]", ".", "declarationSourceStart", ";", "this", ".", "scribe", ".", "setHeaderComment", "(", "headerEndPosition", ")", ";", "ImportReference", "currentPackage", "=", "compilationUnitDeclaration", ".", "currentPackage", ";", "final", "boolean", "hasPackage", "=", "currentPackage", "!=", "null", ";", "if", "(", "hasPackage", ")", "{", "printComment", "(", ")", ";", "int", "blankLinesBeforePackage", "=", "this", ".", "preferences", ".", "blank_lines_before_package", ";", "if", "(", "blankLinesBeforePackage", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "blankLinesBeforePackage", ")", ";", "}", "this", ".", "scribe", ".", "printModifiers", "(", "currentPackage", ".", "annotations", ",", "this", ",", "ICodeFormatterConstants", ".", "ANNOTATION_ON_PACKAGE", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamepackage", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "this", ".", "scribe", ".", "printQualifiedReference", "(", "compilationUnitDeclaration", ".", "currentPackage", ".", "sourceEnd", ",", "false", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "int", "blankLinesAfterPackage", "=", "this", ".", "preferences", ".", "blank_lines_after_package", ";", "if", "(", "blankLinesAfterPackage", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "blankLinesAfterPackage", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "}", "final", "ImportReference", "[", "]", "imports", "=", "compilationUnitDeclaration", ".", "imports", ";", "if", "(", "imports", "!=", "null", ")", "{", "if", "(", "hasPackage", ")", "{", "int", "blankLinesBeforeImports", "=", "this", ".", "preferences", ".", "blank_lines_before_imports", ";", "if", "(", "blankLinesBeforeImports", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "blankLinesBeforeImports", ")", ";", "}", "}", "int", "importLength", "=", "imports", ".", "length", ";", "if", "(", "importLength", "!=", "1", ")", "{", "format", "(", "imports", "[", "0", "]", ",", "false", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "importLength", "-", "1", ";", "i", "++", ")", "{", "format", "(", "imports", "[", "i", "]", ",", "false", ")", ";", "}", "format", "(", "imports", "[", "importLength", "-", "1", "]", ",", "true", ")", ";", "}", "else", "{", "format", "(", "imports", "[", "0", "]", ",", "true", ")", ";", "}", "int", "blankLinesAfterImports", "=", "this", ".", "preferences", ".", "blank_lines_after_imports", ";", "if", "(", "blankLinesAfterImports", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "blankLinesAfterImports", ")", ";", "}", "}", "formatEmptyTypeDeclaration", "(", "true", ")", ";", "int", "blankLineBetweenTypeDeclarations", "=", "this", ".", "preferences", ".", "blank_lines_between_type_declarations", ";", "if", "(", "types", "!=", "null", ")", "{", "int", "typesLength", "=", "types", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "typesLength", "-", "1", ";", "i", "++", ")", "{", "types", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "formatEmptyTypeDeclaration", "(", "false", ")", ";", "if", "(", "blankLineBetweenTypeDeclarations", "!=", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "blankLineBetweenTypeDeclarations", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "types", "[", "typesLength", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "this", ".", "scribe", ".", "printEndOfCompilationUnit", "(", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "CompoundAssignment", "compoundAssignment", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "compoundAssignment", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "compoundAssignment", ",", "numberOfParens", ")", ";", "}", "compoundAssignment", ".", "lhs", ".", "traverse", "(", "this", ",", "scope", ")", ";", "int", "operator", ";", "switch", "(", "compoundAssignment", ".", "operator", ")", "{", "case", "OperatorIds", ".", "PLUS", ":", "operator", "=", "TerminalTokens", ".", "TokenNamePLUS_EQUAL", ";", "break", ";", "case", "OperatorIds", ".", "MINUS", ":", "operator", "=", "TerminalTokens", ".", "TokenNameMINUS_EQUAL", ";", "break", ";", "case", "OperatorIds", ".", "MULTIPLY", ":", "operator", "=", "TerminalTokens", ".", "TokenNameMULTIPLY_EQUAL", ";", "break", ";", "case", "OperatorIds", ".", "DIVIDE", ":", "operator", "=", "TerminalTokens", ".", "TokenNameDIVIDE_EQUAL", ";", "break", ";", "case", "OperatorIds", ".", "AND", ":", "operator", "=", "TerminalTokens", ".", "TokenNameAND_EQUAL", ";", "break", ";", "case", "OperatorIds", ".", "OR", ":", "operator", "=", "TerminalTokens", ".", "TokenNameOR_EQUAL", ";", "break", ";", "case", "OperatorIds", ".", "XOR", ":", "operator", "=", "TerminalTokens", ".", "TokenNameXOR_EQUAL", ";", "break", ";", "case", "OperatorIds", ".", "REMAINDER", ":", "operator", "=", "TerminalTokens", ".", "TokenNameREMAINDER_EQUAL", ";", "break", ";", "case", "OperatorIds", ".", "LEFT_SHIFT", ":", "operator", "=", "TerminalTokens", ".", "TokenNameLEFT_SHIFT_EQUAL", ";", "break", ";", "case", "OperatorIds", ".", "RIGHT_SHIFT", ":", "operator", "=", "TerminalTokens", ".", "TokenNameRIGHT_SHIFT_EQUAL", ";", "break", ";", "default", ":", "operator", "=", "TerminalTokens", ".", "TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "operator", ",", "this", ".", "preferences", ".", "insert_space_before_assignment_operator", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_assignment_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "Alignment", "assignmentAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "COMPOUND_ASSIGNMENT", ",", "this", ".", "preferences", ".", "alignment_for_assignment", ",", "Alignment", ".", "R_OUTERMOST", ",", "1", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "assignmentAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "assignmentAlignment", ",", "0", ")", ";", "compoundAssignment", ".", "expression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "assignmentAlignment", ",", "true", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "compoundAssignment", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ConditionalExpression", "conditionalExpression", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "conditionalExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "conditionalExpression", ",", "numberOfParens", ")", ";", "}", "conditionalExpression", ".", "condition", ".", "traverse", "(", "this", ",", "scope", ")", ";", "Alignment", "conditionalExpressionAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "CONDITIONAL_EXPRESSION", ",", "this", ".", "preferences", ".", "alignment_for_conditional_expression", ",", "2", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "conditionalExpressionAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "conditionalExpressionAlignment", ",", "0", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameQUESTION", ",", "this", ".", "preferences", ".", "insert_space_before_question_in_conditional", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_question_in_conditional", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "conditionalExpression", ".", "valueIfTrue", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "alignFragment", "(", "conditionalExpressionAlignment", ",", "1", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOLON", ",", "this", ".", "preferences", ".", "insert_space_before_colon_in_conditional", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_colon_in_conditional", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "conditionalExpression", ".", "valueIfFalse", ".", "traverse", "(", "this", ",", "scope", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "conditionalExpressionAlignment", ",", "true", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "conditionalExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ConstructorDeclaration", "constructorDeclaration", ",", "ClassScope", "scope", ")", "{", "if", "(", "constructorDeclaration", ".", "ignoreFurtherInvestigation", ")", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "if", "(", "this", ".", "scribe", ".", "indentationLevel", "!=", "0", ")", "{", "this", ".", "scribe", ".", "printIndentationIfNecessary", "(", ")", ";", "}", "this", ".", "scribe", ".", "scanner", ".", "resetTo", "(", "constructorDeclaration", ".", "declarationSourceEnd", "+", "1", ",", "this", ".", "scribe", ".", "scannerEndPosition", "-", "1", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "switch", "(", "this", ".", "scribe", ".", "scanner", ".", "source", "[", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", "]", ")", "{", "case", "'\\n'", ":", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", "++", ";", "this", ".", "scribe", ".", "lastNumberOfNewLines", "=", "1", ";", "break", ";", "case", "'\\r'", ":", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", "++", ";", "if", "(", "this", ".", "scribe", ".", "scanner", ".", "source", "[", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", "]", "==", "'\\n'", ")", "{", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", "++", ";", "}", "this", ".", "scribe", ".", "lastNumberOfNewLines", "=", "1", ";", "}", "return", "false", ";", "}", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "this", ".", "scribe", ".", "printModifiers", "(", "constructorDeclaration", ".", "annotations", ",", "this", ",", "ICodeFormatterConstants", ".", "ANNOTATION_ON_METHOD", ")", ";", "if", "(", "this", ".", "scribe", ".", "line", ">", "line", ")", "{", "line", "=", "this", ".", "scribe", ".", "line", ";", "}", "this", ".", "scribe", ".", "space", "(", ")", ";", "TypeParameter", "[", "]", "typeParameters", "=", "constructorDeclaration", ".", "typeParameters", ";", "if", "(", "typeParameters", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_type_parameters", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_type_parameters", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "length", "=", "typeParameters", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", "-", "1", ";", "i", "++", ")", "{", "typeParameters", "[", "i", "]", ".", "traverse", "(", "this", ",", "constructorDeclaration", ".", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_type_parameters", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_type_parameters", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeParameters", "[", "length", "-", "1", "]", ".", "traverse", "(", "this", ",", "constructorDeclaration", ".", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_type_parameters", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_closing_angle_bracket_in_type_parameters", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "true", ")", ";", "formatMethodArguments", "(", "constructorDeclaration", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_constructor_declaration", ",", "this", ".", "preferences", ".", "insert_space_between_empty_parens_in_constructor_declaration", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_constructor_declaration", ",", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_constructor_declaration", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_constructor_declaration_parameters", ",", "this", ".", "preferences", ".", "insert_space_after_comma_in_constructor_declaration_parameters", ",", "this", ".", "preferences", ".", "alignment_for_parameters_in_constructor_declaration", ")", ";", "formatThrowsClause", "(", "constructorDeclaration", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_constructor_declaration_throws", ",", "this", ".", "preferences", ".", "insert_space_after_comma_in_constructor_declaration_throws", ",", "this", ".", "preferences", ".", "alignment_for_throws_clause_in_constructor_declaration", ")", ";", "if", "(", "!", "constructorDeclaration", ".", "isNative", "(", ")", "&&", "!", "constructorDeclaration", ".", "isAbstract", "(", ")", ")", "{", "String", "constructor_declaration_brace", "=", "this", ".", "preferences", ".", "brace_position_for_constructor_declaration", ";", "formatLeftCurlyBrace", "(", "line", ",", "constructor_declaration_brace", ")", ";", "formatOpeningBrace", "(", "constructor_declaration_brace", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_constructor_declaration", ")", ";", "final", "int", "numberOfBlankLinesAtBeginningOfMethodBody", "=", "this", ".", "preferences", ".", "blank_lines_at_beginning_of_method_body", ";", "if", "(", "numberOfBlankLinesAtBeginningOfMethodBody", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "numberOfBlankLinesAtBeginningOfMethodBody", ")", ";", "}", "if", "(", "constructorDeclaration", ".", "constructorCall", "!=", "null", "&&", "!", "constructorDeclaration", ".", "constructorCall", ".", "isImplicitSuper", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_body", ")", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "constructorDeclaration", ".", "constructorCall", ".", "traverse", "(", "this", ",", "constructorDeclaration", ".", "scope", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_body", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "final", "Statement", "[", "]", "statements", "=", "constructorDeclaration", ".", "statements", ";", "if", "(", "statements", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_body", ")", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "formatStatements", "(", "constructorDeclaration", ".", "scope", ",", "statements", ",", "true", ")", ";", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_body", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "else", "{", "if", "(", "this", ".", "preferences", ".", "insert_new_line_in_empty_method_body", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_body", ")", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_body", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "constructor_declaration_brace", ".", "equals", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_SHIFTED", ")", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ContinueStatement", "continueStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamecontinue", ")", ";", "if", "(", "continueStatement", ".", "label", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "true", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "DoStatement", "doStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamedo", ")", ";", "final", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "final", "Statement", "action", "=", "doStatement", ".", "action", ";", "if", "(", "action", "!=", "null", ")", "{", "if", "(", "action", "instanceof", "Block", ")", "{", "formatLeftCurlyBrace", "(", "line", ",", "this", ".", "preferences", ".", "brace_position_for_block", ")", ";", "action", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "else", "if", "(", "action", "instanceof", "EmptyStatement", ")", "{", "formatNecessaryEmptyStatement", "(", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "this", ".", "scribe", ".", "indent", "(", ")", ";", "action", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "action", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "else", "{", "formatNecessaryEmptyStatement", "(", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_new_line_before_while_in_do_statement", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamewhile", ",", "this", ".", "preferences", ".", "insert_space_after_closing_brace_in_block", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_while", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_while", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "doStatement", ".", "condition", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_while", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "DoubleLiteral", "doubleLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "doubleLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "doubleLiteral", ",", "numberOfParens", ")", ";", "}", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDoubleLiteral", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "doubleLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "EmptyStatement", "statement", ",", "BlockScope", "scope", ")", "{", "if", "(", "this", ".", "preferences", ".", "put_empty_statement_on_new_line", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "FieldDeclaration", "enumConstant", ",", "MethodScope", "scope", ")", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "final", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "this", ".", "scribe", ".", "printModifiers", "(", "enumConstant", ".", "annotations", ",", "this", ",", "ICodeFormatterConstants", ".", "ANNOTATION_ON_FIELD", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "false", ")", ";", "formatEnumConstantArguments", "(", "enumConstant", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_enum_constant", ",", "this", ".", "preferences", ".", "insert_space_between_empty_parens_in_enum_constant", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_enum_constant", ",", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_enum_constant", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_enum_constant_arguments", ",", "this", ".", "preferences", ".", "insert_space_after_comma_in_enum_constant_arguments", ",", "this", ".", "preferences", ".", "alignment_for_arguments_in_enum_constant", ")", ";", "Expression", "initialization", "=", "enumConstant", ".", "initialization", ";", "if", "(", "initialization", "instanceof", "QualifiedAllocationExpression", ")", "{", "TypeDeclaration", "typeDeclaration", "=", "(", "(", "QualifiedAllocationExpression", ")", "initialization", ")", ".", "anonymousType", ";", "int", "fieldsCount", "=", "typeDeclaration", ".", "fields", "==", "null", "?", "0", ":", "typeDeclaration", ".", "fields", ".", "length", ";", "int", "methodsCount", "=", "typeDeclaration", ".", "methods", "==", "null", "?", "0", ":", "typeDeclaration", ".", "methods", ".", "length", ";", "int", "membersCount", "=", "typeDeclaration", ".", "memberTypes", "==", "null", "?", "0", ":", "typeDeclaration", ".", "memberTypes", ".", "length", ";", "String", "enum_constant_brace", "=", "this", ".", "preferences", ".", "brace_position_for_enum_constant", ";", "formatLeftCurlyBrace", "(", "line", ",", "enum_constant_brace", ")", ";", "formatTypeOpeningBraceForEnumConstant", "(", "enum_constant_brace", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_enum_constant", ",", "typeDeclaration", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_body_declarations_compare_to_enum_constant_header", ")", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "if", "(", "fieldsCount", "!=", "0", "||", "methodsCount", "!=", "0", "||", "membersCount", "!=", "0", ")", "{", "formatTypeMembers", "(", "typeDeclaration", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "indent_body_declarations_compare_to_enum_constant_header", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_new_line_in_empty_enum_constant", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "enum_constant_brace", ".", "equals", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_SHIFTED", ")", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "if", "(", "hasComments", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "EqualExpression", "equalExpression", ",", "BlockScope", "scope", ")", "{", "if", "(", "(", "equalExpression", ".", "bits", "&", "ASTNode", ".", "OperatorMASK", ")", ">>", "ASTNode", ".", "OperatorSHIFT", "==", "OperatorIds", ".", "EQUAL_EQUAL", ")", "{", "return", "dumpEqualityExpression", "(", "equalExpression", ",", "TerminalTokens", ".", "TokenNameEQUAL_EQUAL", ",", "scope", ")", ";", "}", "else", "{", "return", "dumpEqualityExpression", "(", "equalExpression", ",", "TerminalTokens", ".", "TokenNameNOT_EQUAL", ",", "scope", ")", ";", "}", "}", "public", "boolean", "visit", "(", "ExplicitConstructorCall", "explicitConstructor", ",", "BlockScope", "scope", ")", "{", "if", "(", "explicitConstructor", ".", "isImplicitSuper", "(", ")", ")", "{", "return", "false", ";", "}", "final", "Expression", "qualification", "=", "explicitConstructor", ".", "qualification", ";", "if", "(", "qualification", "!=", "null", ")", "{", "qualification", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "}", "TypeReference", "[", "]", "typeArguments", "=", "explicitConstructor", ".", "typeArguments", ";", "if", "(", "typeArguments", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "length", "=", "typeArguments", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", "-", "1", ";", "i", "++", ")", "{", "typeArguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeArguments", "[", "length", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_type_arguments", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_closing_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "if", "(", "explicitConstructor", ".", "isSuperAccess", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamesuper", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamethis", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_method_invocation", ")", ";", "final", "Expression", "[", "]", "arguments", "=", "explicitConstructor", ".", "arguments", ";", "if", "(", "arguments", "!=", "null", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_method_invocation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "argumentLength", "=", "arguments", ".", "length", ";", "Alignment", "argumentsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "EXPLICIT_CONSTRUCTOR_CALL", ",", "this", ".", "preferences", ".", "alignment_for_arguments_in_explicit_constructor_call", ",", "argumentLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "argumentsAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentLength", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_explicit_constructor_call_arguments", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "i", ")", ";", "if", "(", "i", ">", "0", "&&", "this", ".", "preferences", ".", "insert_space_after_comma_in_explicit_constructor_call_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "arguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "argumentsAlignment", ",", "true", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_method_invocation", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_between_empty_parens_in_method_invocation", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "FalseLiteral", "falseLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "falseLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "falseLiteral", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamefalse", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "falseLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "FieldReference", "fieldReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "fieldReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "fieldReference", ",", "numberOfParens", ")", ";", "}", "fieldReference", ".", "receiver", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "fieldReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "FloatLiteral", "floatLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "floatLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "floatLiteral", ",", "numberOfParens", ")", ";", "}", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameFloatingPointLiteral", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "floatLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ForeachStatement", "forStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamefor", ")", ";", "final", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_for", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_for", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "formatLocalDeclaration", "(", "forStatement", ".", "elementVariable", ",", "scope", ",", "false", ",", "false", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOLON", ",", "this", ".", "preferences", ".", "insert_space_before_colon_in_for", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_colon_in_for", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "forStatement", ".", "collection", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_for", ")", ";", "final", "Statement", "action", "=", "forStatement", ".", "action", ";", "if", "(", "action", "!=", "null", ")", "{", "if", "(", "action", "instanceof", "Block", ")", "{", "formatLeftCurlyBrace", "(", "line", ",", "this", ".", "preferences", ".", "brace_position_for_block", ")", ";", "action", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "else", "if", "(", "action", "instanceof", "EmptyStatement", ")", "{", "formatNecessaryEmptyStatement", "(", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "action", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "if", "(", "action", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "}", "else", "{", "formatNecessaryEmptyStatement", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ForStatement", "forStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamefor", ")", ";", "final", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_for", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_for", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "final", "Statement", "[", "]", "initializations", "=", "forStatement", ".", "initializations", ";", "if", "(", "initializations", "!=", "null", ")", "{", "int", "length", "=", "initializations", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "initializations", "[", "i", "]", "instanceof", "LocalDeclaration", ")", "{", "formatLocalDeclaration", "(", "(", "LocalDeclaration", ")", "initializations", "[", "i", "]", ",", "scope", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_for_inits", ",", "this", ".", "preferences", ".", "insert_space_after_comma_in_for_inits", ")", ";", "}", "else", "{", "initializations", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "i", ">=", "0", "&&", "(", "i", "<", "length", "-", "1", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_for_inits", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_for_inits", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "}", "}", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon_in_for", ")", ";", "final", "Expression", "condition", "=", "forStatement", ".", "condition", ";", "if", "(", "condition", "!=", "null", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_after_semicolon_in_for", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "condition", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon_in_for", ")", ";", "final", "Statement", "[", "]", "increments", "=", "forStatement", ".", "increments", ";", "if", "(", "increments", "!=", "null", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_after_semicolon_in_for", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ",", "length", "=", "increments", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "increments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "i", "!=", "length", "-", "1", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_for_increments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_for_increments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "}", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_for", ")", ";", "final", "Statement", "action", "=", "forStatement", ".", "action", ";", "if", "(", "action", "!=", "null", ")", "{", "if", "(", "action", "instanceof", "Block", ")", "{", "formatLeftCurlyBrace", "(", "line", ",", "this", ".", "preferences", ".", "brace_position_for_block", ")", ";", "action", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "else", "if", "(", "action", "instanceof", "EmptyStatement", ")", "{", "formatNecessaryEmptyStatement", "(", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "action", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "if", "(", "action", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "}", "else", "{", "formatNecessaryEmptyStatement", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "IfStatement", "ifStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameif", ")", ";", "final", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_if", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_if", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "ifStatement", ".", "condition", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_if", ")", ";", "final", "Statement", "thenStatement", "=", "ifStatement", ".", "thenStatement", ";", "final", "Statement", "elseStatement", "=", "ifStatement", ".", "elseStatement", ";", "boolean", "thenStatementIsBlock", "=", "false", ";", "if", "(", "thenStatement", "!=", "null", ")", "{", "if", "(", "thenStatement", "instanceof", "Block", ")", "{", "thenStatementIsBlock", "=", "true", ";", "if", "(", "isGuardClause", "(", "(", "Block", ")", "thenStatement", ")", "&&", "elseStatement", "==", "null", "&&", "this", ".", "preferences", ".", "keep_guardian_clause_on_one_line", ")", "{", "formatGuardClauseBlock", "(", "(", "Block", ")", "thenStatement", ",", "scope", ")", ";", "}", "else", "{", "formatLeftCurlyBrace", "(", "line", ",", "this", ".", "preferences", ".", "brace_position_for_block", ")", ";", "thenStatement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "elseStatement", "!=", "null", "&&", "(", "this", ".", "preferences", ".", "insert_new_line_before_else_in_if_statement", ")", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "}", "else", "if", "(", "elseStatement", "==", "null", "&&", "this", ".", "preferences", ".", "keep_simple_if_on_one_line", ")", "{", "Alignment", "compactIfAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "COMPACT_IF", ",", "this", ".", "preferences", ".", "alignment_for_compact_if", ",", "Alignment", ".", "R_OUTERMOST", ",", "1", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ",", "1", ",", "false", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "compactIfAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "alignFragment", "(", "compactIfAlignment", ",", "0", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "thenStatement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "thenStatement", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "compactIfAlignment", ",", "true", ")", ";", "}", "else", "if", "(", "this", ".", "preferences", ".", "keep_then_statement_on_same_line", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "thenStatement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "thenStatement", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "if", "(", "elseStatement", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "this", ".", "scribe", ".", "indent", "(", ")", ";", "thenStatement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "thenStatement", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "if", "(", "elseStatement", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "if", "(", "elseStatement", "!=", "null", ")", "{", "if", "(", "thenStatementIsBlock", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameelse", ",", "this", ".", "preferences", ".", "insert_space_after_closing_brace_in_block", ",", "Scribe", ".", "PRESERVE_EMPTY_LINES_BEFORE_ELSE", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameelse", ",", "true", ",", "Scribe", ".", "PRESERVE_EMPTY_LINES_BEFORE_ELSE", ")", ";", "}", "if", "(", "elseStatement", "instanceof", "Block", ")", "{", "elseStatement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "else", "if", "(", "elseStatement", "instanceof", "IfStatement", ")", "{", "if", "(", "!", "this", ".", "preferences", ".", "compact_else_if", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "this", ".", "scribe", ".", "space", "(", ")", ";", "elseStatement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "!", "this", ".", "preferences", ".", "compact_else_if", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "else", "if", "(", "this", ".", "preferences", ".", "keep_else_statement_on_same_line", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "elseStatement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "elseStatement", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "this", ".", "scribe", ".", "indent", "(", ")", ";", "elseStatement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "elseStatement", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "Initializer", "initializer", ",", "MethodScope", "scope", ")", "{", "if", "(", "initializer", ".", "isStatic", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamestatic", ")", ";", "}", "initializer", ".", "block", ".", "traverse", "(", "this", ",", "scope", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "InstanceOfExpression", "instanceOfExpression", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "instanceOfExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "instanceOfExpression", ",", "numberOfParens", ")", ";", "}", "instanceOfExpression", ".", "expression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameinstanceof", ",", "true", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "instanceOfExpression", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "instanceOfExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "IntLiteral", "intLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "intLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "intLiteral", ",", "numberOfParens", ")", ";", "}", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIntegerLiteral", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "intLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "LabeledStatement", "labeledStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOLON", ",", "this", ".", "preferences", ".", "insert_space_before_colon_in_labeled_statement", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_colon_in_labeled_statement", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_new_line_after_label", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "final", "Statement", "statement", "=", "labeledStatement", ".", "statement", ";", "statement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "statement", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "LocalDeclaration", "localDeclaration", ",", "BlockScope", "scope", ")", "{", "formatLocalDeclaration", "(", "localDeclaration", ",", "scope", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_multiple_local_declarations", ",", "this", ".", "preferences", ".", "insert_space_after_comma_in_multiple_local_declarations", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "LongLiteral", "longLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "longLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "longLiteral", ",", "numberOfParens", ")", ";", "}", "if", "(", "isNextToken", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLongLiteral", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "longLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "MarkerAnnotation", "annotation", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameAT", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_at_in_annotation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printQualifiedReference", "(", "annotation", ".", "sourceEnd", ",", "false", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "MarkerAnnotation", "annotation", ",", "ClassScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameAT", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_at_in_annotation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printQualifiedReference", "(", "annotation", ".", "sourceEnd", ",", "false", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "MemberValuePair", "pair", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameEQUAL", ",", "this", ".", "preferences", ".", "insert_space_before_assignment_operator", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_assignment_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "pair", ".", "value", ".", "traverse", "(", "this", ",", "scope", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "MessageSend", "messageSend", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "messageSend", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "messageSend", ",", "numberOfParens", ")", ";", "}", "CascadingMethodInvocationFragmentBuilder", "builder", "=", "buildFragments", "(", "messageSend", ",", "scope", ")", ";", "if", "(", "builder", ".", "size", "(", ")", ">=", "3", "&&", "numberOfParens", "==", "0", ")", "{", "formatCascadingMessageSends", "(", "builder", ",", "scope", ")", ";", "}", "else", "{", "Alignment", "messageAlignment", "=", "null", ";", "if", "(", "!", "messageSend", ".", "receiver", ".", "isImplicitThis", "(", ")", ")", "{", "messageSend", ".", "receiver", ".", "traverse", "(", "this", ",", "scope", ")", ";", "int", "alignmentMode", "=", "this", ".", "preferences", ".", "alignment_for_selector_in_method_invocation", ";", "messageAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "MESSAGE_SEND", ",", "alignmentMode", ",", "1", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "messageAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "switch", "(", "alignmentMode", "&", "Alignment", ".", "SPLIT_MASK", ")", "{", "case", "Alignment", ".", "M_COMPACT_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ":", "messageAlignment", ".", "startingColumn", "=", "this", ".", "scribe", ".", "column", ";", "break", ";", "}", "try", "{", "formatMessageSend", "(", "messageSend", ",", "scope", ",", "messageAlignment", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "messageAlignment", ",", "true", ")", ";", "}", "else", "{", "formatMessageSend", "(", "messageSend", ",", "scope", ",", "null", ")", ";", "}", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "messageSend", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "MethodDeclaration", "methodDeclaration", ",", "ClassScope", "scope", ")", "{", "if", "(", "methodDeclaration", ".", "ignoreFurtherInvestigation", ")", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "if", "(", "this", ".", "scribe", ".", "indentationLevel", "!=", "0", ")", "{", "this", ".", "scribe", ".", "printIndentationIfNecessary", "(", ")", ";", "}", "this", ".", "scribe", ".", "scanner", ".", "resetTo", "(", "methodDeclaration", ".", "declarationSourceEnd", "+", "1", ",", "this", ".", "scribe", ".", "scannerEndPosition", "-", "1", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "!", "this", ".", "scribe", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "switch", "(", "this", ".", "scribe", ".", "scanner", ".", "source", "[", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", "]", ")", "{", "case", "'\\n'", ":", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", "++", ";", "this", ".", "scribe", ".", "lastNumberOfNewLines", "=", "1", ";", "break", ";", "case", "'\\r'", ":", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", "++", ";", "if", "(", "this", ".", "scribe", ".", "scanner", ".", "source", "[", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", "]", "==", "'\\n'", ")", "{", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", "++", ";", "}", "this", ".", "scribe", ".", "lastNumberOfNewLines", "=", "1", ";", "}", "}", "return", "false", ";", "}", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "Alignment", "methodDeclAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "METHOD_DECLARATION", ",", "this", ".", "preferences", ".", "alignment_for_method_declaration", ",", "Alignment", ".", "R_INNERMOST", ",", "3", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "methodDeclAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "final", "MethodScope", "methodDeclarationScope", "=", "methodDeclaration", ".", "scope", ";", "do", "{", "try", "{", "this", ".", "scribe", ".", "printModifiers", "(", "methodDeclaration", ".", "annotations", ",", "this", ",", "ICodeFormatterConstants", ".", "ANNOTATION_ON_METHOD", ")", ";", "int", "fragmentIndex", "=", "0", ";", "this", ".", "scribe", ".", "alignFragment", "(", "methodDeclAlignment", ",", "fragmentIndex", ")", ";", "if", "(", "this", ".", "scribe", ".", "line", ">", "line", ")", "{", "line", "=", "this", ".", "scribe", ".", "line", ";", "}", "this", ".", "scribe", ".", "space", "(", ")", ";", "TypeParameter", "[", "]", "typeParameters", "=", "methodDeclaration", ".", "typeParameters", ";", "if", "(", "typeParameters", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_type_parameters", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_type_parameters", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "length", "=", "typeParameters", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", "-", "1", ";", "i", "++", ")", "{", "typeParameters", "[", "i", "]", ".", "traverse", "(", "this", ",", "methodDeclaration", ".", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_type_parameters", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_type_parameters", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeParameters", "[", "length", "-", "1", "]", ".", "traverse", "(", "this", ",", "methodDeclaration", ".", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_type_parameters", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_closing_angle_bracket_in_type_parameters", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "alignFragment", "(", "methodDeclAlignment", ",", "++", "fragmentIndex", ")", ";", "}", "final", "TypeReference", "returnType", "=", "methodDeclaration", ".", "returnType", ";", "if", "(", "returnType", "!=", "null", ")", "{", "returnType", ".", "traverse", "(", "this", ",", "methodDeclarationScope", ")", ";", "}", "this", ".", "scribe", ".", "alignFragment", "(", "methodDeclAlignment", ",", "++", "fragmentIndex", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ",", "true", ")", ";", "formatMethodArguments", "(", "methodDeclaration", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_method_declaration", ",", "this", ".", "preferences", ".", "insert_space_between_empty_parens_in_method_declaration", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_method_declaration", ",", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_method_declaration", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_method_declaration_parameters", ",", "this", ".", "preferences", ".", "insert_space_after_comma_in_method_declaration_parameters", ",", "this", ".", "preferences", ".", "alignment_for_parameters_in_method_declaration", ")", ";", "int", "extraDimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "extraDimensions", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "extraDimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "formatThrowsClause", "(", "methodDeclaration", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_method_declaration_throws", ",", "this", ".", "preferences", ".", "insert_space_after_comma_in_method_declaration_throws", ",", "this", ".", "preferences", ".", "alignment_for_throws_clause_in_method_declaration", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "methodDeclAlignment", ",", "true", ")", ";", "if", "(", "!", "methodDeclaration", ".", "isNative", "(", ")", "&&", "!", "methodDeclaration", ".", "isAbstract", "(", ")", "&&", "(", "(", "methodDeclaration", ".", "modifiers", "&", "ExtraCompilerModifiers", ".", "AccSemicolonBody", ")", "==", "0", ")", ")", "{", "String", "method_declaration_brace", "=", "this", ".", "preferences", ".", "brace_position_for_method_declaration", ";", "formatLeftCurlyBrace", "(", "line", ",", "method_declaration_brace", ")", ";", "formatOpeningBrace", "(", "method_declaration_brace", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_method_declaration", ")", ";", "final", "int", "numberOfBlankLinesAtBeginningOfMethodBody", "=", "this", ".", "preferences", ".", "blank_lines_at_beginning_of_method_body", ";", "if", "(", "numberOfBlankLinesAtBeginningOfMethodBody", ">", "0", ")", "{", "this", ".", "scribe", ".", "printEmptyLines", "(", "numberOfBlankLinesAtBeginningOfMethodBody", ")", ";", "}", "final", "Statement", "[", "]", "statements", "=", "methodDeclaration", ".", "statements", ";", "if", "(", "statements", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_body", ")", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "formatStatements", "(", "methodDeclarationScope", ",", "statements", ",", "true", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "Scribe", ".", "PRESERVE_EMPTY_LINES_AT_END_OF_METHOD_DECLARATION", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_body", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "else", "{", "if", "(", "this", ".", "preferences", ".", "insert_new_line_in_empty_method_body", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_body", ")", "{", "this", ".", "scribe", ".", "indent", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", "Scribe", ".", "PRESERVE_EMPTY_LINES_AT_END_OF_METHOD_DECLARATION", ")", ";", "if", "(", "this", ".", "preferences", ".", "indent_statements_compare_to_body", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "method_declaration_brace", ".", "equals", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_SHIFTED", ")", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "COMPLEX_TRAILING_COMMENT", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "NormalAnnotation", "annotation", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameAT", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_at_in_annotation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printQualifiedReference", "(", "annotation", ".", "sourceEnd", ",", "false", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_annotation", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_annotation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "MemberValuePair", "[", "]", "memberValuePairs", "=", "annotation", ".", "memberValuePairs", ";", "if", "(", "memberValuePairs", "!=", "null", ")", "{", "int", "length", "=", "memberValuePairs", ".", "length", ";", "Alignment", "annotationAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "ANNOTATION_MEMBERS_VALUE_PAIRS", ",", "this", ".", "preferences", ".", "alignment_for_arguments_in_annotation", ",", "length", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "annotationAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_annotation", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "alignFragment", "(", "annotationAlignment", ",", "i", ")", ";", "if", "(", "i", ">", "0", "&&", "this", ".", "preferences", ".", "insert_space_after_comma_in_annotation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "memberValuePairs", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "annotationAlignment", ",", "true", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_annotation", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "NullLiteral", "nullLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "nullLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "nullLiteral", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamenull", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "nullLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "OR_OR_Expression", "or_or_Expression", ",", "BlockScope", "scope", ")", "{", "return", "dumpBinaryExpression", "(", "or_or_Expression", ",", "TerminalTokens", ".", "TokenNameOR_OR", ",", "scope", ")", ";", "}", "public", "boolean", "visit", "(", "ParameterizedQualifiedTypeReference", "parameterizedQualifiedTypeReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "parameterizedQualifiedTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "parameterizedQualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "TypeReference", "[", "]", "[", "]", "typeArguments", "=", "parameterizedQualifiedTypeReference", ".", "typeArguments", ";", "int", "length", "=", "typeArguments", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "TypeReference", "[", "]", "typeArgument", "=", "typeArguments", "[", "i", "]", ";", "if", "(", "typeArgument", "!=", "null", ")", "{", "int", "typeArgumentLength", "=", "typeArgument", ".", "length", ";", "if", "(", "typeArgumentLength", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_parameterized_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "j", "=", "0", ";", "j", "<", "typeArgumentLength", "-", "1", ";", "j", "++", ")", "{", "typeArgument", "[", "j", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_parameterized_type_reference", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_parameterized_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeArgument", "[", "typeArgumentLength", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_parameterized_type_reference", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ")", ";", "}", "}", "if", "(", "i", "<", "length", "-", "1", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "}", "}", "int", "dimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "dimensions", "!=", "0", "&&", "dimensions", "<=", "parameterizedQualifiedTypeReference", ".", "dimensions", "(", ")", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_before_opening_bracket_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_between_brackets_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "parameterizedQualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ParameterizedQualifiedTypeReference", "parameterizedQualifiedTypeReference", ",", "ClassScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "parameterizedQualifiedTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "parameterizedQualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "TypeReference", "[", "]", "[", "]", "typeArguments", "=", "parameterizedQualifiedTypeReference", ".", "typeArguments", ";", "int", "length", "=", "typeArguments", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "TypeReference", "[", "]", "typeArgument", "=", "typeArguments", "[", "i", "]", ";", "if", "(", "typeArgument", "!=", "null", ")", "{", "int", "typeArgumentLength", "=", "typeArgument", ".", "length", ";", "if", "(", "typeArgumentLength", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_parameterized_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "j", "=", "0", ";", "j", "<", "typeArgumentLength", "-", "1", ";", "j", "++", ")", "{", "typeArgument", "[", "j", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_parameterized_type_reference", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_parameterized_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeArgument", "[", "typeArgumentLength", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_parameterized_type_reference", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ")", ";", "}", "}", "if", "(", "i", "<", "length", "-", "1", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "}", "}", "int", "dimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "dimensions", "!=", "0", "&&", "dimensions", "<=", "parameterizedQualifiedTypeReference", ".", "dimensions", "(", ")", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_before_opening_bracket_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_between_brackets_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "parameterizedQualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ParameterizedSingleTypeReference", "parameterizedSingleTypeReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "parameterizedSingleTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "parameterizedSingleTypeReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "TypeReference", "[", "]", "typeArguments", "=", "parameterizedSingleTypeReference", ".", "typeArguments", ";", "int", "typeArgumentsLength", "=", "typeArguments", ".", "length", ";", "if", "(", "typeArgumentsLength", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_parameterized_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "typeArgumentsLength", "-", "1", ";", "i", "++", ")", "{", "typeArguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_parameterized_type_reference", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_parameterized_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeArguments", "[", "typeArgumentsLength", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_parameterized_type_reference", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ")", ";", "}", "int", "dimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "dimensions", "!=", "0", "&&", "dimensions", "<=", "parameterizedSingleTypeReference", ".", "dimensions", "(", ")", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_before_opening_bracket_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_between_brackets_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "parameterizedSingleTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ParameterizedSingleTypeReference", "parameterizedSingleTypeReference", ",", "ClassScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "parameterizedSingleTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "parameterizedSingleTypeReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "TypeReference", "[", "]", "typeArguments", "=", "parameterizedSingleTypeReference", ".", "typeArguments", ";", "int", "typeArgumentsLength", "=", "typeArguments", ".", "length", ";", "if", "(", "typeArgumentsLength", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_parameterized_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "typeArgumentsLength", "-", "1", ";", "i", "++", ")", "{", "typeArguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_parameterized_type_reference", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_parameterized_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeArguments", "[", "typeArgumentsLength", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_parameterized_type_reference", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ")", ";", "}", "int", "dimensions", "=", "getDimensions", "(", ")", ";", "if", "(", "dimensions", "!=", "0", "&&", "dimensions", "<=", "parameterizedSingleTypeReference", ".", "dimensions", "(", ")", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_before_opening_bracket_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "dimensions", ";", "i", "++", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLBRACKET", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_between_brackets_in_array_type_reference", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACKET", ")", ";", "}", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "parameterizedSingleTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "PostfixExpression", "postfixExpression", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "postfixExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "postfixExpression", ",", "numberOfParens", ")", ";", "}", "postfixExpression", ".", "lhs", ".", "traverse", "(", "this", ",", "scope", ")", ";", "int", "operator", "=", "postfixExpression", ".", "operator", "==", "OperatorIds", ".", "PLUS", "?", "TerminalTokens", ".", "TokenNamePLUS_PLUS", ":", "TerminalTokens", ".", "TokenNameMINUS_MINUS", ";", "this", ".", "scribe", ".", "printNextToken", "(", "operator", ",", "this", ".", "preferences", ".", "insert_space_before_postfix_operator", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_postfix_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "postfixExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "PrefixExpression", "prefixExpression", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "prefixExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "prefixExpression", ",", "numberOfParens", ")", ";", "}", "int", "operator", "=", "prefixExpression", ".", "operator", "==", "OperatorIds", ".", "PLUS", "?", "TerminalTokens", ".", "TokenNamePLUS_PLUS", ":", "TerminalTokens", ".", "TokenNameMINUS_MINUS", ";", "this", ".", "scribe", ".", "printNextToken", "(", "operator", ",", "this", ".", "preferences", ".", "insert_space_before_prefix_operator", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_prefix_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "prefixExpression", ".", "lhs", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "prefixExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "QualifiedAllocationExpression", "qualifiedAllocationExpression", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "qualifiedAllocationExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "qualifiedAllocationExpression", ",", "numberOfParens", ")", ";", "}", "final", "Expression", "enclosingInstance", "=", "qualifiedAllocationExpression", ".", "enclosingInstance", ";", "if", "(", "enclosingInstance", "!=", "null", ")", "{", "enclosingInstance", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamenew", ")", ";", "TypeReference", "[", "]", "typeArguments", "=", "qualifiedAllocationExpression", ".", "typeArguments", ";", "if", "(", "typeArguments", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLESS", ",", "this", ".", "preferences", ".", "insert_space_before_opening_angle_bracket_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "length", "=", "typeArguments", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", "-", "1", ";", "i", "++", ")", "{", "typeArguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_type_arguments", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_comma_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "typeArguments", "[", "length", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "isClosingGenericToken", "(", ")", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "CLOSING_GENERICS_EXPECTEDTOKENS", ",", "this", ".", "preferences", ".", "insert_space_before_closing_angle_bracket_in_type_arguments", ")", ";", "}", "if", "(", "this", ".", "preferences", ".", "insert_space_after_closing_angle_bracket_in_type_arguments", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "final", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "qualifiedAllocationExpression", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_method_invocation", ")", ";", "final", "Expression", "[", "]", "arguments", "=", "qualifiedAllocationExpression", ".", "arguments", ";", "if", "(", "arguments", "!=", "null", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_method_invocation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "argumentLength", "=", "arguments", ".", "length", ";", "Alignment", "argumentsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "ALLOCATION", ",", "this", ".", "preferences", ".", "alignment_for_arguments_in_qualified_allocation_expression", ",", "argumentLength", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "argumentsAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentLength", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameCOMMA", ",", "this", ".", "preferences", ".", "insert_space_before_comma_in_allocation_expression", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "i", ")", ";", "if", "(", "i", ">", "0", "&&", "this", ".", "preferences", ".", "insert_space_after_comma_in_allocation_expression", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "arguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "argumentsAlignment", ",", "true", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_method_invocation", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_between_empty_parens_in_method_invocation", ")", ";", "}", "final", "TypeDeclaration", "anonymousType", "=", "qualifiedAllocationExpression", ".", "anonymousType", ";", "if", "(", "anonymousType", "!=", "null", ")", "{", "formatLeftCurlyBrace", "(", "line", ",", "this", ".", "preferences", ".", "brace_position_for_anonymous_type_declaration", ")", ";", "formatAnonymousTypeDeclaration", "(", "anonymousType", ")", ";", "}", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "qualifiedAllocationExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "QualifiedNameReference", "qualifiedNameReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "qualifiedNameReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "qualifiedNameReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printQualifiedReference", "(", "qualifiedNameReference", ".", "sourceEnd", ",", "numberOfParens", ">=", "0", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "qualifiedNameReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "QualifiedSuperReference", "qualifiedSuperReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "qualifiedSuperReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "qualifiedSuperReference", ",", "numberOfParens", ")", ";", "}", "qualifiedSuperReference", ".", "qualification", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamesuper", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "qualifiedSuperReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "QualifiedThisReference", "qualifiedThisReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "qualifiedThisReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "qualifiedThisReference", ",", "numberOfParens", ")", ";", "}", "qualifiedThisReference", ".", "qualification", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameDOT", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamethis", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "qualifiedThisReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "QualifiedTypeReference", "qualifiedTypeReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "qualifiedTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "qualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printQualifiedReference", "(", "qualifiedTypeReference", ".", "sourceEnd", ",", "numberOfParens", ">=", "0", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "qualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "QualifiedTypeReference", "qualifiedTypeReference", ",", "ClassScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "qualifiedTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "qualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printQualifiedReference", "(", "qualifiedTypeReference", ".", "sourceEnd", ",", "numberOfParens", ">=", "0", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "qualifiedTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ReturnStatement", "returnStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamereturn", ")", ";", "final", "Expression", "expression", "=", "returnStatement", ".", "expression", ";", "if", "(", "expression", "!=", "null", ")", "{", "final", "int", "numberOfParens", "=", "(", "expression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "(", "numberOfParens", "!=", "0", "&&", "this", ".", "preferences", ".", "insert_space_before_parenthesized_expression_in_return", ")", "||", "numberOfParens", "==", "0", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "expression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "SingleMemberAnnotation", "annotation", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameAT", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_at_in_annotation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "this", ".", "scribe", ".", "printQualifiedReference", "(", "annotation", ".", "sourceEnd", ",", "false", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_annotation", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_annotation", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "annotation", ".", "memberValue", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_annotation", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "SingleNameReference", "singleNameReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "singleNameReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "singleNameReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "SINGLETYPEREFERENCE_EXPECTEDTOKENS", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "singleNameReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "SingleTypeReference", "singleTypeReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "singleTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "singleTypeReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "SINGLETYPEREFERENCE_EXPECTEDTOKENS", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "singleTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "SingleTypeReference", "singleTypeReference", ",", "ClassScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "singleTypeReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "singleTypeReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "SINGLETYPEREFERENCE_EXPECTEDTOKENS", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "singleTypeReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "StringLiteral", "stringLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "stringLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "stringLiteral", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "checkNLSTag", "(", "stringLiteral", ".", "sourceStart", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameStringLiteral", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "stringLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "StringLiteralConcatenation", "stringLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "stringLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "stringLiteral", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", "Scribe", ".", "PRESERVE_EMPTY_LINES_IN_STRING_LITERAL_CONCATENATION", ")", ";", "ASTNode", "[", "]", "fragments", "=", "stringLiteral", ".", "literals", ";", "int", "fragmentsSize", "=", "stringLiteral", ".", "counter", ";", "Alignment", "binaryExpressionAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "STRING_CONCATENATION", ",", "this", ".", "preferences", ".", "alignment_for_binary_expression", ",", "Alignment", ".", "R_OUTERMOST", ",", "fragmentsSize", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "binaryExpressionAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fragmentsSize", "-", "1", ";", "i", "++", ")", "{", "ASTNode", "fragment", "=", "fragments", "[", "i", "]", ";", "fragment", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "this", ".", "scribe", ".", "lastNumberOfNewLines", "==", "1", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "binaryExpressionAlignment", ".", "breakIndentationLevel", ";", "}", "this", ".", "scribe", ".", "alignFragment", "(", "binaryExpressionAlignment", ",", "i", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamePLUS", ",", "this", ".", "preferences", ".", "insert_space_before_binary_operator", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_binary_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "fragments", "[", "fragmentsSize", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "binaryExpressionAlignment", ",", "true", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "stringLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "SuperReference", "superReference", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "superReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "superReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamesuper", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "superReference", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "SwitchStatement", "switchStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameswitch", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_switch", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_switch", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "switchStatement", ".", "expression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_switch", ")", ";", "String", "switch_brace", "=", "this", ".", "preferences", ".", "brace_position_for_switch", ";", "formatOpeningBrace", "(", "switch_brace", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_switch", ")", ";", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "final", "Statement", "[", "]", "statements", "=", "switchStatement", ".", "statements", ";", "int", "switchIndentationLevel", "=", "this", ".", "scribe", ".", "indentationLevel", ";", "int", "caseIndentation", "=", "0", ";", "int", "statementIndentation", "=", "0", ";", "int", "breakIndentation", "=", "0", ";", "if", "(", "this", ".", "preferences", ".", "indent_switchstatements_compare_to_switch", ")", "{", "caseIndentation", "++", ";", "statementIndentation", "++", ";", "breakIndentation", "++", ";", "}", "if", "(", "this", ".", "preferences", ".", "indent_switchstatements_compare_to_cases", ")", "{", "statementIndentation", "++", ";", "}", "if", "(", "this", ".", "preferences", ".", "indent_breaks_compare_to_cases", ")", "{", "breakIndentation", "++", ";", "}", "boolean", "wasACase", "=", "false", ";", "boolean", "wasABreak", "=", "false", ";", "if", "(", "statements", "!=", "null", ")", "{", "int", "statementsLength", "=", "statements", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "statementsLength", ";", "i", "++", ")", "{", "final", "Statement", "statement", "=", "statements", "[", "i", "]", ";", "if", "(", "statement", "instanceof", "CaseStatement", ")", "{", "if", "(", "wasABreak", ")", "{", "this", ".", "scribe", ".", "setIndentation", "(", "switchIndentationLevel", ",", "caseIndentation", ")", ";", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "}", "else", "{", "if", "(", "wasACase", ")", "{", "this", ".", "scribe", ".", "printComment", "(", "Scribe", ".", "PRESERVE_EMPTY_LINES_IN_SWITCH_CASE", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "}", "this", ".", "scribe", ".", "setIndentation", "(", "switchIndentationLevel", ",", "caseIndentation", ")", ";", "}", "if", "(", "wasACase", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "statement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "setIndentation", "(", "switchIndentationLevel", ",", "statementIndentation", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "COMPLEX_TRAILING_COMMENT", ")", ";", "wasACase", "=", "true", ";", "wasABreak", "=", "false", ";", "}", "else", "if", "(", "statement", "instanceof", "BreakStatement", ")", "{", "this", ".", "scribe", ".", "setIndentation", "(", "switchIndentationLevel", ",", "breakIndentation", ")", ";", "if", "(", "wasACase", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "statement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "wasACase", "=", "false", ";", "wasABreak", "=", "true", ";", "}", "else", "if", "(", "statement", "instanceof", "Block", ")", "{", "this", ".", "scribe", ".", "setIndentation", "(", "switchIndentationLevel", ",", "wasACase", "?", "caseIndentation", ":", "statementIndentation", ")", ";", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "String", "bracePosition", "=", "wasACase", "?", "this", ".", "preferences", ".", "brace_position_for_block_in_case", ":", "this", ".", "preferences", ".", "brace_position_for_block", ";", "formatBlock", "(", "(", "Block", ")", "statement", ",", "scope", ",", "bracePosition", ",", "this", ".", "preferences", ".", "insert_space_before_opening_brace_in_block", ")", ";", "wasACase", "=", "false", ";", "wasABreak", "=", "false", ";", "}", "else", "{", "this", ".", "scribe", ".", "setIndentation", "(", "switchIndentationLevel", ",", "statementIndentation", ")", ";", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "statement", ".", "traverse", "(", "this", ",", "scope", ")", ";", "wasACase", "=", "false", ";", "wasABreak", "=", "false", ";", "}", "if", "(", "statement", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "else", "if", "(", "statement", "instanceof", "LocalDeclaration", ")", "{", "LocalDeclaration", "currentLocal", "=", "(", "LocalDeclaration", ")", "statement", ";", "if", "(", "i", "<", "(", "statementsLength", "-", "1", ")", ")", "{", "if", "(", "statements", "[", "i", "+", "1", "]", "instanceof", "LocalDeclaration", ")", "{", "LocalDeclaration", "nextLocal", "=", "(", "LocalDeclaration", ")", "statements", "[", "i", "+", "1", "]", ";", "if", "(", "currentLocal", ".", "declarationSourceStart", "!=", "nextLocal", ".", "declarationSourceStart", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "if", "(", "!", "wasACase", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "}", "}", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "if", "(", "wasABreak", ")", "{", "this", ".", "scribe", ".", "setIndentation", "(", "switchIndentationLevel", ",", "0", ")", ";", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printComment", "(", ")", ";", "this", ".", "scribe", ".", "setIndentation", "(", "switchIndentationLevel", ",", "0", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRBRACE", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "switch_brace", ".", "equals", "(", "DefaultCodeFormatterConstants", ".", "NEXT_LINE_SHIFTED", ")", ")", "{", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "SynchronizedStatement", "synchronizedStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamesynchronized", ")", ";", "final", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_synchronized", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_synchronized", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "synchronizedStatement", ".", "expression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_synchronized", ")", ";", "formatLeftCurlyBrace", "(", "line", ",", "this", ".", "preferences", ".", "brace_position_for_block", ")", ";", "synchronizedStatement", ".", "block", ".", "traverse", "(", "this", ",", "scope", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ThisReference", "thisReference", ",", "BlockScope", "scope", ")", "{", "if", "(", "!", "thisReference", ".", "isImplicitThis", "(", ")", ")", "{", "final", "int", "numberOfParens", "=", "(", "thisReference", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "thisReference", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamethis", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "thisReference", ",", "numberOfParens", ")", ";", "}", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ThrowStatement", "throwStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamethrow", ")", ";", "Expression", "expression", "=", "throwStatement", ".", "exception", ";", "final", "int", "numberOfParens", "=", "(", "expression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "(", "numberOfParens", ">", "0", "&&", "this", ".", "preferences", ".", "insert_space_before_parenthesized_expression_in_throw", ")", "||", "numberOfParens", "==", "0", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "expression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "TrueLiteral", "trueLiteral", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "trueLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "trueLiteral", ",", "numberOfParens", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNametrue", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "trueLiteral", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "TryStatement", "tryStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNametry", ")", ";", "formatTryResources", "(", "tryStatement", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_try", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_try", ",", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_try", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon_in_try_resources", ",", "this", ".", "preferences", ".", "insert_space_after_semicolon_in_try_resources", ",", "this", ".", "preferences", ".", "alignment_for_resources_in_try", ")", ";", "tryStatement", ".", "tryBlock", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "tryStatement", ".", "catchArguments", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "tryStatement", ".", "catchBlocks", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_new_line_before_catch_in_try_statement", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamecatch", ",", "this", ".", "preferences", ".", "insert_space_after_closing_brace_in_block", ")", ";", "final", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_catch", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_catch", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "tryStatement", ".", "catchArguments", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_catch", ")", ";", "formatLeftCurlyBrace", "(", "line", ",", "this", ".", "preferences", ".", "brace_position_for_block", ")", ";", "tryStatement", ".", "catchBlocks", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "}", "if", "(", "tryStatement", ".", "finallyBlock", "!=", "null", ")", "{", "if", "(", "this", ".", "preferences", ".", "insert_new_line_before_finally_in_try_statement", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamefinally", ",", "this", ".", "preferences", ".", "insert_space_after_closing_brace_in_block", ")", ";", "tryStatement", ".", "finallyBlock", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "}", "private", "void", "formatMultiCatchArguments", "(", "Argument", "argument", ",", "boolean", "spaceBeforePipe", ",", "boolean", "spaceAfterPipe", ",", "int", "multiCatchAlignment", ",", "BlockScope", "scope", ")", "{", "UnionTypeReference", "unionType", "=", "(", "UnionTypeReference", ")", "argument", ".", "type", ";", "int", "length", "=", "unionType", ".", "typeReferences", "!=", "null", "?", "unionType", ".", "typeReferences", ".", "length", ":", "0", ";", "if", "(", "length", ">", "0", ")", "{", "Alignment", "argumentsAlignment", "=", "this", ".", "scribe", ".", "createAlignment", "(", "Alignment", ".", "MULTI_CATCH", ",", "multiCatchAlignment", ",", "length", ",", "this", ".", "scribe", ".", "scanner", ".", "currentPosition", ")", ";", "this", ".", "scribe", ".", "enterAlignment", "(", "argumentsAlignment", ")", ";", "boolean", "ok", "=", "false", ";", "do", "{", "switch", "(", "multiCatchAlignment", "&", "Alignment", ".", "SPLIT_MASK", ")", "{", "case", "Alignment", ".", "M_COMPACT_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ":", "argumentsAlignment", ".", "startingColumn", "=", "this", ".", "scribe", ".", "column", ";", "break", ";", "}", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "if", "(", "this", ".", "preferences", ".", "wrap_before_or_operator_multicatch", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "i", ")", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameOR", ",", "spaceBeforePipe", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "if", "(", "this", ".", "scribe", ".", "lastNumberOfNewLines", "==", "1", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "argumentsAlignment", ".", "breakIndentationLevel", ";", "}", "if", "(", "!", "this", ".", "preferences", ".", "wrap_before_or_operator_multicatch", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "i", ")", ";", "}", "}", "if", "(", "i", "==", "0", ")", "{", "this", ".", "scribe", ".", "alignFragment", "(", "argumentsAlignment", ",", "i", ")", ";", "int", "fragmentIndentation", "=", "argumentsAlignment", ".", "fragmentIndentations", "[", "0", "]", ";", "if", "(", "(", "argumentsAlignment", ".", "mode", "&", "Alignment", ".", "M_INDENT_ON_COLUMN", ")", "!=", "0", "&&", "fragmentIndentation", ">", "0", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "fragmentIndentation", ";", "}", "}", "else", "if", "(", "spaceAfterPipe", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "unionType", ".", "typeReferences", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "argumentsAlignment", ".", "startingColumn", "=", "-", "1", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "AlignmentException", "e", ")", "{", "this", ".", "scribe", ".", "redoAlignment", "(", "e", ")", ";", "}", "}", "while", "(", "!", "ok", ")", ";", "this", ".", "scribe", ".", "exitAlignment", "(", "argumentsAlignment", ",", "true", ")", ";", "}", "}", "public", "boolean", "visit", "(", "TypeDeclaration", "localTypeDeclaration", ",", "BlockScope", "scope", ")", "{", "format", "(", "localTypeDeclaration", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "TypeDeclaration", "memberTypeDeclaration", ",", "ClassScope", "scope", ")", "{", "format", "(", "memberTypeDeclaration", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "TypeDeclaration", "typeDeclaration", ",", "CompilationUnitScope", "scope", ")", "{", "format", "(", "typeDeclaration", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "TypeParameter", "typeParameter", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "if", "(", "typeParameter", ".", "type", "!=", "null", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameextends", ",", "true", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "typeParameter", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "final", "TypeReference", "[", "]", "bounds", "=", "typeParameter", ".", "bounds", ";", "if", "(", "bounds", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameAND", ",", "this", ".", "preferences", ".", "insert_space_before_and_in_type_parameter", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_and_in_type_parameter", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "boundsLength", "=", "bounds", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "boundsLength", "-", "1", ";", "i", "++", ")", "{", "bounds", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameAND", ",", "this", ".", "preferences", ".", "insert_space_before_and_in_type_parameter", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_and_in_type_parameter", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "bounds", "[", "boundsLength", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "TypeParameter", "typeParameter", ",", "ClassScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameIdentifier", ")", ";", "if", "(", "typeParameter", ".", "type", "!=", "null", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameextends", ",", "true", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "typeParameter", ".", "type", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "final", "TypeReference", "[", "]", "bounds", "=", "typeParameter", ".", "bounds", ";", "if", "(", "bounds", "!=", "null", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameAND", ",", "this", ".", "preferences", ".", "insert_space_before_and_in_type_parameter", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_and_in_type_parameter", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "int", "boundsLength", "=", "bounds", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "boundsLength", "-", "1", ";", "i", "++", ")", "{", "bounds", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameAND", ",", "this", ".", "preferences", ".", "insert_space_before_and_in_type_parameter", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_and_in_type_parameter", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "bounds", "[", "boundsLength", "-", "1", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "UnaryExpression", "unaryExpression", ",", "BlockScope", "scope", ")", "{", "final", "int", "numberOfParens", "=", "(", "unaryExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageOpeningParenthesizedExpression", "(", "unaryExpression", ",", "numberOfParens", ")", ";", "}", "int", "operator", ";", "int", "operatorValue", "=", "(", "unaryExpression", ".", "bits", "&", "ASTNode", ".", "OperatorMASK", ")", ">>", "ASTNode", ".", "OperatorSHIFT", ";", "switch", "(", "operatorValue", ")", "{", "case", "OperatorIds", ".", "PLUS", ":", "operator", "=", "TerminalTokens", ".", "TokenNamePLUS", ";", "break", ";", "case", "OperatorIds", ".", "MINUS", ":", "operator", "=", "TerminalTokens", ".", "TokenNameMINUS", ";", "break", ";", "case", "OperatorIds", ".", "TWIDDLE", ":", "operator", "=", "TerminalTokens", ".", "TokenNameTWIDDLE", ";", "break", ";", "default", ":", "operator", "=", "TerminalTokens", ".", "TokenNameNOT", ";", "}", "this", ".", "scribe", ".", "printNextToken", "(", "operator", ",", "this", ".", "preferences", ".", "insert_space_before_unary_operator", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_unary_operator", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "Expression", "expression", "=", "unaryExpression", ".", "expression", ";", "if", "(", "expression", "instanceof", "PrefixExpression", ")", "{", "PrefixExpression", "prefixExpression", "=", "(", "PrefixExpression", ")", "expression", ";", "final", "int", "numberOfParensForExpression", "=", "(", "prefixExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParensForExpression", "==", "0", ")", "{", "switch", "(", "operatorValue", ")", "{", "case", "OperatorIds", ".", "PLUS", ":", "if", "(", "prefixExpression", ".", "operator", "==", "OperatorIds", ".", "PLUS", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "break", ";", "case", "OperatorIds", ".", "MINUS", ":", "if", "(", "prefixExpression", ".", "operator", "==", "OperatorIds", ".", "MINUS", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "break", ";", "}", "}", "}", "else", "if", "(", "expression", "instanceof", "UnaryExpression", ")", "{", "UnaryExpression", "unaryExpression2", "=", "(", "UnaryExpression", ")", "expression", ";", "final", "int", "numberOfParensForExpression", "=", "(", "unaryExpression2", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParensForExpression", "==", "0", ")", "{", "int", "operatorValue2", "=", "(", "unaryExpression2", ".", "bits", "&", "ASTNode", ".", "OperatorMASK", ")", ">>", "ASTNode", ".", "OperatorSHIFT", ";", "switch", "(", "operatorValue", ")", "{", "case", "OperatorIds", ".", "PLUS", ":", "if", "(", "operatorValue2", "==", "OperatorIds", ".", "PLUS", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "break", ";", "case", "OperatorIds", ".", "MINUS", ":", "if", "(", "operatorValue2", "==", "OperatorIds", ".", "MINUS", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "break", ";", "}", "}", "}", "expression", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "manageClosingParenthesizedExpression", "(", "unaryExpression", ",", "numberOfParens", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "UnionTypeReference", "unionTypeReference", ",", "BlockScope", "scope", ")", "{", "TypeReference", "[", "]", "typeReferences", "=", "unionTypeReference", ".", "typeReferences", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "typeReferences", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "if", "(", "i", "!=", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameOR", ",", "true", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "typeReferences", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "UnionTypeReference", "unionTypeReference", ",", "ClassScope", "scope", ")", "{", "TypeReference", "[", "]", "typeReferences", "=", "unionTypeReference", ".", "typeReferences", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "typeReferences", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "if", "(", "i", "!=", "0", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameOR", ",", "true", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "typeReferences", "[", "i", "]", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "WhileStatement", "whileStatement", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamewhile", ")", ";", "final", "int", "line", "=", "this", ".", "scribe", ".", "line", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameLPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_opening_paren_in_while", ")", ";", "if", "(", "this", ".", "preferences", ".", "insert_space_after_opening_paren_in_while", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "whileStatement", ".", "condition", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameRPAREN", ",", "this", ".", "preferences", ".", "insert_space_before_closing_paren_in_while", ")", ";", "final", "Statement", "action", "=", "whileStatement", ".", "action", ";", "if", "(", "action", "!=", "null", ")", "{", "if", "(", "action", "instanceof", "Block", ")", "{", "formatLeftCurlyBrace", "(", "line", ",", "this", ".", "preferences", ".", "brace_position_for_block", ")", ";", "action", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "else", "if", "(", "action", "instanceof", "EmptyStatement", ")", "{", "formatNecessaryEmptyStatement", "(", ")", ";", "}", "else", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "this", ".", "scribe", ".", "indent", "(", ")", ";", "action", ".", "traverse", "(", "this", ",", "scope", ")", ";", "if", "(", "action", "instanceof", "Expression", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameSEMICOLON", ",", "this", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "this", ".", "scribe", ".", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "Scribe", ".", "BASIC_TRAILING_COMMENT", ")", ";", "}", "this", ".", "scribe", ".", "unIndent", "(", ")", ";", "}", "}", "else", "{", "formatNecessaryEmptyStatement", "(", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "Wildcard", "wildcard", ",", "BlockScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameQUESTION", ",", "this", ".", "preferences", ".", "insert_space_before_question_in_wilcard", ")", ";", "switch", "(", "wildcard", ".", "kind", ")", "{", "case", "Wildcard", ".", "SUPER", ":", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamesuper", ",", "true", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "wildcard", ".", "bound", ".", "traverse", "(", "this", ",", "scope", ")", ";", "break", ";", "case", "Wildcard", ".", "EXTENDS", ":", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameextends", ",", "true", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "wildcard", ".", "bound", ".", "traverse", "(", "this", ",", "scope", ")", ";", "break", ";", "case", "Wildcard", ".", "UNBOUND", ":", "if", "(", "this", ".", "preferences", ".", "insert_space_after_question_in_wilcard", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "Wildcard", "wildcard", ",", "ClassScope", "scope", ")", "{", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameQUESTION", ",", "this", ".", "preferences", ".", "insert_space_before_question_in_wilcard", ")", ";", "switch", "(", "wildcard", ".", "kind", ")", "{", "case", "Wildcard", ".", "SUPER", ":", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNamesuper", ",", "true", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "wildcard", ".", "bound", ".", "traverse", "(", "this", ",", "scope", ")", ";", "break", ";", "case", "Wildcard", ".", "EXTENDS", ":", "this", ".", "scribe", ".", "printNextToken", "(", "TerminalTokens", ".", "TokenNameextends", ",", "true", ")", ";", "this", ".", "scribe", ".", "space", "(", ")", ";", "wildcard", ".", "bound", ".", "traverse", "(", "this", ",", "scope", ")", ";", "break", ";", "case", "Wildcard", ".", "UNBOUND", ":", "if", "(", "this", ".", "preferences", ".", "insert_space_after_question_in_wilcard", ")", "{", "this", ".", "scribe", ".", "space", "(", ")", ";", "}", "}", "return", "false", ";", "}", "}", "</s>" ]
3,956
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "public", "class", "Location", "{", "public", "int", "inputOffset", ";", "public", "int", "inputColumn", ";", "public", "int", "outputLine", ";", "public", "int", "outputColumn", ";", "public", "int", "outputIndentationLevel", ";", "public", "boolean", "needSpace", ";", "public", "boolean", "pendingSpace", ";", "public", "int", "nlsTagCounter", ";", "public", "int", "lastLocalDeclarationSourceStart", ";", "public", "int", "numberOfIndentations", ";", "public", "int", "lastNumberOfNewLines", ";", "int", "editsIndex", ";", "OptimizedReplaceEdit", "textEdit", ";", "public", "Location", "(", "Scribe", "scribe", ",", "int", "sourceRestart", ")", "{", "update", "(", "scribe", ",", "sourceRestart", ")", ";", "}", "public", "void", "update", "(", "Scribe", "scribe", ",", "int", "sourceRestart", ")", "{", "this", ".", "outputColumn", "=", "scribe", ".", "column", ";", "this", ".", "outputLine", "=", "scribe", ".", "line", ";", "this", ".", "inputOffset", "=", "sourceRestart", ";", "this", ".", "inputColumn", "=", "scribe", ".", "getCurrentIndentation", "(", "sourceRestart", ")", "+", "1", ";", "this", ".", "outputIndentationLevel", "=", "scribe", ".", "indentationLevel", ";", "this", ".", "lastNumberOfNewLines", "=", "scribe", ".", "lastNumberOfNewLines", ";", "this", ".", "needSpace", "=", "scribe", ".", "needSpace", ";", "this", ".", "pendingSpace", "=", "scribe", ".", "pendingSpace", ";", "this", ".", "editsIndex", "=", "scribe", ".", "editsIndex", ";", "this", ".", "nlsTagCounter", "=", "scribe", ".", "nlsTagCounter", ";", "this", ".", "numberOfIndentations", "=", "scribe", ".", "numberOfIndentations", ";", "this", ".", "textEdit", "=", "scribe", ".", "getLastEdit", "(", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"\"", "+", "this", ".", "outputColumn", ")", ";", "buffer", ".", "append", "(", "\",", "line=\"", "+", "this", ".", "outputLine", ")", ";", "buffer", ".", "append", "(", "\"\"", "+", "this", ".", "outputIndentationLevel", ")", ";", "buffer", ".", "append", "(", "\"\"", "+", "this", ".", "inputOffset", ")", ";", "buffer", ".", "append", "(", "\",", "column=\"", "+", "this", ".", "inputColumn", ")", ";", "buffer", ".", "append", "(", "')'", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,957
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "public", "class", "OptimizedReplaceEdit", "{", "int", "offset", ";", "int", "length", ";", "String", "replacement", ";", "public", "OptimizedReplaceEdit", "(", "int", "offset", ",", "int", "length", ",", "String", "replacement", ")", "{", "this", ".", "offset", "=", "offset", ";", "this", ".", "length", "=", "length", ";", "this", ".", "replacement", "=", "replacement", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "(", "this", ".", "offset", "<", "0", "?", "\"(\"", ":", "\"X(\"", ")", "+", "this", ".", "offset", "+", "\",", "length", "\"", "+", "this", ".", "length", "+", "\"", ":>\"", "+", "this", ".", "replacement", "+", "\"<\"", ";", "}", "}", "</s>" ]
3,958
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ASTVisitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AND_AND_Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayAllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayInitializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayQualifiedTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ArrayTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Assignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "BinaryExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CastExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CharLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ClassLiteralAccess", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CombinedBinaryExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompoundAssignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ConditionalExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "DoubleLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "EqualExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ExtendedStringLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FalseLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FieldReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FloatLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "InstanceOfExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "IntLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "LongLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MessageSend", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "StringLiteralConcatenation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "NullLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "OR_OR_Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "OperatorIds", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "PostfixExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "PrefixExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedAllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedNameReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedSuperReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedThisReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SingleNameReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "StringLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SuperReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ThisReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TrueLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "UnaryExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ClassScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "TerminalTokens", ";", "class", "BinaryExpressionFragmentBuilder", "extends", "ASTVisitor", "{", "ArrayList", "fragmentsList", ";", "ArrayList", "operatorsList", ";", "private", "int", "realFragmentsSize", ";", "BinaryExpressionFragmentBuilder", "(", ")", "{", "this", ".", "fragmentsList", "=", "new", "ArrayList", "(", ")", ";", "this", ".", "operatorsList", "=", "new", "ArrayList", "(", ")", ";", "this", ".", "realFragmentsSize", "=", "0", ";", "}", "private", "final", "void", "addRealFragment", "(", "ASTNode", "node", ")", "{", "this", ".", "fragmentsList", ".", "add", "(", "node", ")", ";", "this", ".", "realFragmentsSize", "++", ";", "}", "private", "final", "void", "addSmallFragment", "(", "ASTNode", "node", ")", "{", "this", ".", "fragmentsList", ".", "add", "(", "node", ")", ";", "}", "private", "boolean", "buildFragments", "(", "Expression", "expression", ")", "{", "if", "(", "(", "(", "expression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ")", "!=", "0", ")", "{", "addRealFragment", "(", "expression", ")", ";", "return", "false", ";", "}", "return", "true", ";", "}", "public", "ASTNode", "[", "]", "fragments", "(", ")", "{", "ASTNode", "[", "]", "fragments", "=", "new", "ASTNode", "[", "this", ".", "fragmentsList", ".", "size", "(", ")", "]", ";", "this", ".", "fragmentsList", ".", "toArray", "(", "fragments", ")", ";", "return", "fragments", ";", "}", "public", "int", "[", "]", "operators", "(", ")", "{", "int", "length", "=", "this", ".", "operatorsList", ".", "size", "(", ")", ";", "int", "[", "]", "tab", "=", "new", "int", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "tab", "[", "i", "]", "=", "(", "(", "Integer", ")", "this", ".", "operatorsList", ".", "get", "(", "i", ")", ")", ".", "intValue", "(", ")", ";", "}", "return", "tab", ";", "}", "public", "int", "realFragmentsSize", "(", ")", "{", "return", "this", ".", "realFragmentsSize", ";", "}", "public", "boolean", "visit", "(", "AllocationExpression", "allocationExpression", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "allocationExpression", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "AND_AND_Expression", "and_and_Expression", ",", "BlockScope", "scope", ")", "{", "if", "(", "(", "(", "and_and_Expression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ")", "!=", "0", ")", "{", "addRealFragment", "(", "and_and_Expression", ")", ";", "}", "else", "{", "and_and_Expression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameAND_AND", ")", ")", ";", "and_and_Expression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayAllocationExpression", "arrayAllocationExpression", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "arrayAllocationExpression", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayInitializer", "arrayInitializer", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "arrayInitializer", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayQualifiedTypeReference", "arrayQualifiedTypeReference", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "arrayQualifiedTypeReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayQualifiedTypeReference", "arrayQualifiedTypeReference", ",", "ClassScope", "scope", ")", "{", "addRealFragment", "(", "arrayQualifiedTypeReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayReference", "arrayReference", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "arrayReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayTypeReference", "arrayTypeReference", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "arrayTypeReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ArrayTypeReference", "arrayTypeReference", ",", "ClassScope", "scope", ")", "{", "addRealFragment", "(", "arrayTypeReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "Assignment", "assignment", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "assignment", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "BinaryExpression", "binaryExpression", ",", "BlockScope", "scope", ")", "{", "if", "(", "binaryExpression", "instanceof", "CombinedBinaryExpression", ")", "{", "CombinedBinaryExpression", "expression", "=", "(", "CombinedBinaryExpression", ")", "binaryExpression", ";", "if", "(", "expression", ".", "referencesTable", "!=", "null", ")", "{", "return", "this", ".", "visit", "(", "expression", ",", "scope", ")", ";", "}", "}", "final", "int", "numberOfParens", "=", "(", "binaryExpression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ";", "if", "(", "numberOfParens", ">", "0", ")", "{", "addRealFragment", "(", "binaryExpression", ")", ";", "}", "else", "{", "switch", "(", "(", "binaryExpression", ".", "bits", "&", "ASTNode", ".", "OperatorMASK", ")", ">>", "ASTNode", ".", "OperatorSHIFT", ")", "{", "case", "OperatorIds", ".", "PLUS", ":", "if", "(", "buildFragments", "(", "binaryExpression", ")", ")", "{", "binaryExpression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNamePLUS", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "case", "OperatorIds", ".", "MINUS", ":", "if", "(", "buildFragments", "(", "binaryExpression", ")", ")", "{", "binaryExpression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameMINUS", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "case", "OperatorIds", ".", "MULTIPLY", ":", "if", "(", "buildFragments", "(", "binaryExpression", ")", ")", "{", "binaryExpression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameMULTIPLY", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "case", "OperatorIds", ".", "REMAINDER", ":", "if", "(", "buildFragments", "(", "binaryExpression", ")", ")", "{", "binaryExpression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameREMAINDER", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "case", "OperatorIds", ".", "XOR", ":", "if", "(", "buildFragments", "(", "binaryExpression", ")", ")", "{", "binaryExpression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameXOR", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "case", "OperatorIds", ".", "DIVIDE", ":", "if", "(", "buildFragments", "(", "binaryExpression", ")", ")", "{", "binaryExpression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameDIVIDE", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "case", "OperatorIds", ".", "OR", ":", "if", "(", "buildFragments", "(", "binaryExpression", ")", ")", "{", "binaryExpression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameOR", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "case", "OperatorIds", ".", "AND", ":", "if", "(", "buildFragments", "(", "binaryExpression", ")", ")", "{", "binaryExpression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameAND", ")", ")", ";", "binaryExpression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "default", ":", "addRealFragment", "(", "binaryExpression", ")", ";", "}", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "CombinedBinaryExpression", "combinedBinaryExpression", ",", "BlockScope", "scope", ")", "{", "if", "(", "combinedBinaryExpression", ".", "referencesTable", "==", "null", ")", "{", "addRealFragment", "(", "combinedBinaryExpression", ".", "left", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNamePLUS", ")", ")", ";", "addRealFragment", "(", "combinedBinaryExpression", ".", "right", ")", ";", "return", "false", ";", "}", "BinaryExpression", "cursor", "=", "combinedBinaryExpression", ".", "referencesTable", "[", "0", "]", ";", "if", "(", "cursor", ".", "left", "instanceof", "CombinedBinaryExpression", ")", "{", "this", ".", "visit", "(", "(", "CombinedBinaryExpression", ")", "cursor", ".", "left", ",", "scope", ")", ";", "}", "else", "{", "addRealFragment", "(", "cursor", ".", "left", ")", ";", "}", "for", "(", "int", "i", "=", "0", ",", "end", "=", "combinedBinaryExpression", ".", "arity", ";", "i", "<", "end", ";", "i", "++", ")", "{", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNamePLUS", ")", ")", ";", "addRealFragment", "(", "combinedBinaryExpression", ".", "referencesTable", "[", "i", "]", ".", "right", ")", ";", "}", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNamePLUS", ")", ")", ";", "addRealFragment", "(", "combinedBinaryExpression", ".", "right", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "CastExpression", "castExpression", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "castExpression", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "CharLiteral", "charLiteral", ",", "BlockScope", "scope", ")", "{", "addSmallFragment", "(", "charLiteral", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ClassLiteralAccess", "classLiteralAccess", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "classLiteralAccess", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "CompoundAssignment", "compoundAssignment", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "compoundAssignment", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ConditionalExpression", "conditionalExpression", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "conditionalExpression", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "DoubleLiteral", "doubleLiteral", ",", "BlockScope", "scope", ")", "{", "addSmallFragment", "(", "doubleLiteral", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "EqualExpression", "equalExpression", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "equalExpression", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ExtendedStringLiteral", "extendedStringLiteral", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "extendedStringLiteral", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "FalseLiteral", "falseLiteral", ",", "BlockScope", "scope", ")", "{", "addSmallFragment", "(", "falseLiteral", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "FieldReference", "fieldReference", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "fieldReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "FloatLiteral", "floatLiteral", ",", "BlockScope", "scope", ")", "{", "addSmallFragment", "(", "floatLiteral", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "InstanceOfExpression", "instanceOfExpression", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "instanceOfExpression", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "IntLiteral", "intLiteral", ",", "BlockScope", "scope", ")", "{", "addSmallFragment", "(", "intLiteral", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "LongLiteral", "longLiteral", ",", "BlockScope", "scope", ")", "{", "addSmallFragment", "(", "longLiteral", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "MessageSend", "messageSend", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "messageSend", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "StringLiteralConcatenation", "stringLiteral", ",", "BlockScope", "scope", ")", "{", "if", "(", "(", "(", "stringLiteral", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ")", "!=", "0", ")", "{", "addRealFragment", "(", "stringLiteral", ")", ";", "}", "else", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "stringLiteral", ".", "counter", ";", "i", "<", "max", ";", "i", "++", ")", "{", "addRealFragment", "(", "stringLiteral", ".", "literals", "[", "i", "]", ")", ";", "if", "(", "i", "<", "max", "-", "1", ")", "{", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNamePLUS", ")", ")", ";", "}", "}", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "NullLiteral", "nullLiteral", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "nullLiteral", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "OR_OR_Expression", "or_or_Expression", ",", "BlockScope", "scope", ")", "{", "if", "(", "(", "(", "or_or_Expression", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", ")", "!=", "0", ")", "{", "addRealFragment", "(", "or_or_Expression", ")", ";", "}", "else", "{", "or_or_Expression", ".", "left", ".", "traverse", "(", "this", ",", "scope", ")", ";", "this", ".", "operatorsList", ".", "add", "(", "new", "Integer", "(", "TerminalTokens", ".", "TokenNameOR_OR", ")", ")", ";", "or_or_Expression", ".", "right", ".", "traverse", "(", "this", ",", "scope", ")", ";", "}", "return", "false", ";", "}", "public", "boolean", "visit", "(", "PostfixExpression", "postfixExpression", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "postfixExpression", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "PrefixExpression", "prefixExpression", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "prefixExpression", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "QualifiedAllocationExpression", "qualifiedAllocationExpression", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "qualifiedAllocationExpression", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "QualifiedNameReference", "qualifiedNameReference", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "qualifiedNameReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "QualifiedSuperReference", "qualifiedSuperReference", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "qualifiedSuperReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "QualifiedThisReference", "qualifiedThisReference", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "qualifiedThisReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "SingleNameReference", "singleNameReference", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "singleNameReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "StringLiteral", "stringLiteral", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "stringLiteral", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "SuperReference", "superReference", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "superReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "ThisReference", "thisReference", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "thisReference", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "TrueLiteral", "trueLiteral", ",", "BlockScope", "scope", ")", "{", "addSmallFragment", "(", "trueLiteral", ")", ";", "return", "false", ";", "}", "public", "boolean", "visit", "(", "UnaryExpression", "unaryExpression", ",", "BlockScope", "scope", ")", "{", "addRealFragment", "(", "unaryExpression", ")", ";", "return", "false", ";", "}", "public", "int", "size", "(", ")", "{", "return", "this", ".", "fragmentsList", ".", "size", "(", ")", ";", "}", "}", "</s>" ]
3,959
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "public", "class", "FormatJavadocReference", "extends", "FormatJavadocNode", "{", "public", "FormatJavadocReference", "(", "int", "start", ",", "int", "end", ",", "int", "line", ")", "{", "super", "(", "start", ",", "end", ",", "line", ")", ";", "}", "public", "FormatJavadocReference", "(", "long", "position", ",", "int", "line", ")", "{", "super", "(", "(", "int", ")", "(", "position", ">>>", "32", ")", ",", "(", "int", ")", "position", ",", "line", ")", ";", "}", "void", "clean", "(", ")", "{", "}", "protected", "void", "toString", "(", "StringBuffer", "buffer", ")", "{", "buffer", ".", "append", "(", "\"ref\"", ")", ";", "super", ".", "toString", "(", "buffer", ")", ";", "}", "}", "</s>" ]
3,960
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ASTVisitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MessageSend", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "class", "CascadingMethodInvocationFragmentBuilder", "extends", "ASTVisitor", "{", "ArrayList", "fragmentsList", ";", "CascadingMethodInvocationFragmentBuilder", "(", ")", "{", "this", ".", "fragmentsList", "=", "new", "ArrayList", "(", ")", ";", "}", "public", "MessageSend", "[", "]", "fragments", "(", ")", "{", "MessageSend", "[", "]", "fragments", "=", "new", "MessageSend", "[", "this", ".", "fragmentsList", ".", "size", "(", ")", "]", ";", "this", ".", "fragmentsList", ".", "toArray", "(", "fragments", ")", ";", "return", "fragments", ";", "}", "public", "int", "size", "(", ")", "{", "return", "this", ".", "fragmentsList", ".", "size", "(", ")", ";", "}", "public", "boolean", "visit", "(", "MessageSend", "messageSend", ",", "BlockScope", "scope", ")", "{", "if", "(", "(", "messageSend", ".", "receiver", ".", "bits", "&", "ASTNode", ".", "ParenthesizedMASK", ")", ">>", "ASTNode", ".", "ParenthesizedSHIFT", "==", "0", ")", "{", "if", "(", "messageSend", ".", "receiver", "instanceof", "MessageSend", ")", "{", "this", ".", "fragmentsList", ".", "add", "(", "0", ",", "messageSend", ")", ";", "messageSend", ".", "receiver", ".", "traverse", "(", "this", ",", "scope", ")", ";", "return", "false", ";", "}", "this", ".", "fragmentsList", ".", "add", "(", "0", ",", "messageSend", ")", ";", "this", ".", "fragmentsList", ".", "add", "(", "1", ",", "messageSend", ")", ";", "}", "else", "{", "this", ".", "fragmentsList", ".", "add", "(", "0", ",", "messageSend", ")", ";", "this", ".", "fragmentsList", ".", "add", "(", "1", ",", "messageSend", ")", ";", "}", "return", "false", ";", "}", "}", "</s>" ]
3,961
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "java", ".", "util", ".", "List", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "InvalidInputException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "JavadocParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "TerminalTokens", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ".", "IJavaDocTagConstants", ";", "public", "class", "FormatterCommentParser", "extends", "JavadocParser", "implements", "IJavaDocTagConstants", "{", "char", "[", "]", "[", "]", "htmlTags", ";", "int", "htmlTagsPtr", "=", "-", "1", ";", "int", "inlineHtmlTagsPtr", "=", "-", "1", ";", "private", "boolean", "invalidTagName", ";", "public", "boolean", "parseHtmlTags", ";", "public", "FormatterCommentParser", "(", "long", "sourceLevel", ")", "{", "super", "(", "null", ")", ";", "this", ".", "kind", "=", "FORMATTER_COMMENT_PARSER", "|", "TEXT_PARSE", ";", "this", ".", "reportProblems", "=", "false", ";", "this", ".", "checkDocComment", "=", "true", ";", "this", ".", "sourceLevel", "=", "sourceLevel", ";", "}", "public", "boolean", "parse", "(", "int", "start", ",", "int", "end", ")", "{", "this", ".", "javadocStart", "=", "start", ";", "this", ".", "javadocEnd", "=", "end", ";", "this", ".", "firstTagPosition", "=", "this", ".", "javadocStart", ";", "this", ".", "htmlTagsPtr", "=", "-", "1", ";", "boolean", "valid", "=", "commentParse", "(", ")", ";", "return", "valid", "&&", "this", ".", "docComment", "!=", "null", ";", "}", "protected", "Object", "createArgumentReference", "(", "char", "[", "]", "name", ",", "int", "dim", ",", "boolean", "isVarargs", ",", "Object", "ref", ",", "long", "[", "]", "dimPositions", ",", "long", "argNamePos", ")", "throws", "InvalidInputException", "{", "FormatJavadocReference", "typeRef", "=", "(", "FormatJavadocReference", ")", "ref", ";", "if", "(", "dim", ">", "0", ")", "{", "typeRef", ".", "sourceEnd", "=", "(", "int", ")", "dimPositions", "[", "dim", "-", "1", "]", ";", "}", "if", "(", "argNamePos", ">=", "0", ")", "typeRef", ".", "sourceEnd", "=", "(", "int", ")", "argNamePos", ";", "return", "ref", ";", "}", "protected", "boolean", "createFakeReference", "(", "int", "start", ")", "{", "this", ".", "scanner", ".", "currentPosition", "=", "this", ".", "index", ";", "int", "lineStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "start", ")", ";", "FormatJavadocReference", "reference", "=", "new", "FormatJavadocReference", "(", "start", ",", "this", ".", "index", "-", "1", ",", "lineStart", ")", ";", "return", "pushSeeRef", "(", "reference", ")", ";", "}", "protected", "Object", "createFieldReference", "(", "Object", "receiver", ")", "throws", "InvalidInputException", "{", "int", "start", "=", "receiver", "==", "null", "?", "this", ".", "memberStart", ":", "(", "(", "FormatJavadocReference", ")", "receiver", ")", ".", "sourceStart", ";", "int", "lineStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "start", ")", ";", "return", "new", "FormatJavadocReference", "(", "start", ",", "(", "int", ")", "this", ".", "identifierPositionStack", "[", "0", "]", ",", "lineStart", ")", ";", "}", "protected", "Object", "createMethodReference", "(", "Object", "receiver", ",", "List", "arguments", ")", "throws", "InvalidInputException", "{", "int", "start", "=", "receiver", "==", "null", "?", "this", ".", "memberStart", ":", "(", "(", "FormatJavadocReference", ")", "receiver", ")", ".", "sourceStart", ";", "int", "lineStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "start", ")", ";", "return", "new", "FormatJavadocReference", "(", "start", ",", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ",", "lineStart", ")", ";", "}", "protected", "void", "createTag", "(", ")", "{", "int", "lineStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "this", ".", "tagSourceStart", ")", ";", "if", "(", "this", ".", "inlineTagStarted", ")", "{", "FormatJavadocBlock", "block", "=", "new", "FormatJavadocBlock", "(", "this", ".", "inlineTagStart", ",", "this", ".", "tagSourceEnd", ",", "lineStart", ",", "this", ".", "tagValue", ")", ";", "FormatJavadocBlock", "previousBlock", "=", "null", ";", "if", "(", "this", ".", "astPtr", "==", "-", "1", ")", "{", "previousBlock", "=", "new", "FormatJavadocBlock", "(", "this", ".", "inlineTagStart", ",", "this", ".", "tagSourceEnd", ",", "lineStart", ",", "NO_TAG_VALUE", ")", ";", "pushOnAstStack", "(", "previousBlock", ",", "true", ")", ";", "}", "else", "{", "previousBlock", "=", "(", "FormatJavadocBlock", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "}", "previousBlock", ".", "addBlock", "(", "block", ",", "this", ".", "htmlTagsPtr", "==", "-", "1", "?", "0", ":", "this", ".", "htmlTagsPtr", ")", ";", "}", "else", "{", "FormatJavadocBlock", "block", "=", "new", "FormatJavadocBlock", "(", "this", ".", "tagSourceStart", ",", "this", ".", "tagSourceEnd", ",", "lineStart", ",", "this", ".", "tagValue", ")", ";", "pushOnAstStack", "(", "block", ",", "true", ")", ";", "}", "}", "protected", "Object", "createTypeReference", "(", "int", "primitiveToken", ")", "{", "int", "size", "=", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "]", ";", "if", "(", "size", "==", "0", ")", "return", "null", ";", "int", "start", "=", "(", "int", ")", "(", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ">>>", "32", ")", ";", "int", "lineStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "start", ")", ";", "if", "(", "size", "==", "1", ")", "{", "return", "new", "FormatJavadocReference", "(", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ",", "lineStart", ")", ";", "}", "long", "[", "]", "positions", "=", "new", "long", "[", "size", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "this", ".", "identifierPtr", "-", "size", "+", "1", ",", "positions", ",", "0", ",", "size", ")", ";", "return", "new", "FormatJavadocReference", "(", "(", "int", ")", "(", "positions", "[", "0", "]", ">>>", "32", ")", ",", "(", "int", ")", "positions", "[", "positions", ".", "length", "-", "1", "]", ",", "lineStart", ")", ";", "}", "private", "int", "getHtmlTagIndex", "(", "char", "[", "]", "htmlTag", ")", "{", "int", "length", "=", "htmlTag", "==", "null", "?", "0", ":", "htmlTag", ".", "length", ";", "int", "tagId", "=", "0", ";", "if", "(", "length", ">", "0", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "JAVADOC_SINGLE_BREAK_TAG", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "char", "[", "]", "tag", "=", "JAVADOC_SINGLE_BREAK_TAG", "[", "i", "]", ";", "if", "(", "length", "==", "tag", ".", "length", "&&", "CharOperation", ".", "equals", "(", "htmlTag", ",", "tag", ",", "false", ")", ")", "{", "return", "(", "tagId", "|", "JAVADOC_SINGLE_BREAK_TAG_ID", ")", "+", "i", ";", "}", "}", "for", "(", "int", "i", "=", "0", ",", "max", "=", "JAVADOC_CODE_TAGS", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "char", "[", "]", "tag", "=", "JAVADOC_CODE_TAGS", "[", "i", "]", ";", "if", "(", "length", "==", "tag", ".", "length", "&&", "CharOperation", ".", "equals", "(", "htmlTag", ",", "tag", ",", "false", ")", ")", "{", "return", "(", "tagId", "|", "JAVADOC_CODE_TAGS_ID", ")", "+", "i", ";", "}", "}", "for", "(", "int", "i", "=", "0", ",", "max", "=", "JAVADOC_BREAK_TAGS", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "char", "[", "]", "tag", "=", "JAVADOC_BREAK_TAGS", "[", "i", "]", ";", "if", "(", "length", "==", "tag", ".", "length", "&&", "CharOperation", ".", "equals", "(", "htmlTag", ",", "tag", ",", "false", ")", ")", "{", "return", "(", "tagId", "|", "JAVADOC_BREAK_TAGS_ID", ")", "+", "i", ";", "}", "}", "for", "(", "int", "i", "=", "0", ",", "max", "=", "JAVADOC_IMMUTABLE_TAGS", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "char", "[", "]", "tag", "=", "JAVADOC_IMMUTABLE_TAGS", "[", "i", "]", ";", "if", "(", "length", "==", "tag", ".", "length", "&&", "CharOperation", ".", "equals", "(", "htmlTag", ",", "tag", ",", "false", ")", ")", "{", "return", "(", "tagId", "|", "JAVADOC_IMMUTABLE_TAGS_ID", ")", "+", "i", ";", "}", "}", "for", "(", "int", "i", "=", "0", ",", "max", "=", "JAVADOC_SEPARATOR_TAGS", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "char", "[", "]", "tag", "=", "JAVADOC_SEPARATOR_TAGS", "[", "i", "]", ";", "if", "(", "length", "==", "tag", ".", "length", "&&", "CharOperation", ".", "equals", "(", "htmlTag", ",", "tag", ",", "false", ")", ")", "{", "return", "(", "tagId", "|", "JAVADOC_SEPARATOR_TAGS_ID", ")", "+", "i", ";", "}", "}", "}", "return", "JAVADOC_TAGS_ID_MASK", ";", "}", "protected", "boolean", "parseHtmlTag", "(", "int", "previousPosition", ",", "int", "endTextPosition", ")", "throws", "InvalidInputException", "{", "if", "(", "!", "this", ".", "parseHtmlTags", ")", "return", "false", ";", "boolean", "closing", "=", "false", ";", "boolean", "valid", "=", "false", ";", "boolean", "incremented", "=", "false", ";", "int", "start", "=", "this", ".", "scanner", ".", "currentPosition", ";", "int", "currentPosition", "=", "start", ";", "int", "htmlPtr", "=", "this", ".", "htmlTagsPtr", ";", "char", "firstChar", "=", "peekChar", "(", ")", ";", "boolean", "hasWhitespaces", "=", "firstChar", "==", "'", "'", "||", "ScannerHelper", ".", "isWhitespace", "(", "firstChar", ")", ";", "try", "{", "int", "token", "=", "readTokenAndConsume", "(", ")", ";", "char", "[", "]", "htmlTag", ";", "int", "htmlIndex", ";", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameIdentifier", ":", "htmlTag", "=", "this", ".", "scanner", ".", "getCurrentIdentifierSource", "(", ")", ";", "htmlIndex", "=", "getHtmlTagIndex", "(", "htmlTag", ")", ";", "if", "(", "htmlIndex", "==", "JAVADOC_TAGS_ID_MASK", ")", "return", "false", ";", "if", "(", "htmlPtr", ">=", "0", ")", "{", "int", "lastHtmlTagIndex", "=", "getHtmlTagIndex", "(", "this", ".", "htmlTags", "[", "htmlPtr", "]", ")", ";", "if", "(", "(", "lastHtmlTagIndex", "&", "JAVADOC_TAGS_ID_MASK", ")", "==", "JAVADOC_IMMUTABLE_TAGS_ID", ")", "{", "if", "(", "(", "htmlIndex", "&", "JAVADOC_TAGS_ID_MASK", ")", "==", "JAVADOC_CODE_TAGS_ID", ")", "{", "FormatJavadocBlock", "previousBlock", "=", "(", "FormatJavadocBlock", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "FormatJavadocNode", "parentNode", "=", "previousBlock", ";", "FormatJavadocNode", "lastNode", "=", "parentNode", ";", "while", "(", "lastNode", ".", "getLastNode", "(", ")", "!=", "null", ")", "{", "parentNode", "=", "lastNode", ";", "lastNode", "=", "lastNode", ".", "getLastNode", "(", ")", ";", "}", "if", "(", "lastNode", ".", "isText", "(", ")", ")", "{", "FormatJavadocText", "text", "=", "(", "FormatJavadocText", ")", "lastNode", ";", "if", "(", "text", ".", "separatorsPtr", "==", "-", "1", ")", "{", "break", ";", "}", "}", "}", "return", "false", ";", "}", "}", "if", "(", "(", "htmlIndex", "&", "JAVADOC_TAGS_ID_MASK", ")", ">", "JAVADOC_SINGLE_TAGS_ID", ")", "{", "if", "(", "this", ".", "htmlTagsPtr", "==", "-", "1", "||", "!", "CharOperation", ".", "equals", "(", "this", ".", "htmlTags", "[", "this", ".", "htmlTagsPtr", "]", ",", "htmlTag", ",", "false", ")", ")", "{", "if", "(", "++", "this", ".", "htmlTagsPtr", "==", "0", ")", "{", "this", ".", "htmlTags", "=", "new", "char", "[", "AST_STACK_INCREMENT", "]", "[", "]", ";", "}", "else", "{", "if", "(", "this", ".", "htmlTagsPtr", "==", "this", ".", "htmlTags", ".", "length", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "htmlTags", ",", "0", ",", "(", "this", ".", "htmlTags", "=", "new", "char", "[", "this", ".", "htmlTags", ".", "length", "+", "AST_STACK_INCREMENT", "]", "[", "]", ")", ",", "0", ",", "this", ".", "htmlTagsPtr", ")", ";", "}", "}", "this", ".", "htmlTags", "[", "this", ".", "htmlTagsPtr", "]", "=", "htmlTag", ";", "incremented", "=", "true", ";", "}", "}", "currentPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "if", "(", "readToken", "(", ")", "==", "TerminalTokens", ".", "TokenNameDIVIDE", ")", "{", "consumeToken", "(", ")", ";", "}", "break", ";", "case", "TerminalTokens", ".", "TokenNameDIVIDE", ":", "if", "(", "this", ".", "htmlTagsPtr", "==", "-", "1", ")", "return", "false", ";", "htmlTag", "=", "this", ".", "htmlTags", "[", "this", ".", "htmlTagsPtr", "]", ";", "if", "(", "(", "token", "=", "readTokenAndConsume", "(", ")", ")", "!=", "TerminalTokens", ".", "TokenNameIdentifier", ")", "{", "return", "false", ";", "}", "char", "[", "]", "identifier", "=", "this", ".", "scanner", ".", "getCurrentIdentifierSource", "(", ")", ";", "htmlIndex", "=", "getHtmlTagIndex", "(", "identifier", ")", ";", "if", "(", "htmlIndex", "==", "JAVADOC_TAGS_ID_MASK", ")", "return", "false", ";", "int", "ptr", "=", "this", ".", "htmlTagsPtr", ";", "while", "(", "!", "CharOperation", ".", "equals", "(", "htmlTag", ",", "identifier", ",", "false", ")", ")", "{", "if", "(", "this", ".", "htmlTagsPtr", "<=", "0", ")", "{", "this", ".", "htmlTagsPtr", "=", "ptr", ";", "return", "false", ";", "}", "this", ".", "htmlTagsPtr", "--", ";", "htmlTag", "=", "this", ".", "htmlTags", "[", "this", ".", "htmlTagsPtr", "]", ";", "}", "htmlIndex", "|=", "JAVADOC_CLOSED_TAG", ";", "closing", "=", "true", ";", "currentPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "default", ":", "return", "false", ";", "}", "switch", "(", "readTokenAndConsume", "(", ")", ")", "{", "case", "TerminalTokens", ".", "TokenNameLESS", ":", "case", "TerminalTokens", ".", "TokenNameLESS_EQUAL", ":", "return", "false", ";", "case", "TerminalTokens", ".", "TokenNameGREATER", ":", "break", ";", "case", "TerminalTokens", ".", "TokenNameGREATER_EQUAL", ":", "case", "TerminalTokens", ".", "TokenNameRIGHT_SHIFT", ":", "case", "TerminalTokens", ".", "TokenNameRIGHT_SHIFT_EQUAL", ":", "break", ";", "default", ":", "this", ".", "index", "=", "currentPosition", ";", "loop", ":", "while", "(", "true", ")", "{", "switch", "(", "readChar", "(", ")", ")", "{", "case", "'<'", ":", "if", "(", "hasWhitespaces", ")", "{", "return", "false", ";", "}", "this", ".", "index", "=", "currentPosition", ";", "this", ".", "scanner", ".", "startPosition", "=", "currentPosition", ";", "this", ".", "scanner", ".", "currentPosition", "=", "currentPosition", ";", "this", ".", "scanner", ".", "currentCharacter", "=", "'<'", ";", "break", "loop", ";", "case", "'>'", ":", "this", ".", "scanner", ".", "startPosition", "=", "this", ".", "index", ";", "this", ".", "scanner", ".", "currentPosition", "=", "this", ".", "index", ";", "this", ".", "scanner", ".", "currentCharacter", "=", "peekChar", "(", ")", ";", "break", "loop", ";", "default", ":", "break", ";", "}", "if", "(", "this", ".", "index", ">=", "this", ".", "javadocTextEnd", ")", "{", "this", ".", "index", "=", "currentPosition", ";", "this", ".", "scanner", ".", "startPosition", "=", "currentPosition", ";", "this", ".", "scanner", ".", "currentPosition", "=", "currentPosition", ";", "break", ";", "}", "}", "}", "if", "(", "this", ".", "lineStarted", "&&", "this", ".", "textStart", "!=", "-", "1", "&&", "this", ".", "textStart", "<", "endTextPosition", ")", "{", "pushText", "(", "this", ".", "textStart", ",", "endTextPosition", ",", "-", "1", ",", "htmlPtr", ")", ";", "}", "pushText", "(", "previousPosition", ",", "this", ".", "index", ",", "htmlIndex", ",", "this", ".", "htmlTagsPtr", ")", ";", "this", ".", "textStart", "=", "-", "1", ";", "valid", "=", "true", ";", "}", "finally", "{", "if", "(", "valid", ")", "{", "if", "(", "closing", ")", "{", "this", ".", "htmlTagsPtr", "--", ";", "}", "}", "else", "if", "(", "!", "this", ".", "abort", ")", "{", "if", "(", "incremented", ")", "{", "this", ".", "htmlTagsPtr", "--", ";", "if", "(", "this", ".", "htmlTagsPtr", "==", "-", "1", ")", "this", ".", "htmlTags", "=", "null", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "start", ",", "this", ".", "scanner", ".", "eofPosition", "-", "1", ")", ";", "this", ".", "index", "=", "start", ";", "}", "}", "return", "valid", ";", "}", "protected", "boolean", "parseIdentifierTag", "(", "boolean", "report", ")", "{", "if", "(", "super", ".", "parseIdentifierTag", "(", "report", ")", ")", "{", "createTag", "(", ")", ";", "this", ".", "index", "=", "this", ".", "tagSourceEnd", "+", "1", ";", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "index", ",", "this", ".", "javadocEnd", ")", ";", "return", "true", ";", "}", "this", ".", "tagValue", "=", "TAG_OTHERS_VALUE", ";", "return", "false", ";", "}", "protected", "boolean", "parseParam", "(", ")", "throws", "InvalidInputException", "{", "boolean", "valid", "=", "super", ".", "parseParam", "(", ")", ";", "if", "(", "!", "valid", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "tagSourceEnd", "+", "1", ",", "this", ".", "javadocEnd", ")", ";", "this", ".", "index", "=", "this", ".", "tagSourceEnd", "+", "1", ";", "char", "ch", "=", "peekChar", "(", ")", ";", "if", "(", "ch", "==", "'", "'", "||", "ScannerHelper", ".", "isWhitespace", "(", "ch", ")", ")", "{", "int", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameIdentifier", ")", "{", "ch", "=", "peekChar", "(", ")", ";", "if", "(", "ch", "==", "'", "'", "||", "ScannerHelper", ".", "isWhitespace", "(", "ch", ")", ")", "{", "pushIdentifier", "(", "true", ",", "false", ")", ";", "pushParamName", "(", "false", ")", ";", "this", ".", "index", "=", "this", ".", "scanner", ".", "currentPosition", ";", "valid", "=", "true", ";", "}", "}", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "tagSourceEnd", "+", "1", ",", "this", ".", "javadocEnd", ")", ";", "}", "this", ".", "tagValue", "=", "TAG_OTHERS_VALUE", ";", "}", "return", "valid", ";", "}", "protected", "boolean", "parseReference", "(", ")", "throws", "InvalidInputException", "{", "boolean", "valid", "=", "super", ".", "parseReference", "(", ")", ";", "if", "(", "!", "valid", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "tagSourceEnd", "+", "1", ",", "this", ".", "javadocEnd", ")", ";", "this", ".", "index", "=", "this", ".", "tagSourceEnd", "+", "1", ";", "this", ".", "tagValue", "=", "TAG_OTHERS_VALUE", ";", "}", "return", "valid", ";", "}", "protected", "boolean", "parseReturn", "(", ")", "{", "createTag", "(", ")", ";", "return", "true", ";", "}", "protected", "boolean", "parseTag", "(", "int", "previousPosition", ")", "throws", "InvalidInputException", "{", "if", "(", "this", ".", "htmlTagsPtr", ">=", "0", ")", "{", "int", "ptr", "=", "this", ".", "htmlTagsPtr", ";", "while", "(", "ptr", ">=", "0", ")", "{", "if", "(", "getHtmlTagIndex", "(", "this", ".", "htmlTags", "[", "ptr", "--", "]", ")", "==", "JAVADOC_CODE_TAGS_ID", ")", "{", "if", "(", "this", ".", "textStart", "==", "-", "1", ")", "this", ".", "textStart", "=", "this", ".", "inlineTagStarted", "?", "this", ".", "inlineTagStart", ":", "previousPosition", ";", "this", ".", "inlineTagStarted", "=", "false", ";", "return", "true", ";", "}", "}", "}", "int", "ptr", "=", "this", ".", "astPtr", ";", "this", ".", "tagSourceStart", "=", "previousPosition", ";", "this", ".", "scanner", ".", "startPosition", "=", "this", ".", "index", ";", "this", ".", "scanner", ".", "currentCharacter", "=", "readChar", "(", ")", ";", "switch", "(", "this", ".", "scanner", ".", "currentCharacter", ")", "{", "case", "'", "'", ":", "case", "'*'", ":", "case", "'}'", ":", "this", ".", "tagSourceEnd", "=", "previousPosition", ";", "if", "(", "this", ".", "textStart", "==", "-", "1", ")", "this", ".", "textStart", "=", "previousPosition", ";", "return", "true", ";", "default", ":", "if", "(", "ScannerHelper", ".", "isWhitespace", "(", "this", ".", "scanner", ".", "currentCharacter", ")", ")", "{", "this", ".", "tagSourceEnd", "=", "previousPosition", ";", "if", "(", "this", ".", "textStart", "==", "-", "1", ")", "this", ".", "textStart", "=", "previousPosition", ";", "return", "true", ";", "}", "break", ";", "}", "int", "currentPosition", "=", "this", ".", "index", ";", "char", "currentChar", "=", "this", ".", "scanner", ".", "currentCharacter", ";", "while", "(", "currentChar", "!=", "'", "'", "&&", "currentChar", "!=", "'*'", "&&", "currentChar", "!=", "'}'", "&&", "!", "ScannerHelper", ".", "isWhitespace", "(", "currentChar", ")", ")", "{", "currentPosition", "=", "this", ".", "index", ";", "currentChar", "=", "readChar", "(", ")", ";", "}", "this", ".", "tagSourceEnd", "=", "currentPosition", "-", "1", ";", "this", ".", "scanner", ".", "currentCharacter", "=", "currentChar", ";", "this", ".", "scanner", ".", "currentPosition", "=", "currentPosition", ";", "char", "[", "]", "tagName", "=", "this", ".", "scanner", ".", "getCurrentIdentifierSource", "(", ")", ";", "int", "length", "=", "tagName", ".", "length", ";", "this", ".", "index", "=", "this", ".", "tagSourceEnd", "+", "1", ";", "this", ".", "tagValue", "=", "TAG_OTHERS_VALUE", ";", "boolean", "valid", "=", "false", ";", "switch", "(", "tagName", "[", "0", "]", ")", "{", "case", "'a'", ":", "if", "(", "length", "==", "TAG_AUTHOR_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_AUTHOR", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_AUTHOR_VALUE", ";", "}", "break", ";", "case", "'c'", ":", "if", "(", "length", "==", "TAG_CATEGORY_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_CATEGORY", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_CATEGORY_VALUE", ";", "valid", "=", "parseIdentifierTag", "(", "false", ")", ";", "}", "else", "if", "(", "length", "==", "TAG_CODE_LENGTH", "&&", "this", ".", "inlineTagStarted", "&&", "CharOperation", ".", "equals", "(", "TAG_CODE", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_CODE_VALUE", ";", "}", "break", ";", "case", "'d'", ":", "if", "(", "length", "==", "TAG_DEPRECATED_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_DEPRECATED", ",", "tagName", ")", ")", "{", "this", ".", "deprecated", "=", "true", ";", "valid", "=", "true", ";", "this", ".", "tagValue", "=", "TAG_DEPRECATED_VALUE", ";", "}", "else", "if", "(", "length", "==", "TAG_DOC_ROOT_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_DOC_ROOT", ",", "tagName", ")", ")", "{", "valid", "=", "true", ";", "this", ".", "tagValue", "=", "TAG_DOC_ROOT_VALUE", ";", "}", "break", ";", "case", "'e'", ":", "if", "(", "length", "==", "TAG_EXCEPTION_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_EXCEPTION", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_EXCEPTION_VALUE", ";", "valid", "=", "parseThrows", "(", ")", ";", "}", "break", ";", "case", "'i'", ":", "if", "(", "length", "==", "TAG_INHERITDOC_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_INHERITDOC", ",", "tagName", ")", ")", "{", "if", "(", "this", ".", "reportProblems", ")", "{", "recordInheritedPosition", "(", "(", "(", "(", "long", ")", "this", ".", "tagSourceStart", ")", "<<", "32", ")", "+", "this", ".", "tagSourceEnd", ")", ";", "}", "valid", "=", "true", ";", "this", ".", "tagValue", "=", "TAG_INHERITDOC_VALUE", ";", "}", "break", ";", "case", "'l'", ":", "if", "(", "length", "==", "TAG_LINK_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_LINK", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_LINK_VALUE", ";", "if", "(", "this", ".", "inlineTagStarted", "||", "(", "this", ".", "kind", "&", "COMPLETION_PARSER", ")", "!=", "0", ")", "{", "valid", "=", "parseReference", "(", ")", ";", "}", "else", "{", "valid", "=", "false", ";", "if", "(", "this", ".", "reportProblems", ")", "{", "this", ".", "sourceParser", ".", "problemReporter", "(", ")", ".", "javadocUnexpectedTag", "(", "this", ".", "tagSourceStart", ",", "this", ".", "tagSourceEnd", ")", ";", "}", "}", "}", "else", "if", "(", "length", "==", "TAG_LINKPLAIN_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_LINKPLAIN", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_LINKPLAIN_VALUE", ";", "if", "(", "this", ".", "inlineTagStarted", ")", "{", "valid", "=", "parseReference", "(", ")", ";", "}", "else", "{", "valid", "=", "false", ";", "if", "(", "this", ".", "reportProblems", ")", "{", "this", ".", "sourceParser", ".", "problemReporter", "(", ")", ".", "javadocUnexpectedTag", "(", "this", ".", "tagSourceStart", ",", "this", ".", "tagSourceEnd", ")", ";", "}", "}", "}", "else", "if", "(", "length", "==", "TAG_LITERAL_LENGTH", "&&", "this", ".", "inlineTagStarted", "&&", "CharOperation", ".", "equals", "(", "TAG_LITERAL", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_LITERAL_VALUE", ";", "}", "break", ";", "case", "'p'", ":", "if", "(", "length", "==", "TAG_PARAM_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_PARAM", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_PARAM_VALUE", ";", "valid", "=", "parseParam", "(", ")", ";", "}", "break", ";", "case", "'s'", ":", "if", "(", "length", "==", "TAG_SEE_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_SEE", ",", "tagName", ")", ")", "{", "if", "(", "this", ".", "inlineTagStarted", ")", "{", "valid", "=", "false", ";", "if", "(", "this", ".", "reportProblems", ")", "{", "this", ".", "sourceParser", ".", "problemReporter", "(", ")", ".", "javadocUnexpectedTag", "(", "this", ".", "tagSourceStart", ",", "this", ".", "tagSourceEnd", ")", ";", "}", "}", "else", "{", "this", ".", "tagValue", "=", "TAG_SEE_VALUE", ";", "valid", "=", "parseReference", "(", ")", ";", "}", "}", "else", "if", "(", "length", "==", "TAG_SERIAL_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_SERIAL", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_SERIAL_VALUE", ";", "}", "else", "if", "(", "length", "==", "TAG_SERIAL_DATA_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_SERIAL_DATA", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_SERIAL_DATA_VALUE", ";", "}", "else", "if", "(", "length", "==", "TAG_SERIAL_FIELD_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_SERIAL_FIELD", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_SERIAL_FIELD_VALUE", ";", "}", "else", "if", "(", "length", "==", "TAG_SINCE_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_SINCE", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_SINCE_VALUE", ";", "}", "break", ";", "case", "'v'", ":", "if", "(", "length", "==", "TAG_VALUE_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_VALUE", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_VALUE_VALUE", ";", "if", "(", "this", ".", "sourceLevel", ">=", "ClassFileConstants", ".", "JDK1_5", ")", "{", "if", "(", "this", ".", "inlineTagStarted", ")", "{", "valid", "=", "parseReference", "(", ")", ";", "}", "else", "{", "valid", "=", "false", ";", "if", "(", "this", ".", "reportProblems", ")", "this", ".", "sourceParser", ".", "problemReporter", "(", ")", ".", "javadocUnexpectedTag", "(", "this", ".", "tagSourceStart", ",", "this", ".", "tagSourceEnd", ")", ";", "}", "}", "}", "else", "if", "(", "length", "==", "TAG_VERSION_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_VERSION", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_VERSION_VALUE", ";", "}", "else", "{", "createTag", "(", ")", ";", "}", "break", ";", "case", "'r'", ":", "if", "(", "length", "==", "TAG_RETURN_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_RETURN", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_RETURN_VALUE", ";", "valid", "=", "parseReturn", "(", ")", ";", "}", "break", ";", "case", "'t'", ":", "if", "(", "length", "==", "TAG_THROWS_LENGTH", "&&", "CharOperation", ".", "equals", "(", "TAG_THROWS", ",", "tagName", ")", ")", "{", "this", ".", "tagValue", "=", "TAG_THROWS_VALUE", ";", "valid", "=", "parseThrows", "(", ")", ";", "}", "break", ";", "default", ":", "createTag", "(", ")", ";", "break", ";", "}", "consumeToken", "(", ")", ";", "this", ".", "textStart", "=", "-", "1", ";", "if", "(", "valid", ")", "{", "switch", "(", "this", ".", "tagValue", ")", "{", "case", "TAG_INHERITDOC_VALUE", ":", "case", "TAG_DEPRECATED_VALUE", ":", "createTag", "(", ")", ";", "break", ";", "}", "}", "else", "if", "(", "this", ".", "invalidTagName", ")", "{", "this", ".", "textStart", "=", "previousPosition", ";", "}", "else", "if", "(", "this", ".", "astPtr", "==", "ptr", ")", "{", "createTag", "(", ")", ";", "}", "return", "true", ";", "}", "protected", "boolean", "parseThrows", "(", ")", "{", "boolean", "valid", "=", "super", ".", "parseThrows", "(", ")", ";", "if", "(", "!", "valid", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "tagSourceEnd", "+", "1", ",", "this", ".", "javadocEnd", ")", ";", "this", ".", "index", "=", "this", ".", "tagSourceEnd", "+", "1", ";", "this", ".", "tagValue", "=", "TAG_OTHERS_VALUE", ";", "}", "return", "valid", ";", "}", "protected", "boolean", "pushParamName", "(", "boolean", "isTypeParam", ")", "{", "int", "lineTagStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "this", ".", "tagSourceStart", ")", ";", "FormatJavadocBlock", "block", "=", "new", "FormatJavadocBlock", "(", "this", ".", "tagSourceStart", ",", "this", ".", "tagSourceEnd", ",", "lineTagStart", ",", "TAG_PARAM_VALUE", ")", ";", "int", "start", "=", "(", "int", ")", "(", "this", ".", "identifierPositionStack", "[", "0", "]", ">>>", "32", ")", ";", "int", "lineStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "start", ")", ";", "FormatJavadocReference", "reference", ";", "reference", "=", "new", "FormatJavadocReference", "(", "start", ",", "(", "int", ")", "this", ".", "identifierPositionStack", "[", "isTypeParam", "?", "2", ":", "0", "]", ",", "lineStart", ")", ";", "block", ".", "reference", "=", "reference", ";", "block", ".", "sourceEnd", "=", "reference", ".", "sourceEnd", ";", "pushOnAstStack", "(", "block", ",", "true", ")", ";", "return", "true", ";", "}", "protected", "boolean", "pushSeeRef", "(", "Object", "statement", ")", "{", "FormatJavadocReference", "reference", "=", "(", "FormatJavadocReference", ")", "statement", ";", "int", "lineTagStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "this", ".", "tagSourceStart", ")", ";", "FormatJavadocBlock", "block", "=", "new", "FormatJavadocBlock", "(", "this", ".", "tagSourceStart", ",", "this", ".", "tagSourceEnd", ",", "lineTagStart", ",", "this", ".", "tagValue", ")", ";", "block", ".", "reference", "=", "reference", ";", "block", ".", "sourceEnd", "=", "reference", ".", "sourceEnd", ";", "if", "(", "this", ".", "inlineTagStarted", ")", "{", "block", ".", "sourceStart", "=", "this", ".", "inlineTagStart", ";", "FormatJavadocBlock", "previousBlock", "=", "null", ";", "if", "(", "this", ".", "astPtr", "==", "-", "1", ")", "{", "int", "lineStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "this", ".", "inlineTagStart", ")", ";", "previousBlock", "=", "new", "FormatJavadocBlock", "(", "this", ".", "inlineTagStart", ",", "this", ".", "tagSourceEnd", ",", "lineStart", ",", "NO_TAG_VALUE", ")", ";", "previousBlock", ".", "sourceEnd", "=", "reference", ".", "sourceEnd", ";", "pushOnAstStack", "(", "previousBlock", ",", "true", ")", ";", "}", "else", "{", "previousBlock", "=", "(", "FormatJavadocBlock", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "}", "previousBlock", ".", "addBlock", "(", "block", ",", "this", ".", "htmlTagsPtr", "==", "-", "1", "?", "0", ":", "this", ".", "htmlTagsPtr", ")", ";", "block", ".", "flags", "|=", "FormatJavadocBlock", ".", "INLINED", ";", "}", "else", "{", "pushOnAstStack", "(", "block", ",", "true", ")", ";", "}", "return", "true", ";", "}", "protected", "void", "pushText", "(", "int", "start", ",", "int", "end", ")", "{", "pushText", "(", "start", ",", "end", ",", "-", "1", ",", "this", ".", "htmlTagsPtr", "==", "-", "1", "?", "0", ":", "this", ".", "htmlTagsPtr", ")", ";", "}", "private", "void", "pushText", "(", "int", "start", ",", "int", "end", ",", "int", "htmlIndex", ",", "int", "htmlDepth", ")", "{", "FormatJavadocBlock", "previousBlock", "=", "null", ";", "int", "previousStart", "=", "start", ";", "int", "lineStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "start", ")", ";", "if", "(", "this", ".", "astPtr", "==", "-", "1", ")", "{", "previousBlock", "=", "new", "FormatJavadocBlock", "(", "start", ",", "start", ",", "lineStart", ",", "NO_TAG_VALUE", ")", ";", "pushOnAstStack", "(", "previousBlock", ",", "true", ")", ";", "}", "else", "{", "previousBlock", "=", "(", "FormatJavadocBlock", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "previousStart", "=", "previousBlock", ".", "sourceStart", ";", "}", "if", "(", "this", ".", "inlineTagStarted", ")", "{", "if", "(", "previousBlock", ".", "nodes", "==", "null", ")", "{", "}", "else", "{", "FormatJavadocNode", "lastNode", "=", "previousBlock", ".", "nodes", "[", "previousBlock", ".", "nodesPtr", "]", ";", "while", "(", "lastNode", "!=", "null", "&&", "lastNode", ".", "isText", "(", ")", ")", "{", "lastNode", "=", "lastNode", ".", "getLastNode", "(", ")", ";", "}", "if", "(", "lastNode", "!=", "null", ")", "{", "previousBlock", "=", "(", "FormatJavadocBlock", ")", "lastNode", ";", "previousStart", "=", "previousBlock", ".", "sourceStart", ";", "}", "}", "}", "FormatJavadocText", "text", "=", "new", "FormatJavadocText", "(", "start", ",", "end", "-", "1", ",", "lineStart", ",", "htmlIndex", ",", "htmlDepth", "==", "-", "1", "?", "0", ":", "htmlDepth", ")", ";", "previousBlock", ".", "addText", "(", "text", ")", ";", "previousBlock", ".", "sourceStart", "=", "previousStart", ";", "if", "(", "lineStart", "==", "previousBlock", ".", "lineStart", ")", "{", "previousBlock", ".", "flags", "|=", "FormatJavadocBlock", ".", "TEXT_ON_TAG_LINE", ";", "}", "this", ".", "textStart", "=", "-", "1", ";", "}", "protected", "boolean", "pushThrowName", "(", "Object", "typeRef", ")", "{", "int", "lineStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "this", ".", "tagSourceStart", ")", ";", "FormatJavadocBlock", "block", "=", "new", "FormatJavadocBlock", "(", "this", ".", "tagSourceStart", ",", "this", ".", "tagSourceEnd", ",", "lineStart", ",", "this", ".", "tagValue", ")", ";", "block", ".", "reference", "=", "(", "FormatJavadocReference", ")", "typeRef", ";", "block", ".", "sourceEnd", "=", "block", ".", "reference", ".", "sourceEnd", ";", "pushOnAstStack", "(", "block", ",", "true", ")", ";", "return", "true", ";", "}", "protected", "void", "refreshInlineTagPosition", "(", "int", "previousPosition", ")", "{", "if", "(", "this", ".", "astPtr", "!=", "-", "1", ")", "{", "FormatJavadocNode", "previousBlock", "=", "(", "FormatJavadocNode", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "if", "(", "this", ".", "inlineTagStarted", ")", "{", "FormatJavadocNode", "lastNode", "=", "previousBlock", ";", "while", "(", "lastNode", "!=", "null", ")", "{", "lastNode", ".", "sourceEnd", "=", "previousPosition", ";", "lastNode", "=", "lastNode", ".", "getLastNode", "(", ")", ";", "}", "}", "}", "}", "protected", "void", "setInlineTagStarted", "(", "boolean", "started", ")", "{", "super", ".", "setInlineTagStarted", "(", "started", ")", ";", "if", "(", "started", ")", "{", "this", ".", "inlineHtmlTagsPtr", "=", "this", ".", "htmlTagsPtr", ";", "}", "else", "{", "if", "(", "this", ".", "htmlTagsPtr", ">", "this", ".", "inlineHtmlTagsPtr", ")", "{", "this", ".", "htmlTagsPtr", "=", "this", ".", "inlineHtmlTagsPtr", ";", "}", "}", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "super", ".", "toString", "(", ")", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "String", "toDebugString", "(", ")", "{", "if", "(", "this", ".", "docComment", "==", "null", ")", "{", "return", "\"No", "javadoc!\"", ";", "}", "return", "(", "(", "FormatJavadoc", ")", "this", ".", "docComment", ")", ".", "toDebugString", "(", "this", ".", "source", ")", ";", "}", "protected", "void", "updateDocComment", "(", ")", "{", "int", "length", "=", "this", ".", "astPtr", "+", "1", ";", "FormatJavadoc", "formatJavadoc", "=", "new", "FormatJavadoc", "(", "this", ".", "javadocStart", ",", "this", ".", "javadocEnd", ",", "length", ")", ";", "if", "(", "length", ">", "0", ")", "{", "formatJavadoc", ".", "blocks", "=", "new", "FormatJavadocBlock", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "FormatJavadocBlock", "block", "=", "(", "FormatJavadocBlock", ")", "this", ".", "astStack", "[", "i", "]", ";", "block", ".", "clean", "(", ")", ";", "block", ".", "update", "(", "this", ".", "scanner", ")", ";", "formatJavadoc", ".", "blocks", "[", "i", "]", "=", "block", ";", "if", "(", "i", "==", "0", ")", "{", "block", ".", "flags", "|=", "FormatJavadocBlock", ".", "FIRST", ";", "}", "}", "}", "formatJavadoc", ".", "textStart", "=", "this", ".", "javadocTextStart", ";", "formatJavadoc", ".", "textEnd", "=", "this", ".", "javadocTextEnd", ";", "formatJavadoc", ".", "lineStart", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "this", ".", "javadocTextStart", ")", ";", "formatJavadoc", ".", "lineEnd", "=", "this", ".", "scanner", ".", "getLineNumber", "(", "this", ".", "javadocTextEnd", ")", ";", "FormatJavadocBlock", "firstBlock", "=", "formatJavadoc", ".", "getFirstBlock", "(", ")", ";", "if", "(", "firstBlock", "!=", "null", ")", "{", "firstBlock", ".", "setHeaderLine", "(", "formatJavadoc", ".", "lineStart", ")", ";", "}", "this", ".", "docComment", "=", "formatJavadoc", ";", "if", "(", "DefaultCodeFormatter", ".", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "toDebugString", "(", ")", ")", ";", "}", "}", "protected", "boolean", "verifyEndLine", "(", "int", "textPosition", ")", "{", "return", "true", ";", "}", "protected", "boolean", "verifySpaceOrEndComment", "(", ")", "{", "return", "true", ";", "}", "}", "</s>" ]
3,962
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "JavadocTagConstants", ";", "public", "abstract", "class", "FormatJavadocNode", "implements", "JavadocTagConstants", "{", "final", "static", "int", "DEFAULT_ARRAY_SIZE", "=", "10", ";", "final", "static", "int", "INCREMENT_ARRAY_SIZE", "=", "10", ";", "protected", "int", "sourceStart", ",", "sourceEnd", ";", "protected", "int", "lineStart", ";", "protected", "int", "linesBefore", "=", "0", ";", "public", "FormatJavadocNode", "(", "int", "start", ",", "int", "end", ",", "int", "line", ")", "{", "this", ".", "sourceStart", "=", "start", ";", "this", ".", "sourceEnd", "=", "end", ";", "this", ".", "lineStart", "=", "line", ";", "}", "abstract", "void", "clean", "(", ")", ";", "FormatJavadocNode", "getLastNode", "(", ")", "{", "return", "null", ";", "}", "public", "int", "getLength", "(", ")", "{", "return", "this", ".", "sourceEnd", "-", "this", ".", "sourceStart", "+", "1", ";", "}", "public", "boolean", "isText", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isImmutable", "(", ")", "{", "return", "false", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "toString", "(", "buffer", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "protected", "void", "toString", "(", "StringBuffer", "buffer", ")", "{", "buffer", ".", "append", "(", "\":", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "sourceStart", ")", ";", "buffer", ".", "append", "(", "\"", "->", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "sourceEnd", ")", ";", "}", "public", "String", "toStringDebug", "(", "char", "[", "]", "source", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "toStringDebug", "(", "buffer", ",", "source", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "void", "toStringDebug", "(", "StringBuffer", "buffer", ",", "char", "[", "]", "source", ")", "{", "buffer", ".", "append", "(", "source", ",", "this", ".", "sourceStart", ",", "this", ".", "sourceEnd", "-", "this", ".", "sourceStart", "+", "1", ")", ";", "buffer", ".", "append", "(", "'", "'", ")", ";", "}", "void", "setHeaderLine", "(", "int", "javadocLineStart", ")", "{", "}", "}", "</s>" ]
3,963
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ".", "IJavaDocTagConstants", ";", "public", "class", "FormatJavadocText", "extends", "FormatJavadocNode", "implements", "IJavaDocTagConstants", "{", "long", "[", "]", "separators", ";", "int", "separatorsPtr", "=", "-", "1", ";", "private", "int", "htmlTagIndex", "=", "-", "1", ";", "boolean", "immutable", "=", "false", ";", "FormatJavadocNode", "[", "]", "htmlNodes", ";", "int", "[", "]", "htmlIndexes", ";", "int", "htmlNodesPtr", "=", "-", "1", ";", "int", "depth", "=", "0", ";", "public", "FormatJavadocText", "(", "int", "start", ",", "int", "end", ",", "int", "line", ",", "int", "htmlIndex", ",", "int", "htmlDepth", ")", "{", "super", "(", "start", ",", "end", ",", "line", ")", ";", "this", ".", "htmlTagIndex", "=", "htmlIndex", ";", "this", ".", "depth", "=", "htmlDepth", ";", "}", "void", "appendText", "(", "FormatJavadocText", "text", ")", "{", "text", ".", "immutable", "=", "this", ".", "immutable", ";", "if", "(", "this", ".", "depth", "==", "text", ".", "depth", ")", "{", "addSeparator", "(", "text", ")", ";", "this", ".", "sourceEnd", "=", "text", ".", "sourceEnd", ";", "if", "(", "text", ".", "isClosingHtmlTag", "(", ")", ")", "{", "this", ".", "htmlTagIndex", "=", "text", ".", "htmlTagIndex", ";", "}", "}", "else", "{", "appendNode", "(", "text", ")", ";", "}", "if", "(", "text", ".", "isHtmlTag", "(", ")", ")", "{", "switch", "(", "text", ".", "htmlTagIndex", "&", "JAVADOC_TAGS_ID_MASK", ")", "{", "case", "JAVADOC_CODE_TAGS_ID", ":", "text", ".", "linesBefore", "=", "this", ".", "htmlNodesPtr", "==", "-", "1", "?", "0", ":", "2", ";", "break", ";", "case", "JAVADOC_SEPARATOR_TAGS_ID", ":", "text", ".", "linesBefore", "=", "1", ";", "break", ";", "case", "JAVADOC_SINGLE_BREAK_TAG_ID", ":", "if", "(", "!", "text", ".", "isClosingHtmlTag", "(", ")", ")", "text", ".", "linesBefore", "=", "1", ";", "break", ";", "case", "JAVADOC_BREAK_TAGS_ID", ":", "if", "(", "!", "text", ".", "isClosingHtmlTag", "(", ")", ")", "text", ".", "linesBefore", "=", "1", ";", "}", "}", "}", "void", "appendNode", "(", "FormatJavadocNode", "node", ")", "{", "if", "(", "++", "this", ".", "htmlNodesPtr", "==", "0", ")", "{", "this", ".", "htmlNodes", "=", "new", "FormatJavadocNode", "[", "DEFAULT_ARRAY_SIZE", "]", ";", "}", "else", "{", "if", "(", "this", ".", "htmlNodesPtr", "==", "this", ".", "htmlNodes", ".", "length", ")", "{", "int", "size", "=", "this", ".", "htmlNodesPtr", "+", "DEFAULT_ARRAY_SIZE", ";", "System", ".", "arraycopy", "(", "this", ".", "htmlNodes", ",", "0", ",", "(", "this", ".", "htmlNodes", "=", "new", "FormatJavadocNode", "[", "size", "]", ")", ",", "0", ",", "this", ".", "htmlNodesPtr", ")", ";", "}", "}", "addSeparator", "(", "node", ")", ";", "this", ".", "htmlNodes", "[", "this", ".", "htmlNodesPtr", "]", "=", "node", ";", "this", ".", "sourceEnd", "=", "node", ".", "sourceEnd", ";", "}", "private", "void", "addSeparator", "(", "FormatJavadocNode", "node", ")", "{", "if", "(", "++", "this", ".", "separatorsPtr", "==", "0", ")", "{", "this", ".", "separators", "=", "new", "long", "[", "DEFAULT_ARRAY_SIZE", "]", ";", "this", ".", "htmlIndexes", "=", "new", "int", "[", "DEFAULT_ARRAY_SIZE", "]", ";", "}", "else", "{", "if", "(", "this", ".", "separatorsPtr", "==", "this", ".", "separators", ".", "length", ")", "{", "int", "size", "=", "this", ".", "separatorsPtr", "+", "DEFAULT_ARRAY_SIZE", ";", "System", ".", "arraycopy", "(", "this", ".", "separators", ",", "0", ",", "(", "this", ".", "separators", "=", "new", "long", "[", "size", "]", ")", ",", "0", ",", "this", ".", "separatorsPtr", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "htmlIndexes", ",", "0", ",", "(", "this", ".", "htmlIndexes", "=", "new", "int", "[", "size", "]", ")", ",", "0", ",", "this", ".", "separatorsPtr", ")", ";", "}", "}", "this", ".", "separators", "[", "this", ".", "separatorsPtr", "]", "=", "(", "(", "(", "long", ")", "this", ".", "sourceEnd", ")", "<<", "32", ")", "+", "node", ".", "sourceStart", ";", "this", ".", "htmlIndexes", "[", "this", ".", "separatorsPtr", "]", "=", "node", ".", "isText", "(", ")", "?", "(", "(", "FormatJavadocText", ")", "node", ")", ".", "htmlTagIndex", ":", "-", "1", ";", "}", "void", "clean", "(", ")", "{", "int", "length", "=", "this", ".", "separators", "==", "null", "?", "0", ":", "this", ".", "separators", ".", "length", ";", "if", "(", "this", ".", "separatorsPtr", "!=", "(", "length", "-", "1", ")", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "separators", ",", "0", ",", "this", ".", "separators", "=", "new", "long", "[", "this", ".", "separatorsPtr", "+", "1", "]", ",", "0", ",", "this", ".", "separatorsPtr", "+", "1", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "htmlIndexes", ",", "0", ",", "this", ".", "htmlIndexes", "=", "new", "int", "[", "this", ".", "separatorsPtr", "+", "1", "]", ",", "0", ",", "this", ".", "separatorsPtr", "+", "1", ")", ";", "}", "length", "=", "this", ".", "htmlNodes", "==", "null", "?", "0", ":", "this", ".", "htmlNodes", ".", "length", ";", "if", "(", "this", ".", "htmlNodesPtr", "!=", "(", "length", "-", "1", ")", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "htmlNodes", ",", "0", ",", "this", ".", "htmlNodes", "=", "new", "FormatJavadocNode", "[", "this", ".", "htmlNodesPtr", "+", "1", "]", ",", "0", ",", "this", ".", "htmlNodesPtr", "+", "1", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "this", ".", "htmlNodesPtr", ";", "i", "++", ")", "{", "this", ".", "htmlNodes", "[", "i", "]", ".", "clean", "(", ")", ";", "}", "}", "}", "void", "closeTag", "(", ")", "{", "this", ".", "htmlTagIndex", "|=", "JAVADOC_CLOSED_TAG", ";", "}", "int", "getHtmlTagIndex", "(", ")", "{", "return", "this", ".", "htmlTagIndex", "&", "JAVADOC_TAGS_INDEX_MASK", ";", "}", "int", "getHtmlTagID", "(", ")", "{", "return", "this", ".", "htmlTagIndex", "&", "JAVADOC_TAGS_ID_MASK", ";", "}", "FormatJavadocNode", "getLastNode", "(", ")", "{", "if", "(", "this", ".", "htmlNodes", "!=", "null", ")", "{", "return", "this", ".", "htmlNodes", "[", "this", ".", "htmlNodesPtr", "]", ";", "}", "return", "null", ";", "}", "public", "boolean", "isClosingHtmlTag", "(", ")", "{", "return", "this", ".", "htmlTagIndex", "!=", "-", "1", "&&", "(", "this", ".", "htmlTagIndex", "&", "JAVADOC_CLOSED_TAG", ")", "!=", "0", ";", "}", "public", "boolean", "isHtmlTag", "(", ")", "{", "return", "this", ".", "htmlTagIndex", "!=", "-", "1", ";", "}", "public", "boolean", "isImmutableHtmlTag", "(", ")", "{", "return", "this", ".", "htmlTagIndex", "!=", "-", "1", "&&", "(", "this", ".", "htmlTagIndex", "&", "JAVADOC_TAGS_ID_MASK", ")", "==", "JAVADOC_IMMUTABLE_TAGS_ID", ";", "}", "public", "boolean", "isImmutable", "(", ")", "{", "return", "this", ".", "immutable", "||", "(", "this", ".", "htmlTagIndex", "!=", "-", "1", "&&", "(", "this", ".", "htmlTagIndex", "&", "JAVADOC_TAGS_ID_MASK", ")", "==", "JAVADOC_IMMUTABLE_TAGS_ID", ")", ";", "}", "public", "boolean", "isTextAfterHtmlSeparatorTag", "(", "int", "separatorIndex", ")", "{", "int", "ptr", "=", "separatorIndex", ";", "if", "(", "ptr", ">", "this", ".", "separatorsPtr", ")", "return", "false", ";", "int", "tagIndex", "=", "this", ".", "htmlIndexes", "[", "ptr", "]", "&", "JAVADOC_TAGS_ID_MASK", ";", "return", "tagIndex", "!=", "-", "1", "&&", "tagIndex", "==", "JAVADOC_SEPARATOR_TAGS_ID", ";", "}", "public", "boolean", "isText", "(", ")", "{", "return", "true", ";", "}", "void", "setHeaderLine", "(", "int", "javadocLineStart", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "htmlNodesPtr", ";", "i", "++", ")", "{", "FormatJavadocNode", "node", "=", "this", ".", "htmlNodes", "[", "i", "]", ";", "if", "(", "!", "node", ".", "isText", "(", ")", ")", "{", "(", "(", "FormatJavadocBlock", ")", "node", ")", ".", "setHeaderLine", "(", "javadocLineStart", ")", ";", "}", "}", "}", "protected", "void", "toString", "(", "StringBuffer", "buffer", ")", "{", "StringBuffer", "indentation", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "t", "=", "0", ";", "t", "<=", "this", ".", "depth", ";", "t", "++", ")", "indentation", ".", "append", "(", "'\\t'", ")", ";", "buffer", ".", "append", "(", "indentation", ")", ";", "if", "(", "isImmutable", "(", ")", ")", "{", "buffer", ".", "append", "(", "\"immutable", "\"", ")", ";", "}", "buffer", ".", "append", "(", "\"text\"", ")", ";", "super", ".", "toString", "(", "buffer", ")", ";", "buffer", ".", "append", "(", "\"", "(\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "separatorsPtr", "+", "1", ")", ".", "append", "(", "\"", "sections,", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "htmlNodesPtr", "+", "1", ")", ".", "append", "(", "\"", "html", "tags,", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "depth", ")", ".", "append", "(", "\"", "depth,", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "linesBefore", ")", ".", "append", "(", "\"", "before,", "\"", ")", ";", "String", "tagID", "=", "\"no\"", ";", "switch", "(", "getHtmlTagID", "(", ")", ")", "{", "case", "JAVADOC_TAGS_ID_MASK", ":", "tagID", "=", "\"mask\"", ";", "break", ";", "case", "JAVADOC_SINGLE_BREAK_TAG_ID", ":", "tagID", "=", "\"single", "break\"", ";", "break", ";", "case", "JAVADOC_CODE_TAGS_ID", ":", "tagID", "=", "\"code\"", ";", "break", ";", "case", "JAVADOC_BREAK_TAGS_ID", ":", "tagID", "=", "\"break\"", ";", "break", ";", "case", "JAVADOC_IMMUTABLE_TAGS_ID", ":", "tagID", "=", "\"immutable\"", ";", "break", ";", "case", "JAVADOC_SEPARATOR_TAGS_ID", ":", "tagID", "=", "\"separator\"", ";", "break", ";", "}", "buffer", ".", "append", "(", "tagID", ")", ".", "append", "(", "\"", "tag", "id)\"", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "public", "void", "toStringDebug", "(", "StringBuffer", "buffer", ",", "char", "[", "]", "source", ")", "{", "if", "(", "buffer", ".", "length", "(", ")", ">", "0", ")", "{", "for", "(", "int", "l", "=", "0", ";", "l", "<", "this", ".", "linesBefore", ";", "l", "++", ")", "{", "buffer", ".", "append", "(", "'\\n'", ")", ";", "for", "(", "int", "t", "=", "0", ";", "t", "<", "this", ".", "depth", ";", "t", "++", ")", "buffer", ".", "append", "(", "'\\t'", ")", ";", "}", "}", "if", "(", "this", ".", "separatorsPtr", "==", "-", "1", ")", "{", "super", ".", "toStringDebug", "(", "buffer", ",", "source", ")", ";", "return", ";", "}", "int", "ptr", "=", "0", ";", "int", "nextStart", "=", "this", ".", "sourceStart", ";", "int", "idx", "=", "0", ";", "while", "(", "idx", "<=", "this", ".", "separatorsPtr", "||", "(", "this", ".", "htmlNodesPtr", "!=", "-", "1", "&&", "ptr", "<=", "this", ".", "htmlNodesPtr", ")", ")", "{", "if", "(", "idx", ">", "this", ".", "separatorsPtr", ")", "{", "FormatJavadocNode", "node", "=", "this", ".", "htmlNodes", "[", "ptr", "++", "]", ";", "node", ".", "toStringDebug", "(", "buffer", ",", "source", ")", ";", "return", ";", "}", "int", "end", "=", "(", "int", ")", "(", "this", ".", "separators", "[", "idx", "]", ">>>", "32", ")", ";", "if", "(", "this", ".", "htmlNodesPtr", ">=", "0", "&&", "ptr", "<=", "this", ".", "htmlNodesPtr", "&&", "end", ">", "this", ".", "htmlNodes", "[", "ptr", "]", ".", "sourceStart", ")", "{", "FormatJavadocNode", "node", "=", "this", ".", "htmlNodes", "[", "ptr", "++", "]", ";", "node", ".", "toStringDebug", "(", "buffer", ",", "source", ")", ";", "}", "else", "{", "if", "(", "idx", ">", "1", "&&", "source", "[", "nextStart", "]", "!=", "'<'", ")", "{", "buffer", ".", "append", "(", "'\\n'", ")", ";", "for", "(", "int", "t", "=", "0", ";", "t", "<", "this", ".", "depth", ";", "t", "++", ")", "buffer", ".", "append", "(", "'\\t'", ")", ";", "}", "buffer", ".", "append", "(", "source", ",", "nextStart", ",", "end", "-", "nextStart", "+", "1", ")", ";", "}", "nextStart", "=", "(", "int", ")", "this", ".", "separators", "[", "idx", "++", "]", ";", "}", "if", "(", "source", "[", "nextStart", "]", "==", "'<'", ")", "{", "switch", "(", "getHtmlTagID", "(", ")", ")", "{", "case", "JAVADOC_CODE_TAGS_ID", ":", "buffer", ".", "append", "(", "'\\n'", ")", ";", "for", "(", "int", "t", "=", "0", ";", "t", "<", "this", ".", "depth", ";", "t", "++", ")", "buffer", ".", "append", "(", "'\\t'", ")", ";", "break", ";", "}", "}", "buffer", ".", "append", "(", "source", ",", "nextStart", ",", "this", ".", "sourceEnd", "-", "nextStart", "+", "1", ")", ";", "buffer", ".", "append", "(", "'", "'", ")", ";", "}", "}", "</s>" ]
3,964
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Scanner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ".", "IJavaDocTagConstants", ";", "public", "class", "FormatJavadocBlock", "extends", "FormatJavadocNode", "implements", "IJavaDocTagConstants", "{", "final", "static", "int", "INLINED", "=", "0x0001", ";", "final", "static", "int", "FIRST", "=", "0x0002", ";", "final", "static", "int", "ON_HEADER_LINE", "=", "0x0004", ";", "final", "static", "int", "TEXT_ON_TAG_LINE", "=", "0x0008", ";", "final", "static", "int", "ONE_LINE_TAG", "=", "0x0010", ";", "final", "static", "int", "PARAM_TAG", "=", "0x0020", ";", "final", "static", "int", "IN_PARAM_TAG", "=", "0x0040", ";", "final", "static", "int", "IN_DESCRIPTION", "=", "0x0080", ";", "final", "static", "int", "IMMUTABLE", "=", "0x0100", ";", "final", "static", "int", "MAX_TAG_HIERARCHY", "=", "10", ";", "private", "int", "tagValue", "=", "NO_TAG_VALUE", ";", "int", "tagEnd", ";", "FormatJavadocReference", "reference", ";", "FormatJavadocNode", "[", "]", "nodes", ";", "int", "nodesPtr", "=", "-", "1", ";", "int", "flags", "=", "0", ";", "public", "FormatJavadocBlock", "(", "int", "start", ",", "int", "end", ",", "int", "line", ",", "int", "value", ")", "{", "super", "(", "start", ",", "end", ",", "line", ")", ";", "this", ".", "tagValue", "=", "value", ";", "this", ".", "tagEnd", "=", "end", ";", "switch", "(", "value", ")", "{", "case", "TAG_PARAM_VALUE", ":", "case", "TAG_SERIAL_FIELD_VALUE", ":", "case", "TAG_THROWS_VALUE", ":", "case", "TAG_EXCEPTION_VALUE", ":", "this", ".", "flags", "|=", "PARAM_TAG", ";", "break", ";", "case", "TAG_CODE_VALUE", ":", "case", "TAG_LITERAL_VALUE", ":", "this", ".", "flags", "|=", "IMMUTABLE", ";", "break", ";", "}", "}", "private", "void", "addNode", "(", "FormatJavadocNode", "node", ")", "{", "if", "(", "++", "this", ".", "nodesPtr", "==", "0", ")", "{", "this", ".", "nodes", "=", "new", "FormatJavadocNode", "[", "DEFAULT_ARRAY_SIZE", "]", ";", "}", "else", "if", "(", "this", ".", "nodesPtr", ">=", "this", ".", "nodes", ".", "length", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "nodes", ",", "0", ",", "this", ".", "nodes", "=", "new", "FormatJavadocNode", "[", "this", ".", "nodes", ".", "length", "+", "INCREMENT_ARRAY_SIZE", "]", ",", "0", ",", "this", ".", "nodesPtr", ")", ";", "}", "this", ".", "nodes", "[", "this", ".", "nodesPtr", "]", "=", "node", ";", "this", ".", "sourceEnd", "=", "node", ".", "sourceEnd", ";", "}", "void", "addBlock", "(", "FormatJavadocBlock", "block", ",", "int", "htmlLevel", ")", "{", "if", "(", "this", ".", "nodes", "!=", "null", ")", "{", "FormatJavadocText", "[", "]", "textHierarchy", "=", "getTextHierarchy", "(", "block", ",", "htmlLevel", ")", ";", "if", "(", "textHierarchy", "!=", "null", ")", "{", "FormatJavadocText", "lastText", "=", "textHierarchy", "[", "htmlLevel", "]", ";", "if", "(", "lastText", "!=", "null", ")", "{", "lastText", ".", "appendNode", "(", "block", ")", ";", "for", "(", "int", "i", "=", "htmlLevel", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "textHierarchy", "[", "i", "]", ".", "sourceEnd", "=", "block", ".", "sourceEnd", ";", "}", "this", ".", "sourceEnd", "=", "block", ".", "sourceEnd", ";", "if", "(", "isParamTag", "(", ")", ")", "{", "block", ".", "flags", "|=", "IN_PARAM_TAG", ";", "}", "else", "if", "(", "isDescription", "(", ")", ")", "{", "block", ".", "flags", "|=", "IN_DESCRIPTION", ";", "}", "block", ".", "flags", "|=", "INLINED", ";", "return", ";", "}", "}", "}", "addNode", "(", "block", ")", ";", "if", "(", "isParamTag", "(", ")", ")", "{", "block", ".", "flags", "|=", "IN_PARAM_TAG", ";", "}", "else", "if", "(", "isDescription", "(", ")", ")", "{", "block", ".", "flags", "|=", "IN_DESCRIPTION", ";", "}", "block", ".", "flags", "|=", "INLINED", ";", "}", "void", "addText", "(", "FormatJavadocText", "text", ")", "{", "if", "(", "this", ".", "nodes", "!=", "null", ")", "{", "FormatJavadocText", "[", "]", "textHierarchy", "=", "getTextHierarchy", "(", "text", ",", "text", ".", "depth", ")", ";", "if", "(", "textHierarchy", "!=", "null", ")", "{", "FormatJavadocText", "lastText", "=", "textHierarchy", "[", "text", ".", "depth", "]", ";", "if", "(", "lastText", "!=", "null", ")", "{", "lastText", ".", "appendText", "(", "text", ")", ";", "for", "(", "int", "i", "=", "text", ".", "depth", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "textHierarchy", "[", "i", "]", ".", "sourceEnd", "=", "text", ".", "sourceEnd", ";", "}", "this", ".", "sourceEnd", "=", "text", ".", "sourceEnd", ";", "return", ";", "}", "if", "(", "text", ".", "depth", ">", "0", ")", "{", "FormatJavadocText", "parentText", "=", "textHierarchy", "[", "text", ".", "depth", "-", "1", "]", ";", "if", "(", "parentText", "!=", "null", ")", "{", "parentText", ".", "appendText", "(", "text", ")", ";", "for", "(", "int", "i", "=", "text", ".", "depth", "-", "2", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "textHierarchy", "[", "i", "]", ".", "sourceEnd", "=", "text", ".", "sourceEnd", ";", "}", "this", ".", "sourceEnd", "=", "text", ".", "sourceEnd", ";", "return", ";", "}", "}", "}", "}", "if", "(", "text", ".", "isHtmlTag", "(", ")", ")", "{", "switch", "(", "text", ".", "getHtmlTagID", "(", ")", ")", "{", "case", "JAVADOC_CODE_TAGS_ID", ":", "text", ".", "linesBefore", "=", "this", ".", "nodesPtr", "==", "-", "1", "?", "0", ":", "2", ";", "break", ";", "case", "JAVADOC_SEPARATOR_TAGS_ID", ":", "text", ".", "linesBefore", "=", "1", ";", "break", ";", "}", "}", "addNode", "(", "text", ")", ";", "if", "(", "isImmutable", "(", ")", ")", "{", "text", ".", "immutable", "=", "true", ";", "}", "}", "void", "clean", "(", ")", "{", "int", "length", "=", "this", ".", "nodes", "==", "null", "?", "0", ":", "this", ".", "nodes", ".", "length", ";", "if", "(", "this", ".", "nodesPtr", "!=", "(", "length", "-", "1", ")", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "nodes", ",", "0", ",", "this", ".", "nodes", "=", "new", "FormatJavadocNode", "[", "this", ".", "nodesPtr", "+", "1", "]", ",", "0", ",", "this", ".", "nodesPtr", "+", "1", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "this", ".", "nodesPtr", ";", "i", "++", ")", "{", "this", ".", "nodes", "[", "i", "]", ".", "clean", "(", ")", ";", "}", "}", "FormatJavadocNode", "getLastNode", "(", ")", "{", "if", "(", "this", ".", "nodes", "!=", "null", ")", "{", "return", "this", ".", "nodes", "[", "this", ".", "nodesPtr", "]", ";", "}", "return", "null", ";", "}", "FormatJavadocText", "[", "]", "getTextHierarchy", "(", "FormatJavadocNode", "node", ",", "int", "htmlDepth", ")", "{", "if", "(", "this", ".", "nodes", "==", "null", ")", "return", "null", ";", "FormatJavadocText", "[", "]", "textHierarchy", "=", "null", ";", "int", "ptr", "=", "0", ";", "FormatJavadocText", "text", "=", "node", ".", "isText", "(", ")", "?", "(", "FormatJavadocText", ")", "node", ":", "null", ";", "FormatJavadocNode", "lastNode", "=", "this", ".", "nodes", "[", "this", ".", "nodesPtr", "]", ";", "while", "(", "lastNode", ".", "isText", "(", ")", ")", "{", "FormatJavadocText", "lastText", "=", "(", "FormatJavadocText", ")", "lastNode", ";", "int", "lastTagCategory", "=", "lastText", ".", "getHtmlTagID", "(", ")", ";", "boolean", "lastSingleTag", "=", "lastTagCategory", "<=", "JAVADOC_SINGLE_TAGS_ID", ";", "boolean", "lastTextCanHaveChildren", "=", "lastText", ".", "isHtmlTag", "(", ")", "&&", "!", "lastText", ".", "isClosingHtmlTag", "(", ")", "&&", "!", "lastSingleTag", ";", "if", "(", "lastText", ".", "depth", "==", "htmlDepth", "||", "lastText", ".", "htmlNodesPtr", "==", "-", "1", ")", "{", "if", "(", "lastText", ".", "isHtmlTag", "(", ")", ")", "{", "boolean", "setLinesBefore", "=", "lastText", ".", "separatorsPtr", "==", "-", "1", "||", "(", "ptr", "==", "0", "&&", "lastText", ".", "isClosingHtmlTag", "(", ")", ")", ";", "if", "(", "!", "setLinesBefore", "&&", "ptr", ">", "0", "&&", "lastText", ".", "isClosingHtmlTag", "(", ")", ")", "{", "FormatJavadocText", "parentText", "=", "textHierarchy", "[", "ptr", "-", "1", "]", ";", "int", "textStart", "=", "(", "int", ")", "parentText", ".", "separators", "[", "parentText", ".", "separatorsPtr", "]", ";", "if", "(", "textStart", "<", "lastText", ".", "sourceStart", ")", "{", "setLinesBefore", "=", "true", ";", "}", "}", "if", "(", "setLinesBefore", ")", "{", "switch", "(", "lastText", ".", "getHtmlTagID", "(", ")", ")", "{", "case", "JAVADOC_CODE_TAGS_ID", ":", "if", "(", "node", ".", "linesBefore", "<", "2", ")", "{", "node", ".", "linesBefore", "=", "2", ";", "}", "break", ";", "case", "JAVADOC_SEPARATOR_TAGS_ID", ":", "case", "JAVADOC_SINGLE_BREAK_TAG_ID", ":", "if", "(", "node", ".", "linesBefore", "<", "1", ")", "{", "node", ".", "linesBefore", "=", "1", ";", "}", "}", "}", "if", "(", "text", "!=", "null", "&&", "text", ".", "isHtmlTag", "(", ")", "&&", "!", "text", ".", "isClosingHtmlTag", "(", ")", "&&", "text", ".", "getHtmlTagIndex", "(", ")", "==", "lastText", ".", "getHtmlTagIndex", "(", ")", "&&", "!", "lastText", ".", "isClosingHtmlTag", "(", ")", ")", "{", "lastText", ".", "closeTag", "(", ")", ";", "return", "textHierarchy", ";", "}", "}", "if", "(", "lastTextCanHaveChildren", "||", "(", "htmlDepth", "==", "0", "&&", "!", "lastText", ".", "isHtmlTag", "(", ")", "&&", "text", "!=", "null", "&&", "!", "text", ".", "isHtmlTag", "(", ")", ")", ")", "{", "if", "(", "textHierarchy", "==", "null", ")", "textHierarchy", "=", "new", "FormatJavadocText", "[", "htmlDepth", "+", "1", "]", ";", "textHierarchy", "[", "ptr", "]", "=", "lastText", ";", "return", "textHierarchy", ";", "}", "return", "textHierarchy", ";", "}", "if", "(", "textHierarchy", "==", "null", ")", "textHierarchy", "=", "new", "FormatJavadocText", "[", "htmlDepth", "+", "1", "]", ";", "textHierarchy", "[", "ptr", "++", "]", "=", "lastText", ";", "lastNode", "=", "lastText", ".", "htmlNodes", "[", "lastText", ".", "htmlNodesPtr", "]", ";", "}", "return", "textHierarchy", ";", "}", "public", "boolean", "hasTextOnTagLine", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "TEXT_ON_TAG_LINE", ")", "!=", "0", ";", "}", "public", "boolean", "isDescription", "(", ")", "{", "return", "this", ".", "tagValue", "==", "NO_TAG_VALUE", ";", "}", "public", "boolean", "isFirst", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "FIRST", ")", "!=", "0", ";", "}", "public", "boolean", "isHeaderLine", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "ON_HEADER_LINE", ")", "!=", "0", ";", "}", "public", "boolean", "isImmutable", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "IMMUTABLE", ")", "==", "IMMUTABLE", ";", "}", "public", "boolean", "isInDescription", "(", ")", "{", "return", "this", ".", "tagValue", "==", "NO_TAG_VALUE", "||", "(", "this", ".", "flags", "&", "IN_DESCRIPTION", ")", "==", "IN_DESCRIPTION", ";", "}", "public", "boolean", "isInlined", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "INLINED", ")", "!=", "0", ";", "}", "public", "boolean", "isInParamTag", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "(", "PARAM_TAG", "|", "IN_PARAM_TAG", ")", ")", "!=", "0", ";", "}", "public", "boolean", "isOneLineTag", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "ONE_LINE_TAG", ")", "!=", "0", ";", "}", "public", "boolean", "isParamTag", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "PARAM_TAG", ")", "==", "PARAM_TAG", ";", "}", "void", "setHeaderLine", "(", "int", "javadocLineStart", ")", "{", "if", "(", "javadocLineStart", "==", "this", ".", "lineStart", ")", "{", "this", ".", "flags", "|=", "ON_HEADER_LINE", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "nodesPtr", ";", "i", "++", ")", "{", "this", ".", "nodes", "[", "i", "]", ".", "setHeaderLine", "(", "javadocLineStart", ")", ";", "}", "}", "protected", "void", "toString", "(", "StringBuffer", "buffer", ")", "{", "boolean", "inlined", "=", "(", "this", ".", "flags", "&", "INLINED", ")", "!=", "0", ";", "if", "(", "inlined", ")", "buffer", ".", "append", "(", "\"t{\"", ")", ";", "buffer", ".", "append", "(", "'@'", ")", ";", "if", "(", "this", ".", "tagValue", "==", "TAG_OTHERS_VALUE", ")", "{", "buffer", ".", "append", "(", "\"others_tag\"", ")", ";", "}", "else", "{", "buffer", ".", "append", "(", "TAG_NAMES", "[", "this", ".", "tagValue", "]", ")", ";", "}", "super", ".", "toString", "(", "buffer", ")", ";", "if", "(", "this", ".", "reference", "==", "null", ")", "{", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "else", "{", "buffer", ".", "append", "(", "\"", "(\"", ")", ";", "this", ".", "reference", ".", "toString", "(", "buffer", ")", ";", "buffer", ".", "append", "(", "\")n\"", ")", ";", "}", "StringBuffer", "flagsBuffer", "=", "new", "StringBuffer", "(", ")", ";", "if", "(", "isDescription", "(", ")", ")", "{", "if", "(", "flagsBuffer", ".", "length", "(", ")", ">", "0", ")", "flagsBuffer", ".", "append", "(", "','", ")", ";", "flagsBuffer", ".", "append", "(", "\"description\"", ")", ";", "}", "if", "(", "isFirst", "(", ")", ")", "{", "if", "(", "flagsBuffer", ".", "length", "(", ")", ">", "0", ")", "flagsBuffer", ".", "append", "(", "','", ")", ";", "flagsBuffer", ".", "append", "(", "\"first\"", ")", ";", "}", "if", "(", "isHeaderLine", "(", ")", ")", "{", "if", "(", "flagsBuffer", ".", "length", "(", ")", ">", "0", ")", "flagsBuffer", ".", "append", "(", "','", ")", ";", "flagsBuffer", ".", "append", "(", "\"header", "line\"", ")", ";", "}", "if", "(", "isImmutable", "(", ")", ")", "{", "if", "(", "flagsBuffer", ".", "length", "(", ")", ">", "0", ")", "flagsBuffer", ".", "append", "(", "','", ")", ";", "flagsBuffer", ".", "append", "(", "\"immutable\"", ")", ";", "}", "if", "(", "isInDescription", "(", ")", ")", "{", "if", "(", "flagsBuffer", ".", "length", "(", ")", ">", "0", ")", "flagsBuffer", ".", "append", "(", "','", ")", ";", "flagsBuffer", ".", "append", "(", "\"\"", ")", ";", "}", "if", "(", "isInlined", "(", ")", ")", "{", "if", "(", "flagsBuffer", ".", "length", "(", ")", ">", "0", ")", "flagsBuffer", ".", "append", "(", "','", ")", ";", "flagsBuffer", ".", "append", "(", "\"inlined\"", ")", ";", "}", "if", "(", "isInParamTag", "(", ")", ")", "{", "if", "(", "flagsBuffer", ".", "length", "(", ")", ">", "0", ")", "flagsBuffer", ".", "append", "(", "','", ")", ";", "flagsBuffer", ".", "append", "(", "\"in", "param", "tag\"", ")", ";", "}", "if", "(", "isOneLineTag", "(", ")", ")", "{", "if", "(", "flagsBuffer", ".", "length", "(", ")", ">", "0", ")", "flagsBuffer", ".", "append", "(", "','", ")", ";", "flagsBuffer", ".", "append", "(", "\"one", "line", "tag\"", ")", ";", "}", "if", "(", "isParamTag", "(", ")", ")", "{", "if", "(", "flagsBuffer", ".", "length", "(", ")", ">", "0", ")", "flagsBuffer", ".", "append", "(", "','", ")", ";", "flagsBuffer", ".", "append", "(", "\"param", "tag\"", ")", ";", "}", "if", "(", "flagsBuffer", ".", "length", "(", ")", ">", "0", ")", "{", "if", "(", "inlined", ")", "buffer", ".", "append", "(", "'\\t'", ")", ";", "buffer", ".", "append", "(", "\"tflags:", "\"", ")", ";", "buffer", ".", "append", "(", "flagsBuffer", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "if", "(", "this", ".", "nodesPtr", ">", "-", "1", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "this", ".", "nodesPtr", ";", "i", "++", ")", "{", "if", "(", "inlined", ")", "buffer", ".", "append", "(", "'\\t'", ")", ";", "this", ".", "nodes", "[", "i", "]", ".", "toString", "(", "buffer", ")", ";", "}", "}", "}", "public", "String", "toStringDebug", "(", "char", "[", "]", "source", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "toStringDebug", "(", "buffer", ",", "source", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "void", "toStringDebug", "(", "StringBuffer", "buffer", ",", "char", "[", "]", "source", ")", "{", "if", "(", "this", ".", "tagValue", ">", "0", ")", "{", "buffer", ".", "append", "(", "source", ",", "this", ".", "sourceStart", ",", "this", ".", "tagEnd", "-", "this", ".", "sourceStart", "+", "1", ")", ";", "buffer", ".", "append", "(", "'", "'", ")", ";", "}", "if", "(", "this", ".", "reference", "!=", "null", ")", "{", "this", ".", "reference", ".", "toStringDebug", "(", "buffer", ",", "source", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "this", ".", "nodesPtr", ";", "i", "++", ")", "{", "this", ".", "nodes", "[", "i", "]", ".", "toStringDebug", "(", "buffer", ",", "source", ")", ";", "}", "}", "void", "update", "(", "Scanner", "scanner", ")", "{", "int", "blockEnd", "=", "scanner", ".", "getLineNumber", "(", "this", ".", "sourceEnd", ")", ";", "if", "(", "blockEnd", "==", "this", ".", "lineStart", ")", "{", "this", ".", "flags", "|=", "FormatJavadocBlock", ".", "ONE_LINE_TAG", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "this", ".", "nodesPtr", ";", "i", "++", ")", "{", "if", "(", "!", "this", ".", "nodes", "[", "i", "]", ".", "isText", "(", ")", ")", "{", "(", "(", "FormatJavadocBlock", ")", "this", ".", "nodes", "[", "i", "]", ")", ".", "update", "(", "scanner", ")", ";", "}", "}", "}", "}", "</s>" ]
3,965
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "StringReader", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "InvalidInputException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "CodeFormatter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ASTVisitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Annotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Parser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Scanner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "TerminalTokens", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "CodeSnippetParsingUtil", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "RecordedParsingInformation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "align", ".", "Alignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "align", ".", "AlignmentException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ".", "CommentFormatterUtil", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ".", "HTMLEntity2JavaReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ".", "IJavaDocTagConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "comment", ".", "Java2HTMLEntityReader", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadLocationException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "DefaultLineTracker", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "ILineTracker", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IRegion", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Region", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "MalformedTreeException", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "MultiTextEdit", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "ReplaceEdit", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "public", "class", "Scribe", "implements", "IJavaDocTagConstants", "{", "private", "static", "final", "int", "INITIAL_SIZE", "=", "100", ";", "private", "boolean", "checkLineWrapping", ";", "public", "int", "column", ";", "private", "int", "[", "]", "[", "]", "commentPositions", ";", "public", "Alignment", "currentAlignment", ";", "public", "int", "currentToken", ";", "private", "OptimizedReplaceEdit", "[", "]", "edits", ";", "public", "int", "editsIndex", ";", "public", "CodeFormatterVisitor", "formatter", ";", "public", "int", "indentationLevel", ";", "public", "int", "lastNumberOfNewLines", ";", "private", "boolean", "preserveLineBreakIndentation", "=", "false", ";", "public", "int", "line", ";", "private", "int", "[", "]", "lineEnds", ";", "private", "int", "maxLines", ";", "public", "Alignment", "memberAlignment", ";", "public", "boolean", "needSpace", "=", "false", ";", "final", "private", "String", "lineSeparator", ";", "final", "private", "String", "lineSeparatorAndSpace", ";", "final", "private", "char", "firstLS", ";", "final", "private", "int", "lsLength", ";", "public", "int", "nlsTagCounter", ";", "public", "int", "pageWidth", ";", "public", "boolean", "pendingSpace", "=", "false", ";", "public", "Scanner", "scanner", ";", "public", "int", "scannerEndPosition", ";", "public", "int", "tabLength", ";", "public", "int", "indentationSize", ";", "private", "final", "IRegion", "[", "]", "regions", ";", "private", "IRegion", "[", "]", "adaptedRegions", ";", "public", "int", "tabChar", ";", "public", "int", "numberOfIndentations", ";", "private", "boolean", "useTabsOnlyForLeadingIndents", ";", "private", "final", "boolean", "indentEmptyLines", ";", "int", "blank_lines_between_import_groups", "=", "-", "1", ";", "public", "static", "final", "int", "DO_NOT_PRESERVE_EMPTY_LINES", "=", "-", "1", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION", "=", "1", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_IN_FORMAT_LEFT_CURLY_BRACE", "=", "2", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_IN_STRING_LITERAL_CONCATENATION", "=", "3", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_IN_CLOSING_ARRAY_INITIALIZER", "=", "4", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_IN_FORMAT_OPENING_BRACE", "=", "5", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_IN_BINARY_EXPRESSION", "=", "6", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_IN_EQUALITY_EXPRESSION", "=", "7", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_BEFORE_ELSE", "=", "8", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_IN_SWITCH_CASE", "=", "9", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_AT_END_OF_METHOD_DECLARATION", "=", "10", ";", "public", "static", "final", "int", "PRESERVE_EMPTY_LINES_AT_END_OF_BLOCK", "=", "11", ";", "final", "static", "int", "PRESERVE_EMPTY_LINES_DO_NOT_USE_ANY_INDENTATION", "=", "-", "1", ";", "final", "static", "int", "PRESERVE_EMPTY_LINES_USE_CURRENT_INDENTATION", "=", "0", ";", "final", "static", "int", "PRESERVE_EMPTY_LINES_USE_TEMPORARY_INDENTATION", "=", "1", ";", "boolean", "editsEnabled", ";", "boolean", "useTags", ";", "int", "tagsKind", ";", "private", "static", "final", "int", "INCLUDE_BLOCK_COMMENTS", "=", "CodeFormatter", ".", "F_INCLUDE_COMMENTS", "|", "CodeFormatter", ".", "K_MULTI_LINE_COMMENT", ";", "private", "static", "final", "int", "INCLUDE_JAVA_DOC", "=", "CodeFormatter", ".", "F_INCLUDE_COMMENTS", "|", "CodeFormatter", ".", "K_JAVA_DOC", ";", "private", "static", "final", "int", "INCLUDE_LINE_COMMENTS", "=", "CodeFormatter", ".", "F_INCLUDE_COMMENTS", "|", "CodeFormatter", ".", "K_SINGLE_LINE_COMMENT", ";", "private", "static", "final", "int", "SKIP_FIRST_WHITESPACE_TOKEN", "=", "-", "2", ";", "private", "static", "final", "int", "INVALID_TOKEN", "=", "2000", ";", "static", "final", "int", "NO_TRAILING_COMMENT", "=", "0x0000", ";", "static", "final", "int", "BASIC_TRAILING_COMMENT", "=", "0x0100", ";", "static", "final", "int", "COMPLEX_TRAILING_COMMENT", "=", "0x0200", ";", "static", "final", "int", "IMPORT_TRAILING_COMMENT", "=", "COMPLEX_TRAILING_COMMENT", "|", "0x0001", ";", "static", "final", "int", "UNMODIFIABLE_TRAILING_COMMENT", "=", "0x0400", ";", "private", "int", "formatComments", "=", "0", ";", "private", "int", "headerEndPosition", "=", "-", "1", ";", "String", "commentIndentation", ";", "static", "class", "LineComment", "{", "boolean", "contiguous", "=", "false", ";", "int", "currentIndentation", ",", "indentation", ";", "int", "lines", ";", "char", "[", "]", "leadingSpaces", ";", "}", "final", "LineComment", "lastLineComment", "=", "new", "LineComment", "(", ")", ";", "private", "FormatterCommentParser", "formatterCommentParser", ";", "OptimizedReplaceEdit", "previousDisabledEdit", ";", "private", "char", "[", "]", "disablingTag", ",", "enablingTag", ";", "private", "String", "[", "]", "newEmptyLines", "=", "new", "String", "[", "10", "]", ";", "private", "static", "String", "[", "]", "COMMENT_INDENTATIONS", "=", "new", "String", "[", "20", "]", ";", "private", "final", "StringBuffer", "tempBuffer", "=", "new", "StringBuffer", "(", ")", ";", "private", "final", "StringBuffer", "blockCommentBuffer", "=", "new", "StringBuffer", "(", ")", ";", "private", "final", "StringBuffer", "blockCommentTokensBuffer", "=", "new", "StringBuffer", "(", ")", ";", "private", "final", "StringBuffer", "codeSnippetBuffer", "=", "new", "StringBuffer", "(", ")", ";", "private", "final", "StringBuffer", "javadocBlockRefBuffer", "=", "new", "StringBuffer", "(", ")", ";", "private", "final", "StringBuffer", "javadocGapLinesBuffer", "=", "new", "StringBuffer", "(", ")", ";", "private", "StringBuffer", "[", "]", "javadocHtmlTagBuffers", "=", "new", "StringBuffer", "[", "5", "]", ";", "private", "final", "StringBuffer", "javadocTextBuffer", "=", "new", "StringBuffer", "(", ")", ";", "private", "final", "StringBuffer", "javadocTokensBuffer", "=", "new", "StringBuffer", "(", ")", ";", "Scribe", "(", "CodeFormatterVisitor", "formatter", ",", "long", "sourceLevel", ",", "IRegion", "[", "]", "regions", ",", "CodeSnippetParsingUtil", "codeSnippetParsingUtil", ",", "boolean", "includeComments", ")", "{", "initializeScanner", "(", "sourceLevel", ",", "formatter", ".", "preferences", ")", ";", "this", ".", "formatter", "=", "formatter", ";", "this", ".", "pageWidth", "=", "formatter", ".", "preferences", ".", "page_width", ";", "this", ".", "tabLength", "=", "formatter", ".", "preferences", ".", "tab_size", ";", "this", ".", "indentationLevel", "=", "0", ";", "this", ".", "numberOfIndentations", "=", "0", ";", "this", ".", "useTabsOnlyForLeadingIndents", "=", "formatter", ".", "preferences", ".", "use_tabs_only_for_leading_indentations", ";", "this", ".", "indentEmptyLines", "=", "formatter", ".", "preferences", ".", "indent_empty_lines", ";", "this", ".", "tabChar", "=", "formatter", ".", "preferences", ".", "tab_char", ";", "if", "(", "this", ".", "tabChar", "==", "DefaultCodeFormatterOptions", ".", "MIXED", ")", "{", "this", ".", "indentationSize", "=", "formatter", ".", "preferences", ".", "indentation_size", ";", "}", "else", "{", "this", ".", "indentationSize", "=", "this", ".", "tabLength", ";", "}", "this", ".", "lineSeparator", "=", "formatter", ".", "preferences", ".", "line_separator", ";", "this", ".", "lineSeparatorAndSpace", "=", "this", ".", "lineSeparator", "+", "'", "'", ";", "this", ".", "firstLS", "=", "this", ".", "lineSeparator", ".", "charAt", "(", "0", ")", ";", "this", ".", "lsLength", "=", "this", ".", "lineSeparator", ".", "length", "(", ")", ";", "this", ".", "indentationLevel", "=", "formatter", ".", "preferences", ".", "initial_indentation_level", "*", "this", ".", "indentationSize", ";", "this", ".", "regions", "=", "regions", ";", "if", "(", "codeSnippetParsingUtil", "!=", "null", ")", "{", "final", "RecordedParsingInformation", "information", "=", "codeSnippetParsingUtil", ".", "recordedParsingInformation", ";", "if", "(", "information", "!=", "null", ")", "{", "this", ".", "lineEnds", "=", "information", ".", "lineEnds", ";", "this", ".", "commentPositions", "=", "information", ".", "commentPositions", ";", "}", "}", "if", "(", "formatter", ".", "preferences", ".", "comment_format_line_comment", ")", "this", ".", "formatComments", "|=", "CodeFormatter", ".", "K_SINGLE_LINE_COMMENT", ";", "if", "(", "formatter", ".", "preferences", ".", "comment_format_block_comment", ")", "this", ".", "formatComments", "|=", "CodeFormatter", ".", "K_MULTI_LINE_COMMENT", ";", "if", "(", "formatter", ".", "preferences", ".", "comment_format_javadoc_comment", ")", "this", ".", "formatComments", "|=", "CodeFormatter", ".", "K_JAVA_DOC", ";", "if", "(", "includeComments", ")", "this", ".", "formatComments", "|=", "CodeFormatter", ".", "F_INCLUDE_COMMENTS", ";", "reset", "(", ")", ";", "}", "private", "void", "adaptRegions", "(", ")", "{", "int", "max", "=", "this", ".", "regions", ".", "length", ";", "if", "(", "max", "==", "1", ")", "{", "if", "(", "this", ".", "regions", "[", "0", "]", ".", "getOffset", "(", ")", "==", "0", "&&", "this", ".", "regions", "[", "0", "]", ".", "getLength", "(", ")", "==", "this", ".", "scannerEndPosition", ")", "{", "this", ".", "adaptedRegions", "=", "this", ".", "regions", ";", "return", ";", "}", "}", "this", ".", "adaptedRegions", "=", "new", "IRegion", "[", "max", "]", ";", "int", "commentIndex", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "max", ";", "i", "++", ")", "{", "IRegion", "aRegion", "=", "this", ".", "regions", "[", "i", "]", ";", "int", "offset", "=", "aRegion", ".", "getOffset", "(", ")", ";", "int", "length", "=", "aRegion", ".", "getLength", "(", ")", ";", "int", "index", "=", "getCommentIndex", "(", "commentIndex", ",", "offset", ")", ";", "int", "adaptedOffset", "=", "offset", ";", "int", "adaptedLength", "=", "length", ";", "if", "(", "index", ">=", "0", ")", "{", "adaptedOffset", "=", "this", ".", "commentPositions", "[", "index", "]", "[", "0", "]", ";", "if", "(", "adaptedOffset", ">=", "0", ")", "{", "adaptedLength", "=", "length", "+", "offset", "-", "adaptedOffset", ";", "commentIndex", "=", "index", ";", "}", "}", "index", "=", "getCommentIndex", "(", "commentIndex", ",", "offset", "+", "length", "-", "1", ")", ";", "if", "(", "index", ">=", "0", "&&", "this", ".", "commentPositions", "[", "index", "]", "[", "0", "]", ">=", "0", ")", "{", "int", "commentEnd", "=", "this", ".", "commentPositions", "[", "index", "]", "[", "1", "]", ";", "if", "(", "commentEnd", "<", "0", ")", "commentEnd", "=", "-", "commentEnd", ";", "adaptedLength", "=", "commentEnd", "-", "adaptedOffset", ";", "commentIndex", "=", "index", ";", "}", "if", "(", "adaptedLength", "!=", "length", ")", "{", "this", ".", "adaptedRegions", "[", "i", "]", "=", "new", "Region", "(", "adaptedOffset", ",", "adaptedLength", ")", ";", "}", "else", "{", "this", ".", "adaptedRegions", "[", "i", "]", "=", "aRegion", ";", "}", "}", "}", "private", "void", "adaptEdits", "(", ")", "{", "int", "max", "=", "this", ".", "regions", ".", "length", ";", "if", "(", "max", "==", "1", ")", "{", "if", "(", "this", ".", "regions", "[", "0", "]", ".", "getOffset", "(", ")", "==", "0", "&&", "this", ".", "regions", "[", "0", "]", ".", "getLength", "(", ")", "==", "this", ".", "scannerEndPosition", ")", "{", "return", ";", "}", "}", "OptimizedReplaceEdit", "[", "]", "sortedEdits", "=", "new", "OptimizedReplaceEdit", "[", "this", ".", "editsIndex", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "edits", ",", "0", ",", "sortedEdits", ",", "0", ",", "this", ".", "editsIndex", ")", ";", "Arrays", ".", "sort", "(", "sortedEdits", ",", "new", "Comparator", "(", ")", "{", "public", "int", "compare", "(", "Object", "o1", ",", "Object", "o2", ")", "{", "OptimizedReplaceEdit", "edit1", "=", "(", "OptimizedReplaceEdit", ")", "o1", ";", "OptimizedReplaceEdit", "edit2", "=", "(", "OptimizedReplaceEdit", ")", "o2", ";", "return", "edit1", ".", "offset", "-", "edit2", ".", "offset", ";", "}", "}", ")", ";", "int", "currentEdit", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "max", ";", "i", "++", ")", "{", "IRegion", "region", "=", "this", ".", "adaptedRegions", "[", "i", "]", ";", "int", "offset", "=", "region", ".", "getOffset", "(", ")", ";", "int", "length", "=", "region", ".", "getLength", "(", ")", ";", "int", "index", "=", "adaptEdit", "(", "sortedEdits", ",", "currentEdit", ",", "offset", ",", "offset", "+", "length", ")", ";", "if", "(", "index", "!=", "-", "1", ")", "{", "currentEdit", "=", "index", ";", "}", "}", "if", "(", "currentEdit", "!=", "-", "1", ")", "{", "int", "length", "=", "sortedEdits", ".", "length", ";", "for", "(", "int", "e", "=", "currentEdit", ";", "e", "<", "length", ";", "e", "++", ")", "{", "sortedEdits", "[", "e", "]", ".", "offset", "=", "-", "1", ";", "}", "}", "}", "private", "int", "adaptEdit", "(", "OptimizedReplaceEdit", "[", "]", "sortedEdits", ",", "int", "start", ",", "int", "regionStart", ",", "int", "regionEnd", ")", "{", "int", "initialStart", "=", "start", "==", "-", "1", "?", "0", ":", "start", ";", "int", "bottom", "=", "initialStart", ",", "top", "=", "sortedEdits", ".", "length", "-", "1", ";", "int", "topEnd", "=", "top", ";", "int", "i", "=", "0", ";", "OptimizedReplaceEdit", "edit", "=", "null", ";", "int", "overlapIndex", "=", "-", "1", ";", "while", "(", "bottom", "<=", "top", ")", "{", "i", "=", "bottom", "+", "(", "top", "-", "bottom", ")", "/", "2", ";", "edit", "=", "sortedEdits", "[", "i", "]", ";", "int", "editStart", "=", "edit", ".", "offset", ";", "int", "editEnd", "=", "editStart", "+", "edit", ".", "length", ";", "if", "(", "editStart", ">", "regionStart", ")", "{", "top", "=", "i", "-", "1", ";", "if", "(", "editStart", ">", "regionEnd", ")", "{", "topEnd", "=", "top", ";", "}", "}", "else", "{", "if", "(", "editEnd", "<", "regionStart", ")", "{", "bottom", "=", "i", "+", "1", ";", "}", "else", "{", "int", "linesOutside", "=", "0", ";", "StringBuffer", "spacesOutside", "=", "new", "StringBuffer", "(", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "editStart", ",", "editEnd", "-", "1", ")", ";", "while", "(", "this", ".", "scanner", ".", "currentPosition", "<", "regionStart", "&&", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "char", "ch", "=", "(", "char", ")", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "switch", "(", "ch", ")", "{", "case", "'\\n'", ":", "linesOutside", "++", ";", "spacesOutside", ".", "setLength", "(", "0", ")", ";", "break", ";", "case", "'\\r'", ":", "break", ";", "default", ":", "spacesOutside", ".", "append", "(", "ch", ")", ";", "break", ";", "}", "}", "edit", ".", "offset", "=", "regionStart", ";", "int", "editLength", "=", "edit", ".", "length", ";", "edit", ".", "length", "-=", "edit", ".", "offset", "-", "editStart", ";", "int", "length", "=", "edit", ".", "replacement", ".", "length", "(", ")", ";", "if", "(", "length", ">", "0", ")", "{", "int", "linesReplaced", "=", "0", ";", "for", "(", "int", "idx", "=", "0", ";", "idx", "<", "length", ";", "idx", "++", ")", "{", "if", "(", "edit", ".", "replacement", ".", "charAt", "(", "idx", ")", "==", "'\\n'", ")", "linesReplaced", "++", ";", "}", "if", "(", "editLength", ">", "0", "&&", "edit", ".", "length", "==", "0", "&&", "editEnd", "==", "regionStart", "&&", "linesReplaced", "==", "0", "&&", "linesOutside", "==", "0", ")", "{", "edit", ".", "offset", "=", "-", "1", ";", "}", "else", "{", "if", "(", "linesReplaced", ">", "0", ")", "{", "int", "linesCount", "=", "linesOutside", ">=", "linesReplaced", "?", "linesReplaced", ":", "linesOutside", ";", "if", "(", "linesCount", ">", "0", ")", "{", "int", "idx", "=", "0", ";", "loop", ":", "while", "(", "idx", "<", "length", ")", "{", "char", "ch", "=", "edit", ".", "replacement", ".", "charAt", "(", "idx", ")", ";", "switch", "(", "ch", ")", "{", "case", "'\\n'", ":", "linesCount", "--", ";", "if", "(", "linesCount", "==", "0", ")", "{", "idx", "++", ";", "break", "loop", ";", "}", "break", ";", "case", "'\\r'", ":", "case", "'", "'", ":", "case", "'\\t'", ":", "break", ";", "default", ":", "break", "loop", ";", "}", "idx", "++", ";", "}", "int", "spacesOutsideLength", "=", "spacesOutside", ".", "length", "(", ")", ";", "int", "replacementStart", "=", "idx", ";", "for", "(", "int", "o", "=", "0", ",", "r", "=", "0", ";", "o", "<", "spacesOutsideLength", "&&", "r", "<", "(", "length", "-", "idx", ")", ";", "o", "++", ")", "{", "char", "rch", "=", "edit", ".", "replacement", ".", "charAt", "(", "idx", "+", "r", ")", ";", "char", "och", "=", "spacesOutside", ".", "charAt", "(", "o", ")", ";", "if", "(", "rch", "==", "och", ")", "{", "replacementStart", "++", ";", "r", "++", ";", "}", "else", "if", "(", "rch", "==", "'\\t'", "&&", "(", "this", ".", "tabLength", ">", "0", "&&", "och", "==", "'", "'", ")", ")", "{", "if", "(", "(", "o", "+", "1", ")", "%", "this", ".", "tabLength", "==", "0", ")", "{", "replacementStart", "++", ";", "r", "++", ";", "}", "}", "else", "{", "break", ";", "}", "}", "if", "(", "replacementStart", ">", "length", "||", "(", "replacementStart", "==", "length", "&&", "spacesOutsideLength", ">", "0", ")", ")", "{", "edit", ".", "offset", "=", "-", "1", ";", "}", "else", "if", "(", "spacesOutsideLength", "==", "0", "&&", "replacementStart", "==", "length", ")", "{", "edit", ".", "replacement", "=", "\"\"", ";", "}", "else", "{", "edit", ".", "replacement", "=", "edit", ".", "replacement", ".", "substring", "(", "replacementStart", ")", ";", "}", "}", "}", "}", "}", "overlapIndex", "=", "i", ";", "break", ";", "}", "}", "}", "int", "validIndex", "=", "(", "overlapIndex", "!=", "-", "1", ")", "?", "overlapIndex", ":", "bottom", ";", "if", "(", "overlapIndex", "!=", "-", "1", ")", "bottom", "=", "overlapIndex", ";", "while", "(", "bottom", "<=", "topEnd", ")", "{", "i", "=", "bottom", "+", "(", "topEnd", "-", "bottom", ")", "/", "2", ";", "edit", "=", "sortedEdits", "[", "i", "]", ";", "int", "editStart", "=", "edit", ".", "offset", ";", "int", "editEnd", "=", "editStart", "+", "edit", ".", "length", ";", "if", "(", "regionEnd", "<", "editStart", ")", "{", "topEnd", "=", "i", "-", "1", ";", "}", "else", "if", "(", "regionEnd", "==", "editStart", ")", "{", "topEnd", "=", "i", "-", "1", ";", "if", "(", "edit", ".", "length", "==", "0", ")", "{", "int", "nrLength", "=", "0", ";", "int", "rLength", "=", "edit", ".", "replacement", ".", "length", "(", ")", ";", "if", "(", "nrLength", "<", "rLength", ")", "{", "int", "ch", "=", "edit", ".", "replacement", ".", "charAt", "(", "nrLength", ")", ";", "loop", ":", "while", "(", "nrLength", "<", "rLength", ")", "{", "switch", "(", "ch", ")", "{", "case", "'", "'", ":", "case", "'\\t'", ":", "nrLength", "++", ";", "break", ";", "default", ":", "break", "loop", ";", "}", "}", "}", "if", "(", "nrLength", ">", "0", ")", "{", "topEnd", "++", ";", "if", "(", "nrLength", "<", "rLength", ")", "{", "edit", ".", "replacement", "=", "edit", ".", "replacement", ".", "substring", "(", "0", ",", "nrLength", ")", ";", "}", "}", "}", "break", ";", "}", "else", "if", "(", "editEnd", "<=", "regionEnd", ")", "{", "bottom", "=", "i", "+", "1", ";", "}", "else", "{", "int", "linesOutside", "=", "0", ";", "this", ".", "scanner", ".", "resetTo", "(", "editStart", ",", "editEnd", "-", "1", ")", ";", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "boolean", "after", "=", "this", ".", "scanner", ".", "currentPosition", ">=", "regionEnd", ";", "char", "ch", "=", "(", "char", ")", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "if", "(", "ch", "==", "'\\n'", ")", "{", "if", "(", "after", ")", "linesOutside", "++", ";", "}", "}", "int", "length", "=", "edit", ".", "replacement", ".", "length", "(", ")", ";", "if", "(", "length", ">", "0", ")", "{", "int", "linesReplaced", "=", "0", ";", "for", "(", "int", "idx", "=", "0", ";", "idx", "<", "length", ";", "idx", "++", ")", "{", "if", "(", "edit", ".", "replacement", ".", "charAt", "(", "idx", ")", "==", "'\\n'", ")", "linesReplaced", "++", ";", "}", "if", "(", "linesReplaced", "==", "0", ")", "{", "edit", ".", "replacement", "=", "\"\"", ";", "}", "else", "{", "int", "linesCount", "=", "linesReplaced", ">", "linesOutside", "?", "linesReplaced", "-", "linesOutside", ":", "0", ";", "if", "(", "linesCount", "==", "0", ")", "{", "edit", ".", "replacement", "=", "\"\"", ";", "}", "else", "{", "edit", ".", "replacement", "=", "getNewLineString", "(", "linesCount", ")", ";", "}", "}", "}", "edit", ".", "length", "=", "regionEnd", "-", "editStart", ";", "topEnd", "=", "i", ";", "break", ";", "}", "}", "for", "(", "int", "e", "=", "initialStart", ";", "e", "<", "validIndex", ";", "e", "++", ")", "{", "sortedEdits", "[", "e", "]", ".", "offset", "=", "-", "1", ";", "}", "return", "topEnd", "+", "1", ";", "}", "private", "final", "void", "addDeleteEdit", "(", "int", "start", ",", "int", "end", ")", "{", "if", "(", "this", ".", "edits", ".", "length", "==", "this", ".", "editsIndex", ")", "{", "resize", "(", ")", ";", "}", "addOptimizedReplaceEdit", "(", "start", ",", "end", "-", "start", "+", "1", ",", "Util", ".", "EMPTY_STRING", ")", ";", "}", "public", "final", "void", "addInsertEdit", "(", "int", "insertPosition", ",", "String", "insertedString", ")", "{", "if", "(", "this", ".", "edits", ".", "length", "==", "this", ".", "editsIndex", ")", "{", "resize", "(", ")", ";", "}", "addOptimizedReplaceEdit", "(", "insertPosition", ",", "0", ",", "insertedString", ")", ";", "}", "private", "final", "void", "addOptimizedReplaceEdit", "(", "int", "offset", ",", "int", "length", ",", "String", "replacement", ")", "{", "if", "(", "!", "this", ".", "editsEnabled", ")", "{", "if", "(", "this", ".", "previousDisabledEdit", "!=", "null", "&&", "this", ".", "previousDisabledEdit", ".", "offset", "==", "offset", ")", "{", "replacement", "=", "this", ".", "previousDisabledEdit", ".", "replacement", ";", "}", "this", ".", "previousDisabledEdit", "=", "null", ";", "if", "(", "replacement", ".", "indexOf", "(", "this", ".", "lineSeparator", ")", ">=", "0", ")", "{", "if", "(", "length", "==", "0", "||", "printNewLinesCharacters", "(", "offset", ",", "length", ")", ")", "{", "this", ".", "previousDisabledEdit", "=", "new", "OptimizedReplaceEdit", "(", "offset", ",", "length", ",", "replacement", ")", ";", "}", "}", "return", ";", "}", "if", "(", "this", ".", "editsIndex", ">", "0", ")", "{", "final", "OptimizedReplaceEdit", "previous", "=", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", ";", "final", "int", "previousOffset", "=", "previous", ".", "offset", ";", "final", "int", "previousLength", "=", "previous", ".", "length", ";", "final", "int", "endOffsetOfPreviousEdit", "=", "previousOffset", "+", "previousLength", ";", "final", "int", "replacementLength", "=", "replacement", ".", "length", "(", ")", ";", "final", "String", "previousReplacement", "=", "previous", ".", "replacement", ";", "final", "int", "previousReplacementLength", "=", "previousReplacement", ".", "length", "(", ")", ";", "if", "(", "previousOffset", "==", "offset", "&&", "previousLength", "==", "length", "&&", "(", "replacementLength", "==", "0", "||", "previousReplacementLength", "==", "0", ")", ")", "{", "if", "(", "this", ".", "currentAlignment", "!=", "null", ")", "{", "final", "Location", "location", "=", "this", ".", "currentAlignment", ".", "location", ";", "if", "(", "location", ".", "editsIndex", "==", "this", ".", "editsIndex", ")", "{", "location", ".", "editsIndex", "--", ";", "location", ".", "textEdit", "=", "previous", ";", "}", "}", "this", ".", "editsIndex", "--", ";", "return", ";", "}", "if", "(", "endOffsetOfPreviousEdit", "==", "offset", ")", "{", "if", "(", "length", "!=", "0", ")", "{", "if", "(", "replacementLength", "!=", "0", ")", "{", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", "=", "new", "OptimizedReplaceEdit", "(", "previousOffset", ",", "previousLength", "+", "length", ",", "previousReplacement", "+", "replacement", ")", ";", "}", "else", "if", "(", "previousLength", "+", "length", "==", "previousReplacementLength", ")", "{", "boolean", "canBeRemoved", "=", "true", ";", "loop", ":", "for", "(", "int", "i", "=", "previousOffset", ";", "i", "<", "previousOffset", "+", "previousReplacementLength", ";", "i", "++", ")", "{", "if", "(", "this", ".", "scanner", ".", "source", "[", "i", "]", "!=", "previousReplacement", ".", "charAt", "(", "i", "-", "previousOffset", ")", ")", "{", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", "=", "new", "OptimizedReplaceEdit", "(", "previousOffset", ",", "previousReplacementLength", ",", "previousReplacement", ")", ";", "canBeRemoved", "=", "false", ";", "break", "loop", ";", "}", "}", "if", "(", "canBeRemoved", ")", "{", "if", "(", "this", ".", "currentAlignment", "!=", "null", ")", "{", "final", "Location", "location", "=", "this", ".", "currentAlignment", ".", "location", ";", "if", "(", "location", ".", "editsIndex", "==", "this", ".", "editsIndex", ")", "{", "location", ".", "editsIndex", "--", ";", "location", ".", "textEdit", "=", "previous", ";", "}", "}", "this", ".", "editsIndex", "--", ";", "}", "}", "else", "{", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", "=", "new", "OptimizedReplaceEdit", "(", "previousOffset", ",", "previousLength", "+", "length", ",", "previousReplacement", ")", ";", "}", "}", "else", "{", "if", "(", "replacementLength", "!=", "0", ")", "{", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", "=", "new", "OptimizedReplaceEdit", "(", "previousOffset", ",", "previousLength", ",", "previousReplacement", "+", "replacement", ")", ";", "}", "}", "}", "else", "if", "(", "(", "offset", "+", "length", "==", "previousOffset", ")", "&&", "(", "previousLength", "+", "length", "==", "replacementLength", "+", "previousReplacementLength", ")", ")", "{", "boolean", "canBeRemoved", "=", "true", ";", "String", "totalReplacement", "=", "replacement", "+", "previousReplacement", ";", "loop", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<", "previousLength", "+", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "scanner", ".", "source", "[", "i", "+", "offset", "]", "!=", "totalReplacement", ".", "charAt", "(", "i", ")", ")", "{", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", "=", "new", "OptimizedReplaceEdit", "(", "offset", ",", "previousLength", "+", "length", ",", "totalReplacement", ")", ";", "canBeRemoved", "=", "false", ";", "break", "loop", ";", "}", "}", "if", "(", "canBeRemoved", ")", "{", "if", "(", "this", ".", "currentAlignment", "!=", "null", ")", "{", "final", "Location", "location", "=", "this", ".", "currentAlignment", ".", "location", ";", "if", "(", "location", ".", "editsIndex", "==", "this", ".", "editsIndex", ")", "{", "location", ".", "editsIndex", "--", ";", "location", ".", "textEdit", "=", "previous", ";", "}", "}", "this", ".", "editsIndex", "--", ";", "}", "}", "else", "{", "this", ".", "edits", "[", "this", ".", "editsIndex", "++", "]", "=", "new", "OptimizedReplaceEdit", "(", "offset", ",", "length", ",", "replacement", ")", ";", "}", "}", "else", "{", "this", ".", "edits", "[", "this", ".", "editsIndex", "++", "]", "=", "new", "OptimizedReplaceEdit", "(", "offset", ",", "length", ",", "replacement", ")", ";", "}", "}", "public", "final", "void", "addReplaceEdit", "(", "int", "start", ",", "int", "end", ",", "String", "replacement", ")", "{", "if", "(", "this", ".", "edits", ".", "length", "==", "this", ".", "editsIndex", ")", "{", "resize", "(", ")", ";", "}", "addOptimizedReplaceEdit", "(", "start", ",", "end", "-", "start", "+", "1", ",", "replacement", ")", ";", "}", "public", "void", "alignFragment", "(", "Alignment", "alignment", ",", "int", "fragmentIndex", ")", "{", "alignment", ".", "fragmentIndex", "=", "fragmentIndex", ";", "alignment", ".", "checkColumn", "(", ")", ";", "alignment", ".", "performFragmentEffect", "(", ")", ";", "}", "public", "void", "checkNLSTag", "(", "int", "sourceStart", ")", "{", "if", "(", "hasNLSTag", "(", "sourceStart", ")", ")", "{", "this", ".", "nlsTagCounter", "++", ";", "}", "}", "private", "int", "consumeInvalidToken", "(", "int", "end", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "scanner", ".", "startPosition", ",", "end", ")", ";", "if", "(", "this", ".", "scanner", ".", "currentCharacter", "==", "'\\\\'", ")", "{", "this", ".", "scanner", ".", "currentPosition", "=", "this", ".", "scanner", ".", "startPosition", "+", "1", ";", "}", "int", "previousPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "char", "ch", "=", "(", "char", ")", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "if", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "return", "INVALID_TOKEN", ";", "}", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", "&&", "ch", "!=", "'*'", "&&", "!", "ScannerHelper", ".", "isWhitespace", "(", "ch", ")", ")", "{", "previousPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "ch", "=", "(", "char", ")", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "}", "this", ".", "scanner", ".", "currentPosition", "=", "previousPosition", ";", "return", "INVALID_TOKEN", ";", "}", "public", "Alignment", "createAlignment", "(", "int", "kind", ",", "int", "mode", ",", "int", "count", ",", "int", "sourceRestart", ")", "{", "return", "createAlignment", "(", "kind", ",", "mode", ",", "Alignment", ".", "R_INNERMOST", ",", "count", ",", "sourceRestart", ")", ";", "}", "public", "Alignment", "createAlignment", "(", "int", "kind", ",", "int", "mode", ",", "int", "tieBreakRule", ",", "int", "count", ",", "int", "sourceRestart", ")", "{", "return", "createAlignment", "(", "kind", ",", "mode", ",", "tieBreakRule", ",", "count", ",", "sourceRestart", ",", "this", ".", "formatter", ".", "preferences", ".", "continuation_indentation", ",", "false", ")", ";", "}", "public", "Alignment", "createAlignment", "(", "int", "kind", ",", "int", "mode", ",", "int", "count", ",", "int", "sourceRestart", ",", "int", "continuationIndent", ",", "boolean", "adjust", ")", "{", "return", "createAlignment", "(", "kind", ",", "mode", ",", "Alignment", ".", "R_INNERMOST", ",", "count", ",", "sourceRestart", ",", "continuationIndent", ",", "adjust", ")", ";", "}", "public", "Alignment", "createAlignment", "(", "int", "kind", ",", "int", "mode", ",", "int", "tieBreakRule", ",", "int", "count", ",", "int", "sourceRestart", ",", "int", "continuationIndent", ",", "boolean", "adjust", ")", "{", "Alignment", "alignment", "=", "new", "Alignment", "(", "kind", ",", "mode", ",", "tieBreakRule", ",", "this", ",", "count", ",", "sourceRestart", ",", "continuationIndent", ")", ";", "if", "(", "(", "this", ".", "currentAlignment", "==", "null", "&&", "this", ".", "formatter", ".", "expressionsDepth", ">=", "0", ")", "||", "(", "this", ".", "currentAlignment", "!=", "null", "&&", "this", ".", "currentAlignment", ".", "kind", "==", "Alignment", ".", "BINARY_EXPRESSION", "&&", "(", "this", ".", "formatter", ".", "expressionsPos", "&", "CodeFormatterVisitor", ".", "EXPRESSIONS_POS_MASK", ")", "==", "CodeFormatterVisitor", ".", "EXPRESSIONS_POS_BETWEEN_TWO", ")", ")", "{", "switch", "(", "kind", ")", "{", "case", "Alignment", ".", "CONDITIONAL_EXPRESSION", ":", "case", "Alignment", ".", "MESSAGE_ARGUMENTS", ":", "case", "Alignment", ".", "MESSAGE_SEND", ":", "if", "(", "this", ".", "formatter", ".", "lastBinaryExpressionAlignmentBreakIndentation", "==", "alignment", ".", "breakIndentationLevel", ")", "{", "alignment", ".", "breakIndentationLevel", "+=", "this", ".", "indentationSize", ";", "alignment", ".", "shiftBreakIndentationLevel", "+=", "this", ".", "indentationSize", ";", "this", ".", "formatter", ".", "lastBinaryExpressionAlignmentBreakIndentation", "=", "0", ";", "}", "break", ";", "}", "}", "if", "(", "adjust", "&&", "this", ".", "memberAlignment", "!=", "null", ")", "{", "Alignment", "current", "=", "this", ".", "memberAlignment", ";", "while", "(", "current", ".", "enclosing", "!=", "null", ")", "{", "current", "=", "current", ".", "enclosing", ";", "}", "if", "(", "(", "current", ".", "mode", "&", "Alignment", ".", "M_MULTICOLUMN", ")", "!=", "0", ")", "{", "final", "int", "indentSize", "=", "this", ".", "indentationSize", ";", "switch", "(", "current", ".", "chunkKind", ")", "{", "case", "Alignment", ".", "CHUNK_METHOD", ":", "case", "Alignment", ".", "CHUNK_TYPE", ":", "if", "(", "(", "mode", "&", "Alignment", ".", "M_INDENT_BY_ONE", ")", "!=", "0", ")", "{", "alignment", ".", "breakIndentationLevel", "=", "this", ".", "indentationLevel", "+", "indentSize", ";", "}", "else", "{", "alignment", ".", "breakIndentationLevel", "=", "this", ".", "indentationLevel", "+", "continuationIndent", "*", "indentSize", ";", "}", "alignment", ".", "update", "(", ")", ";", "break", ";", "case", "Alignment", ".", "CHUNK_FIELD", ":", "if", "(", "(", "mode", "&", "Alignment", ".", "M_INDENT_BY_ONE", ")", "!=", "0", ")", "{", "alignment", ".", "breakIndentationLevel", "=", "current", ".", "originalIndentationLevel", "+", "indentSize", ";", "}", "else", "{", "alignment", ".", "breakIndentationLevel", "=", "current", ".", "originalIndentationLevel", "+", "continuationIndent", "*", "indentSize", ";", "}", "alignment", ".", "update", "(", ")", ";", "break", ";", "}", "}", "else", "{", "switch", "(", "current", ".", "mode", "&", "Alignment", ".", "SPLIT_MASK", ")", "{", "case", "Alignment", ".", "M_COMPACT_SPLIT", ":", "case", "Alignment", ".", "M_COMPACT_FIRST_BREAK_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ":", "case", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ":", "final", "int", "indentSize", "=", "this", ".", "indentationSize", ";", "switch", "(", "current", ".", "chunkKind", ")", "{", "case", "Alignment", ".", "CHUNK_METHOD", ":", "case", "Alignment", ".", "CHUNK_TYPE", ":", "if", "(", "(", "mode", "&", "Alignment", ".", "M_INDENT_BY_ONE", ")", "!=", "0", ")", "{", "alignment", ".", "breakIndentationLevel", "=", "this", ".", "indentationLevel", "+", "indentSize", ";", "}", "else", "{", "alignment", ".", "breakIndentationLevel", "=", "this", ".", "indentationLevel", "+", "continuationIndent", "*", "indentSize", ";", "}", "alignment", ".", "update", "(", ")", ";", "break", ";", "case", "Alignment", ".", "CHUNK_FIELD", ":", "if", "(", "(", "mode", "&", "Alignment", ".", "M_INDENT_BY_ONE", ")", "!=", "0", ")", "{", "alignment", ".", "breakIndentationLevel", "=", "current", ".", "originalIndentationLevel", "+", "indentSize", ";", "}", "else", "{", "alignment", ".", "breakIndentationLevel", "=", "current", ".", "originalIndentationLevel", "+", "continuationIndent", "*", "indentSize", ";", "}", "alignment", ".", "update", "(", ")", ";", "break", ";", "}", "break", ";", "}", "}", "}", "return", "alignment", ";", "}", "public", "Alignment", "createMemberAlignment", "(", "int", "kind", ",", "int", "mode", ",", "int", "count", ",", "int", "sourceRestart", ")", "{", "Alignment", "mAlignment", "=", "createAlignment", "(", "kind", ",", "mode", ",", "Alignment", ".", "R_INNERMOST", ",", "count", ",", "sourceRestart", ")", ";", "mAlignment", ".", "breakIndentationLevel", "=", "this", ".", "indentationLevel", ";", "return", "mAlignment", ";", "}", "public", "void", "enterAlignment", "(", "Alignment", "alignment", ")", "{", "alignment", ".", "enclosing", "=", "this", ".", "currentAlignment", ";", "alignment", ".", "location", ".", "lastLocalDeclarationSourceStart", "=", "this", ".", "formatter", ".", "lastLocalDeclarationSourceStart", ";", "this", ".", "currentAlignment", "=", "alignment", ";", "}", "public", "void", "enterMemberAlignment", "(", "Alignment", "alignment", ")", "{", "alignment", ".", "enclosing", "=", "this", ".", "memberAlignment", ";", "alignment", ".", "location", ".", "lastLocalDeclarationSourceStart", "=", "this", ".", "formatter", ".", "lastLocalDeclarationSourceStart", ";", "this", ".", "memberAlignment", "=", "alignment", ";", "}", "public", "void", "exitAlignment", "(", "Alignment", "alignment", ",", "boolean", "discardAlignment", ")", "{", "Alignment", "current", "=", "this", ".", "currentAlignment", ";", "while", "(", "current", "!=", "null", ")", "{", "if", "(", "current", "==", "alignment", ")", "break", ";", "current", "=", "current", ".", "enclosing", ";", "}", "if", "(", "current", "==", "null", ")", "{", "throw", "new", "AbortFormatting", "(", "\"\"", "+", "alignment", ")", ";", "}", "this", ".", "indentationLevel", "=", "alignment", ".", "location", ".", "outputIndentationLevel", ";", "this", ".", "numberOfIndentations", "=", "alignment", ".", "location", ".", "numberOfIndentations", ";", "this", ".", "formatter", ".", "lastLocalDeclarationSourceStart", "=", "alignment", ".", "location", ".", "lastLocalDeclarationSourceStart", ";", "if", "(", "discardAlignment", ")", "{", "this", ".", "currentAlignment", "=", "alignment", ".", "enclosing", ";", "if", "(", "this", ".", "currentAlignment", "==", "null", ")", "{", "this", ".", "formatter", ".", "lastBinaryExpressionAlignmentBreakIndentation", "=", "0", ";", "}", "}", "}", "public", "void", "exitMemberAlignment", "(", "Alignment", "alignment", ")", "{", "Alignment", "current", "=", "this", ".", "memberAlignment", ";", "while", "(", "current", "!=", "null", ")", "{", "if", "(", "current", "==", "alignment", ")", "break", ";", "current", "=", "current", ".", "enclosing", ";", "}", "if", "(", "current", "==", "null", ")", "{", "throw", "new", "AbortFormatting", "(", "\"\"", "+", "alignment", ")", ";", "}", "this", ".", "indentationLevel", "=", "current", ".", "location", ".", "outputIndentationLevel", ";", "this", ".", "numberOfIndentations", "=", "current", ".", "location", ".", "numberOfIndentations", ";", "this", ".", "formatter", ".", "lastLocalDeclarationSourceStart", "=", "alignment", ".", "location", ".", "lastLocalDeclarationSourceStart", ";", "this", ".", "memberAlignment", "=", "current", ".", "enclosing", ";", "}", "public", "int", "getColumnIndentationLevel", "(", ")", "{", "return", "this", ".", "column", "-", "1", ";", "}", "public", "final", "int", "getCommentIndex", "(", "int", "position", ")", "{", "if", "(", "this", ".", "commentPositions", "==", "null", ")", "return", "-", "1", ";", "int", "length", "=", "this", ".", "commentPositions", ".", "length", ";", "if", "(", "length", "==", "0", ")", "{", "return", "-", "1", ";", "}", "int", "g", "=", "0", ",", "d", "=", "length", "-", "1", ";", "int", "m", "=", "0", ";", "while", "(", "g", "<=", "d", ")", "{", "m", "=", "g", "+", "(", "d", "-", "g", ")", "/", "2", ";", "int", "bound", "=", "this", ".", "commentPositions", "[", "m", "]", "[", "1", "]", ";", "if", "(", "bound", "<", "0", ")", "{", "bound", "=", "-", "bound", ";", "}", "if", "(", "bound", "<", "position", ")", "{", "g", "=", "m", "+", "1", ";", "}", "else", "if", "(", "bound", ">", "position", ")", "{", "d", "=", "m", "-", "1", ";", "}", "else", "{", "return", "m", ";", "}", "}", "return", "-", "(", "g", "+", "1", ")", ";", "}", "private", "int", "getCommentIndex", "(", "int", "start", ",", "int", "position", ")", "{", "int", "commentsLength", "=", "this", ".", "commentPositions", "==", "null", "?", "0", ":", "this", ".", "commentPositions", ".", "length", ";", "if", "(", "commentsLength", "==", "0", ")", "return", "-", "1", ";", "if", "(", "position", "==", "0", ")", "{", "if", "(", "commentsLength", ">", "0", "&&", "this", ".", "commentPositions", "[", "0", "]", "[", "0", "]", "==", "0", ")", "{", "return", "0", ";", "}", "return", "-", "1", ";", "}", "int", "bottom", "=", "start", ",", "top", "=", "commentsLength", "-", "1", ";", "int", "i", "=", "0", ";", "int", "[", "]", "comment", "=", "null", ";", "while", "(", "bottom", "<=", "top", ")", "{", "i", "=", "bottom", "+", "(", "top", "-", "bottom", ")", "/", "2", ";", "comment", "=", "this", ".", "commentPositions", "[", "i", "]", ";", "int", "commentStart", "=", "comment", "[", "0", "]", ";", "if", "(", "commentStart", "<", "0", ")", "commentStart", "=", "-", "commentStart", ";", "if", "(", "position", "<", "commentStart", ")", "{", "top", "=", "i", "-", "1", ";", "}", "else", "{", "int", "commentEnd", "=", "comment", "[", "1", "]", ";", "if", "(", "commentEnd", "<", "0", ")", "commentEnd", "=", "-", "commentEnd", ";", "if", "(", "position", ">=", "commentEnd", ")", "{", "bottom", "=", "i", "+", "1", ";", "}", "else", "{", "return", "i", ";", "}", "}", "}", "return", "-", "1", ";", "}", "private", "int", "getCurrentCommentIndentation", "(", "int", "start", ")", "{", "int", "linePtr", "=", "-", "Arrays", ".", "binarySearch", "(", "this", ".", "lineEnds", ",", "start", ")", ";", "int", "indentation", "=", "0", ";", "int", "beginningOfLine", "=", "getLineEnd", "(", "linePtr", "-", "1", ")", "+", "1", ";", "if", "(", "beginningOfLine", "==", "-", "1", ")", "{", "beginningOfLine", "=", "0", ";", "}", "int", "currentStartPosition", "=", "start", ";", "char", "[", "]", "source", "=", "this", ".", "scanner", ".", "source", ";", "while", "(", "beginningOfLine", ">", "currentStartPosition", ")", "{", "if", "(", "linePtr", ">", "0", ")", "{", "beginningOfLine", "=", "getLineEnd", "(", "--", "linePtr", ")", "+", "1", ";", "}", "else", "{", "beginningOfLine", "=", "0", ";", "break", ";", "}", "}", "for", "(", "int", "i", "=", "beginningOfLine", ";", "i", "<", "currentStartPosition", ";", "i", "++", ")", "{", "char", "currentCharacter", "=", "source", "[", "i", "]", ";", "switch", "(", "currentCharacter", ")", "{", "case", "'\\t'", ":", "if", "(", "this", ".", "tabLength", "!=", "0", ")", "{", "int", "reminder", "=", "indentation", "%", "this", ".", "tabLength", ";", "if", "(", "reminder", "==", "0", ")", "{", "indentation", "+=", "this", ".", "tabLength", ";", "}", "else", "{", "indentation", "=", "(", "(", "indentation", "/", "this", ".", "tabLength", ")", "+", "1", ")", "*", "this", ".", "tabLength", ";", "}", "}", "break", ";", "case", "'\\r'", ":", "case", "'\\n'", ":", "indentation", "=", "0", ";", "break", ";", "default", ":", "indentation", "++", ";", "break", ";", "}", "}", "return", "indentation", ";", "}", "int", "getCurrentIndentation", "(", "char", "[", "]", "whitespaces", ",", "int", "offset", ")", "{", "if", "(", "whitespaces", "==", "null", ")", "return", "offset", ";", "int", "length", "=", "whitespaces", ".", "length", ";", "if", "(", "this", ".", "tabLength", "==", "0", ")", "return", "length", ";", "int", "indentation", "=", "offset", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "char", "ch", "=", "whitespaces", "[", "i", "]", ";", "switch", "(", "ch", ")", "{", "case", "'\\t'", ":", "int", "reminder", "=", "indentation", "%", "this", ".", "tabLength", ";", "if", "(", "reminder", "==", "0", ")", "{", "indentation", "+=", "this", ".", "tabLength", ";", "}", "else", "{", "indentation", "=", "(", "(", "indentation", "/", "this", ".", "tabLength", ")", "+", "1", ")", "*", "this", ".", "tabLength", ";", "}", "break", ";", "case", "'\\r'", ":", "case", "'\\n'", ":", "indentation", "=", "0", ";", "break", ";", "default", ":", "indentation", "++", ";", "break", ";", "}", "}", "return", "indentation", ";", "}", "int", "getCurrentIndentation", "(", "int", "start", ")", "{", "int", "linePtr", "=", "Arrays", ".", "binarySearch", "(", "this", ".", "lineEnds", ",", "start", ")", ";", "if", "(", "linePtr", "<", "0", ")", "{", "linePtr", "=", "-", "linePtr", "-", "1", ";", "}", "int", "indentation", "=", "0", ";", "int", "beginningOfLine", "=", "getLineEnd", "(", "linePtr", ")", "+", "1", ";", "if", "(", "beginningOfLine", "==", "-", "1", ")", "{", "beginningOfLine", "=", "0", ";", "}", "char", "[", "]", "source", "=", "this", ".", "scanner", ".", "source", ";", "for", "(", "int", "i", "=", "beginningOfLine", ";", "i", "<", "start", ";", "i", "++", ")", "{", "char", "currentCharacter", "=", "source", "[", "i", "]", ";", "switch", "(", "currentCharacter", ")", "{", "case", "'\\t'", ":", "if", "(", "this", ".", "tabLength", "!=", "0", ")", "{", "int", "reminder", "=", "indentation", "%", "this", ".", "tabLength", ";", "if", "(", "reminder", "==", "0", ")", "{", "indentation", "+=", "this", ".", "tabLength", ";", "}", "else", "{", "indentation", "=", "(", "(", "indentation", "/", "this", ".", "tabLength", ")", "+", "1", ")", "*", "this", ".", "tabLength", ";", "}", "}", "break", ";", "case", "'\\r'", ":", "case", "'\\n'", ":", "indentation", "=", "0", ";", "break", ";", "case", "'", "'", ":", "indentation", "++", ";", "break", ";", "default", ":", "return", "indentation", ";", "}", "}", "return", "indentation", ";", "}", "public", "String", "getEmptyLines", "(", "int", "linesNumber", ")", "{", "if", "(", "this", ".", "nlsTagCounter", ">", "0", ")", "{", "return", "Util", ".", "EMPTY_STRING", ";", "}", "String", "emptyLines", ";", "if", "(", "this", ".", "lastNumberOfNewLines", "==", "0", ")", "{", "linesNumber", "++", ";", "if", "(", "this", ".", "indentEmptyLines", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "linesNumber", ";", "i", "++", ")", "{", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "}", "emptyLines", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "}", "else", "{", "emptyLines", "=", "getNewLineString", "(", "linesNumber", ")", ";", "}", "this", ".", "lastNumberOfNewLines", "+=", "linesNumber", ";", "this", ".", "line", "+=", "linesNumber", ";", "this", ".", "column", "=", "1", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "pendingSpace", "=", "false", ";", "}", "else", "if", "(", "this", ".", "lastNumberOfNewLines", "==", "1", ")", "{", "if", "(", "this", ".", "indentEmptyLines", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "linesNumber", ";", "i", "++", ")", "{", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "}", "emptyLines", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "}", "else", "{", "emptyLines", "=", "getNewLineString", "(", "linesNumber", ")", ";", "}", "this", ".", "lastNumberOfNewLines", "+=", "linesNumber", ";", "this", ".", "line", "+=", "linesNumber", ";", "this", ".", "column", "=", "1", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "pendingSpace", "=", "false", ";", "}", "else", "{", "if", "(", "(", "this", ".", "lastNumberOfNewLines", "-", "1", ")", ">=", "linesNumber", ")", "{", "return", "Util", ".", "EMPTY_STRING", ";", "}", "final", "int", "realNewLineNumber", "=", "linesNumber", "-", "this", ".", "lastNumberOfNewLines", "+", "1", ";", "if", "(", "this", ".", "indentEmptyLines", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "realNewLineNumber", ";", "i", "++", ")", "{", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "}", "emptyLines", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "}", "else", "{", "emptyLines", "=", "getNewLineString", "(", "realNewLineNumber", ")", ";", "}", "this", ".", "lastNumberOfNewLines", "+=", "realNewLineNumber", ";", "this", ".", "line", "+=", "realNewLineNumber", ";", "this", ".", "column", "=", "1", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "pendingSpace", "=", "false", ";", "}", "return", "emptyLines", ";", "}", "public", "OptimizedReplaceEdit", "getLastEdit", "(", ")", "{", "if", "(", "this", ".", "editsIndex", ">", "0", ")", "{", "return", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", ";", "}", "return", "null", ";", "}", "public", "final", "int", "getLineEnd", "(", "int", "lineNumber", ")", "{", "if", "(", "this", ".", "lineEnds", "==", "null", ")", "return", "-", "1", ";", "if", "(", "lineNumber", ">=", "this", ".", "lineEnds", ".", "length", "+", "1", ")", "return", "this", ".", "scannerEndPosition", ";", "if", "(", "lineNumber", "<=", "0", ")", "return", "-", "1", ";", "return", "this", ".", "lineEnds", "[", "lineNumber", "-", "1", "]", ";", "}", "Alignment", "getMemberAlignment", "(", ")", "{", "return", "this", ".", "memberAlignment", ";", "}", "public", "String", "getNewLine", "(", ")", "{", "if", "(", "this", ".", "nlsTagCounter", ">", "0", ")", "{", "return", "Util", ".", "EMPTY_STRING", ";", "}", "if", "(", "this", ".", "lastNumberOfNewLines", ">=", "1", ")", "{", "this", ".", "column", "=", "1", ";", "return", "Util", ".", "EMPTY_STRING", ";", "}", "this", ".", "line", "++", ";", "this", ".", "lastNumberOfNewLines", "=", "1", ";", "this", ".", "column", "=", "1", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "pendingSpace", "=", "false", ";", "return", "this", ".", "lineSeparator", ";", "}", "private", "String", "getNewLineString", "(", "int", "linesCount", ")", "{", "int", "length", "=", "this", ".", "newEmptyLines", ".", "length", ";", "if", "(", "linesCount", ">", "length", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "newEmptyLines", ",", "0", ",", "this", ".", "newEmptyLines", "=", "new", "String", "[", "linesCount", "+", "10", "]", ",", "0", ",", "length", ")", ";", "}", "String", "newLineString", "=", "this", ".", "newEmptyLines", "[", "linesCount", "-", "1", "]", ";", "if", "(", "newLineString", "==", "null", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "linesCount", ";", "j", "++", ")", "{", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "}", "newLineString", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "this", ".", "newEmptyLines", "[", "linesCount", "-", "1", "]", "=", "newLineString", ";", "}", "return", "newLineString", ";", "}", "public", "int", "getNextIndentationLevel", "(", "int", "someColumn", ")", "{", "int", "indent", "=", "someColumn", "-", "1", ";", "if", "(", "indent", "==", "0", ")", "return", "this", ".", "indentationLevel", ";", "if", "(", "this", ".", "tabChar", "==", "DefaultCodeFormatterOptions", ".", "TAB", ")", "{", "if", "(", "this", ".", "useTabsOnlyForLeadingIndents", ")", "{", "return", "indent", ";", "}", "if", "(", "this", ".", "indentationSize", "==", "0", ")", "{", "return", "indent", ";", "}", "int", "rem", "=", "indent", "%", "this", ".", "indentationSize", ";", "int", "addition", "=", "rem", "==", "0", "?", "0", ":", "this", ".", "indentationSize", "-", "rem", ";", "return", "indent", "+", "addition", ";", "}", "return", "indent", ";", "}", "private", "String", "getPreserveEmptyLines", "(", "int", "count", ",", "int", "emptyLinesRules", ")", "{", "if", "(", "count", "==", "0", ")", "{", "int", "currentIndentationLevel", "=", "this", ".", "indentationLevel", ";", "int", "useAlignmentBreakIndentation", "=", "useAlignmentBreakIndentation", "(", "emptyLinesRules", ")", ";", "switch", "(", "useAlignmentBreakIndentation", ")", "{", "case", "PRESERVE_EMPTY_LINES_DO_NOT_USE_ANY_INDENTATION", ":", "return", "Util", ".", "EMPTY_STRING", ";", "default", ":", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "getNewLine", "(", ")", ")", ";", "printIndentationIfNecessary", "(", "buffer", ")", ";", "if", "(", "useAlignmentBreakIndentation", "==", "PRESERVE_EMPTY_LINES_USE_TEMPORARY_INDENTATION", ")", "{", "this", ".", "indentationLevel", "=", "currentIndentationLevel", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "if", "(", "this", ".", "blank_lines_between_import_groups", ">=", "0", ")", "{", "useAlignmentBreakIndentation", "(", "emptyLinesRules", ")", ";", "return", "getEmptyLines", "(", "this", ".", "blank_lines_between_import_groups", ")", ";", "}", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "number_of_empty_lines_to_preserve", "!=", "0", ")", "{", "useAlignmentBreakIndentation", "(", "emptyLinesRules", ")", ";", "int", "linesToPreserve", "=", "Math", ".", "min", "(", "count", ",", "this", ".", "formatter", ".", "preferences", ".", "number_of_empty_lines_to_preserve", ")", ";", "return", "getEmptyLines", "(", "linesToPreserve", ")", ";", "}", "return", "getNewLine", "(", ")", ";", "}", "private", "int", "useAlignmentBreakIndentation", "(", "int", "emptyLinesRules", ")", "{", "boolean", "specificEmptyLinesRule", "=", "emptyLinesRules", "!=", "PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION", ";", "if", "(", "(", "this", ".", "currentAlignment", "!=", "null", "||", "specificEmptyLinesRule", ")", "&&", "!", "this", ".", "formatter", ".", "preferences", ".", "join_wrapped_lines", ")", "{", "if", "(", "this", ".", "lastNumberOfNewLines", "==", "0", "||", "specificEmptyLinesRule", "||", "this", ".", "formatter", ".", "arrayInitializersDepth", ">=", "0", ")", "{", "boolean", "useAlignmentBreakIndentation", ";", "boolean", "useAlignmentShiftBreakIndentation", "=", "false", ";", "boolean", "useLastBinaryExpressionAlignmentBreakIndentation", "=", "false", ";", "switch", "(", "emptyLinesRules", ")", "{", "case", "DO_NOT_PRESERVE_EMPTY_LINES", ":", "case", "PRESERVE_EMPTY_LINES_IN_SWITCH_CASE", ":", "case", "PRESERVE_EMPTY_LINES_AT_END_OF_METHOD_DECLARATION", ":", "case", "PRESERVE_EMPTY_LINES_AT_END_OF_BLOCK", ":", "return", "PRESERVE_EMPTY_LINES_DO_NOT_USE_ANY_INDENTATION", ";", "case", "PRESERVE_EMPTY_LINES_IN_BINARY_EXPRESSION", ":", "useAlignmentBreakIndentation", "=", "true", ";", "if", "(", "(", "this", ".", "formatter", ".", "expressionsPos", "&", "CodeFormatterVisitor", ".", "EXPRESSIONS_POS_MASK", ")", "==", "CodeFormatterVisitor", ".", "EXPRESSIONS_POS_BETWEEN_TWO", ")", "{", "useLastBinaryExpressionAlignmentBreakIndentation", "=", "true", ";", "}", "break", ";", "case", "PRESERVE_EMPTY_LINES_IN_EQUALITY_EXPRESSION", ":", "useAlignmentShiftBreakIndentation", "=", "this", ".", "currentAlignment", "==", "null", "||", "this", ".", "currentAlignment", ".", "kind", "==", "Alignment", ".", "BINARY_EXPRESSION", ";", "useAlignmentBreakIndentation", "=", "!", "useAlignmentShiftBreakIndentation", ";", "break", ";", "case", "PRESERVE_EMPTY_LINES_IN_FORMAT_OPENING_BRACE", ":", "useAlignmentBreakIndentation", "=", "this", ".", "formatter", ".", "arrayInitializersDepth", "<=", "1", "&&", "this", ".", "currentAlignment", "!=", "null", "&&", "this", ".", "currentAlignment", ".", "kind", "==", "Alignment", ".", "ARRAY_INITIALIZER", ";", "break", ";", "case", "PRESERVE_EMPTY_LINES_IN_FORMAT_LEFT_CURLY_BRACE", ":", "useAlignmentBreakIndentation", "=", "false", ";", "break", ";", "default", ":", "if", "(", "(", "emptyLinesRules", "&", "0xFFFF", ")", "==", "PRESERVE_EMPTY_LINES_IN_CLOSING_ARRAY_INITIALIZER", "&&", "this", ".", "scanner", ".", "currentCharacter", "==", "'}'", ")", "{", "this", ".", "indentationLevel", "=", "emptyLinesRules", ">>", "16", ";", "this", ".", "preserveLineBreakIndentation", "=", "true", ";", "return", "PRESERVE_EMPTY_LINES_USE_CURRENT_INDENTATION", ";", "}", "useAlignmentBreakIndentation", "=", "true", ";", "break", ";", "}", "Alignment", "alignment", "=", "this", ".", "currentAlignment", ";", "if", "(", "alignment", "==", "null", ")", "{", "if", "(", "useLastBinaryExpressionAlignmentBreakIndentation", ")", "{", "if", "(", "this", ".", "indentationLevel", "<", "this", ".", "formatter", ".", "lastBinaryExpressionAlignmentBreakIndentation", ")", "{", "this", ".", "indentationLevel", "=", "this", ".", "formatter", ".", "lastBinaryExpressionAlignmentBreakIndentation", ";", "}", "}", "if", "(", "useAlignmentShiftBreakIndentation", "&&", "this", ".", "memberAlignment", "!=", "null", ")", "{", "if", "(", "this", ".", "indentationLevel", "<", "this", ".", "memberAlignment", ".", "shiftBreakIndentationLevel", ")", "{", "this", ".", "indentationLevel", "=", "this", ".", "memberAlignment", ".", "shiftBreakIndentationLevel", ";", "}", "}", "}", "else", "{", "if", "(", "this", ".", "memberAlignment", "!=", "null", "&&", "this", ".", "memberAlignment", ".", "location", ".", "inputOffset", ">", "alignment", ".", "location", ".", "inputOffset", ")", "{", "alignment", "=", "this", ".", "memberAlignment", ";", "}", "if", "(", "useLastBinaryExpressionAlignmentBreakIndentation", ")", "{", "if", "(", "this", ".", "indentationLevel", "<", "this", ".", "formatter", ".", "lastBinaryExpressionAlignmentBreakIndentation", ")", "{", "this", ".", "indentationLevel", "=", "this", ".", "formatter", ".", "lastBinaryExpressionAlignmentBreakIndentation", ";", "}", "}", "if", "(", "useAlignmentBreakIndentation", ")", "{", "if", "(", "this", ".", "indentationLevel", "<", "alignment", ".", "breakIndentationLevel", ")", "{", "this", ".", "indentationLevel", "=", "alignment", ".", "breakIndentationLevel", ";", "}", "}", "else", "if", "(", "useAlignmentShiftBreakIndentation", ")", "{", "if", "(", "this", ".", "indentationLevel", "<", "alignment", ".", "shiftBreakIndentationLevel", ")", "{", "this", ".", "indentationLevel", "=", "alignment", ".", "shiftBreakIndentationLevel", ";", "}", "}", "}", "this", ".", "preserveLineBreakIndentation", "=", "true", ";", "if", "(", "useLastBinaryExpressionAlignmentBreakIndentation", "||", "useAlignmentShiftBreakIndentation", ")", "{", "return", "PRESERVE_EMPTY_LINES_USE_TEMPORARY_INDENTATION", ";", "}", "return", "PRESERVE_EMPTY_LINES_USE_CURRENT_INDENTATION", ";", "}", "}", "return", "PRESERVE_EMPTY_LINES_DO_NOT_USE_ANY_INDENTATION", ";", "}", "public", "TextEdit", "getRootEdit", "(", ")", "{", "adaptRegions", "(", ")", ";", "adaptEdits", "(", ")", ";", "MultiTextEdit", "edit", "=", "null", ";", "int", "regionsLength", "=", "this", ".", "adaptedRegions", ".", "length", ";", "int", "textRegionStart", ";", "int", "textRegionEnd", ";", "if", "(", "regionsLength", "==", "1", ")", "{", "IRegion", "lastRegion", "=", "this", ".", "adaptedRegions", "[", "0", "]", ";", "textRegionStart", "=", "lastRegion", ".", "getOffset", "(", ")", ";", "textRegionEnd", "=", "textRegionStart", "+", "lastRegion", ".", "getLength", "(", ")", ";", "}", "else", "{", "textRegionStart", "=", "this", ".", "adaptedRegions", "[", "0", "]", ".", "getOffset", "(", ")", ";", "IRegion", "lastRegion", "=", "this", ".", "adaptedRegions", "[", "regionsLength", "-", "1", "]", ";", "textRegionEnd", "=", "lastRegion", ".", "getOffset", "(", ")", "+", "lastRegion", ".", "getLength", "(", ")", ";", "}", "int", "length", "=", "textRegionEnd", "-", "textRegionStart", "+", "1", ";", "if", "(", "textRegionStart", "<=", "0", ")", "{", "if", "(", "length", "<=", "0", ")", "{", "edit", "=", "new", "MultiTextEdit", "(", "0", ",", "0", ")", ";", "}", "else", "{", "edit", "=", "new", "MultiTextEdit", "(", "0", ",", "textRegionEnd", ")", ";", "}", "}", "else", "{", "edit", "=", "new", "MultiTextEdit", "(", "textRegionStart", ",", "length", "-", "1", ")", ";", "}", "for", "(", "int", "i", "=", "0", ",", "max", "=", "this", ".", "editsIndex", ";", "i", "<", "max", ";", "i", "++", ")", "{", "OptimizedReplaceEdit", "currentEdit", "=", "this", ".", "edits", "[", "i", "]", ";", "if", "(", "currentEdit", ".", "offset", ">=", "0", "&&", "currentEdit", ".", "offset", "<=", "this", ".", "scannerEndPosition", ")", "{", "if", "(", "currentEdit", ".", "length", "==", "0", "||", "(", "currentEdit", ".", "offset", "!=", "this", ".", "scannerEndPosition", "&&", "isMeaningfulEdit", "(", "currentEdit", ")", ")", ")", "{", "try", "{", "edit", ".", "addChild", "(", "new", "ReplaceEdit", "(", "currentEdit", ".", "offset", ",", "currentEdit", ".", "length", ",", "currentEdit", ".", "replacement", ")", ")", ";", "}", "catch", "(", "MalformedTreeException", "ex", ")", "{", "CommentFormatterUtil", ".", "log", "(", "ex", ")", ";", "throw", "ex", ";", "}", "}", "}", "}", "this", ".", "edits", "=", "null", ";", "return", "edit", ";", "}", "public", "void", "handleLineTooLong", "(", ")", "{", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "wrap_outer_expressions_when_nested", ")", "{", "handleLineTooLongSmartly", "(", ")", ";", "return", ";", "}", "int", "relativeDepth", "=", "0", ",", "outerMostDepth", "=", "-", "1", ";", "Alignment", "targetAlignment", "=", "this", ".", "currentAlignment", ";", "while", "(", "targetAlignment", "!=", "null", ")", "{", "if", "(", "targetAlignment", ".", "tieBreakRule", "==", "Alignment", ".", "R_OUTERMOST", "&&", "targetAlignment", ".", "couldBreak", "(", ")", ")", "{", "outerMostDepth", "=", "relativeDepth", ";", "}", "targetAlignment", "=", "targetAlignment", ".", "enclosing", ";", "relativeDepth", "++", ";", "}", "if", "(", "outerMostDepth", ">=", "0", ")", "{", "throw", "new", "AlignmentException", "(", "AlignmentException", ".", "LINE_TOO_LONG", ",", "outerMostDepth", ")", ";", "}", "relativeDepth", "=", "0", ";", "targetAlignment", "=", "this", ".", "currentAlignment", ";", "while", "(", "targetAlignment", "!=", "null", ")", "{", "if", "(", "targetAlignment", ".", "couldBreak", "(", ")", ")", "{", "throw", "new", "AlignmentException", "(", "AlignmentException", ".", "LINE_TOO_LONG", ",", "relativeDepth", ")", ";", "}", "targetAlignment", "=", "targetAlignment", ".", "enclosing", ";", "relativeDepth", "++", ";", "}", "}", "private", "void", "handleLineTooLongSmartly", "(", ")", "{", "int", "relativeDepth", "=", "0", ",", "outerMostDepth", "=", "-", "1", ";", "Alignment", "targetAlignment", "=", "this", ".", "currentAlignment", ";", "int", "previousKind", "=", "-", "1", ";", "int", "insideMessage", "=", "0", ";", "boolean", "insideStringConcat", "=", "false", ";", "while", "(", "targetAlignment", "!=", "null", ")", "{", "boolean", "couldBreak", "=", "targetAlignment", ".", "tieBreakRule", "==", "Alignment", ".", "R_OUTERMOST", "||", "(", "!", "insideStringConcat", "&&", "insideMessage", ">", "0", "&&", "targetAlignment", ".", "kind", "==", "Alignment", ".", "MESSAGE_ARGUMENTS", "&&", "(", "!", "targetAlignment", ".", "wasReset", "(", ")", "||", "previousKind", "!=", "Alignment", ".", "MESSAGE_SEND", ")", ")", ";", "if", "(", "couldBreak", "&&", "targetAlignment", ".", "couldBreak", "(", ")", ")", "{", "outerMostDepth", "=", "relativeDepth", ";", "}", "switch", "(", "targetAlignment", ".", "kind", ")", "{", "case", "Alignment", ".", "MESSAGE_ARGUMENTS", ":", "case", "Alignment", ".", "MESSAGE_SEND", ":", "insideMessage", "++", ";", "break", ";", "case", "Alignment", ".", "STRING_CONCATENATION", ":", "insideStringConcat", "=", "true", ";", "break", ";", "}", "previousKind", "=", "targetAlignment", ".", "kind", ";", "targetAlignment", "=", "targetAlignment", ".", "enclosing", ";", "relativeDepth", "++", ";", "}", "if", "(", "outerMostDepth", ">=", "0", ")", "{", "throw", "new", "AlignmentException", "(", "AlignmentException", ".", "LINE_TOO_LONG", ",", "outerMostDepth", ")", ";", "}", "relativeDepth", "=", "0", ";", "targetAlignment", "=", "this", ".", "currentAlignment", ";", "AlignmentException", "alignmentException", "=", "null", ";", "int", "msgArgsDepth", "=", "-", "1", ";", "while", "(", "targetAlignment", "!=", "null", ")", "{", "if", "(", "targetAlignment", ".", "kind", "==", "Alignment", ".", "MESSAGE_ARGUMENTS", ")", "{", "msgArgsDepth", "=", "relativeDepth", ";", "}", "if", "(", "alignmentException", "==", "null", ")", "{", "if", "(", "targetAlignment", ".", "couldBreak", "(", ")", ")", "{", "alignmentException", "=", "new", "AlignmentException", "(", "AlignmentException", ".", "LINE_TOO_LONG", ",", "relativeDepth", ")", ";", "if", "(", "insideStringConcat", ")", "throw", "alignmentException", ";", "}", "}", "else", "if", "(", "targetAlignment", ".", "wasSplit", ")", "{", "if", "(", "!", "targetAlignment", ".", "wasReset", "(", ")", ")", "{", "targetAlignment", ".", "reset", "(", ")", ";", "if", "(", "msgArgsDepth", ">", "alignmentException", ".", "relativeDepth", ")", "{", "alignmentException", ".", "relativeDepth", "=", "msgArgsDepth", ";", "}", "throw", "alignmentException", ";", "}", "}", "targetAlignment", "=", "targetAlignment", ".", "enclosing", ";", "relativeDepth", "++", ";", "}", "if", "(", "alignmentException", "!=", "null", ")", "{", "throw", "alignmentException", ";", "}", "if", "(", "this", ".", "currentAlignment", "!=", "null", ")", "{", "this", ".", "currentAlignment", ".", "blockAlign", "=", "false", ";", "this", ".", "currentAlignment", ".", "tooLong", "=", "true", ";", "}", "}", "private", "boolean", "hasNLSTag", "(", "int", "sourceStart", ")", "{", "if", "(", "this", ".", "lineEnds", "==", "null", ")", "return", "false", ";", "int", "index", "=", "Arrays", ".", "binarySearch", "(", "this", ".", "lineEnds", ",", "sourceStart", ")", ";", "int", "currentLineEnd", "=", "getLineEnd", "(", "-", "index", ")", ";", "if", "(", "currentLineEnd", "!=", "-", "1", ")", "{", "int", "commentIndex", "=", "getCommentIndex", "(", "currentLineEnd", ")", ";", "if", "(", "commentIndex", "<", "0", ")", "{", "commentIndex", "=", "-", "commentIndex", "-", "2", ";", "}", "if", "(", "commentIndex", ">=", "0", "&&", "commentIndex", "<", "this", ".", "commentPositions", ".", "length", ")", "{", "int", "start", "=", "this", ".", "commentPositions", "[", "commentIndex", "]", "[", "0", "]", ";", "if", "(", "start", "<", "0", ")", "{", "start", "=", "-", "start", ";", "int", "lineIndexForComment", "=", "Arrays", ".", "binarySearch", "(", "this", ".", "lineEnds", ",", "start", ")", ";", "if", "(", "lineIndexForComment", "==", "index", ")", "{", "return", "CharOperation", ".", "indexOf", "(", "Scanner", ".", "TAG_PREFIX", ",", "this", ".", "scanner", ".", "source", ",", "true", ",", "start", ",", "currentLineEnd", ")", "!=", "-", "1", ";", "}", "}", "}", "}", "return", "false", ";", "}", "private", "boolean", "includesBlockComments", "(", ")", "{", "return", "(", "(", "this", ".", "formatComments", "&", "INCLUDE_BLOCK_COMMENTS", ")", "==", "INCLUDE_BLOCK_COMMENTS", "&&", "this", ".", "headerEndPosition", "<", "this", ".", "scanner", ".", "currentPosition", ")", "||", "(", "this", ".", "formatter", ".", "preferences", ".", "comment_format_header", "&&", "this", ".", "headerEndPosition", ">=", "this", ".", "scanner", ".", "currentPosition", ")", ";", "}", "private", "boolean", "includesJavadocComments", "(", ")", "{", "return", "(", "(", "this", ".", "formatComments", "&", "INCLUDE_JAVA_DOC", ")", "==", "INCLUDE_JAVA_DOC", "&&", "this", ".", "headerEndPosition", "<", "this", ".", "scanner", ".", "currentPosition", ")", "||", "(", "this", ".", "formatter", ".", "preferences", ".", "comment_format_header", "&&", "this", ".", "headerEndPosition", ">=", "this", ".", "scanner", ".", "currentPosition", ")", ";", "}", "private", "boolean", "includesLineComments", "(", ")", "{", "return", "(", "(", "this", ".", "formatComments", "&", "INCLUDE_LINE_COMMENTS", ")", "==", "INCLUDE_LINE_COMMENTS", "&&", "this", ".", "headerEndPosition", "<", "this", ".", "scanner", ".", "currentPosition", ")", "||", "(", "this", ".", "formatter", ".", "preferences", ".", "comment_format_header", "&&", "this", ".", "headerEndPosition", ">=", "this", ".", "scanner", ".", "currentPosition", ")", ";", "}", "boolean", "includesComments", "(", ")", "{", "return", "(", "this", ".", "formatComments", "&", "CodeFormatter", ".", "F_INCLUDE_COMMENTS", ")", "!=", "0", ";", "}", "public", "void", "indent", "(", ")", "{", "this", ".", "indentationLevel", "+=", "this", ".", "indentationSize", ";", "this", ".", "numberOfIndentations", "++", ";", "}", "void", "setIndentation", "(", "int", "level", ",", "int", "n", ")", "{", "this", ".", "indentationLevel", "=", "level", "+", "n", "*", "this", ".", "indentationSize", ";", "this", ".", "numberOfIndentations", "=", "this", ".", "indentationLevel", "/", "this", ".", "indentationSize", ";", "}", "private", "void", "initializeScanner", "(", "long", "sourceLevel", ",", "DefaultCodeFormatterOptions", "preferences", ")", "{", "this", ".", "useTags", "=", "preferences", ".", "use_tags", ";", "this", ".", "tagsKind", "=", "0", ";", "char", "[", "]", "[", "]", "taskTags", "=", "null", ";", "if", "(", "this", ".", "useTags", ")", "{", "this", ".", "disablingTag", "=", "preferences", ".", "disabling_tag", ";", "this", ".", "enablingTag", "=", "preferences", ".", "enabling_tag", ";", "if", "(", "this", ".", "disablingTag", "==", "null", ")", "{", "if", "(", "this", ".", "enablingTag", "!=", "null", ")", "{", "taskTags", "=", "new", "char", "[", "]", "[", "]", "{", "this", ".", "enablingTag", "}", ";", "}", "}", "else", "if", "(", "this", ".", "enablingTag", "==", "null", ")", "{", "taskTags", "=", "new", "char", "[", "]", "[", "]", "{", "this", ".", "disablingTag", "}", ";", "}", "else", "{", "taskTags", "=", "new", "char", "[", "]", "[", "]", "{", "this", ".", "disablingTag", ",", "this", ".", "enablingTag", "}", ";", "}", "}", "if", "(", "taskTags", "!=", "null", ")", "{", "loop", ":", "for", "(", "int", "i", "=", "0", ",", "length", "=", "taskTags", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "taskTags", "[", "i", "]", ".", "length", ">", "2", "&&", "taskTags", "[", "i", "]", "[", "0", "]", "==", "'/'", ")", "{", "switch", "(", "taskTags", "[", "i", "]", "[", "1", "]", ")", "{", "case", "'/'", ":", "this", ".", "tagsKind", "=", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ";", "break", "loop", ";", "case", "'*'", ":", "if", "(", "taskTags", "[", "i", "]", "[", "2", "]", "!=", "'*'", ")", "{", "this", ".", "tagsKind", "=", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ";", "break", "loop", ";", "}", "break", ";", "}", "}", "}", "}", "this", ".", "scanner", "=", "new", "Scanner", "(", "true", ",", "true", ",", "false", ",", "sourceLevel", ",", "taskTags", ",", "null", ",", "true", ")", ";", "this", ".", "editsEnabled", "=", "true", ";", "}", "private", "void", "initFormatterCommentParser", "(", ")", "{", "if", "(", "this", ".", "formatterCommentParser", "==", "null", ")", "{", "this", ".", "formatterCommentParser", "=", "new", "FormatterCommentParser", "(", "this", ".", "scanner", ".", "sourceLevel", ")", ";", "}", "this", ".", "formatterCommentParser", ".", "scanner", ".", "setSource", "(", "this", ".", "scanner", ".", "source", ")", ";", "this", ".", "formatterCommentParser", ".", "source", "=", "this", ".", "scanner", ".", "source", ";", "this", ".", "formatterCommentParser", ".", "scanner", ".", "lineEnds", "=", "this", ".", "lineEnds", ";", "this", ".", "formatterCommentParser", ".", "scanner", ".", "linePtr", "=", "this", ".", "maxLines", ";", "this", ".", "formatterCommentParser", ".", "parseHtmlTags", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_format_html", ";", "}", "private", "boolean", "isOnFirstColumn", "(", "int", "start", ")", "{", "if", "(", "this", ".", "lineEnds", "==", "null", ")", "return", "start", "==", "0", ";", "int", "index", "=", "Arrays", ".", "binarySearch", "(", "this", ".", "lineEnds", ",", "start", ")", ";", "int", "previousLineEnd", "=", "getLineEnd", "(", "-", "index", "-", "1", ")", ";", "return", "previousLineEnd", "!=", "-", "1", "&&", "previousLineEnd", "==", "start", "-", "1", ";", "}", "private", "boolean", "isMeaningfulEdit", "(", "OptimizedReplaceEdit", "edit", ")", "{", "final", "int", "editLength", "=", "edit", ".", "length", ";", "final", "int", "editReplacementLength", "=", "edit", ".", "replacement", ".", "length", "(", ")", ";", "final", "int", "editOffset", "=", "edit", ".", "offset", ";", "if", "(", "editReplacementLength", "!=", "0", "&&", "editLength", "==", "editReplacementLength", ")", "{", "for", "(", "int", "i", "=", "editOffset", ",", "max", "=", "editOffset", "+", "editLength", ";", "i", "<", "max", ";", "i", "++", ")", "{", "if", "(", "this", ".", "scanner", ".", "source", "[", "i", "]", "!=", "edit", ".", "replacement", ".", "charAt", "(", "i", "-", "editOffset", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "return", "true", ";", "}", "private", "void", "preserveEmptyLines", "(", "int", "count", ",", "int", "insertPosition", ")", "{", "if", "(", "count", ">", "0", ")", "{", "if", "(", "this", ".", "blank_lines_between_import_groups", ">=", "0", ")", "{", "printEmptyLines", "(", "this", ".", "blank_lines_between_import_groups", ",", "insertPosition", ")", ";", "}", "else", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "number_of_empty_lines_to_preserve", "!=", "0", ")", "{", "int", "linesToPreserve", "=", "Math", ".", "min", "(", "count", ",", "this", ".", "formatter", ".", "preferences", ".", "number_of_empty_lines_to_preserve", ")", ";", "printEmptyLines", "(", "linesToPreserve", ",", "insertPosition", ")", ";", "}", "else", "{", "printNewLine", "(", "insertPosition", ")", ";", "}", "}", "}", "private", "void", "print", "(", "int", "length", ",", "boolean", "considerSpaceIfAny", ")", "{", "if", "(", "this", ".", "checkLineWrapping", "&&", "length", "+", "this", ".", "column", ">", "this", ".", "pageWidth", ")", "{", "handleLineTooLong", "(", ")", ";", "}", "this", ".", "lastNumberOfNewLines", "=", "0", ";", "if", "(", "this", ".", "indentationLevel", "!=", "0", ")", "{", "printIndentationIfNecessary", "(", ")", ";", "}", "if", "(", "considerSpaceIfAny", ")", "{", "space", "(", ")", ";", "}", "if", "(", "this", ".", "pendingSpace", ")", "{", "addInsertEdit", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "\"", "\"", ")", ";", "}", "this", ".", "pendingSpace", "=", "false", ";", "this", ".", "column", "+=", "length", ";", "this", ".", "needSpace", "=", "true", ";", "}", "private", "void", "printBlockComment", "(", "boolean", "isJavadoc", ")", "{", "int", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ";", "int", "currentTokenEndPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", "+", "1", ";", "boolean", "includesBlockComments", "=", "!", "isJavadoc", "&&", "includesBlockComments", "(", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "currentTokenEndPosition", "-", "1", ")", ";", "int", "currentCharacter", ";", "boolean", "isNewLine", "=", "false", ";", "int", "start", "=", "currentTokenStartPosition", ";", "int", "nextCharacterStart", "=", "currentTokenStartPosition", ";", "int", "previousStart", "=", "currentTokenStartPosition", ";", "boolean", "onFirstColumn", "=", "isOnFirstColumn", "(", "start", ")", ";", "boolean", "indentComment", "=", "false", ";", "if", "(", "this", ".", "indentationLevel", "!=", "0", ")", "{", "if", "(", "isJavadoc", "||", "!", "this", ".", "formatter", ".", "preferences", ".", "never_indent_block_comments_on_first_column", "||", "!", "onFirstColumn", ")", "{", "indentComment", "=", "true", ";", "printIndentationIfNecessary", "(", ")", ";", "}", "}", "if", "(", "this", ".", "pendingSpace", ")", "{", "addInsertEdit", "(", "currentTokenStartPosition", ",", "\"", "\"", ")", ";", "}", "this", ".", "needSpace", "=", "false", ";", "this", ".", "pendingSpace", "=", "false", ";", "int", "commentColumn", "=", "this", ".", "column", ";", "if", "(", "includesBlockComments", ")", "{", "if", "(", "printBlockComment", "(", "currentTokenStartPosition", ",", "currentTokenEndPosition", ")", ")", "{", "return", ";", "}", "}", "int", "currentIndentationLevel", "=", "this", ".", "indentationLevel", ";", "if", "(", "(", "commentColumn", "-", "1", ")", ">", "this", ".", "indentationLevel", ")", "{", "this", ".", "indentationLevel", "=", "commentColumn", "-", "1", ";", "}", "int", "currentCommentIndentation", "=", "onFirstColumn", "?", "0", ":", "getCurrentCommentIndentation", "(", "start", ")", ";", "boolean", "formatComment", "=", "(", "isJavadoc", "&&", "(", "this", ".", "formatComments", "&", "CodeFormatter", ".", "K_JAVA_DOC", ")", "!=", "0", ")", "||", "(", "!", "isJavadoc", "&&", "(", "this", ".", "formatComments", "&", "CodeFormatter", ".", "K_MULTI_LINE_COMMENT", ")", "!=", "0", ")", ";", "try", "{", "while", "(", "nextCharacterStart", "<=", "currentTokenEndPosition", "&&", "(", "currentCharacter", "=", "this", ".", "scanner", ".", "getNextChar", "(", ")", ")", "!=", "-", "1", ")", "{", "nextCharacterStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "switch", "(", "currentCharacter", ")", "{", "case", "'\\r'", ":", "start", "=", "previousStart", ";", "isNewLine", "=", "true", ";", "if", "(", "this", ".", "scanner", ".", "getNextChar", "(", "'\\n'", ")", ")", "{", "currentCharacter", "=", "'\\n'", ";", "nextCharacterStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "}", "break", ";", "case", "'\\n'", ":", "start", "=", "previousStart", ";", "isNewLine", "=", "true", ";", "nextCharacterStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "default", ":", "if", "(", "isNewLine", ")", "{", "this", ".", "column", "=", "1", ";", "this", ".", "line", "++", ";", "isNewLine", "=", "false", ";", "boolean", "addSpace", "=", "false", ";", "if", "(", "onFirstColumn", ")", "{", "if", "(", "formatComment", ")", "{", "if", "(", "ScannerHelper", ".", "isWhitespace", "(", "(", "char", ")", "currentCharacter", ")", ")", "{", "int", "previousStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "while", "(", "currentCharacter", "!=", "-", "1", "&&", "currentCharacter", "!=", "'\\r'", "&&", "currentCharacter", "!=", "'\\n'", "&&", "ScannerHelper", ".", "isWhitespace", "(", "(", "char", ")", "currentCharacter", ")", ")", "{", "previousStart", "=", "nextCharacterStart", ";", "previousStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "currentCharacter", "=", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "nextCharacterStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "}", "if", "(", "currentCharacter", "==", "'\\r'", "||", "currentCharacter", "==", "'\\n'", ")", "{", "nextCharacterStart", "=", "previousStartPosition", ";", "}", "}", "if", "(", "currentCharacter", "!=", "'\\r'", "&&", "currentCharacter", "!=", "'\\n'", ")", "{", "addSpace", "=", "true", ";", "}", "}", "}", "else", "{", "if", "(", "ScannerHelper", ".", "isWhitespace", "(", "(", "char", ")", "currentCharacter", ")", ")", "{", "int", "previousStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "int", "currentIndentation", "=", "0", ";", "loop", ":", "while", "(", "currentCharacter", "!=", "-", "1", "&&", "currentCharacter", "!=", "'\\r'", "&&", "currentCharacter", "!=", "'\\n'", "&&", "ScannerHelper", ".", "isWhitespace", "(", "(", "char", ")", "currentCharacter", ")", ")", "{", "if", "(", "currentIndentation", ">=", "currentCommentIndentation", ")", "{", "break", "loop", ";", "}", "previousStart", "=", "nextCharacterStart", ";", "previousStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "switch", "(", "currentCharacter", ")", "{", "case", "'\\t'", ":", "if", "(", "this", ".", "tabLength", "!=", "0", ")", "{", "int", "reminder", "=", "currentIndentation", "%", "this", ".", "tabLength", ";", "if", "(", "reminder", "==", "0", ")", "{", "currentIndentation", "+=", "this", ".", "tabLength", ";", "}", "else", "{", "currentIndentation", "=", "(", "(", "currentIndentation", "/", "this", ".", "tabLength", ")", "+", "1", ")", "*", "this", ".", "tabLength", ";", "}", "}", "break", ";", "default", ":", "currentIndentation", "++", ";", "}", "currentCharacter", "=", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "nextCharacterStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "}", "if", "(", "currentCharacter", "==", "'\\r'", "||", "currentCharacter", "==", "'\\n'", ")", "{", "nextCharacterStart", "=", "previousStartPosition", ";", "}", "}", "if", "(", "formatComment", ")", "{", "int", "previousStartTemp", "=", "previousStart", ";", "int", "nextCharacterStartTemp", "=", "nextCharacterStart", ";", "while", "(", "currentCharacter", "!=", "-", "1", "&&", "currentCharacter", "!=", "'\\r'", "&&", "currentCharacter", "!=", "'\\n'", "&&", "ScannerHelper", ".", "isWhitespace", "(", "(", "char", ")", "currentCharacter", ")", ")", "{", "previousStart", "=", "nextCharacterStart", ";", "currentCharacter", "=", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "nextCharacterStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "}", "if", "(", "currentCharacter", "==", "'*'", ")", "{", "addSpace", "=", "true", ";", "}", "else", "{", "previousStart", "=", "previousStartTemp", ";", "nextCharacterStart", "=", "nextCharacterStartTemp", ";", "}", "this", ".", "scanner", ".", "currentPosition", "=", "nextCharacterStart", ";", "}", "}", "String", "replacement", ";", "if", "(", "indentComment", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "if", "(", "this", ".", "indentationLevel", ">", "0", ")", "{", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "}", "if", "(", "addSpace", ")", "{", "this", ".", "tempBuffer", ".", "append", "(", "'", "'", ")", ";", "}", "replacement", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "}", "else", "{", "replacement", "=", "addSpace", "?", "this", ".", "lineSeparatorAndSpace", ":", "this", ".", "lineSeparator", ";", "}", "addReplaceEdit", "(", "start", ",", "previousStart", "-", "1", ",", "replacement", ")", ";", "}", "else", "{", "this", ".", "column", "+=", "(", "nextCharacterStart", "-", "previousStart", ")", ";", "}", "}", "previousStart", "=", "nextCharacterStart", ";", "this", ".", "scanner", ".", "currentPosition", "=", "nextCharacterStart", ";", "}", "}", "finally", "{", "this", ".", "indentationLevel", "=", "currentIndentationLevel", ";", "}", "this", ".", "lastNumberOfNewLines", "=", "0", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenEndPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "}", "private", "boolean", "printBlockComment", "(", "int", "currentTokenStartPosition", ",", "int", "currentTokenEndPosition", ")", "{", "int", "maxColumn", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_line_length", "+", "1", ";", "int", "indentLevel", "=", "this", ".", "indentationLevel", ";", "int", "indentations", "=", "this", ".", "numberOfIndentations", ";", "switch", "(", "this", ".", "tabChar", ")", "{", "case", "DefaultCodeFormatterOptions", ".", "TAB", ":", "switch", "(", "this", ".", "tabLength", ")", "{", "case", "0", ":", "this", ".", "indentationLevel", "=", "0", ";", "this", ".", "column", "=", "1", ";", "this", ".", "numberOfIndentations", "=", "0", ";", "break", ";", "case", "1", ":", "this", ".", "indentationLevel", "=", "this", ".", "column", "-", "1", ";", "this", ".", "numberOfIndentations", "=", "this", ".", "indentationLevel", ";", "break", ";", "default", ":", "this", ".", "indentationLevel", "=", "(", "this", ".", "column", "/", "this", ".", "tabLength", ")", "*", "this", ".", "tabLength", ";", "this", ".", "column", "=", "this", ".", "indentationLevel", "+", "1", ";", "this", ".", "numberOfIndentations", "=", "this", ".", "indentationLevel", "/", "this", ".", "tabLength", ";", "}", "break", ";", "case", "DefaultCodeFormatterOptions", ".", "MIXED", ":", "if", "(", "this", ".", "tabLength", "==", "0", ")", "{", "this", ".", "indentationLevel", "=", "0", ";", "this", ".", "column", "=", "1", ";", "this", ".", "numberOfIndentations", "=", "0", ";", "}", "else", "{", "this", ".", "indentationLevel", "=", "this", ".", "column", "-", "1", ";", "this", ".", "numberOfIndentations", "=", "this", ".", "indentationLevel", "/", "this", ".", "tabLength", ";", "}", "break", ";", "case", "DefaultCodeFormatterOptions", ".", "SPACE", ":", "if", "(", "this", ".", "indentationSize", "==", "0", ")", "{", "this", ".", "indentationLevel", "=", "0", ";", "this", ".", "column", "=", "1", ";", "this", ".", "numberOfIndentations", "=", "0", ";", "}", "else", "{", "this", ".", "indentationLevel", "=", "this", ".", "column", "-", "1", ";", "}", "break", ";", "}", "this", ".", "blockCommentBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "this", ".", "column", "+=", "2", ";", "this", ".", "scanner", ".", "skipComments", "=", "true", ";", "this", ".", "blockCommentTokensBuffer", ".", "setLength", "(", "0", ")", ";", "int", "editStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "int", "editEnd", "=", "-", "1", ";", "int", "previousToken", "=", "-", "1", ";", "boolean", "newLine", "=", "false", ";", "boolean", "multiLines", "=", "false", ";", "boolean", "hasMultiLines", "=", "false", ";", "boolean", "hasTokens", "=", "false", ";", "boolean", "bufferHasTokens", "=", "false", ";", "boolean", "bufferHasNewLine", "=", "false", ";", "boolean", "lineHasTokens", "=", "false", ";", "int", "hasTextOnFirstLine", "=", "0", ";", "boolean", "firstWord", "=", "true", ";", "boolean", "clearBlankLines", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_clear_blank_lines_in_block_comment", ";", "boolean", "joinLines", "=", "this", ".", "formatter", ".", "preferences", ".", "join_lines_in_comments", ";", "boolean", "newLinesAtBoundaries", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_new_lines_at_block_boundaries", ";", "int", "scannerLine", "=", "Util", ".", "getLineNumber", "(", "this", ".", "scanner", ".", "currentPosition", ",", "this", ".", "lineEnds", ",", "0", ",", "this", ".", "maxLines", ")", ";", "int", "firstLine", "=", "scannerLine", ";", "int", "lineNumber", "=", "scannerLine", ";", "int", "lastTextLine", "=", "-", "1", ";", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "int", "token", ";", "try", "{", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "}", "catch", "(", "InvalidInputException", "iie", ")", "{", "token", "=", "consumeInvalidToken", "(", "currentTokenEndPosition", "-", "1", ")", ";", "newLine", "=", "false", ";", "}", "boolean", "insertSpace", "=", "(", "previousToken", "==", "TerminalTokens", ".", "TokenNameWHITESPACE", ")", "&&", "(", "!", "firstWord", "||", "!", "hasTokens", ")", ";", "boolean", "isTokenStar", "=", "false", ";", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "if", "(", "this", ".", "blockCommentTokensBuffer", ".", "length", "(", ")", ">", "0", ")", "{", "if", "(", "hasTextOnFirstLine", "==", "1", "&&", "multiLines", ")", "{", "printBlockCommentHeaderLine", "(", "this", ".", "blockCommentBuffer", ")", ";", "hasTextOnFirstLine", "=", "-", "1", ";", "}", "this", ".", "blockCommentBuffer", ".", "append", "(", "this", ".", "blockCommentTokensBuffer", ")", ";", "this", ".", "column", "+=", "this", ".", "blockCommentTokensBuffer", ".", "length", "(", ")", ";", "this", ".", "blockCommentTokensBuffer", ".", "setLength", "(", "0", ")", ";", "bufferHasTokens", "=", "true", ";", "bufferHasNewLine", "=", "false", ";", "}", "if", "(", "previousToken", "==", "-", "1", ")", "{", "previousToken", "=", "SKIP_FIRST_WHITESPACE_TOKEN", ";", "}", "else", "{", "previousToken", "=", "token", ";", "}", "lineNumber", "=", "Util", ".", "getLineNumber", "(", "this", ".", "scanner", ".", "currentPosition", ",", "this", ".", "lineEnds", ",", "scannerLine", ">", "1", "?", "scannerLine", "-", "2", ":", "0", ",", "this", ".", "maxLines", ")", ";", "if", "(", "lineNumber", ">", "scannerLine", ")", "{", "hasMultiLines", "=", "true", ";", "newLine", "=", "true", ";", "}", "scannerLine", "=", "lineNumber", ";", "continue", ";", "case", "TerminalTokens", ".", "TokenNameMULTIPLY", ":", "isTokenStar", "=", "true", ";", "lineNumber", "=", "Util", ".", "getLineNumber", "(", "this", ".", "scanner", ".", "currentPosition", ",", "this", ".", "lineEnds", ",", "scannerLine", ">", "1", "?", "scannerLine", "-", "2", ":", "0", ",", "this", ".", "maxLines", ")", ";", "if", "(", "lineNumber", "==", "firstLine", "&&", "previousToken", "==", "SKIP_FIRST_WHITESPACE_TOKEN", ")", "{", "this", ".", "blockCommentBuffer", ".", "append", "(", "'", "'", ")", ";", "}", "previousToken", "=", "token", ";", "if", "(", "this", ".", "scanner", ".", "currentCharacter", "==", "'/'", ")", "{", "editEnd", "=", "this", ".", "scanner", ".", "startPosition", "-", "1", ";", "if", "(", "this", ".", "blockCommentTokensBuffer", ".", "length", "(", ")", ">", "0", ")", "{", "this", ".", "blockCommentBuffer", ".", "append", "(", "this", ".", "blockCommentTokensBuffer", ")", ";", "this", ".", "column", "+=", "this", ".", "blockCommentTokensBuffer", ".", "length", "(", ")", ";", "}", "if", "(", "newLinesAtBoundaries", ")", "{", "if", "(", "multiLines", "||", "hasMultiLines", ")", "{", "this", ".", "blockCommentBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "blockCommentBuffer", ")", ";", "}", "}", "this", ".", "blockCommentBuffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "+=", "BLOCK_FOOTER_LENGTH", "+", "1", ";", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "continue", ";", "}", "if", "(", "newLine", ")", "{", "scannerLine", "=", "lineNumber", ";", "newLine", "=", "false", ";", "continue", ";", "}", "break", ";", "case", "TerminalTokens", ".", "TokenNameMULTIPLY_EQUAL", ":", "if", "(", "newLine", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "scanner", ".", "startPosition", ",", "currentTokenEndPosition", "-", "1", ")", ";", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "previousToken", "=", "TerminalTokens", ".", "TokenNameMULTIPLY", ";", "scannerLine", "=", "Util", ".", "getLineNumber", "(", "this", ".", "scanner", ".", "currentPosition", ",", "this", ".", "lineEnds", ",", "scannerLine", ">", "1", "?", "scannerLine", "-", "2", ":", "0", ",", "this", ".", "maxLines", ")", ";", "continue", ";", "}", "break", ";", "case", "TerminalTokens", ".", "TokenNameMINUS", ":", "case", "TerminalTokens", ".", "TokenNameMINUS_MINUS", ":", "if", "(", "previousToken", "==", "-", "1", ")", "{", "this", ".", "indentationLevel", "=", "indentLevel", ";", "this", ".", "numberOfIndentations", "=", "indentations", ";", "this", ".", "lastNumberOfNewLines", "=", "0", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "scanner", ".", "skipComments", "=", "false", ";", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "currentTokenEndPosition", "-", "1", ")", ";", "return", "false", ";", "}", "break", ";", "default", ":", "break", ";", "}", "int", "linesGap", ";", "int", "max", ";", "lineNumber", "=", "Util", ".", "getLineNumber", "(", "this", ".", "scanner", ".", "currentPosition", ",", "this", ".", "lineEnds", ",", "scannerLine", ">", "1", "?", "scannerLine", "-", "2", ":", "0", ",", "this", ".", "maxLines", ")", ";", "if", "(", "lastTextLine", "==", "-", "1", ")", "{", "linesGap", "=", "newLinesAtBoundaries", "?", "lineNumber", "-", "firstLine", ":", "0", ";", "max", "=", "0", ";", "}", "else", "{", "linesGap", "=", "lineNumber", "-", "lastTextLine", ";", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameAT", "&&", "linesGap", "==", "1", ")", "{", "linesGap", "=", "2", ";", "}", "max", "=", "joinLines", "&&", "lineHasTokens", "?", "1", ":", "0", ";", "}", "if", "(", "linesGap", ">", "max", ")", "{", "if", "(", "clearBlankLines", ")", "{", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameAT", ")", "{", "linesGap", "=", "1", ";", "}", "else", "{", "linesGap", "=", "(", "max", "==", "0", "||", "!", "joinLines", ")", "?", "1", ":", "0", ";", "}", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "linesGap", ";", "i", "++", ")", "{", "if", "(", "this", ".", "blockCommentTokensBuffer", ".", "length", "(", ")", ">", "0", ")", "{", "if", "(", "hasTextOnFirstLine", "==", "1", ")", "{", "printBlockCommentHeaderLine", "(", "this", ".", "blockCommentBuffer", ")", ";", "hasTextOnFirstLine", "=", "-", "1", ";", "}", "this", ".", "blockCommentBuffer", ".", "append", "(", "this", ".", "blockCommentTokensBuffer", ")", ";", "this", ".", "blockCommentTokensBuffer", ".", "setLength", "(", "0", ")", ";", "bufferHasTokens", "=", "true", ";", "}", "this", ".", "blockCommentBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "blockCommentBuffer", ")", ";", "this", ".", "blockCommentBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "firstWord", "=", "true", ";", "multiLines", "=", "true", ";", "bufferHasNewLine", "=", "true", ";", "}", "insertSpace", "=", "insertSpace", "&&", "linesGap", "==", "0", ";", "}", "if", "(", "newLine", ")", "lineHasTokens", "=", "false", ";", "int", "tokenStart", "=", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ";", "int", "tokenLength", "=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "tokenStart", ";", "hasTokens", "=", "true", ";", "if", "(", "!", "isTokenStar", ")", "lineHasTokens", "=", "true", ";", "if", "(", "hasTextOnFirstLine", "==", "0", "&&", "!", "isTokenStar", ")", "{", "if", "(", "firstLine", "==", "lineNumber", ")", "{", "hasTextOnFirstLine", "=", "1", ";", "this", ".", "column", "++", ";", "}", "else", "{", "hasTextOnFirstLine", "=", "-", "1", ";", "}", "}", "int", "lastColumn", "=", "this", ".", "column", "+", "this", ".", "blockCommentTokensBuffer", ".", "length", "(", ")", "+", "tokenLength", ";", "if", "(", "insertSpace", ")", "lastColumn", "++", ";", "if", "(", "lineHasTokens", "&&", "!", "firstWord", "&&", "lastColumn", ">", "maxColumn", ")", "{", "String", "tokensString", "=", "this", ".", "blockCommentTokensBuffer", ".", "toString", "(", ")", ".", "trim", "(", ")", ";", "int", "tokensStringLength", "=", "tokensString", ".", "length", "(", ")", ";", "if", "(", "hasTextOnFirstLine", "==", "1", ")", "{", "printBlockCommentHeaderLine", "(", "this", ".", "blockCommentBuffer", ")", ";", "}", "if", "(", "(", "this", ".", "indentationLevel", "+", "tokensStringLength", "+", "tokenLength", ")", ">", "maxColumn", ")", "{", "this", ".", "blockCommentBuffer", ".", "append", "(", "this", ".", "blockCommentTokensBuffer", ")", ";", "this", ".", "column", "+=", "this", ".", "blockCommentTokensBuffer", ".", "length", "(", ")", ";", "this", ".", "blockCommentTokensBuffer", ".", "setLength", "(", "0", ")", ";", "bufferHasNewLine", "=", "false", ";", "bufferHasTokens", "=", "true", ";", "}", "if", "(", "bufferHasTokens", "&&", "!", "bufferHasNewLine", ")", "{", "this", ".", "blockCommentBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "blockCommentBuffer", ")", ";", "this", ".", "blockCommentBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "}", "if", "(", "this", ".", "blockCommentTokensBuffer", ".", "length", "(", ")", ">", "0", ")", "{", "this", ".", "blockCommentBuffer", ".", "append", "(", "tokensString", ")", ";", "this", ".", "column", "+=", "tokensStringLength", ";", "this", ".", "blockCommentTokensBuffer", ".", "setLength", "(", "0", ")", ";", "}", "this", ".", "blockCommentBuffer", ".", "append", "(", "this", ".", "scanner", ".", "source", ",", "tokenStart", ",", "tokenLength", ")", ";", "bufferHasTokens", "=", "true", ";", "bufferHasNewLine", "=", "false", ";", "this", ".", "column", "+=", "tokenLength", ";", "multiLines", "=", "true", ";", "hasTextOnFirstLine", "=", "-", "1", ";", "}", "else", "{", "if", "(", "insertSpace", ")", "{", "this", ".", "blockCommentTokensBuffer", ".", "append", "(", "'", "'", ")", ";", "}", "this", ".", "blockCommentTokensBuffer", ".", "append", "(", "this", ".", "scanner", ".", "source", ",", "tokenStart", ",", "tokenLength", ")", ";", "}", "previousToken", "=", "token", ";", "newLine", "=", "false", ";", "firstWord", "=", "false", ";", "scannerLine", "=", "lineNumber", ";", "lastTextLine", "=", "lineNumber", ";", "}", "if", "(", "this", ".", "nlsTagCounter", "==", "0", "||", "!", "multiLines", ")", "{", "if", "(", "hasTokens", "||", "multiLines", ")", "{", "StringBuffer", "replacement", ";", "if", "(", "hasTextOnFirstLine", "==", "1", ")", "{", "this", ".", "blockCommentTokensBuffer", ".", "setLength", "(", "0", ")", ";", "replacement", "=", "this", ".", "blockCommentTokensBuffer", ";", "if", "(", "(", "hasMultiLines", "||", "multiLines", ")", ")", "{", "int", "col", "=", "this", ".", "column", ";", "replacement", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "replacement", ")", ";", "replacement", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "=", "col", ";", "}", "else", "if", "(", "this", ".", "blockCommentBuffer", ".", "length", "(", ")", "==", "0", "||", "this", ".", "blockCommentBuffer", ".", "charAt", "(", "0", ")", "!=", "'", "'", ")", "{", "replacement", ".", "append", "(", "'", "'", ")", ";", "}", "replacement", ".", "append", "(", "this", ".", "blockCommentBuffer", ")", ";", "}", "else", "{", "replacement", "=", "this", ".", "blockCommentBuffer", ";", "}", "addReplaceEdit", "(", "editStart", ",", "editEnd", ",", "replacement", ".", "toString", "(", ")", ")", ";", "}", "}", "this", ".", "indentationLevel", "=", "indentLevel", ";", "this", ".", "numberOfIndentations", "=", "indentations", ";", "this", ".", "lastNumberOfNewLines", "=", "0", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenEndPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "this", ".", "scanner", ".", "skipComments", "=", "false", ";", "return", "true", ";", "}", "private", "void", "printBlockCommentHeaderLine", "(", "StringBuffer", "buffer", ")", "{", "if", "(", "!", "this", ".", "formatter", ".", "preferences", ".", "comment_new_lines_at_block_boundaries", ")", "{", "buffer", ".", "insert", "(", "0", ",", "'", "'", ")", ";", "this", ".", "column", "++", ";", "}", "else", "if", "(", "buffer", ".", "length", "(", ")", "==", "0", ")", "{", "buffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "buffer", ")", ";", "buffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "}", "else", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "buffer", ".", "insert", "(", "0", ",", "this", ".", "tempBuffer", ".", "toString", "(", ")", ")", ";", "}", "}", "public", "void", "printEndOfCompilationUnit", "(", ")", "{", "try", "{", "int", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "boolean", "hasComment", "=", "false", ";", "boolean", "hasLineComment", "=", "false", ";", "boolean", "hasWhitespace", "=", "false", ";", "int", "count", "=", "0", ";", "while", "(", "true", ")", "{", "this", ".", "currentToken", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "switch", "(", "this", ".", "currentToken", ")", "{", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "char", "[", "]", "whiteSpaces", "=", "this", ".", "scanner", ".", "getCurrentTokenSource", "(", ")", ";", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "whiteSpaces", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "switch", "(", "whiteSpaces", "[", "i", "]", ")", "{", "case", "'\\r'", ":", "if", "(", "(", "i", "+", "1", ")", "<", "max", ")", "{", "if", "(", "whiteSpaces", "[", "i", "+", "1", "]", "==", "'\\n'", ")", "{", "i", "++", ";", "}", "}", "count", "++", ";", "break", ";", "case", "'\\n'", ":", "count", "++", ";", "}", "}", "if", "(", "count", "==", "0", ")", "{", "hasWhitespace", "=", "true", ";", "addDeleteEdit", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ")", ";", "}", "else", "if", "(", "hasLineComment", ")", "{", "preserveEmptyLines", "(", "count", ",", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "addDeleteEdit", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ")", ";", "}", "else", "if", "(", "hasComment", ")", "{", "if", "(", "count", "==", "1", ")", "{", "this", ".", "printNewLine", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "else", "{", "preserveEmptyLines", "(", "count", "-", "1", ",", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "addDeleteEdit", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ")", ";", "}", "else", "{", "addDeleteEdit", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ")", ";", "}", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "if", "(", "count", ">=", "1", ")", "{", "if", "(", "count", ">", "1", ")", "{", "preserveEmptyLines", "(", "count", "-", "1", ",", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "else", "if", "(", "count", "==", "1", ")", "{", "printNewLine", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "}", "else", "if", "(", "hasWhitespace", ")", "{", "space", "(", ")", ";", "}", "hasWhitespace", "=", "false", ";", "printLineComment", "(", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "hasLineComment", "=", "true", ";", "count", "=", "0", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "if", "(", "count", ">=", "1", ")", "{", "if", "(", "count", ">", "1", ")", "{", "preserveEmptyLines", "(", "count", "-", "1", ",", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "else", "if", "(", "count", "==", "1", ")", "{", "printNewLine", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "}", "else", "if", "(", "hasWhitespace", ")", "{", "space", "(", ")", ";", "}", "hasWhitespace", "=", "false", ";", "printBlockComment", "(", "false", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "hasLineComment", "=", "false", ";", "hasComment", "=", "true", ";", "count", "=", "0", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "if", "(", "count", ">=", "1", ")", "{", "if", "(", "count", ">", "1", ")", "{", "preserveEmptyLines", "(", "count", "-", "1", ",", "this", ".", "scanner", ".", "startPosition", ")", ";", "}", "else", "if", "(", "count", "==", "1", ")", "{", "printNewLine", "(", "this", ".", "scanner", ".", "startPosition", ")", ";", "}", "}", "else", "if", "(", "hasWhitespace", ")", "{", "space", "(", ")", ";", "}", "hasWhitespace", "=", "false", ";", "if", "(", "includesJavadocComments", "(", ")", ")", "{", "printJavadocComment", "(", "this", ".", "scanner", ".", "startPosition", ",", "this", ".", "scanner", ".", "currentPosition", ")", ";", "}", "else", "{", "printBlockComment", "(", "true", ")", ";", "}", "printNewLine", "(", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "hasLineComment", "=", "false", ";", "hasComment", "=", "true", ";", "count", "=", "0", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameSEMICOLON", ":", "print", "(", "this", ".", "scanner", ".", "currentPosition", "-", "this", ".", "scanner", ".", "startPosition", ",", "this", ".", "formatter", ".", "preferences", ".", "insert_space_before_semicolon", ")", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameEOF", ":", "if", "(", "count", ">=", "1", "||", "this", ".", "formatter", ".", "preferences", ".", "insert_new_line_at_end_of_file_if_missing", ")", "{", "this", ".", "printNewLine", "(", "this", ".", "scannerEndPosition", ")", ";", "}", "return", ";", "default", ":", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "throw", "new", "AbortFormatting", "(", "e", ")", ";", "}", "}", "private", "void", "printCodeSnippet", "(", "int", "startPosition", ",", "int", "endPosition", ",", "int", "linesGap", ")", "{", "String", "snippet", "=", "new", "String", "(", "this", ".", "scanner", ".", "source", ",", "startPosition", ",", "endPosition", "-", "startPosition", "+", "1", ")", ";", "int", "firstLine", "=", "Util", ".", "getLineNumber", "(", "startPosition", ",", "this", ".", "lineEnds", ",", "0", ",", "this", ".", "maxLines", ")", "-", "1", ";", "int", "lastLine", "=", "Util", ".", "getLineNumber", "(", "endPosition", ",", "this", ".", "lineEnds", ",", "firstLine", ">", "1", "?", "firstLine", "-", "2", ":", "0", ",", "this", ".", "maxLines", ")", "-", "1", ";", "this", ".", "codeSnippetBuffer", ".", "setLength", "(", "0", ")", ";", "if", "(", "firstLine", "==", "lastLine", "&&", "linesGap", "==", "0", ")", "{", "this", ".", "codeSnippetBuffer", ".", "append", "(", "snippet", ")", ";", "}", "else", "{", "boolean", "hasCharsAfterStar", "=", "false", ";", "if", "(", "linesGap", "==", "0", ")", "{", "this", ".", "codeSnippetBuffer", ".", "append", "(", "this", ".", "scanner", ".", "source", ",", "startPosition", ",", "this", ".", "lineEnds", "[", "firstLine", "]", "+", "1", "-", "startPosition", ")", ";", "firstLine", "++", ";", "}", "int", "initialLength", "=", "this", ".", "codeSnippetBuffer", ".", "length", "(", ")", ";", "for", "(", "int", "currentLine", "=", "firstLine", ";", "currentLine", "<=", "lastLine", ";", "currentLine", "++", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "lineEnds", "[", "currentLine", "-", "1", "]", "+", "1", ",", "this", ".", "lineEnds", "[", "currentLine", "]", ")", ";", "int", "lineStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "boolean", "hasStar", "=", "false", ";", "loop", ":", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "char", "ch", "=", "(", "char", ")", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "switch", "(", "ch", ")", "{", "case", "'", "'", ":", "case", "'\\t'", ":", "case", "'", "'", ":", "break", ";", "case", "'\\r'", ":", "case", "'\\n'", ":", "break", "loop", ";", "case", "'*'", ":", "hasStar", "=", "true", ";", "break", "loop", ";", "default", ":", "if", "(", "ScannerHelper", ".", "isWhitespace", "(", "ch", ")", ")", "{", "break", ";", "}", "break", "loop", ";", "}", "}", "if", "(", "hasStar", ")", "{", "lineStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "if", "(", "!", "hasCharsAfterStar", "&&", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "char", "ch", "=", "(", "char", ")", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "boolean", "atEnd", "=", "this", ".", "scanner", ".", "atEnd", "(", ")", ";", "switch", "(", "ch", ")", "{", "case", "'", "'", ":", "case", "'\\t'", ":", "case", "'", "'", ":", "break", ";", "case", "'\\r'", ":", "case", "'\\n'", ":", "atEnd", "=", "true", ";", "break", ";", "default", ":", "if", "(", "!", "ScannerHelper", ".", "isWhitespace", "(", "ch", ")", ")", "{", "if", "(", "hasStar", ")", "{", "hasCharsAfterStar", "=", "true", ";", "currentLine", "=", "firstLine", "-", "1", ";", "this", ".", "codeSnippetBuffer", ".", "setLength", "(", "initialLength", ")", ";", "continue", ";", "}", "}", "break", ";", "}", "if", "(", "!", "hasCharsAfterStar", "&&", "!", "atEnd", ")", "{", "lineStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "}", "}", "}", "int", "end", "=", "currentLine", "==", "lastLine", "?", "endPosition", ":", "this", ".", "lineEnds", "[", "currentLine", "]", ";", "this", ".", "codeSnippetBuffer", ".", "append", "(", "this", ".", "scanner", ".", "source", ",", "lineStart", ",", "end", "+", "1", "-", "lineStart", ")", ";", "}", "}", "HTMLEntity2JavaReader", "reader", "=", "new", "HTMLEntity2JavaReader", "(", "new", "StringReader", "(", "this", ".", "codeSnippetBuffer", ".", "toString", "(", ")", ")", ")", ";", "char", "[", "]", "buf", "=", "new", "char", "[", "this", ".", "codeSnippetBuffer", ".", "length", "(", ")", "]", ";", "String", "convertedSnippet", ";", "try", "{", "int", "read", "=", "reader", ".", "read", "(", "buf", ")", ";", "convertedSnippet", "=", "new", "String", "(", "buf", ",", "0", ",", "read", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "CommentFormatterUtil", ".", "log", "(", "e", ")", ";", "return", ";", "}", "String", "formattedSnippet", "=", "convertedSnippet", ";", "Map", "options", "=", "this", ".", "formatter", ".", "preferences", ".", "getMap", "(", ")", ";", "if", "(", "this", ".", "scanner", ".", "sourceLevel", ">", "ClassFileConstants", ".", "JDK1_3", ")", "{", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "CompilerOptions", ".", "versionFromJdkLevel", "(", "this", ".", "scanner", ".", "sourceLevel", ")", ")", ";", "}", "TextEdit", "edit", "=", "CommentFormatterUtil", ".", "format2", "(", "CodeFormatter", ".", "K_UNKNOWN", "|", "CodeFormatter", ".", "F_INCLUDE_COMMENTS", ",", "convertedSnippet", ",", "0", ",", "this", ".", "lineSeparator", ",", "options", ")", ";", "if", "(", "edit", "==", "null", ")", "{", "formattedSnippet", "=", "this", ".", "codeSnippetBuffer", ".", "toString", "(", ")", ";", "}", "else", "{", "formattedSnippet", "=", "CommentFormatterUtil", ".", "evaluateFormatterEdit", "(", "convertedSnippet", ",", "edit", ",", "null", ")", ";", "Java2HTMLEntityReader", "javaReader", "=", "new", "Java2HTMLEntityReader", "(", "new", "StringReader", "(", "formattedSnippet", ")", ")", ";", "buf", "=", "new", "char", "[", "256", "]", ";", "this", ".", "codeSnippetBuffer", ".", "setLength", "(", "0", ")", ";", "int", "l", ";", "try", "{", "do", "{", "l", "=", "javaReader", ".", "read", "(", "buf", ")", ";", "if", "(", "l", "!=", "-", "1", ")", "this", ".", "codeSnippetBuffer", ".", "append", "(", "buf", ",", "0", ",", "l", ")", ";", "}", "while", "(", "l", ">", "0", ")", ";", "formattedSnippet", "=", "this", ".", "codeSnippetBuffer", ".", "toString", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "CommentFormatterUtil", ".", "log", "(", "e", ")", ";", "return", ";", "}", "}", "this", ".", "codeSnippetBuffer", ".", "setLength", "(", "0", ")", ";", "ILineTracker", "tracker", "=", "new", "DefaultLineTracker", "(", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "codeSnippetBuffer", ")", ";", "this", ".", "codeSnippetBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "String", "linePrefix", "=", "this", ".", "codeSnippetBuffer", ".", "toString", "(", ")", ";", "this", ".", "codeSnippetBuffer", ".", "setLength", "(", "0", ")", ";", "String", "replacement", "=", "formattedSnippet", ";", "tracker", ".", "set", "(", "formattedSnippet", ")", ";", "int", "numberOfLines", "=", "tracker", ".", "getNumberOfLines", "(", ")", ";", "if", "(", "numberOfLines", ">", "1", ")", "{", "int", "lastLineOffset", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "numberOfLines", "-", "1", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "this", ".", "codeSnippetBuffer", ".", "append", "(", "linePrefix", ")", ";", "try", "{", "lastLineOffset", "=", "tracker", ".", "getLineOffset", "(", "i", "+", "1", ")", ";", "this", ".", "codeSnippetBuffer", ".", "append", "(", "formattedSnippet", ".", "substring", "(", "tracker", ".", "getLineOffset", "(", "i", ")", ",", "lastLineOffset", ")", ")", ";", "}", "catch", "(", "BadLocationException", "e", ")", "{", "CommentFormatterUtil", ".", "log", "(", "e", ")", ";", "return", ";", "}", "}", "this", ".", "codeSnippetBuffer", ".", "append", "(", "linePrefix", ")", ";", "this", ".", "codeSnippetBuffer", ".", "append", "(", "formattedSnippet", ".", "substring", "(", "lastLineOffset", ")", ")", ";", "replacement", "=", "this", ".", "codeSnippetBuffer", ".", "toString", "(", ")", ";", "}", "addReplaceEdit", "(", "startPosition", ",", "endPosition", ",", "replacement", ")", ";", "}", "void", "printComment", "(", ")", "{", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "NO_TRAILING_COMMENT", ",", "PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION", ")", ";", "}", "void", "printComment", "(", "int", "emptyLinesRules", ")", "{", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "NO_TRAILING_COMMENT", ",", "emptyLinesRules", ")", ";", "}", "void", "printComment", "(", "int", "kind", ",", "int", "trailing", ")", "{", "printComment", "(", "kind", ",", "trailing", ",", "PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION", ")", ";", "}", "void", "printComment", "(", "int", "kind", ",", "int", "trailing", ",", "int", "emptyLinesRules", ")", "{", "final", "boolean", "rejectLineComment", "=", "kind", "==", "CodeFormatter", ".", "K_MULTI_LINE_COMMENT", "||", "kind", "==", "CodeFormatter", ".", "K_JAVA_DOC", ";", "final", "boolean", "rejectBlockComment", "=", "kind", "==", "CodeFormatter", ".", "K_SINGLE_LINE_COMMENT", "||", "kind", "==", "CodeFormatter", ".", "K_JAVA_DOC", ";", "final", "boolean", "rejectJavadocComment", "=", "kind", "==", "CodeFormatter", ".", "K_SINGLE_LINE_COMMENT", "||", "kind", "==", "CodeFormatter", ".", "K_MULTI_LINE_COMMENT", ";", "try", "{", "int", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "boolean", "hasComment", "=", "false", ";", "boolean", "hasLineComment", "=", "false", ";", "boolean", "hasWhitespaces", "=", "false", ";", "int", "lines", "=", "0", ";", "while", "(", "(", "this", ".", "currentToken", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ")", "!=", "TerminalTokens", ".", "TokenNameEOF", ")", "{", "int", "foundTaskCount", "=", "this", ".", "scanner", ".", "foundTaskCount", ";", "int", "tokenStartPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ";", "switch", "(", "this", ".", "currentToken", ")", "{", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "char", "[", "]", "whiteSpaces", "=", "this", ".", "scanner", ".", "getCurrentTokenSource", "(", ")", ";", "int", "whitespacesEndPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ";", "lines", "=", "0", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "whiteSpaces", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "switch", "(", "whiteSpaces", "[", "i", "]", ")", "{", "case", "'\\r'", ":", "if", "(", "(", "i", "+", "1", ")", "<", "max", ")", "{", "if", "(", "whiteSpaces", "[", "i", "+", "1", "]", "==", "'\\n'", ")", "{", "i", "++", ";", "}", "}", "lines", "++", ";", "break", ";", "case", "'\\n'", ":", "lines", "++", ";", "}", "}", "boolean", "realTrailing", "=", "trailing", ">", "NO_TRAILING_COMMENT", ";", "if", "(", "realTrailing", "&&", "this", ".", "scanner", ".", "currentCharacter", "==", "'/'", "&&", "(", "lines", "==", "0", "||", "(", "lines", "==", "1", "&&", "!", "hasLineComment", "&&", "trailing", "==", "IMPORT_TRAILING_COMMENT", ")", ")", ")", "{", "boolean", "canChangeTrailing", "=", "(", "trailing", "&", "COMPLEX_TRAILING_COMMENT", ")", "!=", "0", ";", "if", "(", "trailing", "==", "BASIC_TRAILING_COMMENT", "&&", "hasLineComment", ")", "{", "int", "currentCommentIndentation", "=", "getCurrentIndentation", "(", "whiteSpaces", ",", "0", ")", ";", "int", "relativeIndentation", "=", "currentCommentIndentation", "-", "this", ".", "lastLineComment", ".", "currentIndentation", ";", "if", "(", "this", ".", "tabLength", "==", "0", ")", "{", "canChangeTrailing", "=", "relativeIndentation", "==", "0", ";", "}", "else", "{", "canChangeTrailing", "=", "relativeIndentation", ">", "-", "this", ".", "tabLength", ";", "}", "}", "if", "(", "canChangeTrailing", ")", "{", "int", "currentPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "if", "(", "this", ".", "scanner", ".", "getNextToken", "(", ")", "==", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ")", "{", "realTrailing", "=", "!", "hasLineComment", ";", "switch", "(", "this", ".", "scanner", ".", "getNextToken", "(", ")", ")", "{", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "realTrailing", "=", "false", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "if", "(", "this", ".", "scanner", ".", "getNextToken", "(", ")", "==", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ")", "{", "realTrailing", "=", "false", ";", "}", "break", ";", "}", "}", "this", ".", "scanner", ".", "resetTo", "(", "currentPosition", ",", "this", ".", "scanner", ".", "eofPosition", "-", "1", ")", ";", "}", "}", "if", "(", "lines", ">", "1", "||", "(", "lines", "==", "1", "&&", "hasLineComment", ")", ")", "{", "this", ".", "lastLineComment", ".", "contiguous", "=", "false", ";", "}", "this", ".", "lastLineComment", ".", "leadingSpaces", "=", "whiteSpaces", ";", "this", ".", "lastLineComment", ".", "lines", "=", "lines", ";", "if", "(", "realTrailing", ")", "{", "if", "(", "hasLineComment", ")", "{", "if", "(", "lines", ">=", "1", ")", "{", "currentTokenStartPosition", "=", "tokenStartPosition", ";", "preserveEmptyLines", "(", "lines", ",", "currentTokenStartPosition", ")", ";", "addDeleteEdit", "(", "currentTokenStartPosition", ",", "whitespacesEndPosition", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "scanner", ".", "currentPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "if", "(", "lines", ">=", "1", ")", "{", "if", "(", "hasComment", ")", "{", "this", ".", "printNewLine", "(", "tokenStartPosition", ")", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "hasWhitespaces", "=", "true", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "addDeleteEdit", "(", "tokenStartPosition", ",", "whitespacesEndPosition", ")", ";", "}", "else", "{", "if", "(", "lines", "==", "0", ")", "{", "hasWhitespaces", "=", "true", ";", "if", "(", "hasLineComment", "&&", "emptyLinesRules", "!=", "PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION", ")", "{", "addReplaceEdit", "(", "tokenStartPosition", ",", "whitespacesEndPosition", ",", "getPreserveEmptyLines", "(", "0", ",", "emptyLinesRules", ")", ")", ";", "}", "else", "{", "addDeleteEdit", "(", "tokenStartPosition", ",", "whitespacesEndPosition", ")", ";", "}", "}", "else", "if", "(", "hasLineComment", ")", "{", "useAlignmentBreakIndentation", "(", "emptyLinesRules", ")", ";", "currentTokenStartPosition", "=", "tokenStartPosition", ";", "preserveEmptyLines", "(", "lines", ",", "currentTokenStartPosition", ")", ";", "addDeleteEdit", "(", "currentTokenStartPosition", ",", "whitespacesEndPosition", ")", ";", "}", "else", "if", "(", "hasComment", ")", "{", "useAlignmentBreakIndentation", "(", "emptyLinesRules", ")", ";", "if", "(", "lines", "==", "1", ")", "{", "this", ".", "printNewLine", "(", "tokenStartPosition", ")", ";", "}", "else", "{", "preserveEmptyLines", "(", "lines", "-", "1", ",", "tokenStartPosition", ")", ";", "}", "addDeleteEdit", "(", "tokenStartPosition", ",", "whitespacesEndPosition", ")", ";", "}", "else", "if", "(", "lines", "!=", "0", "&&", "(", "!", "this", ".", "formatter", ".", "preferences", ".", "join_wrapped_lines", "||", "this", ".", "formatter", ".", "preferences", ".", "number_of_empty_lines_to_preserve", "!=", "0", "||", "this", ".", "blank_lines_between_import_groups", ">", "0", ")", ")", "{", "addReplaceEdit", "(", "tokenStartPosition", ",", "whitespacesEndPosition", ",", "getPreserveEmptyLines", "(", "lines", "-", "1", ",", "emptyLinesRules", ")", ")", ";", "}", "else", "{", "useAlignmentBreakIndentation", "(", "emptyLinesRules", ")", ";", "addDeleteEdit", "(", "tokenStartPosition", ",", "whitespacesEndPosition", ")", ";", "}", "}", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "if", "(", "this", ".", "useTags", "&&", "this", ".", "editsEnabled", ")", "{", "boolean", "turnOff", "=", "false", ";", "if", "(", "foundTaskCount", ">", "0", ")", "{", "setEditsEnabled", "(", "foundTaskCount", ")", ";", "turnOff", "=", "true", ";", "}", "else", "if", "(", "this", ".", "tagsKind", "==", "this", ".", "currentToken", "&&", "CharOperation", ".", "fragmentEquals", "(", "this", ".", "disablingTag", ",", "this", ".", "scanner", ".", "source", ",", "tokenStartPosition", ",", "true", ")", ")", "{", "this", ".", "editsEnabled", "=", "false", ";", "turnOff", "=", "true", ";", "}", "if", "(", "turnOff", ")", "{", "if", "(", "!", "this", ".", "editsEnabled", "&&", "this", ".", "editsIndex", ">", "1", ")", "{", "OptimizedReplaceEdit", "currentEdit", "=", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", ";", "if", "(", "this", ".", "scanner", ".", "startPosition", "==", "currentEdit", ".", "offset", "+", "currentEdit", ".", "length", ")", "{", "printNewLinesBeforeDisablingComment", "(", ")", ";", "}", "}", "}", "}", "if", "(", "rejectLineComment", ")", "break", ";", "if", "(", "lines", ">=", "1", ")", "{", "if", "(", "lines", ">", "1", ")", "{", "preserveEmptyLines", "(", "lines", "-", "1", ",", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "else", "if", "(", "lines", "==", "1", ")", "{", "printNewLine", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "}", "else", "if", "(", "hasWhitespaces", ")", "{", "space", "(", ")", ";", "}", "hasWhitespaces", "=", "false", ";", "printLineComment", "(", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "hasLineComment", "=", "true", ";", "lines", "=", "0", ";", "if", "(", "this", ".", "useTags", "&&", "!", "this", ".", "editsEnabled", ")", "{", "if", "(", "foundTaskCount", ">", "0", ")", "{", "setEditsEnabled", "(", "foundTaskCount", ")", ";", "}", "else", "if", "(", "this", ".", "tagsKind", "==", "this", ".", "currentToken", ")", "{", "this", ".", "editsEnabled", "=", "CharOperation", ".", "fragmentEquals", "(", "this", ".", "enablingTag", ",", "this", ".", "scanner", ".", "source", ",", "tokenStartPosition", ",", "true", ")", ";", "}", "}", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "if", "(", "this", ".", "useTags", "&&", "this", ".", "editsEnabled", ")", "{", "boolean", "turnOff", "=", "false", ";", "if", "(", "foundTaskCount", ">", "0", ")", "{", "setEditsEnabled", "(", "foundTaskCount", ")", ";", "turnOff", "=", "true", ";", "}", "else", "if", "(", "this", ".", "tagsKind", "==", "this", ".", "currentToken", "&&", "CharOperation", ".", "fragmentEquals", "(", "this", ".", "disablingTag", ",", "this", ".", "scanner", ".", "source", ",", "tokenStartPosition", ",", "true", ")", ")", "{", "this", ".", "editsEnabled", "=", "false", ";", "turnOff", "=", "true", ";", "}", "if", "(", "turnOff", ")", "{", "if", "(", "!", "this", ".", "editsEnabled", "&&", "this", ".", "editsIndex", ">", "1", ")", "{", "OptimizedReplaceEdit", "currentEdit", "=", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", ";", "if", "(", "this", ".", "scanner", ".", "startPosition", "==", "currentEdit", ".", "offset", "+", "currentEdit", ".", "length", ")", "{", "printNewLinesBeforeDisablingComment", "(", ")", ";", "}", "}", "}", "}", "if", "(", "trailing", ">", "NO_TRAILING_COMMENT", "&&", "lines", ">=", "1", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "this", ".", "lastLineComment", ".", "contiguous", "=", "false", ";", "if", "(", "rejectBlockComment", ")", "break", ";", "if", "(", "lines", ">=", "1", ")", "{", "if", "(", "lines", ">", "1", ")", "{", "preserveEmptyLines", "(", "lines", "-", "1", ",", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "else", "if", "(", "lines", "==", "1", ")", "{", "printNewLine", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "}", "else", "if", "(", "hasWhitespaces", ")", "{", "space", "(", ")", ";", "}", "hasWhitespaces", "=", "false", ";", "printBlockComment", "(", "false", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "hasLineComment", "=", "false", ";", "hasComment", "=", "true", ";", "lines", "=", "0", ";", "if", "(", "this", ".", "useTags", "&&", "!", "this", ".", "editsEnabled", ")", "{", "if", "(", "foundTaskCount", ">", "0", ")", "{", "setEditsEnabled", "(", "foundTaskCount", ")", ";", "}", "else", "if", "(", "this", ".", "tagsKind", "==", "this", ".", "currentToken", ")", "{", "this", ".", "editsEnabled", "=", "CharOperation", ".", "fragmentEquals", "(", "this", ".", "enablingTag", ",", "this", ".", "scanner", ".", "source", ",", "tokenStartPosition", ",", "true", ")", ";", "}", "}", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "if", "(", "this", ".", "useTags", "&&", "this", ".", "editsEnabled", "&&", "foundTaskCount", ">", "0", ")", "{", "setEditsEnabled", "(", "foundTaskCount", ")", ";", "if", "(", "!", "this", ".", "editsEnabled", "&&", "this", ".", "editsIndex", ">", "1", ")", "{", "OptimizedReplaceEdit", "currentEdit", "=", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", ";", "if", "(", "this", ".", "scanner", ".", "startPosition", "==", "currentEdit", ".", "offset", "+", "currentEdit", ".", "length", ")", "{", "printNewLinesBeforeDisablingComment", "(", ")", ";", "}", "}", "}", "if", "(", "trailing", ">", "NO_TRAILING_COMMENT", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "this", ".", "lastLineComment", ".", "contiguous", "=", "false", ";", "if", "(", "rejectJavadocComment", ")", "break", ";", "if", "(", "lines", ">=", "1", ")", "{", "if", "(", "lines", ">", "1", ")", "{", "preserveEmptyLines", "(", "lines", "-", "1", ",", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "else", "if", "(", "lines", "==", "1", ")", "{", "printNewLine", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ")", ";", "}", "}", "else", "if", "(", "hasWhitespaces", ")", "{", "space", "(", ")", ";", "}", "hasWhitespaces", "=", "false", ";", "if", "(", "includesJavadocComments", "(", ")", ")", "{", "printJavadocComment", "(", "this", ".", "scanner", ".", "startPosition", ",", "this", ".", "scanner", ".", "currentPosition", ")", ";", "}", "else", "{", "printBlockComment", "(", "true", ")", ";", "}", "if", "(", "this", ".", "useTags", "&&", "!", "this", ".", "editsEnabled", "&&", "foundTaskCount", ">", "0", ")", "{", "setEditsEnabled", "(", "foundTaskCount", ")", ";", "}", "printNewLine", "(", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "hasLineComment", "=", "false", ";", "hasComment", "=", "true", ";", "lines", "=", "0", ";", "break", ";", "default", ":", "this", ".", "lastLineComment", ".", "contiguous", "=", "false", ";", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "throw", "new", "AbortFormatting", "(", "e", ")", ";", "}", "}", "void", "printComment", "(", "int", "kind", ",", "String", "source", ",", "int", "start", ",", "int", "end", ",", "int", "level", ")", "{", "resetScanner", "(", "source", ".", "toCharArray", "(", ")", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "start", ",", "end", ")", ";", "this", ".", "numberOfIndentations", "=", "level", ";", "this", ".", "indentationLevel", "=", "level", "*", "this", ".", "indentationSize", ";", "this", ".", "column", "=", "this", ".", "indentationLevel", "+", "1", ";", "switch", "(", "kind", ")", "{", "case", "CodeFormatter", ".", "K_SINGLE_LINE_COMMENT", ":", "printComment", "(", "kind", ",", "NO_TRAILING_COMMENT", ")", ";", "break", ";", "case", "CodeFormatter", ".", "K_MULTI_LINE_COMMENT", ":", "printComment", "(", "kind", ",", "NO_TRAILING_COMMENT", ")", ";", "break", ";", "case", "CodeFormatter", ".", "K_JAVA_DOC", ":", "printJavadocComment", "(", "start", ",", "end", ")", ";", "break", ";", "}", "}", "private", "void", "printLineComment", "(", ")", "{", "int", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ";", "int", "currentTokenEndPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", "+", "1", ";", "boolean", "includesLineComments", "=", "includesLineComments", "(", ")", ";", "boolean", "isNlsTag", "=", "false", ";", "if", "(", "CharOperation", ".", "indexOf", "(", "Scanner", ".", "TAG_PREFIX", ",", "this", ".", "scanner", ".", "source", ",", "true", ",", "currentTokenStartPosition", ",", "currentTokenEndPosition", ")", "!=", "-", "1", ")", "{", "this", ".", "nlsTagCounter", "=", "0", ";", "isNlsTag", "=", "true", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "currentTokenEndPosition", "-", "1", ")", ";", "int", "currentCharacter", ";", "int", "start", "=", "currentTokenStartPosition", ";", "int", "nextCharacterStart", "=", "currentTokenStartPosition", ";", "int", "commentIndentationLevel", ";", "boolean", "onFirstColumn", "=", "isOnFirstColumn", "(", "start", ")", ";", "if", "(", "this", ".", "indentationLevel", "==", "0", ")", "{", "commentIndentationLevel", "=", "this", ".", "column", "-", "1", ";", "}", "else", "{", "if", "(", "onFirstColumn", "&&", "(", "(", "includesLineComments", "&&", "!", "this", ".", "formatter", ".", "preferences", ".", "comment_format_line_comment_starting_on_first_column", ")", "||", "this", ".", "formatter", ".", "preferences", ".", "never_indent_line_comments_on_first_column", ")", ")", "{", "commentIndentationLevel", "=", "this", ".", "column", "-", "1", ";", "}", "else", "{", "if", "(", "this", ".", "lastLineComment", ".", "contiguous", ")", "{", "int", "currentCommentIndentation", "=", "getCurrentIndentation", "(", "this", ".", "lastLineComment", ".", "leadingSpaces", ",", "0", ")", ";", "int", "relativeIndentation", "=", "currentCommentIndentation", "-", "this", ".", "lastLineComment", ".", "currentIndentation", ";", "boolean", "similarCommentsIndentation", "=", "false", ";", "if", "(", "this", ".", "tabLength", "==", "0", ")", "{", "similarCommentsIndentation", "=", "relativeIndentation", "==", "0", ";", "}", "else", "if", "(", "relativeIndentation", ">", "-", "this", ".", "tabLength", ")", "{", "similarCommentsIndentation", "=", "relativeIndentation", "==", "0", "||", "currentCommentIndentation", "!=", "0", "&&", "this", ".", "lastLineComment", ".", "currentIndentation", "!=", "0", ";", "}", "if", "(", "similarCommentsIndentation", "&&", "this", ".", "lastLineComment", ".", "indentation", "!=", "this", ".", "indentationLevel", ")", "{", "int", "currentIndentationLevel", "=", "this", ".", "indentationLevel", ";", "this", ".", "indentationLevel", "=", "this", ".", "lastLineComment", ".", "indentation", ";", "printIndentationIfNecessary", "(", ")", ";", "this", ".", "indentationLevel", "=", "currentIndentationLevel", ";", "commentIndentationLevel", "=", "this", ".", "lastLineComment", ".", "indentation", ";", "}", "else", "{", "printIndentationIfNecessary", "(", ")", ";", "commentIndentationLevel", "=", "this", ".", "column", "-", "1", ";", "}", "}", "else", "{", "if", "(", "this", ".", "currentAlignment", "!=", "null", "&&", "this", ".", "currentAlignment", ".", "kind", "==", "Alignment", ".", "ARRAY_INITIALIZER", "&&", "this", ".", "currentAlignment", ".", "fragmentCount", ">", "0", "&&", "this", ".", "indentationLevel", "<", "this", ".", "currentAlignment", ".", "breakIndentationLevel", "&&", "this", ".", "lastLineComment", ".", "lines", ">", "0", ")", "{", "int", "currentIndentationLevel", "=", "this", ".", "indentationLevel", ";", "this", ".", "indentationLevel", "=", "this", ".", "currentAlignment", ".", "breakIndentationLevel", ";", "printIndentationIfNecessary", "(", ")", ";", "this", ".", "indentationLevel", "=", "currentIndentationLevel", ";", "commentIndentationLevel", "=", "this", ".", "currentAlignment", ".", "breakIndentationLevel", ";", "}", "else", "{", "printIndentationIfNecessary", "(", ")", ";", "commentIndentationLevel", "=", "this", ".", "column", "-", "1", ";", "}", "}", "}", "}", "this", ".", "lastLineComment", ".", "contiguous", "=", "true", ";", "this", ".", "lastLineComment", ".", "currentIndentation", "=", "getCurrentCommentIndentation", "(", "currentTokenStartPosition", ")", ";", "this", ".", "lastLineComment", ".", "indentation", "=", "commentIndentationLevel", ";", "if", "(", "this", ".", "pendingSpace", ")", "{", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "comment_preserve_white_space_between_code_and_line_comments", ")", "{", "addInsertEdit", "(", "currentTokenStartPosition", ",", "new", "String", "(", "this", ".", "lastLineComment", ".", "leadingSpaces", ")", ")", ";", "}", "else", "{", "addInsertEdit", "(", "currentTokenStartPosition", ",", "\"", "\"", ")", ";", "}", "}", "this", ".", "needSpace", "=", "false", ";", "this", ".", "pendingSpace", "=", "false", ";", "int", "previousStart", "=", "currentTokenStartPosition", ";", "if", "(", "!", "isNlsTag", "&&", "includesLineComments", "&&", "(", "!", "onFirstColumn", "||", "this", ".", "formatter", ".", "preferences", ".", "comment_format_line_comment_starting_on_first_column", ")", ")", "{", "printLineComment", "(", "currentTokenStartPosition", ",", "currentTokenEndPosition", "-", "1", ")", ";", "}", "else", "{", "loop", ":", "while", "(", "nextCharacterStart", "<=", "currentTokenEndPosition", "&&", "(", "currentCharacter", "=", "this", ".", "scanner", ".", "getNextChar", "(", ")", ")", "!=", "-", "1", ")", "{", "nextCharacterStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "switch", "(", "currentCharacter", ")", "{", "case", "'\\r'", ":", "start", "=", "previousStart", ";", "break", "loop", ";", "case", "'\\n'", ":", "start", "=", "previousStart", ";", "break", "loop", ";", "}", "previousStart", "=", "nextCharacterStart", ";", "}", "if", "(", "start", "!=", "currentTokenStartPosition", ")", "{", "addReplaceEdit", "(", "start", ",", "currentTokenEndPosition", "-", "1", ",", "this", ".", "lineSeparator", ")", ";", "this", ".", "line", "++", ";", "this", ".", "column", "=", "1", ";", "this", ".", "lastNumberOfNewLines", "=", "1", ";", "}", "}", "this", ".", "needSpace", "=", "false", ";", "this", ".", "pendingSpace", "=", "false", ";", "if", "(", "this", ".", "currentAlignment", "!=", "null", ")", "{", "if", "(", "this", ".", "memberAlignment", "!=", "null", ")", "{", "if", "(", "this", ".", "currentAlignment", ".", "location", ".", "inputOffset", ">", "this", ".", "memberAlignment", ".", "location", ".", "inputOffset", ")", "{", "if", "(", "this", ".", "currentAlignment", ".", "couldBreak", "(", ")", "&&", "this", ".", "currentAlignment", ".", "wasSplit", ")", "{", "this", ".", "currentAlignment", ".", "performFragmentEffect", "(", ")", ";", "}", "}", "else", "{", "this", ".", "indentationLevel", "=", "Math", ".", "max", "(", "this", ".", "indentationLevel", ",", "this", ".", "memberAlignment", ".", "breakIndentationLevel", ")", ";", "}", "}", "else", "if", "(", "this", ".", "currentAlignment", ".", "couldBreak", "(", ")", "&&", "this", ".", "currentAlignment", ".", "wasSplit", ")", "{", "this", ".", "currentAlignment", ".", "performFragmentEffect", "(", ")", ";", "}", "if", "(", "this", ".", "currentAlignment", ".", "kind", "==", "Alignment", ".", "BINARY_EXPRESSION", "&&", "this", ".", "currentAlignment", ".", "enclosing", "!=", "null", "&&", "this", ".", "currentAlignment", ".", "enclosing", ".", "kind", "==", "Alignment", ".", "BINARY_EXPRESSION", "&&", "this", ".", "indentationLevel", "<", "this", ".", "currentAlignment", ".", "breakIndentationLevel", ")", "{", "this", ".", "indentationLevel", "=", "this", ".", "currentAlignment", ".", "breakIndentationLevel", ";", "}", "}", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenEndPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "}", "private", "void", "printLineComment", "(", "int", "commentStart", ",", "int", "commentEnd", ")", "{", "int", "firstColumn", "=", "this", ".", "column", ";", "int", "indentLevel", "=", "this", ".", "indentationLevel", ";", "int", "indentations", "=", "this", ".", "numberOfIndentations", ";", "this", ".", "indentationLevel", "=", "getNextIndentationLevel", "(", "firstColumn", ")", ";", "if", "(", "this", ".", "indentationSize", "!=", "0", ")", "{", "this", ".", "numberOfIndentations", "=", "this", ".", "indentationLevel", "/", "this", ".", "indentationSize", ";", "}", "else", "{", "this", ".", "numberOfIndentations", "=", "0", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "commentStart", ",", "commentEnd", ")", ";", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "this", ".", "column", "+=", "2", ";", "int", "maxColumn", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_line_length", "+", "1", ";", "int", "previousToken", "=", "-", "1", ";", "int", "lastTokenEndPosition", "=", "commentStart", ";", "int", "spaceStartPosition", "=", "-", "1", ";", "int", "spaceEndPosition", "=", "-", "1", ";", "this", ".", "scanner", ".", "skipComments", "=", "true", ";", "String", "newLineString", "=", "null", ";", "this", ".", "commentIndentation", "=", "null", ";", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "int", "token", ";", "try", "{", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "}", "catch", "(", "InvalidInputException", "iie", ")", "{", "token", "=", "consumeInvalidToken", "(", "commentEnd", ")", ";", "}", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "if", "(", "previousToken", "==", "-", "1", ")", "{", "previousToken", "=", "SKIP_FIRST_WHITESPACE_TOKEN", ";", "}", "else", "{", "previousToken", "=", "token", ";", "}", "spaceStartPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ";", "spaceEndPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ";", "continue", ";", "case", "TerminalTokens", ".", "TokenNameEOF", ":", "continue", ";", "case", "TerminalTokens", ".", "TokenNameIdentifier", ":", "if", "(", "previousToken", "==", "-", "1", "||", "previousToken", "==", "SKIP_FIRST_WHITESPACE_TOKEN", ")", "{", "char", "[", "]", "identifier", "=", "this", ".", "scanner", ".", "getCurrentTokenSource", "(", ")", ";", "int", "startPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ";", "int", "restartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "if", "(", "CharOperation", ".", "equals", "(", "identifier", ",", "Parser", ".", "FALL_THROUGH_TAG", ",", "0", ",", "5", ")", "&&", "this", ".", "scanner", ".", "currentCharacter", "==", "'-'", ")", "{", "try", "{", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameIdentifier", ")", "{", "identifier", "=", "this", ".", "scanner", ".", "getCurrentTokenSource", "(", ")", ";", "if", "(", "CharOperation", ".", "endsWith", "(", "Parser", ".", "FALL_THROUGH_TAG", ",", "identifier", ")", ")", "{", "if", "(", "previousToken", "==", "SKIP_FIRST_WHITESPACE_TOKEN", ")", "{", "addReplaceEdit", "(", "spaceStartPosition", ",", "startPosition", "-", "1", ",", "\"", "\"", ")", ";", "}", "this", ".", "scanner", ".", "startPosition", "=", "startPosition", ";", "previousToken", "=", "token", ";", "break", ";", "}", "}", "}", "catch", "(", "InvalidInputException", "iie", ")", "{", "}", "}", "this", ".", "scanner", ".", "startPosition", "=", "startPosition", ";", "this", ".", "scanner", ".", "currentPosition", "=", "restartPosition", ";", "}", "break", ";", "}", "int", "tokenStart", "=", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ";", "int", "tokenLength", "=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "tokenStart", ";", "if", "(", "previousToken", "==", "-", "1", ")", "{", "addInsertEdit", "(", "this", ".", "scanner", ".", "startPosition", ",", "\"", "\"", ")", ";", "this", ".", "column", "++", ";", "}", "else", "if", "(", "previousToken", "==", "SKIP_FIRST_WHITESPACE_TOKEN", ")", "{", "addReplaceEdit", "(", "spaceStartPosition", ",", "this", ".", "scanner", ".", "startPosition", "-", "1", ",", "\"", "\"", ")", ";", "this", ".", "column", "++", ";", "spaceStartPosition", "=", "-", "1", ";", "}", "else", "{", "boolean", "insertSpace", "=", "previousToken", "==", "TerminalTokens", ".", "TokenNameWHITESPACE", ";", "if", "(", "insertSpace", ")", "{", "tokenLength", "++", ";", "}", "if", "(", "spaceStartPosition", ">", "0", "&&", "(", "this", ".", "column", "+", "tokenLength", ")", ">", "maxColumn", ")", "{", "this", ".", "lastNumberOfNewLines", "++", ";", "this", ".", "line", "++", ";", "if", "(", "newLineString", "==", "null", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "if", "(", "!", "this", ".", "formatter", ".", "preferences", ".", "never_indent_line_comments_on_first_column", ")", "{", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "}", "this", ".", "tempBuffer", ".", "append", "(", "LINE_COMMENT_PREFIX", ")", ";", "this", ".", "column", "+=", "LINE_COMMENT_PREFIX_LENGTH", ";", "newLineString", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "firstColumn", "=", "this", ".", "column", ";", "}", "else", "{", "this", ".", "column", "=", "firstColumn", ";", "}", "if", "(", "lastTokenEndPosition", ">", "spaceEndPosition", ")", "{", "this", ".", "column", "+=", "lastTokenEndPosition", "-", "(", "spaceEndPosition", "+", "1", ")", ";", "}", "if", "(", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", ".", "offset", "==", "spaceStartPosition", ")", "{", "this", ".", "editsIndex", "--", ";", "}", "addReplaceEdit", "(", "spaceStartPosition", ",", "spaceEndPosition", ",", "newLineString", ")", ";", "spaceStartPosition", "=", "-", "1", ";", "if", "(", "insertSpace", ")", "{", "tokenLength", "--", ";", "}", "}", "else", "if", "(", "insertSpace", ")", "{", "addReplaceEdit", "(", "spaceStartPosition", ",", "this", ".", "scanner", ".", "startPosition", "-", "1", ",", "\"", "\"", ")", ";", "}", "}", "this", ".", "column", "+=", "tokenLength", ";", "previousToken", "=", "token", ";", "lastTokenEndPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "}", "this", ".", "scanner", ".", "skipComments", "=", "false", ";", "this", ".", "indentationLevel", "=", "indentLevel", ";", "this", ".", "numberOfIndentations", "=", "indentations", ";", "this", ".", "lastNumberOfNewLines", "=", "0", ";", "this", ".", "scanner", ".", "resetTo", "(", "lastTokenEndPosition", ",", "commentEnd", ")", ";", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "spaceEndPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "if", "(", "this", ".", "scanner", ".", "currentCharacter", "==", "'\\n'", "||", "this", ".", "scanner", ".", "currentCharacter", "==", "'\\r'", ")", "{", "this", ".", "column", "=", "1", ";", "this", ".", "line", "++", ";", "this", ".", "lastNumberOfNewLines", "++", ";", "break", ";", "}", "}", "int", "startReplace", "=", "previousToken", "==", "SKIP_FIRST_WHITESPACE_TOKEN", "?", "spaceStartPosition", ":", "lastTokenEndPosition", ";", "if", "(", "this", ".", "column", "==", "1", "&&", "commentEnd", ">=", "startReplace", ")", "{", "addReplaceEdit", "(", "startReplace", ",", "commentEnd", ",", "this", ".", "formatter", ".", "preferences", ".", "line_separator", ")", ";", "}", "}", "public", "void", "printEmptyLines", "(", "int", "linesNumber", ")", "{", "this", ".", "printEmptyLines", "(", "linesNumber", ",", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", "+", "1", ")", ";", "}", "private", "void", "printEmptyLines", "(", "int", "linesNumber", ",", "int", "insertPosition", ")", "{", "final", "String", "buffer", "=", "getEmptyLines", "(", "linesNumber", ")", ";", "if", "(", "Util", ".", "EMPTY_STRING", "==", "buffer", ")", "return", ";", "addInsertEdit", "(", "insertPosition", ",", "buffer", ")", ";", "}", "void", "printIndentationIfNecessary", "(", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "if", "(", "this", ".", "tempBuffer", ".", "length", "(", ")", ">", "0", ")", "{", "addInsertEdit", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "tempBuffer", ".", "toString", "(", ")", ")", ";", "this", ".", "pendingSpace", "=", "false", ";", "}", "}", "private", "void", "printIndentationIfNecessary", "(", "StringBuffer", "buffer", ")", "{", "switch", "(", "this", ".", "tabChar", ")", "{", "case", "DefaultCodeFormatterOptions", ".", "TAB", ":", "boolean", "useTabsForLeadingIndents", "=", "this", ".", "useTabsOnlyForLeadingIndents", ";", "int", "numberOfLeadingIndents", "=", "this", ".", "numberOfIndentations", ";", "int", "indentationsAsTab", "=", "0", ";", "if", "(", "useTabsForLeadingIndents", ")", "{", "while", "(", "this", ".", "column", "<=", "this", ".", "indentationLevel", ")", "{", "if", "(", "this", ".", "tabLength", ">", "0", "&&", "indentationsAsTab", "<", "numberOfLeadingIndents", ")", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'\\t'", ")", ";", "indentationsAsTab", "++", ";", "int", "complement", "=", "this", ".", "tabLength", "-", "(", "(", "this", ".", "column", "-", "1", ")", "%", "this", ".", "tabLength", ")", ";", "this", ".", "column", "+=", "complement", ";", "}", "else", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "}", "this", ".", "needSpace", "=", "false", ";", "}", "}", "else", "if", "(", "this", ".", "tabLength", ">", "0", ")", "{", "while", "(", "this", ".", "column", "<=", "this", ".", "indentationLevel", ")", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'\\t'", ")", ";", "int", "complement", "=", "this", ".", "tabLength", "-", "(", "(", "this", ".", "column", "-", "1", ")", "%", "this", ".", "tabLength", ")", ";", "this", ".", "column", "+=", "complement", ";", "this", ".", "needSpace", "=", "false", ";", "}", "}", "break", ";", "case", "DefaultCodeFormatterOptions", ".", "SPACE", ":", "while", "(", "this", ".", "column", "<=", "this", ".", "indentationLevel", ")", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "this", ".", "needSpace", "=", "false", ";", "}", "break", ";", "case", "DefaultCodeFormatterOptions", ".", "MIXED", ":", "useTabsForLeadingIndents", "=", "this", ".", "useTabsOnlyForLeadingIndents", ";", "numberOfLeadingIndents", "=", "this", ".", "numberOfIndentations", ";", "indentationsAsTab", "=", "0", ";", "if", "(", "useTabsForLeadingIndents", ")", "{", "final", "int", "columnForLeadingIndents", "=", "numberOfLeadingIndents", "*", "this", ".", "indentationSize", ";", "while", "(", "this", ".", "column", "<=", "this", ".", "indentationLevel", ")", "{", "if", "(", "this", ".", "column", "<=", "columnForLeadingIndents", ")", "{", "if", "(", "this", ".", "tabLength", ">", "0", "&&", "(", "this", ".", "column", "-", "1", "+", "this", ".", "tabLength", ")", "<=", "this", ".", "indentationLevel", ")", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'\\t'", ")", ";", "this", ".", "column", "+=", "this", ".", "tabLength", ";", "}", "else", "if", "(", "(", "this", ".", "column", "-", "1", "+", "this", ".", "indentationSize", ")", "<=", "this", ".", "indentationLevel", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "this", ".", "indentationSize", ";", "i", "<", "max", ";", "i", "++", ")", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "}", "}", "else", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "}", "}", "else", "{", "for", "(", "int", "i", "=", "this", ".", "column", ",", "max", "=", "this", ".", "indentationLevel", ";", "i", "<=", "max", ";", "i", "++", ")", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "}", "}", "this", ".", "needSpace", "=", "false", ";", "}", "}", "else", "{", "while", "(", "this", ".", "column", "<=", "this", ".", "indentationLevel", ")", "{", "if", "(", "this", ".", "tabLength", ">", "0", "&&", "(", "this", ".", "column", "-", "1", "+", "this", ".", "tabLength", ")", "<=", "this", ".", "indentationLevel", ")", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'\\t'", ")", ";", "this", ".", "column", "+=", "this", ".", "tabLength", ";", "}", "else", "if", "(", "this", ".", "indentationSize", ">", "0", "&&", "(", "this", ".", "column", "-", "1", "+", "this", ".", "indentationSize", ")", "<=", "this", ".", "indentationLevel", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "this", ".", "indentationSize", ";", "i", "<", "max", ";", "i", "++", ")", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "}", "}", "else", "{", "if", "(", "buffer", "!=", "null", ")", "buffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "}", "this", ".", "needSpace", "=", "false", ";", "}", "}", "break", ";", "}", "}", "private", "void", "printJavadocBlock", "(", "FormatJavadocBlock", "block", ")", "{", "if", "(", "block", "==", "null", ")", "return", ";", "int", "previousEnd", "=", "block", ".", "tagEnd", ";", "int", "maxNodes", "=", "block", ".", "nodesPtr", ";", "boolean", "headerLine", "=", "block", ".", "isHeaderLine", "(", ")", "&&", "this", ".", "lastNumberOfNewLines", "==", "0", ";", "int", "maxColumn", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_line_length", "+", "1", ";", "if", "(", "headerLine", ")", "{", "maxColumn", "++", ";", "}", "if", "(", "!", "block", ".", "isInlined", "(", ")", ")", "{", "this", ".", "lastNumberOfNewLines", "=", "0", ";", "}", "if", "(", "block", ".", "isDescription", "(", ")", ")", "{", "if", "(", "!", "block", ".", "isInlined", "(", ")", ")", "{", "this", ".", "commentIndentation", "=", "null", ";", "}", "}", "else", "{", "int", "tagLength", "=", "previousEnd", "-", "block", ".", "sourceStart", "+", "1", ";", "this", ".", "column", "+=", "tagLength", ";", "if", "(", "!", "block", ".", "isInlined", "(", ")", ")", "{", "boolean", "indentRootTags", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_indent_root_tags", "&&", "!", "block", ".", "isInDescription", "(", ")", ";", "int", "commentIndentationLevel", "=", "0", ";", "if", "(", "indentRootTags", ")", "{", "commentIndentationLevel", "=", "tagLength", "+", "1", ";", "boolean", "indentParamTag", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_indent_parameter_description", "&&", "block", ".", "isInParamTag", "(", ")", ";", "if", "(", "indentParamTag", ")", "{", "commentIndentationLevel", "+=", "this", ".", "indentationSize", ";", "}", "}", "setCommentIndentation", "(", "commentIndentationLevel", ")", ";", "}", "FormatJavadocReference", "reference", "=", "block", ".", "reference", ";", "if", "(", "reference", "!=", "null", ")", "{", "printJavadocBlockReference", "(", "block", ",", "reference", ")", ";", "previousEnd", "=", "reference", ".", "sourceEnd", ";", "}", "if", "(", "maxNodes", "<", "0", ")", "{", "if", "(", "block", ".", "isInlined", "(", ")", ")", "{", "this", ".", "column", "++", ";", "}", "return", ";", "}", "}", "int", "previousLine", "=", "Util", ".", "getLineNumber", "(", "previousEnd", ",", "this", ".", "lineEnds", ",", "0", ",", "this", ".", "maxLines", ")", ";", "boolean", "clearBlankLines", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_clear_blank_lines_in_javadoc_comment", ";", "boolean", "joinLines", "=", "this", ".", "formatter", ".", "preferences", ".", "join_lines_in_comments", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "maxNodes", ";", "i", "++", ")", "{", "FormatJavadocNode", "node", "=", "block", ".", "nodes", "[", "i", "]", ";", "int", "nodeStart", "=", "node", ".", "sourceStart", ";", "int", "newLines", ";", "if", "(", "i", "==", "0", ")", "{", "newLines", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_insert_new_line_for_parameter", "&&", "block", ".", "isParamTag", "(", ")", "?", "1", ":", "0", ";", "if", "(", "nodeStart", ">", "(", "previousEnd", "+", "1", ")", ")", "{", "if", "(", "!", "clearBlankLines", "||", "!", "joinLines", ")", "{", "int", "startLine", "=", "Util", ".", "getLineNumber", "(", "nodeStart", ",", "this", ".", "lineEnds", ",", "previousLine", "-", "1", ",", "this", ".", "maxLines", ")", ";", "int", "gapLine", "=", "previousLine", ";", "if", "(", "joinLines", ")", "gapLine", "++", ";", "if", "(", "startLine", ">", "gapLine", ")", "{", "newLines", "=", "startLine", "-", "previousLine", ";", "}", "if", "(", "clearBlankLines", ")", "{", "if", "(", "newLines", ">", "0", ")", "newLines", "=", "1", ";", "}", "}", "if", "(", "newLines", "==", "0", "&&", "(", "!", "node", ".", "isImmutable", "(", ")", "||", "block", ".", "reference", "!=", "null", ")", ")", "{", "newLines", "=", "printJavadocBlockNodesNewLines", "(", "block", ",", "node", ",", "previousEnd", ")", ";", "}", "if", "(", "block", ".", "isImmutable", "(", ")", ")", "{", "printJavadocGapLinesForImmutableBlock", "(", "block", ")", ";", "}", "else", "{", "printJavadocGapLines", "(", "previousEnd", "+", "1", ",", "nodeStart", "-", "1", ",", "newLines", ",", "clearBlankLines", ",", "false", ",", "null", ")", ";", "}", "}", "else", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "if", "(", "newLines", ">", "0", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "newLines", ";", "j", "++", ")", "{", "printJavadocNewLine", "(", "this", ".", "tempBuffer", ")", ";", "}", "addInsertEdit", "(", "nodeStart", ",", "this", ".", "tempBuffer", ".", "toString", "(", ")", ")", ";", "}", "}", "}", "else", "{", "newLines", "=", "this", ".", "column", ">", "maxColumn", "?", "1", ":", "0", ";", "if", "(", "!", "clearBlankLines", "&&", "node", ".", "lineStart", ">", "(", "previousLine", "+", "1", ")", ")", "newLines", "=", "node", ".", "lineStart", "-", "previousLine", ";", "if", "(", "newLines", "<", "node", ".", "linesBefore", ")", "newLines", "=", "node", ".", "linesBefore", ";", "if", "(", "newLines", "==", "0", ")", "{", "newLines", "=", "printJavadocBlockNodesNewLines", "(", "block", ",", "node", ",", "previousEnd", ")", ";", "}", "if", "(", "newLines", ">", "0", "||", "nodeStart", ">", "(", "previousEnd", "+", "1", ")", ")", "{", "printJavadocGapLines", "(", "previousEnd", "+", "1", ",", "nodeStart", "-", "1", ",", "newLines", ",", "clearBlankLines", ",", "false", ",", "null", ")", ";", "}", "}", "if", "(", "headerLine", "&&", "newLines", ">", "0", ")", "{", "headerLine", "=", "false", ";", "maxColumn", "--", ";", "}", "if", "(", "node", ".", "isText", "(", ")", ")", "{", "FormatJavadocText", "text", "=", "(", "FormatJavadocText", ")", "node", ";", "if", "(", "text", ".", "isImmutable", "(", ")", ")", "{", "if", "(", "text", ".", "isImmutableHtmlTag", "(", ")", "&&", "newLines", ">", "0", "&&", "this", ".", "commentIndentation", "!=", "null", ")", "{", "addInsertEdit", "(", "node", ".", "sourceStart", ",", "this", ".", "commentIndentation", ")", ";", "this", ".", "column", "+=", "this", ".", "commentIndentation", ".", "length", "(", ")", ";", "}", "printJavadocImmutableText", "(", "text", ",", "block", ",", "newLines", ">", "0", ")", ";", "this", ".", "column", "+=", "getTextLength", "(", "block", ",", "text", ")", ";", "}", "else", "if", "(", "text", ".", "isHtmlTag", "(", ")", ")", "{", "printJavadocHtmlTag", "(", "text", ",", "block", ",", "newLines", ">", "0", ")", ";", "}", "else", "{", "printJavadocText", "(", "text", ",", "block", ",", "newLines", ">", "0", ")", ";", "}", "}", "else", "{", "if", "(", "newLines", ">", "0", "&&", "this", ".", "commentIndentation", "!=", "null", ")", "{", "addInsertEdit", "(", "node", ".", "sourceStart", ",", "this", ".", "commentIndentation", ")", ";", "this", ".", "column", "+=", "this", ".", "commentIndentation", ".", "length", "(", ")", ";", "}", "printJavadocBlock", "(", "(", "FormatJavadocBlock", ")", "node", ")", ";", "}", "previousEnd", "=", "node", ".", "sourceEnd", ";", "previousLine", "=", "Util", ".", "getLineNumber", "(", "previousEnd", ",", "this", ".", "lineEnds", ",", "node", ".", "lineStart", ">", "1", "?", "node", ".", "lineStart", "-", "2", ":", "0", ",", "this", ".", "maxLines", ")", ";", "}", "this", ".", "lastNumberOfNewLines", "=", "0", ";", "}", "private", "int", "printJavadocBlockNodesNewLines", "(", "FormatJavadocBlock", "block", ",", "FormatJavadocNode", "node", ",", "int", "previousEnd", ")", "{", "int", "maxColumn", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_line_length", "+", "1", ";", "int", "nodeStart", "=", "node", ".", "sourceStart", ";", "try", "{", "this", ".", "scanner", ".", "resetTo", "(", "nodeStart", ",", "node", ".", "sourceEnd", ")", ";", "int", "length", "=", "0", ";", "boolean", "newLine", "=", "false", ";", "boolean", "headerLine", "=", "block", ".", "isHeaderLine", "(", ")", "&&", "this", ".", "lastNumberOfNewLines", "==", "0", ";", "int", "firstColumn", "=", "1", "+", "this", ".", "indentationLevel", "+", "BLOCK_LINE_PREFIX_LENGTH", ";", "if", "(", "this", ".", "commentIndentation", "!=", "null", ")", "firstColumn", "+=", "this", ".", "commentIndentation", ".", "length", "(", ")", ";", "if", "(", "headerLine", ")", "maxColumn", "++", ";", "FormatJavadocText", "text", "=", "null", ";", "boolean", "isImmutableNode", "=", "node", ".", "isImmutable", "(", ")", ";", "boolean", "nodeIsText", "=", "node", ".", "isText", "(", ")", ";", "if", "(", "nodeIsText", ")", "{", "text", "=", "(", "FormatJavadocText", ")", "node", ";", "}", "else", "{", "FormatJavadocBlock", "inlinedBlock", "=", "(", "FormatJavadocBlock", ")", "node", ";", "if", "(", "isImmutableNode", ")", "{", "text", "=", "(", "FormatJavadocText", ")", "inlinedBlock", ".", "getLastNode", "(", ")", ";", "if", "(", "text", "!=", "null", ")", "{", "length", "+=", "inlinedBlock", ".", "tagEnd", "-", "inlinedBlock", ".", "sourceStart", "+", "1", ";", "if", "(", "nodeStart", ">", "(", "previousEnd", "+", "1", ")", ")", "{", "length", "++", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "text", ".", "sourceStart", ",", "node", ".", "sourceEnd", ")", ";", "}", "}", "}", "if", "(", "text", "!=", "null", ")", "{", "if", "(", "isImmutableNode", ")", "{", "if", "(", "nodeStart", ">", "(", "previousEnd", "+", "1", ")", ")", "{", "length", "++", ";", "}", "int", "lastColumn", "=", "this", ".", "column", "+", "length", ";", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "try", "{", "int", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "if", "(", "CharOperation", ".", "indexOf", "(", "'\\n'", ",", "this", ".", "scanner", ".", "source", ",", "this", ".", "scanner", ".", "startPosition", ",", "this", ".", "scanner", ".", "currentPosition", ")", ">=", "0", ")", "{", "return", "0", ";", "}", "lastColumn", "=", "getCurrentIndentation", "(", "this", ".", "scanner", ".", "getCurrentTokenSource", "(", ")", ",", "lastColumn", ")", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameMULTIPLY", ":", "if", "(", "newLine", ")", "{", "newLine", "=", "false", ";", "continue", ";", "}", "lastColumn", "++", ";", "break", ";", "default", ":", "lastColumn", "+=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "this", ".", "scanner", ".", "startPosition", ";", "break", ";", "}", "}", "catch", "(", "InvalidInputException", "iie", ")", "{", "lastColumn", "+=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "this", ".", "scanner", ".", "startPosition", ";", "}", "if", "(", "lastColumn", ">", "maxColumn", ")", "{", "return", "1", ";", "}", "}", "return", "0", ";", "}", "if", "(", "text", ".", "isHtmlTag", "(", ")", ")", "{", "if", "(", "text", ".", "getHtmlTagID", "(", ")", "==", "JAVADOC_SINGLE_BREAK_TAG_ID", ")", "{", "return", "0", ";", "}", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "if", "(", "this", ".", "scanner", ".", "getNextToken", "(", ")", "==", "TerminalTokens", ".", "TokenNameDIVIDE", ")", "{", "length", "++", ";", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "}", "length", "+=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "this", ".", "scanner", ".", "startPosition", ";", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "length", "++", ";", "}", "else", "{", "while", "(", "true", ")", "{", "int", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameWHITESPACE", "||", "token", "==", "TerminalTokens", ".", "TokenNameEOF", ")", "break", ";", "int", "tokenLength", "=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "this", ".", "scanner", ".", "startPosition", ";", "length", "+=", "tokenLength", ";", "if", "(", "(", "this", ".", "column", "+", "length", ")", ">=", "maxColumn", ")", "{", "break", ";", "}", "}", "}", "}", "else", "{", "FormatJavadocBlock", "inlinedBlock", "=", "(", "FormatJavadocBlock", ")", "node", ";", "length", "+=", "inlinedBlock", ".", "tagEnd", "-", "inlinedBlock", ".", "sourceStart", "+", "1", ";", "if", "(", "inlinedBlock", ".", "reference", "!=", "null", ")", "{", "length", "++", ";", "this", ".", "scanner", ".", "resetTo", "(", "inlinedBlock", ".", "reference", ".", "sourceStart", ",", "inlinedBlock", ".", "reference", ".", "sourceEnd", ")", ";", "int", "previousToken", "=", "-", "1", ";", "loop", ":", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "int", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "int", "tokenLength", "=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "this", ".", "scanner", ".", "startPosition", ";", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "if", "(", "previousToken", "==", "TerminalTokens", ".", "TokenNameCOMMA", ")", "{", "length", "++", ";", "}", "break", ";", "case", "TerminalTokens", ".", "TokenNameMULTIPLY", ":", "break", ";", "default", ":", "length", "+=", "tokenLength", ";", "if", "(", "(", "this", ".", "column", "+", "length", ")", ">", "maxColumn", ")", "{", "break", "loop", ";", "}", "break", ";", "}", "previousToken", "=", "token", ";", "}", "}", "length", "++", ";", "}", "if", "(", "nodeStart", ">", "(", "previousEnd", "+", "1", ")", ")", "{", "length", "++", ";", "}", "if", "(", "(", "firstColumn", "+", "length", ")", ">=", "maxColumn", "&&", "node", "==", "block", ".", "nodes", "[", "0", "]", ")", "{", "return", "0", ";", "}", "if", "(", "(", "this", ".", "column", "+", "length", ")", ">", "maxColumn", ")", "{", "return", "1", ";", "}", "}", "catch", "(", "InvalidInputException", "iie", ")", "{", "int", "tokenLength", "=", "1", ";", "if", "(", "nodeStart", ">", "(", "previousEnd", "+", "1", ")", ")", "{", "tokenLength", "++", ";", "}", "if", "(", "(", "this", ".", "column", "+", "tokenLength", ")", ">", "maxColumn", ")", "{", "return", "1", ";", "}", "}", "return", "0", ";", "}", "private", "void", "printJavadocBlockReference", "(", "FormatJavadocBlock", "block", ",", "FormatJavadocReference", "reference", ")", "{", "int", "maxColumn", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_line_length", "+", "1", ";", "boolean", "headerLine", "=", "block", ".", "isHeaderLine", "(", ")", ";", "boolean", "inlined", "=", "block", ".", "isInlined", "(", ")", ";", "if", "(", "headerLine", ")", "maxColumn", "++", ";", "this", ".", "scanner", ".", "resetTo", "(", "block", ".", "tagEnd", "+", "1", ",", "reference", ".", "sourceEnd", ")", ";", "this", ".", "javadocBlockRefBuffer", ".", "setLength", "(", "0", ")", ";", "boolean", "needFormat", "=", "false", ";", "int", "previousToken", "=", "-", "1", ";", "int", "spacePosition", "=", "-", "1", ";", "String", "newLineString", "=", "null", ";", "int", "firstColumn", "=", "-", "1", ";", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "int", "token", ";", "try", "{", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "int", "tokenLength", "=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "this", ".", "scanner", ".", "startPosition", ";", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "if", "(", "previousToken", "!=", "-", "1", "||", "tokenLength", ">", "1", "||", "this", ".", "scanner", ".", "currentCharacter", "!=", "'", "'", ")", "needFormat", "=", "true", ";", "switch", "(", "previousToken", ")", "{", "case", "TerminalTokens", ".", "TokenNameMULTIPLY", ":", "case", "TerminalTokens", ".", "TokenNameLPAREN", ":", "break", ";", "default", ":", "spacePosition", "=", "this", ".", "javadocBlockRefBuffer", ".", "length", "(", ")", ";", "case", "-", "1", ":", "this", ".", "javadocBlockRefBuffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "break", ";", "}", "break", ";", "case", "TerminalTokens", ".", "TokenNameMULTIPLY", ":", "break", ";", "default", ":", "if", "(", "!", "inlined", "&&", "spacePosition", ">", "0", "&&", "(", "this", ".", "column", "+", "tokenLength", ")", ">", "maxColumn", ")", "{", "this", ".", "lastNumberOfNewLines", "++", ";", "this", ".", "line", "++", ";", "if", "(", "newLineString", "==", "null", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "if", "(", "this", ".", "commentIndentation", "!=", "null", ")", "{", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "commentIndentation", ")", ";", "this", ".", "column", "+=", "this", ".", "commentIndentation", ".", "length", "(", ")", ";", "}", "newLineString", "=", "this", ".", "tempBuffer", ".", "substring", "(", "0", ",", "this", ".", "tempBuffer", ".", "length", "(", ")", "-", "1", ")", ";", "firstColumn", "=", "this", ".", "column", ";", "}", "else", "{", "this", ".", "column", "=", "firstColumn", ";", "}", "this", ".", "column", "=", "firstColumn", "+", "this", ".", "javadocBlockRefBuffer", ".", "length", "(", ")", "-", "spacePosition", "-", "1", ";", "this", ".", "javadocBlockRefBuffer", ".", "insert", "(", "spacePosition", ",", "newLineString", ")", ";", "if", "(", "headerLine", ")", "{", "headerLine", "=", "false", ";", "maxColumn", "--", ";", "}", "spacePosition", "=", "-", "1", ";", "}", "this", ".", "javadocBlockRefBuffer", ".", "append", "(", "this", ".", "scanner", ".", "source", ",", "this", ".", "scanner", ".", "startPosition", ",", "tokenLength", ")", ";", "this", ".", "column", "+=", "tokenLength", ";", "break", ";", "}", "previousToken", "=", "token", ";", "}", "catch", "(", "InvalidInputException", "iie", ")", "{", "}", "}", "if", "(", "needFormat", ")", "{", "addReplaceEdit", "(", "block", ".", "tagEnd", "+", "1", ",", "reference", ".", "sourceEnd", ",", "this", ".", "javadocBlockRefBuffer", ".", "toString", "(", ")", ")", ";", "}", "}", "private", "int", "getTextLength", "(", "FormatJavadocBlock", "block", ",", "FormatJavadocText", "text", ")", "{", "if", "(", "text", ".", "isImmutable", "(", ")", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "text", ".", "sourceStart", ",", "text", ".", "sourceEnd", ")", ";", "int", "textLength", "=", "0", ";", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "try", "{", "int", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameWHITESPACE", ")", "{", "if", "(", "CharOperation", ".", "indexOf", "(", "'\\n'", ",", "this", ".", "scanner", ".", "source", ",", "this", ".", "scanner", ".", "startPosition", ",", "this", ".", "scanner", ".", "currentPosition", ")", ">=", "0", ")", "{", "textLength", "=", "0", ";", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "if", "(", "this", ".", "scanner", ".", "currentCharacter", "==", "'*'", ")", "{", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "if", "(", "this", ".", "scanner", ".", "currentCharacter", "!=", "'", "'", ")", "{", "textLength", "++", ";", "}", "}", "else", "{", "textLength", "++", ";", "}", "continue", ";", "}", "}", "textLength", "+=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "this", ".", "scanner", ".", "startPosition", ";", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "textLength", "+=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "this", ".", "scanner", ".", "startPosition", ";", "}", "}", "return", "textLength", ";", "}", "if", "(", "block", ".", "isOneLineTag", "(", ")", ")", "{", "return", "text", ".", "sourceEnd", "-", "text", ".", "sourceStart", "+", "1", ";", "}", "int", "startLine", "=", "Util", ".", "getLineNumber", "(", "text", ".", "sourceStart", ",", "this", ".", "lineEnds", ",", "0", ",", "this", ".", "maxLines", ")", ";", "int", "endLine", "=", "startLine", ";", "int", "previousEnd", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "text", ".", "separatorsPtr", ";", "i", "++", ")", "{", "int", "end", "=", "(", "int", ")", "(", "text", ".", "separators", "[", "i", "]", ">>>", "32", ")", ";", "endLine", "=", "Util", ".", "getLineNumber", "(", "end", ",", "this", ".", "lineEnds", ",", "endLine", "-", "1", ",", "this", ".", "maxLines", ")", ";", "if", "(", "endLine", ">", "startLine", ")", "{", "return", "previousEnd", "-", "text", ".", "sourceStart", "+", "1", ";", "}", "previousEnd", "=", "end", ";", "}", "return", "text", ".", "sourceEnd", "-", "text", ".", "sourceStart", "+", "1", ";", "}", "void", "printJavadocComment", "(", "int", "start", ",", "int", "end", ")", "{", "int", "lastIndentationLevel", "=", "this", ".", "indentationLevel", ";", "try", "{", "this", ".", "scanner", ".", "resetTo", "(", "start", ",", "end", "-", "1", ")", ";", "if", "(", "!", "this", ".", "formatterCommentParser", ".", "parse", "(", "start", ",", "end", "-", "1", ")", ")", "{", "return", ";", "}", "FormatJavadoc", "javadoc", "=", "(", "FormatJavadoc", ")", "this", ".", "formatterCommentParser", ".", "docComment", ";", "if", "(", "this", ".", "indentationLevel", "!=", "0", ")", "{", "printIndentationIfNecessary", "(", ")", ";", "}", "if", "(", "this", ".", "pendingSpace", ")", "{", "addInsertEdit", "(", "start", ",", "\"", "\"", ")", ";", "}", "if", "(", "javadoc", ".", "blocks", "==", "null", ")", "{", "return", ";", "}", "this", ".", "needSpace", "=", "false", ";", "this", ".", "pendingSpace", "=", "false", ";", "int", "length", "=", "javadoc", ".", "blocks", ".", "length", ";", "FormatJavadocBlock", "previousBlock", "=", "javadoc", ".", "blocks", "[", "0", "]", ";", "this", ".", "lastNumberOfNewLines", "=", "0", ";", "int", "currentLine", "=", "this", ".", "line", ";", "int", "firstBlockStart", "=", "previousBlock", ".", "sourceStart", ";", "printIndentationIfNecessary", "(", "null", ")", ";", "this", ".", "column", "+=", "JAVADOC_HEADER_LENGTH", ";", "int", "index", "=", "1", ";", "if", "(", "length", ">", "1", ")", "{", "if", "(", "previousBlock", ".", "isDescription", "(", ")", ")", "{", "printJavadocBlock", "(", "previousBlock", ")", ";", "FormatJavadocBlock", "block", "=", "javadoc", ".", "blocks", "[", "index", "++", "]", ";", "int", "newLines", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_insert_empty_line_before_root_tags", "?", "2", ":", "1", ";", "printJavadocGapLines", "(", "previousBlock", ".", "sourceEnd", "+", "1", ",", "block", ".", "sourceStart", "-", "1", ",", "newLines", ",", "this", ".", "formatter", ".", "preferences", ".", "comment_clear_blank_lines_in_javadoc_comment", ",", "false", ",", "null", ")", ";", "previousBlock", "=", "block", ";", "}", "while", "(", "index", "<", "length", ")", "{", "printJavadocBlock", "(", "previousBlock", ")", ";", "FormatJavadocBlock", "block", "=", "javadoc", ".", "blocks", "[", "index", "++", "]", ";", "printJavadocGapLines", "(", "previousBlock", ".", "sourceEnd", "+", "1", ",", "block", ".", "sourceStart", "-", "1", ",", "1", ",", "this", ".", "formatter", ".", "preferences", ".", "comment_clear_blank_lines_in_javadoc_comment", ",", "false", ",", "null", ")", ";", "previousBlock", "=", "block", ";", "}", "}", "printJavadocBlock", "(", "previousBlock", ")", ";", "int", "newLines", "=", "(", "this", ".", "formatter", ".", "preferences", ".", "comment_new_lines_at_javadoc_boundaries", "&&", "(", "this", ".", "line", ">", "currentLine", "||", "javadoc", ".", "isMultiLine", "(", ")", ")", ")", "?", "1", ":", "0", ";", "printJavadocGapLines", "(", "javadoc", ".", "textStart", ",", "firstBlockStart", "-", "1", ",", "newLines", ",", "this", ".", "formatter", ".", "preferences", ".", "comment_clear_blank_lines_in_javadoc_comment", ",", "false", ",", "null", ")", ";", "printJavadocGapLines", "(", "previousBlock", ".", "sourceEnd", "+", "1", ",", "javadoc", ".", "textEnd", ",", "newLines", ",", "this", ".", "formatter", ".", "preferences", ".", "comment_clear_blank_lines_in_javadoc_comment", ",", "true", ",", "null", ")", ";", "}", "finally", "{", "this", ".", "scanner", ".", "resetTo", "(", "end", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "indentationLevel", "=", "lastIndentationLevel", ";", "this", ".", "lastNumberOfNewLines", "=", "0", ";", "}", "}", "private", "void", "printJavadocGapLines", "(", "int", "textStartPosition", ",", "int", "textEndPosition", ",", "int", "newLines", ",", "boolean", "clearBlankLines", ",", "boolean", "footer", ",", "StringBuffer", "output", ")", "{", "try", "{", "if", "(", "newLines", "==", "0", ")", "{", "if", "(", "output", "==", "null", ")", "{", "addReplaceEdit", "(", "textStartPosition", ",", "textEndPosition", ",", "\"", "\"", ")", ";", "}", "else", "{", "output", ".", "append", "(", "'", "'", ")", ";", "}", "this", ".", "column", "++", ";", "return", ";", "}", "if", "(", "textStartPosition", ">", "textEndPosition", ")", "{", "if", "(", "newLines", ">", "0", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "setLength", "(", "0", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "newLines", ";", "i", "++", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "javadocGapLinesBuffer", ")", ";", "if", "(", "footer", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "}", "else", "{", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "}", "}", "if", "(", "output", "==", "null", ")", "{", "addInsertEdit", "(", "textStartPosition", ",", "this", ".", "javadocGapLinesBuffer", ".", "toString", "(", ")", ")", ";", "}", "else", "{", "output", ".", "append", "(", "this", ".", "javadocGapLinesBuffer", ")", ";", "}", "}", "return", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "textStartPosition", ",", "textEndPosition", ")", ";", "this", ".", "scanner", ".", "recordLineSeparator", "=", "true", ";", "this", ".", "scanner", ".", "linePtr", "=", "Util", ".", "getLineNumber", "(", "textStartPosition", ",", "this", ".", "lineEnds", ",", "0", ",", "this", ".", "maxLines", ")", "-", "2", ";", "int", "linePtr", "=", "this", ".", "scanner", ".", "linePtr", ";", "int", "lineCount", "=", "0", ";", "int", "start", "=", "textStartPosition", ";", "boolean", "endsOnMultiply", "=", "false", ";", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "switch", "(", "this", ".", "scanner", ".", "getNextToken", "(", ")", ")", "{", "case", "TerminalTokens", ".", "TokenNameMULTIPLY", ":", "int", "linesGap", "=", "this", ".", "scanner", ".", "linePtr", "-", "linePtr", ";", "if", "(", "linesGap", ">", "0", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "setLength", "(", "0", ")", ";", "if", "(", "lineCount", ">", "0", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "'", "'", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "linesGap", ";", "i", "++", ")", "{", "if", "(", "clearBlankLines", "&&", "lineCount", ">=", "newLines", ")", "{", "if", "(", "textEndPosition", ">=", "start", ")", "{", "if", "(", "output", "==", "null", ")", "{", "addReplaceEdit", "(", "start", ",", "textEndPosition", ",", "this", ".", "javadocGapLinesBuffer", ".", "toString", "(", ")", ")", ";", "}", "else", "{", "output", ".", "append", "(", "this", ".", "javadocGapLinesBuffer", ")", ";", "}", "}", "return", ";", "}", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "javadocGapLinesBuffer", ")", ";", "if", "(", "i", "==", "(", "linesGap", "-", "1", ")", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "}", "else", "{", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "}", "lineCount", "++", ";", "}", "int", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ";", "int", "tokenLength", "=", "this", ".", "scanner", ".", "currentPosition", "-", "currentTokenStartPosition", ";", "if", "(", "output", "==", "null", ")", "{", "addReplaceEdit", "(", "start", ",", "currentTokenStartPosition", "-", "1", ",", "this", ".", "javadocGapLinesBuffer", ".", "toString", "(", ")", ")", ";", "}", "else", "{", "output", ".", "append", "(", "this", ".", "javadocGapLinesBuffer", ")", ";", "output", ".", "append", "(", "this", ".", "scanner", ".", "source", ",", "currentTokenStartPosition", ",", "tokenLength", ")", ";", "}", "this", ".", "column", "+=", "tokenLength", ";", "if", "(", "footer", "&&", "clearBlankLines", "&&", "lineCount", "==", "newLines", ")", "{", "if", "(", "textEndPosition", ">=", "currentTokenStartPosition", ")", "{", "if", "(", "output", "==", "null", ")", "{", "addDeleteEdit", "(", "currentTokenStartPosition", ",", "textEndPosition", ")", ";", "}", "}", "return", ";", "}", "}", "start", "=", "this", ".", "scanner", ".", "currentPosition", ";", "linePtr", "=", "this", ".", "scanner", ".", "linePtr", ";", "endsOnMultiply", "=", "true", ";", "break", ";", "default", ":", "endsOnMultiply", "=", "false", ";", "break", ";", "}", "}", "if", "(", "lineCount", "<", "newLines", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "setLength", "(", "0", ")", ";", "if", "(", "lineCount", ">", "0", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "'", "'", ")", ";", "}", "for", "(", "int", "i", "=", "lineCount", ";", "i", "<", "newLines", "-", "1", ";", "i", "++", ")", "{", "printJavadocNewLine", "(", "this", ".", "javadocGapLinesBuffer", ")", ";", "}", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "javadocGapLinesBuffer", ")", ";", "if", "(", "footer", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "'", "'", ")", ";", "this", ".", "column", "++", ";", "}", "else", "{", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "}", "if", "(", "output", "==", "null", ")", "{", "if", "(", "textEndPosition", ">=", "start", ")", "{", "addReplaceEdit", "(", "start", ",", "textEndPosition", ",", "this", ".", "javadocGapLinesBuffer", ".", "toString", "(", ")", ")", ";", "}", "else", "{", "addInsertEdit", "(", "textEndPosition", "+", "1", ",", "this", ".", "javadocGapLinesBuffer", ".", "toString", "(", ")", ")", ";", "}", "}", "else", "{", "output", ".", "append", "(", "this", ".", "javadocGapLinesBuffer", ")", ";", "}", "}", "else", "{", "if", "(", "textEndPosition", ">=", "start", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "setLength", "(", "0", ")", ";", "if", "(", "this", ".", "scanner", ".", "linePtr", ">", "linePtr", ")", "{", "if", "(", "lineCount", ">", "0", ")", "{", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "'", "'", ")", ";", "}", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "javadocGapLinesBuffer", ")", ";", "}", "this", ".", "javadocGapLinesBuffer", ".", "append", "(", "'", "'", ")", ";", "if", "(", "output", "==", "null", ")", "{", "addReplaceEdit", "(", "start", ",", "textEndPosition", ",", "this", ".", "javadocGapLinesBuffer", ".", "toString", "(", ")", ")", ";", "}", "else", "{", "output", ".", "append", "(", "this", ".", "javadocGapLinesBuffer", ")", ";", "}", "this", ".", "needSpace", "=", "false", ";", "}", "else", "if", "(", "endsOnMultiply", ")", "{", "if", "(", "output", "==", "null", ")", "{", "addInsertEdit", "(", "textEndPosition", "+", "1", ",", "\"", "\"", ")", ";", "}", "else", "{", "output", ".", "append", "(", "'", "'", ")", ";", "}", "this", ".", "needSpace", "=", "false", ";", "}", "this", ".", "column", "++", ";", "}", "}", "catch", "(", "InvalidInputException", "iie", ")", "{", "}", "finally", "{", "this", ".", "scanner", ".", "recordLineSeparator", "=", "false", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "scanner", ".", "resetTo", "(", "textEndPosition", "+", "1", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "this", ".", "lastNumberOfNewLines", "+=", "newLines", ";", "this", ".", "line", "+=", "newLines", ";", "}", "}", "private", "void", "printJavadocImmutableText", "(", "FormatJavadocText", "text", ",", "FormatJavadocBlock", "block", ",", "boolean", "textOnNewLine", ")", "{", "try", "{", "int", "textLineStart", "=", "text", ".", "lineStart", ";", "this", ".", "scanner", ".", "tokenizeWhiteSpace", "=", "false", ";", "String", "newLineString", "=", "null", ";", "for", "(", "int", "idx", "=", "0", ",", "max", "=", "text", ".", "separatorsPtr", ";", "idx", "<=", "max", ";", "idx", "++", ")", "{", "int", "start", "=", "(", "int", ")", "text", ".", "separators", "[", "idx", "]", ";", "int", "lineStart", "=", "Util", ".", "getLineNumber", "(", "start", ",", "this", ".", "lineEnds", ",", "textLineStart", "-", "1", ",", "this", ".", "maxLines", ")", ";", "while", "(", "textLineStart", "<", "lineStart", ")", "{", "int", "end", "=", "this", ".", "lineEnds", "[", "textLineStart", "-", "1", "]", ";", "this", ".", "scanner", ".", "resetTo", "(", "end", ",", "start", ")", ";", "int", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameMULTIPLY", ":", "case", "TerminalTokens", ".", "TokenNameMULTIPLY_EQUAL", ":", "break", ";", "default", ":", "return", ";", "}", "if", "(", "this", ".", "scanner", ".", "currentCharacter", "==", "'", "'", ")", "{", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "}", "if", "(", "newLineString", "==", "null", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "newLineString", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "}", "addReplaceEdit", "(", "end", "+", "1", ",", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ",", "newLineString", ")", ";", "textLineStart", "=", "Util", ".", "getLineNumber", "(", "this", ".", "scanner", ".", "currentPosition", "-", "1", ",", "this", ".", "lineEnds", ",", "textLineStart", ",", "this", ".", "maxLines", ")", ";", "}", "}", "}", "catch", "(", "InvalidInputException", "iie", ")", "{", "}", "finally", "{", "this", ".", "needSpace", "=", "false", ";", "this", ".", "scanner", ".", "tokenizeWhiteSpace", "=", "true", ";", "this", ".", "scanner", ".", "resetTo", "(", "text", ".", "sourceEnd", "+", "1", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "}", "}", "private", "void", "printJavadocGapLinesForImmutableBlock", "(", "FormatJavadocBlock", "block", ")", "{", "int", "firstLineEnd", "=", "-", "1", ";", "int", "newLineStart", "=", "-", "1", ";", "int", "secondLineStart", "=", "-", "1", ";", "int", "starPosition", "=", "-", "1", ";", "int", "offset", "=", "0", ";", "int", "start", "=", "block", ".", "tagEnd", "+", "1", ";", "int", "end", "=", "block", ".", "nodes", "[", "0", "]", ".", "sourceStart", "-", "1", ";", "this", ".", "scanner", ".", "resetTo", "(", "start", ",", "end", ")", ";", "int", "lineStart", "=", "block", ".", "lineStart", ";", "int", "lineEnd", "=", "Util", ".", "getLineNumber", "(", "block", ".", "nodes", "[", "0", "]", ".", "sourceEnd", ",", "this", ".", "lineEnds", ",", "lineStart", "-", "1", ",", "this", ".", "maxLines", ")", ";", "boolean", "multiLinesBlock", "=", "lineEnd", ">", "(", "lineStart", "+", "1", ")", ";", "int", "previousPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "String", "newLineString", "=", "null", ";", "int", "indentationColumn", "=", "0", ";", "int", "leadingSpaces", "=", "-", "1", ";", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "char", "ch", "=", "(", "char", ")", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "switch", "(", "ch", ")", "{", "case", "'\\t'", ":", "if", "(", "secondLineStart", ">", "0", "||", "firstLineEnd", "<", "0", ")", "{", "int", "reminder", "=", "this", ".", "tabLength", "==", "0", "?", "0", ":", "offset", "%", "this", ".", "tabLength", ";", "if", "(", "reminder", "==", "0", ")", "{", "offset", "+=", "this", ".", "tabLength", ";", "}", "else", "{", "offset", "=", "(", "(", "offset", "/", "this", ".", "tabLength", ")", "+", "1", ")", "*", "this", ".", "tabLength", ";", "}", "}", "else", "if", "(", "leadingSpaces", ">=", "0", ")", "{", "int", "reminder", "=", "this", ".", "tabLength", "==", "0", "?", "0", ":", "offset", "%", "this", ".", "tabLength", ";", "if", "(", "reminder", "==", "0", ")", "{", "leadingSpaces", "+=", "this", ".", "tabLength", ";", "}", "else", "{", "leadingSpaces", "=", "(", "(", "offset", "/", "this", ".", "tabLength", ")", "+", "1", ")", "*", "this", ".", "tabLength", ";", "}", "}", "break", ";", "case", "'\\r'", ":", "case", "'\\n'", ":", "if", "(", "firstLineEnd", "<", "0", ")", "{", "firstLineEnd", "=", "previousPosition", ";", "}", "if", "(", "leadingSpaces", ">", "0", "&&", "multiLinesBlock", ")", "{", "if", "(", "newLineString", "==", "null", ")", "{", "this", ".", "column", "=", "1", ";", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "newLineString", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "indentationColumn", "=", "this", ".", "column", ";", "}", "else", "{", "this", ".", "column", "=", "indentationColumn", ";", "}", "addReplaceEdit", "(", "newLineStart", ",", "newLineStart", "+", "indentationColumn", "-", "2", ",", "newLineString", ")", ";", "}", "newLineStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "leadingSpaces", "=", "0", ";", "starPosition", "=", "-", "1", ";", "if", "(", "multiLinesBlock", ")", "{", "offset", "=", "0", ";", "secondLineStart", "=", "-", "1", ";", "}", "break", ";", "case", "'*'", ":", "if", "(", "starPosition", "<", "0", "&&", "firstLineEnd", ">", "0", ")", "{", "secondLineStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "starPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "leadingSpaces", "=", "-", "1", ";", "}", "break", ";", "default", ":", "if", "(", "secondLineStart", ">", "0", ")", "{", "if", "(", "secondLineStart", "==", "starPosition", ")", "{", "secondLineStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "}", "else", "{", "if", "(", "offset", "==", "0", "&&", "multiLinesBlock", ")", "{", "if", "(", "newLineString", "==", "null", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "indentationColumn", "=", "this", ".", "column", ";", "newLineString", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "}", "else", "{", "this", ".", "column", "=", "indentationColumn", ";", "}", "addReplaceEdit", "(", "newLineStart", ",", "secondLineStart", "-", "1", ",", "newLineString", ")", ";", "}", "offset", "++", ";", "}", "}", "else", "if", "(", "firstLineEnd", "<", "0", ")", "{", "offset", "++", ";", "}", "else", "if", "(", "leadingSpaces", ">=", "0", ")", "{", "leadingSpaces", "++", ";", "}", "break", ";", "}", "previousPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "}", "if", "(", "multiLinesBlock", ")", "{", "this", ".", "column", "+=", "offset", ";", "}", "else", "{", "this", ".", "column", "++", ";", "}", "if", "(", "!", "multiLinesBlock", ")", "{", "if", "(", "firstLineEnd", ">", "0", ")", "{", "addReplaceEdit", "(", "firstLineEnd", ",", "end", ",", "\"", "\"", ")", ";", "}", "}", "else", "if", "(", "secondLineStart", ">", "0", ")", "{", "if", "(", "newLineString", "==", "null", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "newLineString", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "indentationColumn", "=", "this", ".", "column", ";", "}", "else", "{", "this", ".", "column", "=", "indentationColumn", ";", "}", "addReplaceEdit", "(", "newLineStart", ",", "secondLineStart", "-", "1", ",", "newLineString", ")", ";", "}", "else", "if", "(", "leadingSpaces", ">", "0", ")", "{", "if", "(", "newLineString", "==", "null", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "newLineString", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "indentationColumn", "=", "this", ".", "column", ";", "}", "else", "{", "this", ".", "column", "=", "indentationColumn", ";", "}", "addReplaceEdit", "(", "newLineStart", ",", "newLineStart", "+", "indentationColumn", "-", "2", ",", "newLineString", ")", ";", "}", "this", ".", "needSpace", "=", "false", ";", "this", ".", "scanner", ".", "resetTo", "(", "end", "+", "1", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "}", "private", "int", "printJavadocHtmlTag", "(", "FormatJavadocText", "text", ",", "FormatJavadocBlock", "block", ",", "boolean", "textOnNewLine", ")", "{", "boolean", "clearBlankLines", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_clear_blank_lines_in_javadoc_comment", ";", "int", "textStart", "=", "text", ".", "sourceStart", ";", "int", "nextStart", "=", "textStart", ";", "int", "startLine", "=", "Util", ".", "getLineNumber", "(", "textStart", ",", "this", ".", "lineEnds", ",", "0", ",", "this", ".", "maxLines", ")", ";", "int", "htmlTagID", "=", "text", ".", "getHtmlTagID", "(", ")", ";", "if", "(", "text", ".", "depth", ">=", "this", ".", "javadocHtmlTagBuffers", ".", "length", ")", "{", "int", "length", "=", "this", ".", "javadocHtmlTagBuffers", ".", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "javadocHtmlTagBuffers", ",", "0", ",", "this", ".", "javadocHtmlTagBuffers", "=", "new", "StringBuffer", "[", "text", ".", "depth", "+", "6", "]", ",", "0", ",", "length", ")", ";", "}", "StringBuffer", "buffer", "=", "this", ".", "javadocHtmlTagBuffers", "[", "text", ".", "depth", "]", ";", "if", "(", "buffer", "==", "null", ")", "{", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "this", ".", "javadocHtmlTagBuffers", "[", "text", ".", "depth", "]", "=", "buffer", ";", "}", "else", "{", "buffer", ".", "setLength", "(", "0", ")", ";", "}", "int", "max", "=", "text", ".", "separatorsPtr", ";", "int", "linesAfter", "=", "0", ";", "int", "previousEnd", "=", "-", "1", ";", "boolean", "isHtmlBreakTag", "=", "htmlTagID", "==", "JAVADOC_SINGLE_BREAK_TAG_ID", ";", "boolean", "isHtmlSeparatorTag", "=", "htmlTagID", "==", "JAVADOC_SEPARATOR_TAGS_ID", ";", "if", "(", "isHtmlBreakTag", ")", "{", "return", "1", ";", "}", "boolean", "isCode", "=", "htmlTagID", "==", "JAVADOC_CODE_TAGS_ID", ";", "for", "(", "int", "idx", "=", "0", ",", "ptr", "=", "0", ";", "idx", "<=", "max", "||", "(", "text", ".", "htmlNodesPtr", "!=", "-", "1", "&&", "ptr", "<=", "text", ".", "htmlNodesPtr", ")", ";", "idx", "++", ")", "{", "int", "end", "=", "(", "idx", ">", "max", ")", "?", "text", ".", "sourceEnd", ":", "(", "int", ")", "(", "text", ".", "separators", "[", "idx", "]", ">>>", "32", ")", ";", "int", "nodeKind", "=", "0", ";", "if", "(", "text", ".", "htmlNodesPtr", ">=", "0", "&&", "ptr", "<=", "text", ".", "htmlNodesPtr", "&&", "end", ">", "text", ".", "htmlNodes", "[", "ptr", "]", ".", "sourceStart", ")", "{", "FormatJavadocNode", "node", "=", "text", ".", "htmlNodes", "[", "ptr", "]", ";", "FormatJavadocText", "htmlTag", "=", "node", ".", "isText", "(", ")", "?", "(", "FormatJavadocText", ")", "node", ":", "null", ";", "int", "newLines", "=", "htmlTag", "==", "null", "?", "0", ":", "htmlTag", ".", "linesBefore", ";", "if", "(", "linesAfter", ">", "newLines", ")", "{", "newLines", "=", "linesAfter", ";", "if", "(", "newLines", ">", "1", "&&", "clearBlankLines", ")", "{", "if", "(", "idx", "<", "2", "||", "(", "text", ".", "htmlIndexes", "[", "idx", "-", "2", "]", "&", "JAVADOC_TAGS_ID_MASK", ")", "!=", "JAVADOC_CODE_TAGS_ID", ")", "{", "newLines", "=", "1", ";", "}", "}", "}", "if", "(", "textStart", "<", "previousEnd", ")", "{", "addReplaceEdit", "(", "textStart", ",", "previousEnd", ",", "buffer", ".", "toString", "(", ")", ")", ";", "}", "boolean", "immutable", "=", "node", ".", "isImmutable", "(", ")", ";", "if", "(", "newLines", "==", "0", ")", "{", "newLines", "=", "printJavadocBlockNodesNewLines", "(", "block", ",", "node", ",", "previousEnd", ")", ";", "}", "int", "nodeStart", "=", "node", ".", "sourceStart", ";", "if", "(", "newLines", ">", "0", "||", "(", "idx", ">", "1", "&&", "nodeStart", ">", "(", "previousEnd", "+", "1", ")", ")", ")", "{", "printJavadocGapLines", "(", "previousEnd", "+", "1", ",", "nodeStart", "-", "1", ",", "newLines", ",", "clearBlankLines", ",", "false", ",", "null", ")", ";", "}", "if", "(", "newLines", ">", "0", ")", "textOnNewLine", "=", "true", ";", "buffer", ".", "setLength", "(", "0", ")", ";", "if", "(", "node", ".", "isText", "(", ")", ")", "{", "if", "(", "immutable", ")", "{", "if", "(", "textOnNewLine", "&&", "this", ".", "commentIndentation", "!=", "null", ")", "{", "addInsertEdit", "(", "node", ".", "sourceStart", ",", "this", ".", "commentIndentation", ")", ";", "this", ".", "column", "+=", "this", ".", "commentIndentation", ".", "length", "(", ")", ";", "}", "printJavadocImmutableText", "(", "htmlTag", ",", "block", ",", "textOnNewLine", ")", ";", "this", ".", "column", "+=", "getTextLength", "(", "block", ",", "htmlTag", ")", ";", "linesAfter", "=", "0", ";", "}", "else", "{", "linesAfter", "=", "printJavadocHtmlTag", "(", "htmlTag", ",", "block", ",", "textOnNewLine", ")", ";", "}", "nodeKind", "=", "1", ";", "}", "else", "{", "if", "(", "textOnNewLine", "&&", "this", ".", "commentIndentation", "!=", "null", ")", "{", "addInsertEdit", "(", "node", ".", "sourceStart", ",", "this", ".", "commentIndentation", ")", ";", "this", ".", "column", "+=", "this", ".", "commentIndentation", ".", "length", "(", ")", ";", "}", "printJavadocBlock", "(", "(", "FormatJavadocBlock", ")", "node", ")", ";", "linesAfter", "=", "0", ";", "nodeKind", "=", "2", ";", "}", "textStart", "=", "node", ".", "sourceEnd", "+", "1", ";", "ptr", "++", ";", "if", "(", "idx", ">", "max", ")", "{", "return", "linesAfter", ";", "}", "}", "else", "{", "if", "(", "idx", ">", "0", "&&", "linesAfter", ">", "0", ")", "{", "printJavadocGapLines", "(", "previousEnd", "+", "1", ",", "nextStart", "-", "1", ",", "linesAfter", ",", "clearBlankLines", ",", "false", ",", "buffer", ")", ";", "textOnNewLine", "=", "true", ";", "}", "boolean", "needIndentation", "=", "textOnNewLine", ";", "if", "(", "idx", ">", "0", ")", "{", "if", "(", "!", "needIndentation", "&&", "text", ".", "isTextAfterHtmlSeparatorTag", "(", "idx", "-", "1", ")", ")", "{", "needIndentation", "=", "true", ";", "}", "}", "this", ".", "needSpace", "=", "idx", ">", "1", "&&", "(", "previousEnd", "+", "1", ")", "<", "nextStart", ";", "printJavadocTextLine", "(", "buffer", ",", "nextStart", ",", "end", ",", "block", ",", "idx", "==", "0", ",", "needIndentation", ",", "idx", "==", "0", "||", "text", ".", "htmlIndexes", "[", "idx", "-", "1", "]", "!=", "-", "1", ")", ";", "linesAfter", "=", "0", ";", "if", "(", "idx", "==", "0", ")", "{", "if", "(", "isHtmlSeparatorTag", ")", "{", "linesAfter", "=", "1", ";", "}", "}", "else", "if", "(", "text", ".", "htmlIndexes", "[", "idx", "-", "1", "]", "==", "JAVADOC_SINGLE_BREAK_TAG_ID", ")", "{", "linesAfter", "=", "1", ";", "}", "}", "nextStart", "=", "(", "int", ")", "text", ".", "separators", "[", "idx", "]", ";", "int", "endLine", "=", "Util", ".", "getLineNumber", "(", "end", ",", "this", ".", "lineEnds", ",", "startLine", "-", "1", ",", "this", ".", "maxLines", ")", ";", "startLine", "=", "Util", ".", "getLineNumber", "(", "nextStart", ",", "this", ".", "lineEnds", ",", "endLine", "-", "1", ",", "this", ".", "maxLines", ")", ";", "int", "linesGap", "=", "startLine", "-", "endLine", ";", "if", "(", "linesGap", ">", "0", ")", "{", "if", "(", "clearBlankLines", ")", "{", "}", "else", "{", "if", "(", "idx", "==", "0", "||", "linesGap", ">", "1", "||", "(", "idx", "<", "max", "&&", "nodeKind", "==", "1", "&&", "(", "text", ".", "htmlIndexes", "[", "idx", "-", "1", "]", "&", "JAVADOC_TAGS_ID_MASK", ")", "!=", "JAVADOC_IMMUTABLE_TAGS_ID", ")", ")", "{", "if", "(", "linesAfter", "<", "linesGap", ")", "{", "linesAfter", "=", "linesGap", ";", "}", "}", "}", "}", "textOnNewLine", "=", "linesAfter", ">", "0", ";", "if", "(", "isCode", ")", "{", "int", "codeEnd", "=", "(", "int", ")", "(", "text", ".", "separators", "[", "max", "]", ">>>", "32", ")", ";", "if", "(", "codeEnd", ">", "end", ")", "{", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "comment_format_source", ")", "{", "if", "(", "textStart", "<", "end", ")", "addReplaceEdit", "(", "textStart", ",", "end", ",", "buffer", ".", "toString", "(", ")", ")", ";", "if", "(", "linesGap", ">", "0", ")", "{", "int", "lineStart", "=", "this", ".", "scanner", ".", "getLineStart", "(", "startLine", ")", ";", "if", "(", "nextStart", ">", "lineStart", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "lineStart", ",", "nextStart", "-", "1", ")", ";", "try", "{", "int", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameWHITESPACE", ")", "{", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "}", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameMULTIPLY", ")", "{", "nextStart", "=", "this", ".", "scanner", ".", "currentPosition", ";", "}", "}", "catch", "(", "InvalidInputException", "iie", ")", "{", "}", "}", "}", "int", "newLines", "=", "linesGap", ";", "if", "(", "newLines", "==", "0", ")", "newLines", "=", "1", ";", "this", ".", "needSpace", "=", "false", ";", "printJavadocGapLines", "(", "end", "+", "1", ",", "nextStart", "-", "1", ",", "newLines", ",", "false", ",", "false", ",", "null", ")", ";", "printCodeSnippet", "(", "nextStart", ",", "codeEnd", ",", "linesGap", ")", ";", "nextStart", "=", "(", "int", ")", "text", ".", "separators", "[", "max", "]", ";", "printJavadocGapLines", "(", "codeEnd", "+", "1", ",", "nextStart", "-", "1", ",", "1", ",", "false", ",", "false", ",", "null", ")", ";", "return", "2", ";", "}", "}", "else", "{", "nextStart", "=", "(", "int", ")", "text", ".", "separators", "[", "max", "]", ";", "if", "(", "(", "nextStart", "-", "1", ")", ">", "(", "end", "+", "1", ")", ")", "{", "int", "line1", "=", "Util", ".", "getLineNumber", "(", "end", "+", "1", ",", "this", ".", "lineEnds", ",", "startLine", "-", "1", ",", "this", ".", "maxLines", ")", ";", "int", "line2", "=", "Util", ".", "getLineNumber", "(", "nextStart", "-", "1", ",", "this", ".", "lineEnds", ",", "line1", "-", "1", ",", "this", ".", "maxLines", ")", ";", "int", "gapLines", "=", "line2", "-", "line1", "-", "1", ";", "printJavadocGapLines", "(", "end", "+", "1", ",", "nextStart", "-", "1", ",", "gapLines", ",", "false", ",", "false", ",", "null", ")", ";", "if", "(", "gapLines", ">", "0", ")", "textOnNewLine", "=", "true", ";", "}", "}", "return", "1", ";", "}", "previousEnd", "=", "end", ";", "}", "boolean", "closingTag", "=", "isHtmlBreakTag", "||", "(", "text", ".", "htmlIndexes", "!=", "null", "&&", "(", "text", ".", "htmlIndexes", "[", "max", "]", "&", "JAVADOC_TAGS_ID_MASK", ")", "==", "htmlTagID", ")", ";", "boolean", "isValidHtmlSeparatorTag", "=", "max", ">", "0", "&&", "isHtmlSeparatorTag", "&&", "closingTag", ";", "if", "(", "previousEnd", "!=", "-", "1", ")", "{", "if", "(", "isValidHtmlSeparatorTag", ")", "{", "if", "(", "linesAfter", "==", "0", ")", "linesAfter", "=", "1", ";", "}", "if", "(", "linesAfter", ">", "0", ")", "{", "printJavadocGapLines", "(", "previousEnd", "+", "1", ",", "nextStart", "-", "1", ",", "linesAfter", ",", "clearBlankLines", ",", "false", ",", "buffer", ")", ";", "textOnNewLine", "=", "linesAfter", ">", "0", ";", "}", "}", "boolean", "needIndentation", "=", "textOnNewLine", ";", "if", "(", "!", "needIndentation", "&&", "!", "isHtmlBreakTag", "&&", "text", ".", "htmlIndexes", "!=", "null", "&&", "text", ".", "isTextAfterHtmlSeparatorTag", "(", "max", ")", ")", "{", "needIndentation", "=", "true", ";", "}", "this", ".", "needSpace", "=", "!", "closingTag", "&&", "max", ">", "0", "&&", "(", "previousEnd", "+", "1", ")", "<", "nextStart", ";", "printJavadocTextLine", "(", "buffer", ",", "nextStart", ",", "text", ".", "sourceEnd", ",", "block", ",", "max", "<=", "0", ",", "needIndentation", ",", "closingTag", ")", ";", "if", "(", "textStart", "<", "text", ".", "sourceEnd", ")", "{", "addReplaceEdit", "(", "textStart", ",", "text", ".", "sourceEnd", ",", "buffer", ".", "toString", "(", ")", ")", ";", "}", "this", ".", "needSpace", "=", "false", ";", "this", ".", "scanner", ".", "resetTo", "(", "text", ".", "sourceEnd", "+", "1", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", "isValidHtmlSeparatorTag", "?", "1", ":", "0", ";", "}", "private", "void", "printJavadocNewLine", "(", "StringBuffer", "buffer", ")", "{", "buffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "buffer", ")", ";", "buffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "this", ".", "line", "++", ";", "this", ".", "lastNumberOfNewLines", "++", ";", "}", "private", "void", "printJavadocText", "(", "FormatJavadocText", "text", ",", "FormatJavadocBlock", "block", ",", "boolean", "textOnNewLine", ")", "{", "boolean", "clearBlankLines", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_clear_blank_lines_in_javadoc_comment", ";", "boolean", "joinLines", "=", "this", ".", "formatter", ".", "preferences", ".", "join_lines_in_comments", ";", "this", ".", "javadocTextBuffer", ".", "setLength", "(", "0", ")", ";", "int", "textStart", "=", "text", ".", "sourceStart", ";", "int", "nextStart", "=", "textStart", ";", "int", "startLine", "=", "Util", ".", "getLineNumber", "(", "textStart", ",", "this", ".", "lineEnds", ",", "0", ",", "this", ".", "maxLines", ")", ";", "for", "(", "int", "idx", "=", "0", ",", "max", "=", "text", ".", "separatorsPtr", ";", "idx", "<=", "max", ";", "idx", "++", ")", "{", "int", "end", "=", "(", "int", ")", "(", "text", ".", "separators", "[", "idx", "]", ">>>", "32", ")", ";", "boolean", "needIndentation", "=", "textOnNewLine", ";", "if", "(", "idx", ">", "0", ")", "{", "if", "(", "!", "needIndentation", "&&", "text", ".", "isTextAfterHtmlSeparatorTag", "(", "idx", "-", "1", ")", ")", "{", "needIndentation", "=", "true", ";", "}", "}", "this", ".", "needSpace", "=", "idx", ">", "0", ";", "printJavadocTextLine", "(", "this", ".", "javadocTextBuffer", ",", "nextStart", ",", "end", ",", "block", ",", "idx", "==", "0", "||", "(", "!", "joinLines", "&&", "textOnNewLine", ")", ",", "needIndentation", ",", "false", ")", ";", "textOnNewLine", "=", "false", ";", "nextStart", "=", "(", "int", ")", "text", ".", "separators", "[", "idx", "]", ";", "if", "(", "!", "clearBlankLines", "||", "!", "joinLines", ")", "{", "int", "endLine", "=", "Util", ".", "getLineNumber", "(", "end", ",", "this", ".", "lineEnds", ",", "startLine", "-", "1", ",", "this", ".", "maxLines", ")", ";", "startLine", "=", "Util", ".", "getLineNumber", "(", "nextStart", ",", "this", ".", "lineEnds", ",", "endLine", "-", "1", ",", "this", ".", "maxLines", ")", ";", "int", "gapLine", "=", "endLine", ";", "if", "(", "joinLines", ")", "gapLine", "++", ";", "if", "(", "startLine", ">", "gapLine", ")", "{", "addReplaceEdit", "(", "textStart", ",", "end", ",", "this", ".", "javadocTextBuffer", ".", "toString", "(", ")", ")", ";", "textStart", "=", "nextStart", ";", "this", ".", "javadocTextBuffer", ".", "setLength", "(", "0", ")", ";", "int", "newLines", "=", "startLine", "-", "endLine", ";", "if", "(", "clearBlankLines", ")", "newLines", "=", "1", ";", "printJavadocGapLines", "(", "end", "+", "1", ",", "nextStart", "-", "1", ",", "newLines", ",", "this", ".", "formatter", ".", "preferences", ".", "comment_clear_blank_lines_in_javadoc_comment", ",", "false", ",", "null", ")", ";", "textOnNewLine", "=", "true", ";", "}", "else", "if", "(", "startLine", ">", "endLine", ")", "{", "textOnNewLine", "=", "!", "joinLines", ";", "}", "}", "}", "boolean", "needIndentation", "=", "textOnNewLine", ";", "this", ".", "needSpace", "=", "text", ".", "separatorsPtr", ">=", "0", ";", "printJavadocTextLine", "(", "this", ".", "javadocTextBuffer", ",", "nextStart", ",", "text", ".", "sourceEnd", ",", "block", ",", "text", ".", "separatorsPtr", "==", "-", "1", ",", "needIndentation", ",", "false", ")", ";", "addReplaceEdit", "(", "textStart", ",", "text", ".", "sourceEnd", ",", "this", ".", "javadocTextBuffer", ".", "toString", "(", ")", ")", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "scanner", ".", "resetTo", "(", "text", ".", "sourceEnd", "+", "1", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "}", "private", "void", "printJavadocTextLine", "(", "StringBuffer", "buffer", ",", "int", "textStart", ",", "int", "textEnd", ",", "FormatJavadocBlock", "block", ",", "boolean", "firstText", ",", "boolean", "needIndentation", ",", "boolean", "isHtmlTag", ")", "{", "boolean", "headerLine", "=", "block", ".", "isHeaderLine", "(", ")", "&&", "this", ".", "lastNumberOfNewLines", "==", "0", ";", "this", ".", "javadocTokensBuffer", ".", "setLength", "(", "0", ")", ";", "int", "firstColumn", "=", "1", "+", "this", ".", "indentationLevel", "+", "BLOCK_LINE_PREFIX_LENGTH", ";", "int", "maxColumn", "=", "this", ".", "formatter", ".", "preferences", ".", "comment_line_length", "+", "1", ";", "if", "(", "headerLine", ")", "{", "firstColumn", "++", ";", "maxColumn", "++", ";", "}", "if", "(", "needIndentation", "&&", "this", ".", "commentIndentation", "!=", "null", ")", "{", "buffer", ".", "append", "(", "this", ".", "commentIndentation", ")", ";", "this", ".", "column", "+=", "this", ".", "commentIndentation", ".", "length", "(", ")", ";", "firstColumn", "+=", "this", ".", "commentIndentation", ".", "length", "(", ")", ";", "}", "if", "(", "this", ".", "column", "<", "firstColumn", ")", "{", "this", ".", "column", "=", "firstColumn", ";", "}", "String", "newLineString", "=", "null", ";", "try", "{", "this", ".", "scanner", ".", "resetTo", "(", "textStart", ",", "textEnd", ")", ";", "this", ".", "scanner", ".", "skipComments", "=", "true", ";", "int", "previousToken", "=", "-", "1", ";", "boolean", "textOnNewLine", "=", "needIndentation", ";", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "int", "token", ";", "try", "{", "token", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "}", "catch", "(", "InvalidInputException", "iie", ")", "{", "token", "=", "consumeInvalidToken", "(", "textEnd", ")", ";", "}", "int", "tokensBufferLength", "=", "this", ".", "javadocTokensBuffer", ".", "length", "(", ")", ";", "int", "tokenStart", "=", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ";", "int", "tokenLength", "=", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", "?", "this", ".", "scanner", ".", "eofPosition", ":", "this", ".", "scanner", ".", "currentPosition", ")", "-", "tokenStart", ";", "boolean", "insertSpace", "=", "(", "previousToken", "==", "TerminalTokens", ".", "TokenNameWHITESPACE", "||", "this", ".", "needSpace", ")", "&&", "!", "textOnNewLine", ";", "String", "tokensBufferString", "=", "this", ".", "javadocTokensBuffer", ".", "toString", "(", ")", ".", "trim", "(", ")", ";", "switch", "(", "token", ")", "{", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "if", "(", "tokensBufferLength", ">", "0", ")", "{", "boolean", "shouldSplit", "=", "(", "this", ".", "column", "+", "tokensBufferLength", ")", ">", "maxColumn", "&&", "!", "isHtmlTag", "&&", "(", "insertSpace", "||", "tokensBufferLength", ">", "1", ")", "&&", "tokensBufferString", ".", "charAt", "(", "0", ")", "!=", "'@'", ";", "if", "(", "shouldSplit", ")", "{", "this", ".", "lastNumberOfNewLines", "++", ";", "this", ".", "line", "++", ";", "if", "(", "newLineString", "==", "null", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "if", "(", "this", ".", "commentIndentation", "!=", "null", ")", "{", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "commentIndentation", ")", ";", "this", ".", "column", "+=", "this", ".", "commentIndentation", ".", "length", "(", ")", ";", "}", "firstColumn", "=", "this", ".", "column", ";", "newLineString", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "}", "else", "{", "this", ".", "column", "=", "firstColumn", ";", "}", "buffer", ".", "append", "(", "newLineString", ")", ";", "buffer", ".", "append", "(", "tokensBufferString", ")", ";", "this", ".", "column", "+=", "tokensBufferString", ".", "length", "(", ")", ";", "if", "(", "headerLine", ")", "{", "firstColumn", "--", ";", "maxColumn", "--", ";", "headerLine", "=", "false", ";", "}", "}", "else", "{", "buffer", ".", "append", "(", "this", ".", "javadocTokensBuffer", ")", ";", "this", ".", "column", "+=", "tokensBufferLength", ";", "}", "this", ".", "javadocTokensBuffer", ".", "setLength", "(", "0", ")", ";", "}", "textOnNewLine", "=", "false", ";", "previousToken", "=", "token", ";", "continue", ";", "case", "TerminalTokens", ".", "TokenNameCharacterLiteral", ":", "if", "(", "this", ".", "scanner", ".", "currentPosition", ">", "this", ".", "scanner", ".", "eofPosition", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "scanner", ".", "startPosition", ",", "textEnd", ")", ";", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "token", "=", "1", ";", "}", "break", ";", "}", "int", "lastColumn", "=", "this", ".", "column", "+", "tokensBufferLength", "+", "tokenLength", ";", "if", "(", "insertSpace", ")", "lastColumn", "++", ";", "boolean", "shouldSplit", "=", "lastColumn", ">", "maxColumn", "&&", "(", "!", "isHtmlTag", "||", "previousToken", "==", "-", "1", ")", "&&", "token", "!=", "TerminalTokens", ".", "TokenNameAT", "&&", "(", "tokensBufferLength", "==", "0", "||", "this", ".", "javadocTokensBuffer", ".", "charAt", "(", "tokensBufferLength", "-", "1", ")", "!=", "'@'", ")", ";", "if", "(", "shouldSplit", ")", "{", "if", "(", "(", "tokensBufferLength", ">", "0", "||", "tokenLength", "<", "maxColumn", ")", "&&", "!", "isHtmlTag", "&&", "tokensBufferLength", ">", "0", "&&", "(", "firstColumn", "+", "tokensBufferLength", "+", "tokenLength", ")", ">=", "maxColumn", ")", "{", "buffer", ".", "append", "(", "this", ".", "javadocTokensBuffer", ")", ";", "this", ".", "column", "+=", "tokensBufferLength", ";", "this", ".", "javadocTokensBuffer", ".", "setLength", "(", "0", ")", ";", "tokensBufferLength", "=", "0", ";", "textOnNewLine", "=", "false", ";", "}", "if", "(", "(", "tokensBufferLength", ">", "0", "||", "this", ".", "column", ">", "firstColumn", ")", "&&", "(", "!", "textOnNewLine", "||", "!", "firstText", ")", ")", "{", "this", ".", "lastNumberOfNewLines", "++", ";", "this", ".", "line", "++", ";", "if", "(", "newLineString", "==", "null", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "this", ".", "column", "=", "1", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "BLOCK_LINE_PREFIX", ")", ";", "this", ".", "column", "+=", "BLOCK_LINE_PREFIX_LENGTH", ";", "if", "(", "this", ".", "commentIndentation", "!=", "null", ")", "{", "this", ".", "tempBuffer", ".", "append", "(", "this", ".", "commentIndentation", ")", ";", "this", ".", "column", "+=", "this", ".", "commentIndentation", ".", "length", "(", ")", ";", "}", "firstColumn", "=", "this", ".", "column", ";", "newLineString", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "}", "else", "{", "this", ".", "column", "=", "firstColumn", ";", "}", "buffer", ".", "append", "(", "newLineString", ")", ";", "}", "if", "(", "tokensBufferLength", ">", "0", ")", "{", "String", "tokensString", "=", "tokensBufferString", ";", "buffer", ".", "append", "(", "tokensString", ")", ";", "this", ".", "column", "+=", "tokensString", ".", "length", "(", ")", ";", "this", ".", "javadocTokensBuffer", ".", "setLength", "(", "0", ")", ";", "tokensBufferLength", "=", "0", ";", "}", "buffer", ".", "append", "(", "this", ".", "scanner", ".", "source", ",", "tokenStart", ",", "tokenLength", ")", ";", "this", ".", "column", "+=", "tokenLength", ";", "textOnNewLine", "=", "false", ";", "if", "(", "headerLine", ")", "{", "firstColumn", "--", ";", "maxColumn", "--", ";", "headerLine", "=", "false", ";", "}", "}", "else", "{", "if", "(", "insertSpace", ")", "{", "this", ".", "javadocTokensBuffer", ".", "append", "(", "'", "'", ")", ";", "}", "this", ".", "javadocTokensBuffer", ".", "append", "(", "this", ".", "scanner", ".", "source", ",", "tokenStart", ",", "tokenLength", ")", ";", "}", "previousToken", "=", "token", ";", "this", ".", "needSpace", "=", "false", ";", "if", "(", "headerLine", "&&", "lastColumn", "==", "maxColumn", "&&", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "this", ".", "lastNumberOfNewLines", "++", ";", "this", ".", "line", "++", ";", "}", "}", "}", "finally", "{", "this", ".", "scanner", ".", "skipComments", "=", "false", ";", "if", "(", "this", ".", "javadocTokensBuffer", ".", "length", "(", ")", ">", "0", ")", "{", "buffer", ".", "append", "(", "this", ".", "javadocTokensBuffer", ")", ";", "this", ".", "column", "+=", "this", ".", "javadocTokensBuffer", ".", "length", "(", ")", ";", "}", "}", "}", "public", "void", "printModifiers", "(", "Annotation", "[", "]", "annotations", ",", "ASTVisitor", "visitor", ")", "{", "printModifiers", "(", "annotations", ",", "visitor", ",", "ICodeFormatterConstants", ".", "ANNOTATION_UNSPECIFIED", ")", ";", "}", "public", "void", "printModifiers", "(", "Annotation", "[", "]", "annotations", ",", "ASTVisitor", "visitor", ",", "int", "annotationSourceKind", ")", "{", "try", "{", "int", "annotationsLength", "=", "annotations", "!=", "null", "?", "annotations", ".", "length", ":", "0", ";", "int", "annotationsIndex", "=", "0", ";", "boolean", "isFirstModifier", "=", "true", ";", "int", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "boolean", "hasComment", "=", "false", ";", "boolean", "hasModifiers", "=", "false", ";", "while", "(", "(", "this", ".", "currentToken", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ")", "!=", "TerminalTokens", ".", "TokenNameEOF", ")", "{", "int", "foundTaskCount", "=", "this", ".", "scanner", ".", "foundTaskCount", ";", "int", "tokenStartPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ";", "int", "tokenEndPosition", "=", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ";", "switch", "(", "this", ".", "currentToken", ")", "{", "case", "TerminalTokens", ".", "TokenNamepublic", ":", "case", "TerminalTokens", ".", "TokenNameprotected", ":", "case", "TerminalTokens", ".", "TokenNameprivate", ":", "case", "TerminalTokens", ".", "TokenNamestatic", ":", "case", "TerminalTokens", ".", "TokenNameabstract", ":", "case", "TerminalTokens", ".", "TokenNamefinal", ":", "case", "TerminalTokens", ".", "TokenNamenative", ":", "case", "TerminalTokens", ".", "TokenNamesynchronized", ":", "case", "TerminalTokens", ".", "TokenNametransient", ":", "case", "TerminalTokens", ".", "TokenNamevolatile", ":", "case", "TerminalTokens", ".", "TokenNamestrictfp", ":", "hasModifiers", "=", "true", ";", "print", "(", "this", ".", "scanner", ".", "currentPosition", "-", "this", ".", "scanner", ".", "startPosition", ",", "!", "isFirstModifier", ")", ";", "isFirstModifier", "=", "false", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameAT", ":", "hasModifiers", "=", "true", ";", "if", "(", "!", "isFirstModifier", ")", "{", "space", "(", ")", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "if", "(", "annotationsIndex", "<", "annotationsLength", ")", "{", "boolean", "insertSpaceBeforeBrace", "=", "this", ".", "formatter", ".", "preferences", ".", "insert_space_before_opening_brace_in_array_initializer", ";", "this", ".", "formatter", ".", "preferences", ".", "insert_space_before_opening_brace_in_array_initializer", "=", "false", ";", "try", "{", "annotations", "[", "annotationsIndex", "++", "]", ".", "traverse", "(", "visitor", ",", "(", "BlockScope", ")", "null", ")", ";", "}", "finally", "{", "this", ".", "formatter", ".", "preferences", ".", "insert_space_before_opening_brace_in_array_initializer", "=", "insertSpaceBeforeBrace", ";", "}", "boolean", "shouldAddNewLine", "=", "false", ";", "switch", "(", "annotationSourceKind", ")", "{", "case", "ICodeFormatterConstants", ".", "ANNOTATION_ON_TYPE", ":", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "insert_new_line_after_annotation_on_type", ")", "{", "shouldAddNewLine", "=", "true", ";", "}", "break", ";", "case", "ICodeFormatterConstants", ".", "ANNOTATION_ON_FIELD", ":", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "insert_new_line_after_annotation_on_field", ")", "{", "shouldAddNewLine", "=", "true", ";", "}", "break", ";", "case", "ICodeFormatterConstants", ".", "ANNOTATION_ON_METHOD", ":", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "insert_new_line_after_annotation_on_method", ")", "{", "shouldAddNewLine", "=", "true", ";", "}", "break", ";", "case", "ICodeFormatterConstants", ".", "ANNOTATION_ON_PACKAGE", ":", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "insert_new_line_after_annotation_on_package", ")", "{", "shouldAddNewLine", "=", "true", ";", "}", "break", ";", "case", "ICodeFormatterConstants", ".", "ANNOTATION_ON_PARAMETER", ":", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "insert_new_line_after_annotation_on_parameter", ")", "{", "shouldAddNewLine", "=", "true", ";", "}", "break", ";", "case", "ICodeFormatterConstants", ".", "ANNOTATION_ON_LOCAL_VARIABLE", ":", "if", "(", "this", ".", "formatter", ".", "preferences", ".", "insert_new_line_after_annotation_on_local_variable", ")", "{", "shouldAddNewLine", "=", "true", ";", "}", "break", ";", "default", ":", "}", "if", "(", "shouldAddNewLine", ")", "{", "this", ".", "printNewLine", "(", ")", ";", "}", "}", "else", "{", "return", ";", "}", "isFirstModifier", "=", "false", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "if", "(", "this", ".", "useTags", "&&", "this", ".", "editsEnabled", ")", "{", "boolean", "turnOff", "=", "false", ";", "if", "(", "foundTaskCount", ">", "0", ")", "{", "setEditsEnabled", "(", "foundTaskCount", ")", ";", "turnOff", "=", "true", ";", "}", "else", "if", "(", "this", ".", "tagsKind", "==", "this", ".", "currentToken", "&&", "CharOperation", ".", "equals", "(", "this", ".", "disablingTag", ",", "this", ".", "scanner", ".", "source", ",", "tokenStartPosition", ",", "tokenEndPosition", "+", "1", ")", ")", "{", "this", ".", "editsEnabled", "=", "false", ";", "turnOff", "=", "true", ";", "}", "if", "(", "turnOff", ")", "{", "if", "(", "!", "this", ".", "editsEnabled", "&&", "this", ".", "editsIndex", ">", "1", ")", "{", "OptimizedReplaceEdit", "currentEdit", "=", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", ";", "if", "(", "this", ".", "scanner", ".", "startPosition", "==", "currentEdit", ".", "offset", "+", "currentEdit", ".", "length", ")", "{", "printNewLinesBeforeDisablingComment", "(", ")", ";", "}", "}", "}", "}", "printBlockComment", "(", "this", ".", "currentToken", "==", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ")", ";", "if", "(", "this", ".", "useTags", "&&", "!", "this", ".", "editsEnabled", ")", "{", "if", "(", "foundTaskCount", ">", "0", ")", "{", "setEditsEnabled", "(", "foundTaskCount", ")", ";", "}", "else", "if", "(", "this", ".", "tagsKind", "==", "this", ".", "currentToken", ")", "{", "this", ".", "editsEnabled", "=", "CharOperation", ".", "equals", "(", "this", ".", "enablingTag", ",", "this", ".", "scanner", ".", "source", ",", "tokenStartPosition", ",", "tokenEndPosition", "+", "1", ")", ";", "}", "}", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "hasComment", "=", "true", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "tokenEndPosition", "=", "-", "this", ".", "scanner", ".", "commentStops", "[", "this", ".", "scanner", ".", "commentPtr", "]", ";", "if", "(", "this", ".", "useTags", "&&", "this", ".", "editsEnabled", ")", "{", "boolean", "turnOff", "=", "false", ";", "if", "(", "foundTaskCount", ">", "0", ")", "{", "setEditsEnabled", "(", "foundTaskCount", ")", ";", "turnOff", "=", "true", ";", "}", "else", "if", "(", "this", ".", "tagsKind", "==", "this", ".", "currentToken", "&&", "CharOperation", ".", "equals", "(", "this", ".", "disablingTag", ",", "this", ".", "scanner", ".", "source", ",", "tokenStartPosition", ",", "tokenEndPosition", ")", ")", "{", "this", ".", "editsEnabled", "=", "false", ";", "turnOff", "=", "true", ";", "}", "if", "(", "turnOff", ")", "{", "if", "(", "!", "this", ".", "editsEnabled", "&&", "this", ".", "editsIndex", ">", "1", ")", "{", "OptimizedReplaceEdit", "currentEdit", "=", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", ";", "if", "(", "this", ".", "scanner", ".", "startPosition", "==", "currentEdit", ".", "offset", "+", "currentEdit", ".", "length", ")", "{", "printNewLinesBeforeDisablingComment", "(", ")", ";", "}", "}", "}", "}", "printLineComment", "(", ")", ";", "if", "(", "this", ".", "useTags", "&&", "!", "this", ".", "editsEnabled", ")", "{", "if", "(", "foundTaskCount", ">", "0", ")", "{", "setEditsEnabled", "(", "foundTaskCount", ")", ";", "}", "else", "if", "(", "this", ".", "tagsKind", "==", "this", ".", "currentToken", ")", "{", "this", ".", "editsEnabled", "=", "CharOperation", ".", "equals", "(", "this", ".", "enablingTag", ",", "this", ".", "scanner", ".", "source", ",", "tokenStartPosition", ",", "tokenEndPosition", ")", ";", "}", "}", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "addDeleteEdit", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ")", ";", "int", "count", "=", "0", ";", "char", "[", "]", "whiteSpaces", "=", "this", ".", "scanner", ".", "getCurrentTokenSource", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "whiteSpaces", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "switch", "(", "whiteSpaces", "[", "i", "]", ")", "{", "case", "'\\r'", ":", "if", "(", "(", "i", "+", "1", ")", "<", "max", ")", "{", "if", "(", "whiteSpaces", "[", "i", "+", "1", "]", "==", "'\\n'", ")", "{", "i", "++", ";", "}", "}", "count", "++", ";", "break", ";", "case", "'\\n'", ":", "count", "++", ";", "}", "}", "if", "(", "count", ">=", "1", "&&", "hasComment", ")", "{", "printNewLine", "(", ")", ";", "}", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "hasComment", "=", "false", ";", "break", ";", "default", ":", "if", "(", "hasModifiers", ")", "{", "space", "(", ")", ";", "}", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "throw", "new", "AbortFormatting", "(", "e", ")", ";", "}", "}", "public", "void", "printNewLine", "(", ")", "{", "this", ".", "printNewLine", "(", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", "+", "1", ")", ";", "}", "public", "void", "printNewLine", "(", "int", "insertPosition", ")", "{", "if", "(", "this", ".", "nlsTagCounter", ">", "0", ")", "{", "return", ";", "}", "if", "(", "this", ".", "lastNumberOfNewLines", ">=", "1", ")", "{", "if", "(", "!", "this", ".", "preserveLineBreakIndentation", ")", "{", "this", ".", "column", "=", "1", ";", "}", "this", ".", "preserveLineBreakIndentation", "=", "false", ";", "return", ";", "}", "addInsertEdit", "(", "insertPosition", ",", "this", ".", "lineSeparator", ")", ";", "this", ".", "line", "++", ";", "this", ".", "lastNumberOfNewLines", "=", "1", ";", "this", ".", "column", "=", "1", ";", "this", ".", "needSpace", "=", "false", ";", "this", ".", "pendingSpace", "=", "false", ";", "this", ".", "preserveLineBreakIndentation", "=", "false", ";", "this", ".", "lastLineComment", ".", "contiguous", "=", "false", ";", "}", "private", "void", "printNewLinesBeforeDisablingComment", "(", ")", "{", "int", "linePtr", "=", "Arrays", ".", "binarySearch", "(", "this", ".", "lineEnds", ",", "this", ".", "scanner", ".", "startPosition", ")", ";", "if", "(", "linePtr", "<", "0", ")", "{", "linePtr", "=", "-", "linePtr", "-", "1", ";", "}", "int", "indentation", "=", "0", ";", "int", "beginningOfLine", "=", "getLineEnd", "(", "linePtr", ")", "+", "1", ";", "if", "(", "beginningOfLine", "==", "-", "1", ")", "{", "beginningOfLine", "=", "0", ";", "}", "OptimizedReplaceEdit", "currentEdit", "=", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", ";", "int", "offset", "=", "currentEdit", ".", "offset", ";", "if", "(", "offset", ">=", "beginningOfLine", ")", "return", ";", "int", "scannerStartPosition", "=", "this", ".", "scanner", ".", "startPosition", ";", "int", "scannerEofPosition", "=", "this", ".", "scanner", ".", "eofPosition", ";", "int", "scannerCurrentPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "char", "scannerCurrentChar", "=", "this", ".", "scanner", ".", "currentCharacter", ";", "int", "length", "=", "currentEdit", ".", "length", ";", "this", ".", "scanner", ".", "resetTo", "(", "beginningOfLine", ",", "offset", "+", "length", "-", "1", ")", ";", "try", "{", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "char", "ch", "=", "(", "char", ")", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "switch", "(", "ch", ")", "{", "case", "'\\t'", ":", "if", "(", "this", ".", "tabLength", "!=", "0", ")", "{", "int", "reminder", "=", "indentation", "%", "this", ".", "tabLength", ";", "if", "(", "reminder", "==", "0", ")", "{", "indentation", "+=", "this", ".", "tabLength", ";", "}", "else", "{", "indentation", "=", "(", "(", "indentation", "/", "this", ".", "tabLength", ")", "+", "1", ")", "*", "this", ".", "tabLength", ";", "}", "}", "break", ";", "case", "'", "'", ":", "indentation", "++", ";", "break", ";", "default", ":", "return", ";", "}", "}", "String", "indentationString", ";", "int", "currentIndentation", "=", "getCurrentIndentation", "(", "this", ".", "scanner", ".", "currentPosition", ")", ";", "if", "(", "currentIndentation", ">", "0", "&&", "this", ".", "indentationLevel", ">", "0", ")", "{", "int", "col", "=", "this", ".", "column", ";", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "printIndentationIfNecessary", "(", "this", ".", "tempBuffer", ")", ";", "indentationString", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "this", ".", "column", "=", "col", ";", "}", "else", "{", "indentationString", "=", "Util", ".", "EMPTY_STRING", ";", "}", "String", "replacement", "=", "currentEdit", ".", "replacement", ";", "if", "(", "replacement", ".", "length", "(", ")", "==", "0", ")", "{", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", "=", "new", "OptimizedReplaceEdit", "(", "beginningOfLine", ",", "offset", "+", "length", "-", "beginningOfLine", ",", "indentationString", ")", ";", "}", "else", "{", "int", "idx", "=", "replacement", ".", "lastIndexOf", "(", "this", ".", "lineSeparator", ")", ";", "if", "(", "idx", ">=", "0", ")", "{", "int", "start", "=", "idx", "+", "this", ".", "lsLength", ";", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "this", ".", "tempBuffer", ".", "append", "(", "replacement", ".", "substring", "(", "0", ",", "start", ")", ")", ";", "if", "(", "indentationString", "!=", "Util", ".", "EMPTY_STRING", ")", "{", "this", ".", "tempBuffer", ".", "append", "(", "indentationString", ")", ";", "}", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", "=", "new", "OptimizedReplaceEdit", "(", "offset", ",", "length", ",", "this", ".", "tempBuffer", ".", "toString", "(", ")", ")", ";", "}", "}", "}", "finally", "{", "this", ".", "scanner", ".", "startPosition", "=", "scannerStartPosition", ";", "this", ".", "scanner", ".", "eofPosition", "=", "scannerEofPosition", ";", "this", ".", "scanner", ".", "currentPosition", "=", "scannerCurrentPosition", ";", "this", ".", "scanner", ".", "currentCharacter", "=", "scannerCurrentChar", ";", "}", "}", "private", "boolean", "printNewLinesCharacters", "(", "int", "offset", ",", "int", "length", ")", "{", "boolean", "foundNewLine", "=", "false", ";", "int", "scannerStartPosition", "=", "this", ".", "scanner", ".", "startPosition", ";", "int", "scannerEofPosition", "=", "this", ".", "scanner", ".", "eofPosition", ";", "int", "scannerCurrentPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "char", "scannerCurrentChar", "=", "this", ".", "scanner", ".", "currentCharacter", ";", "this", ".", "scanner", ".", "resetTo", "(", "offset", ",", "offset", "+", "length", "-", "1", ")", ";", "try", "{", "while", "(", "!", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "{", "int", "start", "=", "this", ".", "scanner", ".", "currentPosition", ";", "char", "ch", "=", "(", "char", ")", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "boolean", "needReplace", "=", "ch", "!=", "this", ".", "firstLS", ";", "switch", "(", "ch", ")", "{", "case", "'\\r'", ":", "if", "(", "this", ".", "scanner", ".", "atEnd", "(", ")", ")", "break", ";", "ch", "=", "(", "char", ")", "this", ".", "scanner", ".", "getNextChar", "(", ")", ";", "if", "(", "ch", "!=", "'\\n'", ")", "break", ";", "needReplace", "=", "needReplace", "||", "this", ".", "lsLength", "!=", "2", ";", "case", "'\\n'", ":", "if", "(", "needReplace", ")", "{", "if", "(", "this", ".", "editsIndex", "==", "0", "||", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", ".", "offset", "!=", "start", ")", "{", "this", ".", "edits", "[", "this", ".", "editsIndex", "++", "]", "=", "new", "OptimizedReplaceEdit", "(", "start", ",", "this", ".", "scanner", ".", "currentPosition", "-", "start", ",", "this", ".", "lineSeparator", ")", ";", "}", "}", "foundNewLine", "=", "true", ";", "break", ";", "}", "}", "}", "finally", "{", "this", ".", "scanner", ".", "startPosition", "=", "scannerStartPosition", ";", "this", ".", "scanner", ".", "eofPosition", "=", "scannerEofPosition", ";", "this", ".", "scanner", ".", "currentPosition", "=", "scannerCurrentPosition", ";", "this", ".", "scanner", ".", "currentCharacter", "=", "scannerCurrentChar", ";", "}", "return", "foundNewLine", ";", "}", "public", "void", "printNextToken", "(", "int", "expectedTokenType", ")", "{", "printNextToken", "(", "expectedTokenType", ",", "false", ")", ";", "}", "public", "void", "printNextToken", "(", "int", "expectedTokenType", ",", "boolean", "considerSpaceIfAny", ")", "{", "printNextToken", "(", "expectedTokenType", ",", "considerSpaceIfAny", ",", "PRESERVE_EMPTY_LINES_KEEP_LAST_NEW_LINES_INDENTATION", ")", ";", "}", "public", "void", "printNextToken", "(", "int", "expectedTokenType", ",", "boolean", "considerSpaceIfAny", ",", "int", "emptyLineRules", ")", "{", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "NO_TRAILING_COMMENT", ",", "emptyLineRules", ")", ";", "try", "{", "this", ".", "currentToken", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "if", "(", "expectedTokenType", "!=", "this", ".", "currentToken", ")", "{", "throw", "new", "AbortFormatting", "(", "\"\"", "+", "expectedTokenType", "+", "\",", "actual:\"", "+", "this", ".", "currentToken", ")", ";", "}", "print", "(", "this", ".", "scanner", ".", "currentPosition", "-", "this", ".", "scanner", ".", "startPosition", ",", "considerSpaceIfAny", ")", ";", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "throw", "new", "AbortFormatting", "(", "e", ")", ";", "}", "}", "public", "void", "printNextToken", "(", "int", "[", "]", "expectedTokenTypes", ")", "{", "printNextToken", "(", "expectedTokenTypes", ",", "false", ")", ";", "}", "public", "void", "printNextToken", "(", "int", "[", "]", "expectedTokenTypes", ",", "boolean", "considerSpaceIfAny", ")", "{", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "NO_TRAILING_COMMENT", ")", ";", "try", "{", "this", ".", "currentToken", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ";", "if", "(", "Arrays", ".", "binarySearch", "(", "expectedTokenTypes", ",", "this", ".", "currentToken", ")", "<", "0", ")", "{", "StringBuffer", "expectations", "=", "new", "StringBuffer", "(", "5", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "expectedTokenTypes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "expectations", ".", "append", "(", "','", ")", ";", "}", "expectations", ".", "append", "(", "expectedTokenTypes", "[", "i", "]", ")", ";", "}", "throw", "new", "AbortFormatting", "(", "\"\"", "+", "expectations", ".", "toString", "(", ")", "+", "\"],", "actual:\"", "+", "this", ".", "currentToken", ")", ";", "}", "print", "(", "this", ".", "scanner", ".", "currentPosition", "-", "this", ".", "scanner", ".", "startPosition", ",", "considerSpaceIfAny", ")", ";", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "throw", "new", "AbortFormatting", "(", "e", ")", ";", "}", "}", "public", "void", "printArrayQualifiedReference", "(", "int", "numberOfTokens", ",", "int", "sourceEnd", ")", "{", "int", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "int", "numberOfIdentifiers", "=", "0", ";", "try", "{", "do", "{", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "NO_TRAILING_COMMENT", ")", ";", "switch", "(", "this", ".", "currentToken", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ")", "{", "case", "TerminalTokens", ".", "TokenNameEOF", ":", "return", ";", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "addDeleteEdit", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "printBlockComment", "(", "false", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "printLineComment", "(", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameIdentifier", ":", "print", "(", "this", ".", "scanner", ".", "currentPosition", "-", "this", ".", "scanner", ".", "startPosition", ",", "false", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "if", "(", "++", "numberOfIdentifiers", "==", "numberOfTokens", ")", "{", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "break", ";", "case", "TerminalTokens", ".", "TokenNameDOT", ":", "print", "(", "this", ".", "scanner", ".", "currentPosition", "-", "this", ".", "scanner", ".", "startPosition", ",", "false", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameRPAREN", ":", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "startPosition", ";", "default", ":", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "}", "while", "(", "this", ".", "scanner", ".", "currentPosition", "<=", "sourceEnd", ")", ";", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "throw", "new", "AbortFormatting", "(", "e", ")", ";", "}", "}", "public", "void", "printQualifiedReference", "(", "int", "sourceEnd", ",", "boolean", "expectParenthesis", ")", "{", "int", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "try", "{", "do", "{", "printComment", "(", "CodeFormatter", ".", "K_UNKNOWN", ",", "NO_TRAILING_COMMENT", ")", ";", "switch", "(", "this", ".", "currentToken", "=", "this", ".", "scanner", ".", "getNextToken", "(", ")", ")", "{", "case", "TerminalTokens", ".", "TokenNameEOF", ":", "return", ";", "case", "TerminalTokens", ".", "TokenNameWHITESPACE", ":", "addDeleteEdit", "(", "this", ".", "scanner", ".", "getCurrentTokenStartPosition", "(", ")", ",", "this", ".", "scanner", ".", "getCurrentTokenEndPosition", "(", ")", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_BLOCK", ":", "case", "TerminalTokens", ".", "TokenNameCOMMENT_JAVADOC", ":", "printBlockComment", "(", "false", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameCOMMENT_LINE", ":", "printLineComment", "(", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameIdentifier", ":", "case", "TerminalTokens", ".", "TokenNameDOT", ":", "print", "(", "this", ".", "scanner", ".", "currentPosition", "-", "this", ".", "scanner", ".", "startPosition", ",", "false", ")", ";", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "currentPosition", ";", "break", ";", "case", "TerminalTokens", ".", "TokenNameRPAREN", ":", "if", "(", "expectParenthesis", ")", "{", "currentTokenStartPosition", "=", "this", ".", "scanner", ".", "startPosition", ";", "}", "default", ":", "this", ".", "scanner", ".", "resetTo", "(", "currentTokenStartPosition", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "return", ";", "}", "}", "while", "(", "this", ".", "scanner", ".", "currentPosition", "<=", "sourceEnd", ")", ";", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "throw", "new", "AbortFormatting", "(", "e", ")", ";", "}", "}", "private", "void", "printRule", "(", "StringBuffer", "stringBuffer", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "pageWidth", ";", "i", "++", ")", "{", "if", "(", "(", "i", "%", "this", ".", "tabLength", ")", "==", "0", ")", "{", "stringBuffer", ".", "append", "(", "'+'", ")", ";", "}", "else", "{", "stringBuffer", ".", "append", "(", "'-'", ")", ";", "}", "}", "stringBuffer", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "(", "this", ".", "pageWidth", "/", "this", ".", "tabLength", ")", ";", "i", "++", ")", "{", "stringBuffer", ".", "append", "(", "i", ")", ";", "stringBuffer", ".", "append", "(", "'\\t'", ")", ";", "}", "}", "void", "redoAlignment", "(", "AlignmentException", "e", ")", "{", "if", "(", "e", ".", "relativeDepth", ">", "0", ")", "{", "e", ".", "relativeDepth", "--", ";", "this", ".", "currentAlignment", "=", "this", ".", "currentAlignment", ".", "enclosing", ";", "throw", "e", ";", "}", "resetAt", "(", "this", ".", "currentAlignment", ".", "location", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "currentAlignment", ".", "location", ".", "inputOffset", ",", "this", ".", "scanner", ".", "eofPosition", "-", "1", ")", ";", "this", ".", "currentAlignment", ".", "chunkKind", "=", "0", ";", "}", "void", "redoMemberAlignment", "(", "AlignmentException", "e", ")", "{", "resetAt", "(", "this", ".", "memberAlignment", ".", "location", ")", ";", "this", ".", "scanner", ".", "resetTo", "(", "this", ".", "memberAlignment", ".", "location", ".", "inputOffset", ",", "this", ".", "scanner", ".", "eofPosition", "-", "1", ")", ";", "this", ".", "memberAlignment", ".", "chunkKind", "=", "0", ";", "}", "public", "void", "reset", "(", ")", "{", "this", ".", "checkLineWrapping", "=", "true", ";", "this", ".", "line", "=", "0", ";", "this", ".", "column", "=", "1", ";", "this", ".", "editsIndex", "=", "0", ";", "this", ".", "nlsTagCounter", "=", "0", ";", "}", "private", "void", "resetAt", "(", "Location", "location", ")", "{", "this", ".", "line", "=", "location", ".", "outputLine", ";", "this", ".", "column", "=", "location", ".", "outputColumn", ";", "this", ".", "indentationLevel", "=", "location", ".", "outputIndentationLevel", ";", "this", ".", "numberOfIndentations", "=", "location", ".", "numberOfIndentations", ";", "this", ".", "lastNumberOfNewLines", "=", "location", ".", "lastNumberOfNewLines", ";", "this", ".", "needSpace", "=", "location", ".", "needSpace", ";", "this", ".", "pendingSpace", "=", "location", ".", "pendingSpace", ";", "this", ".", "editsIndex", "=", "location", ".", "editsIndex", ";", "this", ".", "nlsTagCounter", "=", "location", ".", "nlsTagCounter", ";", "if", "(", "this", ".", "editsIndex", ">", "0", ")", "{", "this", ".", "edits", "[", "this", ".", "editsIndex", "-", "1", "]", "=", "location", ".", "textEdit", ";", "}", "this", ".", "formatter", ".", "lastLocalDeclarationSourceStart", "=", "location", ".", "lastLocalDeclarationSourceStart", ";", "}", "public", "void", "resetScanner", "(", "char", "[", "]", "compilationUnitSource", ")", "{", "this", ".", "scanner", ".", "setSource", "(", "compilationUnitSource", ")", ";", "this", ".", "scannerEndPosition", "=", "compilationUnitSource", ".", "length", ";", "this", ".", "scanner", ".", "resetTo", "(", "0", ",", "this", ".", "scannerEndPosition", "-", "1", ")", ";", "this", ".", "edits", "=", "new", "OptimizedReplaceEdit", "[", "INITIAL_SIZE", "]", ";", "this", ".", "maxLines", "=", "this", ".", "lineEnds", "==", "null", "?", "-", "1", ":", "this", ".", "lineEnds", ".", "length", "-", "1", ";", "this", ".", "scanner", ".", "lineEnds", "=", "this", ".", "lineEnds", ";", "this", ".", "scanner", ".", "linePtr", "=", "this", ".", "maxLines", ";", "initFormatterCommentParser", "(", ")", ";", "}", "private", "void", "resize", "(", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "edits", ",", "0", ",", "(", "this", ".", "edits", "=", "new", "OptimizedReplaceEdit", "[", "this", ".", "editsIndex", "*", "2", "]", ")", ",", "0", ",", "this", ".", "editsIndex", ")", ";", "}", "private", "void", "setCommentIndentation", "(", "int", "commentIndentationLevel", ")", "{", "if", "(", "commentIndentationLevel", "==", "0", ")", "{", "this", ".", "commentIndentation", "=", "null", ";", "}", "else", "{", "int", "length", "=", "COMMENT_INDENTATIONS", ".", "length", ";", "if", "(", "commentIndentationLevel", ">", "length", ")", "{", "System", ".", "arraycopy", "(", "COMMENT_INDENTATIONS", ",", "0", ",", "COMMENT_INDENTATIONS", "=", "new", "String", "[", "commentIndentationLevel", "+", "10", "]", ",", "0", ",", "length", ")", ";", "}", "this", ".", "commentIndentation", "=", "COMMENT_INDENTATIONS", "[", "commentIndentationLevel", "-", "1", "]", ";", "if", "(", "this", ".", "commentIndentation", "==", "null", ")", "{", "this", ".", "tempBuffer", ".", "setLength", "(", "0", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "commentIndentationLevel", ";", "i", "++", ")", "{", "this", ".", "tempBuffer", ".", "append", "(", "'", "'", ")", ";", "}", "this", ".", "commentIndentation", "=", "this", ".", "tempBuffer", ".", "toString", "(", ")", ";", "COMMENT_INDENTATIONS", "[", "commentIndentationLevel", "-", "1", "]", "=", "this", ".", "commentIndentation", ";", "}", "}", "}", "private", "void", "setEditsEnabled", "(", "int", "count", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "if", "(", "this", ".", "disablingTag", "!=", "null", "&&", "CharOperation", ".", "equals", "(", "this", ".", "scanner", ".", "foundTaskTags", "[", "i", "]", ",", "this", ".", "disablingTag", ")", ")", "{", "this", ".", "editsEnabled", "=", "false", ";", "}", "if", "(", "this", ".", "enablingTag", "!=", "null", "&&", "CharOperation", ".", "equals", "(", "this", ".", "scanner", ".", "foundTaskTags", "[", "i", "]", ",", "this", ".", "enablingTag", ")", ")", "{", "this", ".", "editsEnabled", "=", "true", ";", "}", "}", "}", "void", "setIncludeComments", "(", "boolean", "on", ")", "{", "if", "(", "on", ")", "{", "this", ".", "formatComments", "|=", "CodeFormatter", ".", "F_INCLUDE_COMMENTS", ";", "}", "else", "{", "this", ".", "formatComments", "&=", "~", "CodeFormatter", ".", "F_INCLUDE_COMMENTS", ";", "}", "}", "void", "setHeaderComment", "(", "int", "position", ")", "{", "this", ".", "headerEndPosition", "=", "position", ";", "}", "public", "void", "space", "(", ")", "{", "if", "(", "!", "this", ".", "needSpace", ")", "return", ";", "this", ".", "lastNumberOfNewLines", "=", "0", ";", "this", ".", "pendingSpace", "=", "true", ";", "this", ".", "column", "++", ";", "this", ".", "needSpace", "=", "false", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "stringBuffer", "=", "new", "StringBuffer", "(", ")", ";", "stringBuffer", ".", "append", "(", "\"\"", "+", "this", ".", "pageWidth", "+", "\"\"", ")", ";", "switch", "(", "this", ".", "tabChar", ")", "{", "case", "DefaultCodeFormatterOptions", ".", "TAB", ":", "stringBuffer", ".", "append", "(", "\"TAB\"", ")", ";", "break", ";", "case", "DefaultCodeFormatterOptions", ".", "SPACE", ":", "stringBuffer", ".", "append", "(", "\"SPACE\"", ")", ";", "break", ";", "default", ":", "stringBuffer", ".", "append", "(", "\"MIXED\"", ")", ";", "}", "stringBuffer", ".", "append", "(", "\"\"", "+", "this", ".", "tabLength", "+", "\")\"", ")", ".", "append", "(", "this", ".", "lineSeparator", ")", ".", "append", "(", "\"(line", "=", "\"", "+", "this", ".", "line", "+", "\"\"", "+", "this", ".", "column", "+", "\"\"", "+", "this", ".", "indentationLevel", "+", "\")\"", ")", ".", "append", "(", "this", ".", "lineSeparator", ")", ".", "append", "(", "\"\"", "+", "this", ".", "needSpace", "+", "\"\"", "+", "this", ".", "lastNumberOfNewLines", "+", "\"\"", "+", "this", ".", "checkLineWrapping", "+", "\")\"", ")", ".", "append", "(", "this", ".", "lineSeparator", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "this", ".", "lineSeparator", ")", ";", "if", "(", "this", ".", "tabLength", ">", "0", ")", "{", "printRule", "(", "stringBuffer", ")", ";", "}", "return", "stringBuffer", ".", "toString", "(", ")", ";", "}", "public", "void", "unIndent", "(", ")", "{", "this", ".", "indentationLevel", "-=", "this", ".", "indentationSize", ";", "this", ".", "numberOfIndentations", "--", ";", "}", "}", "</s>" ]
3,966
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "public", "interface", "ICodeFormatterConstants", "{", "public", "static", "final", "int", "ANNOTATION_UNSPECIFIED", "=", "0", ";", "public", "static", "final", "int", "ANNOTATION_ON_TYPE", "=", "1", ";", "public", "static", "final", "int", "ANNOTATION_ON_FIELD", "=", "2", ";", "public", "static", "final", "int", "ANNOTATION_ON_METHOD", "=", "3", ";", "public", "static", "final", "int", "ANNOTATION_ON_PACKAGE", "=", "4", ";", "public", "static", "final", "int", "ANNOTATION_ON_PARAMETER", "=", "5", ";", "public", "static", "final", "int", "ANNOTATION_ON_LOCAL_VARIABLE", "=", "6", ";", "}", "</s>" ]
3,967
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "old", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "DefaultCodeFormatterConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "TerminalTokens", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "DefaultCodeFormatter", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "ReplaceEdit", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "public", "class", "CodeFormatter", "implements", "TerminalTokens", ",", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICodeFormatter", "{", "private", "Map", "options", ";", "public", "CodeFormatter", "(", "Map", "options", ")", "{", "if", "(", "options", "==", "null", ")", "{", "this", ".", "options", "=", "JavaCore", ".", "getOptions", "(", ")", ";", "}", "else", "{", "this", ".", "options", "=", "options", ";", "}", "}", "public", "String", "format", "(", "String", "string", ",", "int", "indentLevel", ",", "int", "[", "]", "positions", ",", "String", "lineSeparator", ")", "{", "Map", "newOptions", "=", "DefaultCodeFormatterConstants", ".", "getEclipse21Settings", "(", ")", ";", "Object", "formatterNewLineOpeningBrace", "=", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_NEWLINE_OPENING_BRACE", ")", ";", "if", "(", "formatterNewLineOpeningBrace", "!=", "null", ")", "{", "if", "(", "JavaCore", ".", "INSERT", ".", "equals", "(", "formatterNewLineOpeningBrace", ")", ")", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "NEXT_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_BLOCK", ",", "DefaultCodeFormatterConstants", ".", "NEXT_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "NEXT_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "NEXT_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_SWITCH", ",", "DefaultCodeFormatterConstants", ".", "NEXT_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "NEXT_LINE", ")", ";", "}", "else", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_BLOCK", ",", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_SWITCH", ",", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ")", ";", "}", "}", "Object", "formatterNewLineControl", "=", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_NEWLINE_CONTROL", ")", ";", "if", "(", "formatterNewLineControl", "!=", "null", ")", "{", "if", "(", "JavaCore", ".", "INSERT", ".", "equals", "(", "formatterNewLineControl", ")", ")", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT", ",", "JavaCore", ".", "INSERT", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT", ",", "JavaCore", ".", "INSERT", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT", ",", "JavaCore", ".", "INSERT", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT", ",", "JavaCore", ".", "INSERT", ")", ";", "}", "else", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT", ",", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT", ",", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT", ",", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT", ",", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "}", "}", "Object", "formatterClearBlankLines", "=", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_CLEAR_BLANK_LINES", ")", ";", "if", "(", "formatterClearBlankLines", "!=", "null", ")", "{", "if", "(", "JavaCore", ".", "PRESERVE_ONE", ".", "equals", "(", "formatterClearBlankLines", ")", ")", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE", ",", "\"1\"", ")", ";", "}", "else", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE", ",", "\"0\"", ")", ";", "}", "}", "Object", "formatterNewLineElseIf", "=", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_NEWLINE_ELSE_IF", ")", ";", "if", "(", "formatterNewLineElseIf", "!=", "null", ")", "{", "if", "(", "JavaCore", ".", "INSERT", ".", "equals", "(", "formatterNewLineElseIf", ")", ")", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMPACT_ELSE_IF", ",", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "}", "else", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMPACT_ELSE_IF", ",", "DefaultCodeFormatterConstants", ".", "TRUE", ")", ";", "}", "}", "Object", "formatterNewLineEmptyBlock", "=", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_NEWLINE_EMPTY_BLOCK", ")", ";", "if", "(", "formatterNewLineEmptyBlock", "!=", "null", ")", "{", "if", "(", "JavaCore", ".", "INSERT", ".", "equals", "(", "formatterNewLineEmptyBlock", ")", ")", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK", ",", "JavaCore", ".", "INSERT", ")", ";", "}", "else", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK", ",", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "}", "}", "Object", "formatterCompactAssignment", "=", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_COMPACT_ASSIGNMENT", ")", ";", "if", "(", "formatterCompactAssignment", "!=", "null", ")", "{", "if", "(", "JavaCore", ".", "COMPACT", ".", "equals", "(", "formatterCompactAssignment", ")", ")", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR", ",", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "}", "else", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR", ",", "JavaCore", ".", "INSERT", ")", ";", "}", "}", "if", "(", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_SPACE_CASTEXPRESSION", ")", "!=", "null", ")", "{", "if", "(", "JavaCore", ".", "INSERT", ".", "equals", "(", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_SPACE_CASTEXPRESSION", ")", ")", ")", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST", ",", "JavaCore", ".", "INSERT", ")", ";", "}", "else", "{", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST", ",", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "}", "}", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_CHAR", ",", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_TAB_CHAR", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_SIZE", ",", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_TAB_SIZE", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_LINE_SPLIT", ",", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "FORMATTER_LINE_SPLIT", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER", ",", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_CONTINUATION_INDENTATION", ",", "\"1\"", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "createAlignmentValue", "(", "false", ",", "DefaultCodeFormatterConstants", ".", "WRAP_ONE_PER_LINE", ",", "DefaultCodeFormatterConstants", ".", "INDENT_BY_ONE", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "createAlignmentValue", "(", "false", ",", "DefaultCodeFormatterConstants", ".", "WRAP_ONE_PER_LINE", ",", "DefaultCodeFormatterConstants", ".", "INDENT_BY_ONE", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION", ",", "DefaultCodeFormatterConstants", ".", "createAlignmentValue", "(", "false", ",", "DefaultCodeFormatterConstants", ".", "WRAP_ONE_PER_LINE", ",", "DefaultCodeFormatterConstants", ".", "INDENT_BY_ONE", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL", ",", "DefaultCodeFormatterConstants", ".", "createAlignmentValue", "(", "false", ",", "DefaultCodeFormatterConstants", ".", "WRAP_ONE_PER_LINE", ",", "DefaultCodeFormatterConstants", ".", "INDENT_BY_ONE", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION", ",", "DefaultCodeFormatterConstants", ".", "createAlignmentValue", "(", "false", ",", "DefaultCodeFormatterConstants", ".", "WRAP_ONE_PER_LINE", ",", "DefaultCodeFormatterConstants", ".", "INDENT_BY_ONE", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION", ",", "DefaultCodeFormatterConstants", ".", "createAlignmentValue", "(", "false", ",", "DefaultCodeFormatterConstants", ".", "WRAP_ONE_PER_LINE", ",", "DefaultCodeFormatterConstants", ".", "INDENT_BY_ONE", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION", ",", "DefaultCodeFormatterConstants", ".", "createAlignmentValue", "(", "false", ",", "DefaultCodeFormatterConstants", ".", "WRAP_ONE_PER_LINE", ",", "DefaultCodeFormatterConstants", ".", "INDENT_BY_ONE", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS", ",", "DefaultCodeFormatterConstants", ".", "createAlignmentValue", "(", "false", ",", "DefaultCodeFormatterConstants", ".", "WRAP_ONE_PER_LINE", ",", "DefaultCodeFormatterConstants", ".", "INDENT_BY_ONE", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION", ",", "DefaultCodeFormatterConstants", ".", "createAlignmentValue", "(", "false", ",", "DefaultCodeFormatterConstants", ".", "WRAP_ONE_PER_LINE", ",", "DefaultCodeFormatterConstants", ".", "INDENT_BY_ONE", ")", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER", ",", "JavaCore", ".", "INSERT", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER", ",", "JavaCore", ".", "INSERT", ")", ";", "newOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER", ",", "JavaCore", ".", "INSERT", ")", ";", "DefaultCodeFormatter", "defaultCodeFormatter", "=", "new", "DefaultCodeFormatter", "(", "newOptions", ")", ";", "TextEdit", "textEdit", "=", "defaultCodeFormatter", ".", "format", "(", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "CodeFormatter", ".", "K_UNKNOWN", ",", "string", ",", "0", ",", "string", ".", "length", "(", ")", ",", "indentLevel", ",", "lineSeparator", ")", ";", "if", "(", "positions", "!=", "null", "&&", "textEdit", "!=", "null", ")", "{", "TextEdit", "[", "]", "edits", "=", "textEdit", ".", "getChildren", "(", ")", ";", "int", "textEditSize", "=", "edits", ".", "length", ";", "int", "editsIndex", "=", "0", ";", "int", "delta", "=", "0", ";", "int", "originalSourceLength", "=", "string", ".", "length", "(", ")", "-", "1", ";", "if", "(", "textEditSize", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "positions", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "int", "currentPosition", "=", "positions", "[", "i", "]", ";", "if", "(", "currentPosition", ">", "originalSourceLength", ")", "{", "currentPosition", "=", "originalSourceLength", ";", "}", "ReplaceEdit", "currentEdit", "=", "(", "ReplaceEdit", ")", "edits", "[", "editsIndex", "]", ";", "while", "(", "currentEdit", ".", "getOffset", "(", ")", "<=", "currentPosition", ")", "{", "delta", "+=", "currentEdit", ".", "getText", "(", ")", ".", "length", "(", ")", "-", "currentEdit", ".", "getLength", "(", ")", ";", "editsIndex", "++", ";", "if", "(", "editsIndex", "<", "textEditSize", ")", "{", "currentEdit", "=", "(", "ReplaceEdit", ")", "edits", "[", "editsIndex", "]", ";", "}", "else", "{", "break", ";", "}", "}", "positions", "[", "i", "]", "=", "currentPosition", "+", "delta", ";", "}", "}", "}", "return", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "editedString", "(", "string", ",", "textEdit", ")", ";", "}", "}", "</s>" ]
3,968
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "ITerminalSymbols", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "InvalidInputException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "CodeFormatter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "DefaultCodeFormatterConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompilationUnitDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ConstructorDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Scanner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "TerminalTokens", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "CodeSnippetParsingUtil", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IRegion", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Region", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "public", "class", "DefaultCodeFormatter", "extends", "CodeFormatter", "{", "public", "static", "boolean", "DEBUG", "=", "false", ";", "private", "static", "final", "int", "K_MASK", "=", "K_UNKNOWN", "|", "K_EXPRESSION", "|", "K_STATEMENTS", "|", "K_CLASS_BODY_DECLARATIONS", "|", "K_COMPILATION_UNIT", "|", "K_SINGLE_LINE_COMMENT", "|", "K_MULTI_LINE_COMMENT", "|", "K_JAVA_DOC", ";", "private", "static", "Scanner", "PROBING_SCANNER", ";", "private", "CodeSnippetParsingUtil", "codeSnippetParsingUtil", ";", "private", "Map", "defaultCompilerOptions", ";", "private", "CodeFormatterVisitor", "newCodeFormatter", ";", "private", "Map", "options", ";", "private", "DefaultCodeFormatterOptions", "preferences", ";", "public", "DefaultCodeFormatter", "(", ")", "{", "this", "(", "new", "DefaultCodeFormatterOptions", "(", "DefaultCodeFormatterConstants", ".", "getJavaConventionsSettings", "(", ")", ")", ",", "null", ")", ";", "}", "public", "DefaultCodeFormatter", "(", "DefaultCodeFormatterOptions", "preferences", ")", "{", "this", "(", "preferences", ",", "null", ")", ";", "}", "public", "DefaultCodeFormatter", "(", "DefaultCodeFormatterOptions", "defaultCodeFormatterOptions", ",", "Map", "options", ")", "{", "if", "(", "options", "!=", "null", ")", "{", "this", ".", "options", "=", "options", ";", "this", ".", "preferences", "=", "new", "DefaultCodeFormatterOptions", "(", "options", ")", ";", "}", "else", "{", "this", ".", "options", "=", "JavaCore", ".", "getOptions", "(", ")", ";", "this", ".", "preferences", "=", "new", "DefaultCodeFormatterOptions", "(", "DefaultCodeFormatterConstants", ".", "getJavaConventionsSettings", "(", ")", ")", ";", "}", "this", ".", "defaultCompilerOptions", "=", "getDefaultCompilerOptions", "(", ")", ";", "if", "(", "defaultCodeFormatterOptions", "!=", "null", ")", "{", "this", ".", "preferences", ".", "set", "(", "defaultCodeFormatterOptions", ".", "getMap", "(", ")", ")", ";", "}", "}", "public", "DefaultCodeFormatter", "(", "Map", "options", ")", "{", "this", "(", "null", ",", "options", ")", ";", "}", "public", "String", "createIndentationString", "(", "final", "int", "indentationLevel", ")", "{", "if", "(", "indentationLevel", "<", "0", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "int", "tabs", "=", "0", ";", "int", "spaces", "=", "0", ";", "switch", "(", "this", ".", "preferences", ".", "tab_char", ")", "{", "case", "DefaultCodeFormatterOptions", ".", "SPACE", ":", "spaces", "=", "indentationLevel", "*", "this", ".", "preferences", ".", "tab_size", ";", "break", ";", "case", "DefaultCodeFormatterOptions", ".", "TAB", ":", "tabs", "=", "indentationLevel", ";", "break", ";", "case", "DefaultCodeFormatterOptions", ".", "MIXED", ":", "int", "tabSize", "=", "this", ".", "preferences", ".", "tab_size", ";", "if", "(", "tabSize", "!=", "0", ")", "{", "int", "spaceEquivalents", "=", "indentationLevel", "*", "this", ".", "preferences", ".", "indentation_size", ";", "tabs", "=", "spaceEquivalents", "/", "tabSize", ";", "spaces", "=", "spaceEquivalents", "%", "tabSize", ";", "}", "break", ";", "default", ":", "return", "Util", ".", "EMPTY_STRING", ";", "}", "if", "(", "tabs", "==", "0", "&&", "spaces", "==", "0", ")", "{", "return", "Util", ".", "EMPTY_STRING", ";", "}", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "tabs", "+", "spaces", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tabs", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "'\\t'", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "spaces", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "'", "'", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "TextEdit", "format", "(", "int", "kind", ",", "String", "source", ",", "int", "offset", ",", "int", "length", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ")", "{", "if", "(", "offset", "<", "0", "||", "length", "<", "0", "||", "length", ">", "source", ".", "length", "(", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "switch", "(", "kind", "&", "K_MASK", ")", "{", "case", "K_JAVA_DOC", ":", "return", "formatComment", "(", "kind", "&", "K_MASK", ",", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "new", "IRegion", "[", "]", "{", "new", "Region", "(", "offset", ",", "length", ")", "}", ")", ";", "case", "K_MULTI_LINE_COMMENT", ":", "case", "K_SINGLE_LINE_COMMENT", ":", "return", "formatComment", "(", "kind", "&", "K_MASK", ",", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "new", "IRegion", "[", "]", "{", "new", "Region", "(", "offset", ",", "length", ")", "}", ")", ";", "}", "return", "format", "(", "kind", ",", "source", ",", "new", "IRegion", "[", "]", "{", "new", "Region", "(", "offset", ",", "length", ")", "}", ",", "indentationLevel", ",", "lineSeparator", ")", ";", "}", "public", "TextEdit", "format", "(", "int", "kind", ",", "String", "source", ",", "IRegion", "[", "]", "regions", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ")", "{", "if", "(", "!", "regionsSatisfiesPreconditions", "(", "regions", ",", "source", ".", "length", "(", ")", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "this", ".", "codeSnippetParsingUtil", "=", "new", "CodeSnippetParsingUtil", "(", ")", ";", "boolean", "includeComments", "=", "(", "kind", "&", "F_INCLUDE_COMMENTS", ")", "!=", "0", ";", "switch", "(", "kind", "&", "K_MASK", ")", "{", "case", "K_CLASS_BODY_DECLARATIONS", ":", "return", "formatClassBodyDeclarations", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "regions", ",", "includeComments", ")", ";", "case", "K_COMPILATION_UNIT", ":", "return", "formatCompilationUnit", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "regions", ",", "includeComments", ")", ";", "case", "K_EXPRESSION", ":", "return", "formatExpression", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "regions", ",", "includeComments", ")", ";", "case", "K_STATEMENTS", ":", "return", "formatStatements", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "regions", ",", "includeComments", ")", ";", "case", "K_UNKNOWN", ":", "return", "probeFormatting", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "regions", ",", "includeComments", ")", ";", "case", "K_JAVA_DOC", ":", "case", "K_MULTI_LINE_COMMENT", ":", "case", "K_SINGLE_LINE_COMMENT", ":", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "return", "null", ";", "}", "private", "TextEdit", "formatClassBodyDeclarations", "(", "String", "source", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ",", "IRegion", "[", "]", "regions", ",", "boolean", "includeComments", ")", "{", "ASTNode", "[", "]", "bodyDeclarations", "=", "this", ".", "codeSnippetParsingUtil", ".", "parseClassBodyDeclarations", "(", "source", ".", "toCharArray", "(", ")", ",", "getDefaultCompilerOptions", "(", ")", ",", "true", ")", ";", "if", "(", "bodyDeclarations", "==", "null", ")", "{", "return", "null", ";", "}", "return", "internalFormatClassBodyDeclarations", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "bodyDeclarations", ",", "regions", ",", "includeComments", ")", ";", "}", "private", "TextEdit", "formatComment", "(", "int", "kind", ",", "String", "source", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ",", "IRegion", "[", "]", "regions", ")", "{", "Object", "oldOption", "=", "oldCommentFormatOption", "(", ")", ";", "boolean", "isFormattingComments", "=", "false", ";", "if", "(", "oldOption", "==", "null", ")", "{", "switch", "(", "kind", "&", "K_MASK", ")", "{", "case", "K_SINGLE_LINE_COMMENT", ":", "isFormattingComments", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "this", ".", "options", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_LINE_COMMENT", ")", ")", ";", "break", ";", "case", "K_MULTI_LINE_COMMENT", ":", "isFormattingComments", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "this", ".", "options", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT", ")", ")", ";", "break", ";", "case", "K_JAVA_DOC", ":", "isFormattingComments", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "this", ".", "options", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT", ")", ")", ";", "}", "}", "else", "{", "isFormattingComments", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "oldOption", ")", ";", "}", "if", "(", "isFormattingComments", ")", "{", "if", "(", "lineSeparator", "!=", "null", ")", "{", "this", ".", "preferences", ".", "line_separator", "=", "lineSeparator", ";", "}", "else", "{", "this", ".", "preferences", ".", "line_separator", "=", "Util", ".", "LINE_SEPARATOR", ";", "}", "this", ".", "preferences", ".", "initial_indentation_level", "=", "indentationLevel", ";", "if", "(", "this", ".", "codeSnippetParsingUtil", "==", "null", ")", "this", ".", "codeSnippetParsingUtil", "=", "new", "CodeSnippetParsingUtil", "(", ")", ";", "this", ".", "codeSnippetParsingUtil", ".", "parseCompilationUnit", "(", "source", ".", "toCharArray", "(", ")", ",", "getDefaultCompilerOptions", "(", ")", ",", "true", ")", ";", "this", ".", "newCodeFormatter", "=", "new", "CodeFormatterVisitor", "(", "this", ".", "preferences", ",", "this", ".", "options", ",", "regions", ",", "this", ".", "codeSnippetParsingUtil", ",", "true", ")", ";", "IRegion", "coveredRegion", "=", "getCoveredRegion", "(", "regions", ")", ";", "int", "start", "=", "coveredRegion", ".", "getOffset", "(", ")", ";", "int", "end", "=", "start", "+", "coveredRegion", ".", "getLength", "(", ")", ";", "this", ".", "newCodeFormatter", ".", "formatComment", "(", "kind", ",", "source", ",", "start", ",", "end", ",", "indentationLevel", ")", ";", "return", "this", ".", "newCodeFormatter", ".", "scribe", ".", "getRootEdit", "(", ")", ";", "}", "return", "null", ";", "}", "private", "TextEdit", "formatCompilationUnit", "(", "String", "source", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ",", "IRegion", "[", "]", "regions", ",", "boolean", "includeComments", ")", "{", "CompilationUnitDeclaration", "compilationUnitDeclaration", "=", "this", ".", "codeSnippetParsingUtil", ".", "parseCompilationUnit", "(", "source", ".", "toCharArray", "(", ")", ",", "getDefaultCompilerOptions", "(", ")", ",", "true", ")", ";", "if", "(", "lineSeparator", "!=", "null", ")", "{", "this", ".", "preferences", ".", "line_separator", "=", "lineSeparator", ";", "}", "else", "{", "this", ".", "preferences", ".", "line_separator", "=", "Util", ".", "LINE_SEPARATOR", ";", "}", "this", ".", "preferences", ".", "initial_indentation_level", "=", "indentationLevel", ";", "this", ".", "newCodeFormatter", "=", "new", "CodeFormatterVisitor", "(", "this", ".", "preferences", ",", "this", ".", "options", ",", "regions", ",", "this", ".", "codeSnippetParsingUtil", ",", "includeComments", ")", ";", "return", "this", ".", "newCodeFormatter", ".", "format", "(", "source", ",", "compilationUnitDeclaration", ")", ";", "}", "private", "TextEdit", "formatExpression", "(", "String", "source", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ",", "IRegion", "[", "]", "regions", ",", "boolean", "includeComments", ")", "{", "Expression", "expression", "=", "this", ".", "codeSnippetParsingUtil", ".", "parseExpression", "(", "source", ".", "toCharArray", "(", ")", ",", "getDefaultCompilerOptions", "(", ")", ",", "true", ")", ";", "if", "(", "expression", "==", "null", ")", "{", "return", "null", ";", "}", "return", "internalFormatExpression", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "expression", ",", "regions", ",", "includeComments", ")", ";", "}", "private", "TextEdit", "formatStatements", "(", "String", "source", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ",", "IRegion", "[", "]", "regions", ",", "boolean", "includeComments", ")", "{", "ConstructorDeclaration", "constructorDeclaration", "=", "this", ".", "codeSnippetParsingUtil", ".", "parseStatements", "(", "source", ".", "toCharArray", "(", ")", ",", "getDefaultCompilerOptions", "(", ")", ",", "true", ",", "false", ")", ";", "if", "(", "constructorDeclaration", ".", "statements", "==", "null", ")", "{", "return", "null", ";", "}", "return", "internalFormatStatements", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "constructorDeclaration", ",", "regions", ",", "includeComments", ")", ";", "}", "private", "IRegion", "getCoveredRegion", "(", "IRegion", "[", "]", "regions", ")", "{", "int", "length", "=", "regions", ".", "length", ";", "if", "(", "length", "==", "1", ")", "{", "return", "regions", "[", "0", "]", ";", "}", "int", "offset", "=", "regions", "[", "0", "]", ".", "getOffset", "(", ")", ";", "IRegion", "lastRegion", "=", "regions", "[", "length", "-", "1", "]", ";", "return", "new", "Region", "(", "offset", ",", "lastRegion", ".", "getOffset", "(", ")", "+", "lastRegion", ".", "getLength", "(", ")", "-", "offset", ")", ";", "}", "public", "String", "getDebugOutput", "(", ")", "{", "return", "this", ".", "newCodeFormatter", ".", "scribe", ".", "toString", "(", ")", ";", "}", "private", "Map", "getDefaultCompilerOptions", "(", ")", "{", "if", "(", "this", ".", "defaultCompilerOptions", "==", "null", ")", "{", "Map", "optionsMap", "=", "new", "HashMap", "(", "30", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_LocalVariableAttribute", ",", "CompilerOptions", ".", "DO_NOT_GENERATE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_LineNumberAttribute", ",", "CompilerOptions", ".", "DO_NOT_GENERATE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_SourceFileAttribute", ",", "CompilerOptions", ".", "DO_NOT_GENERATE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_PreserveUnusedLocal", ",", "CompilerOptions", ".", "PRESERVE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_DocCommentSupport", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMethodWithConstructorName", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportOverridingPackageDefaultMethod", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportOverridingMethodWithoutSuperInvocation", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeprecation", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeprecationInDeprecatedCode", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportDeprecationWhenOverridingDeprecatedMethod", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportHiddenCatchBlock", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedLocal", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedObjectAllocation", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedParameter", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedImport", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportSyntheticAccessEmulation", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportNoEffectAssignment", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportNonExternalizedStringLiteral", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportNoImplicitStringConversion", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportNonStaticAccessToStatic", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportIndirectStaticAccess", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportIncompatibleNonInheritedInterfaceMethod", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedPrivateMember", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportLocalVariableHiding", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportFieldHiding", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportPossibleAccidentalBooleanAssignment", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportEmptyStatement", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportAssertIdentifier", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportEnumIdentifier", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUndocumentedEmptyBlock", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnnecessaryTypeCheck", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportInvalidJavadoc", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportInvalidJavadocTagsVisibility", ",", "CompilerOptions", ".", "PUBLIC", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportInvalidJavadocTags", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocTagDescription", ",", "CompilerOptions", ".", "RETURN_TAG", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportInvalidJavadocTagsDeprecatedRef", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportInvalidJavadocTagsNotVisibleRef", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocTags", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocTagsVisibility", ",", "CompilerOptions", ".", "PUBLIC", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocTagsOverriding", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocComments", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocCommentsVisibility", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMissingJavadocCommentsOverriding", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportFinallyBlockNotCompletingNormally", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedDeclaredThrownException", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedDeclaredThrownExceptionWhenOverriding", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnqualifiedFieldAccess", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_Compliance", ",", "CompilerOptions", ".", "VERSION_1_4", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_TargetPlatform", ",", "CompilerOptions", ".", "VERSION_1_2", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_TaskTags", ",", "Util", ".", "EMPTY_STRING", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_TaskPriorities", ",", "Util", ".", "EMPTY_STRING", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_TaskCaseSensitive", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedParameterWhenImplementingAbstract", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnusedParameterWhenOverridingConcrete", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportSpecialParameterHidingField", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportUnavoidableGenericTypeProblems", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_MaxProblemPerUnit", ",", "String", ".", "valueOf", "(", "100", ")", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_InlineJsr", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMethodCanBeStatic", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "optionsMap", ".", "put", "(", "CompilerOptions", ".", "OPTION_ReportMethodCanBePotentiallyStatic", ",", "CompilerOptions", ".", "IGNORE", ")", ";", "this", ".", "defaultCompilerOptions", "=", "optionsMap", ";", "}", "Object", "sourceOption", "=", "this", ".", "options", ".", "get", "(", "CompilerOptions", ".", "OPTION_Source", ")", ";", "if", "(", "sourceOption", "!=", "null", ")", "{", "this", ".", "defaultCompilerOptions", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "sourceOption", ")", ";", "}", "else", "{", "this", ".", "defaultCompilerOptions", ".", "put", "(", "CompilerOptions", ".", "OPTION_Source", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "return", "this", ".", "defaultCompilerOptions", ";", "}", "private", "TextEdit", "internalFormatClassBodyDeclarations", "(", "String", "source", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ",", "ASTNode", "[", "]", "bodyDeclarations", ",", "IRegion", "[", "]", "regions", ",", "boolean", "includeComments", ")", "{", "if", "(", "lineSeparator", "!=", "null", ")", "{", "this", ".", "preferences", ".", "line_separator", "=", "lineSeparator", ";", "}", "else", "{", "this", ".", "preferences", ".", "line_separator", "=", "Util", ".", "LINE_SEPARATOR", ";", "}", "this", ".", "preferences", ".", "initial_indentation_level", "=", "indentationLevel", ";", "this", ".", "newCodeFormatter", "=", "new", "CodeFormatterVisitor", "(", "this", ".", "preferences", ",", "this", ".", "options", ",", "regions", ",", "this", ".", "codeSnippetParsingUtil", ",", "includeComments", ")", ";", "return", "this", ".", "newCodeFormatter", ".", "format", "(", "source", ",", "bodyDeclarations", ")", ";", "}", "private", "TextEdit", "internalFormatExpression", "(", "String", "source", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ",", "Expression", "expression", ",", "IRegion", "[", "]", "regions", ",", "boolean", "includeComments", ")", "{", "if", "(", "lineSeparator", "!=", "null", ")", "{", "this", ".", "preferences", ".", "line_separator", "=", "lineSeparator", ";", "}", "else", "{", "this", ".", "preferences", ".", "line_separator", "=", "Util", ".", "LINE_SEPARATOR", ";", "}", "this", ".", "preferences", ".", "initial_indentation_level", "=", "indentationLevel", ";", "this", ".", "newCodeFormatter", "=", "new", "CodeFormatterVisitor", "(", "this", ".", "preferences", ",", "this", ".", "options", ",", "regions", ",", "this", ".", "codeSnippetParsingUtil", ",", "includeComments", ")", ";", "TextEdit", "textEdit", "=", "this", ".", "newCodeFormatter", ".", "format", "(", "source", ",", "expression", ")", ";", "return", "textEdit", ";", "}", "private", "TextEdit", "internalFormatStatements", "(", "String", "source", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ",", "ConstructorDeclaration", "constructorDeclaration", ",", "IRegion", "[", "]", "regions", ",", "boolean", "includeComments", ")", "{", "if", "(", "lineSeparator", "!=", "null", ")", "{", "this", ".", "preferences", ".", "line_separator", "=", "lineSeparator", ";", "}", "else", "{", "this", ".", "preferences", ".", "line_separator", "=", "Util", ".", "LINE_SEPARATOR", ";", "}", "this", ".", "preferences", ".", "initial_indentation_level", "=", "indentationLevel", ";", "this", ".", "newCodeFormatter", "=", "new", "CodeFormatterVisitor", "(", "this", ".", "preferences", ",", "this", ".", "options", ",", "regions", ",", "this", ".", "codeSnippetParsingUtil", ",", "includeComments", ")", ";", "return", "this", ".", "newCodeFormatter", ".", "format", "(", "source", ",", "constructorDeclaration", ")", ";", "}", "private", "Object", "oldCommentFormatOption", "(", ")", "{", "return", "this", ".", "options", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT", ")", ";", "}", "private", "TextEdit", "probeFormatting", "(", "String", "source", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ",", "IRegion", "[", "]", "regions", ",", "boolean", "includeComments", ")", "{", "if", "(", "PROBING_SCANNER", "==", "null", ")", "{", "PROBING_SCANNER", "=", "new", "Scanner", "(", "true", ",", "false", ",", "false", ",", "ClassFileConstants", ".", "JDK1_6", ",", "ClassFileConstants", ".", "JDK1_6", ",", "null", ",", "null", ",", "true", ")", ";", "}", "PROBING_SCANNER", ".", "setSource", "(", "source", ".", "toCharArray", "(", ")", ")", ";", "IRegion", "coveredRegion", "=", "getCoveredRegion", "(", "regions", ")", ";", "int", "offset", "=", "coveredRegion", ".", "getOffset", "(", ")", ";", "int", "length", "=", "coveredRegion", ".", "getLength", "(", ")", ";", "PROBING_SCANNER", ".", "resetTo", "(", "offset", ",", "offset", "+", "length", "-", "1", ")", ";", "try", "{", "int", "kind", "=", "-", "1", ";", "switch", "(", "PROBING_SCANNER", ".", "getNextToken", "(", ")", ")", "{", "case", "ITerminalSymbols", ".", "TokenNameCOMMENT_BLOCK", ":", "if", "(", "PROBING_SCANNER", ".", "getNextToken", "(", ")", "==", "TerminalTokens", ".", "TokenNameEOF", ")", "{", "kind", "=", "K_MULTI_LINE_COMMENT", ";", "}", "break", ";", "case", "ITerminalSymbols", ".", "TokenNameCOMMENT_LINE", ":", "if", "(", "PROBING_SCANNER", ".", "getNextToken", "(", ")", "==", "TerminalTokens", ".", "TokenNameEOF", ")", "{", "kind", "=", "K_SINGLE_LINE_COMMENT", ";", "}", "break", ";", "case", "ITerminalSymbols", ".", "TokenNameCOMMENT_JAVADOC", ":", "if", "(", "PROBING_SCANNER", ".", "getNextToken", "(", ")", "==", "TerminalTokens", ".", "TokenNameEOF", ")", "{", "kind", "=", "K_JAVA_DOC", ";", "}", "break", ";", "}", "if", "(", "kind", "!=", "-", "1", ")", "{", "return", "formatComment", "(", "kind", ",", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "regions", ")", ";", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "}", "PROBING_SCANNER", ".", "setSource", "(", "(", "char", "[", "]", ")", "null", ")", ";", "Expression", "expression", "=", "this", ".", "codeSnippetParsingUtil", ".", "parseExpression", "(", "source", ".", "toCharArray", "(", ")", ",", "getDefaultCompilerOptions", "(", ")", ",", "true", ")", ";", "if", "(", "expression", "!=", "null", ")", "{", "return", "internalFormatExpression", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "expression", ",", "regions", ",", "includeComments", ")", ";", "}", "ASTNode", "[", "]", "bodyDeclarations", "=", "this", ".", "codeSnippetParsingUtil", ".", "parseClassBodyDeclarations", "(", "source", ".", "toCharArray", "(", ")", ",", "getDefaultCompilerOptions", "(", ")", ",", "true", ")", ";", "if", "(", "bodyDeclarations", "!=", "null", ")", "{", "return", "internalFormatClassBodyDeclarations", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "bodyDeclarations", ",", "regions", ",", "includeComments", ")", ";", "}", "ConstructorDeclaration", "constructorDeclaration", "=", "this", ".", "codeSnippetParsingUtil", ".", "parseStatements", "(", "source", ".", "toCharArray", "(", ")", ",", "getDefaultCompilerOptions", "(", ")", ",", "true", ",", "false", ")", ";", "if", "(", "constructorDeclaration", ".", "statements", "!=", "null", ")", "{", "return", "internalFormatStatements", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "constructorDeclaration", ",", "regions", ",", "includeComments", ")", ";", "}", "return", "formatCompilationUnit", "(", "source", ",", "indentationLevel", ",", "lineSeparator", ",", "regions", ",", "includeComments", ")", ";", "}", "private", "boolean", "regionsSatisfiesPreconditions", "(", "IRegion", "[", "]", "regions", ",", "int", "maxLength", ")", "{", "int", "regionsLength", "=", "regions", "==", "null", "?", "0", ":", "regions", ".", "length", ";", "if", "(", "regionsLength", "==", "0", ")", "{", "return", "false", ";", "}", "IRegion", "first", "=", "regions", "[", "0", "]", ";", "if", "(", "first", ".", "getOffset", "(", ")", "<", "0", "||", "first", ".", "getLength", "(", ")", "<", "0", "||", "first", ".", "getOffset", "(", ")", "+", "first", ".", "getLength", "(", ")", ">", "maxLength", ")", "{", "return", "false", ";", "}", "int", "lastOffset", "=", "first", ".", "getOffset", "(", ")", "+", "first", ".", "getLength", "(", ")", "-", "1", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "regionsLength", ";", "i", "++", ")", "{", "IRegion", "current", "=", "regions", "[", "i", "]", ";", "if", "(", "lastOffset", ">", "current", ".", "getOffset", "(", ")", ")", "{", "return", "false", ";", "}", "if", "(", "current", ".", "getOffset", "(", ")", "<", "0", "||", "current", ".", "getLength", "(", ")", "<", "0", "||", "current", ".", "getOffset", "(", ")", "+", "current", ".", "getLength", "(", ")", ">", "maxLength", ")", "{", "return", "false", ";", "}", "lastOffset", "=", "current", ".", "getOffset", "(", ")", "+", "current", ".", "getLength", "(", ")", "-", "1", ";", "}", "return", "true", ";", "}", "}", "</s>" ]
3,969
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "align", ";", "public", "class", "AlignmentException", "extends", "RuntimeException", "{", "public", "static", "final", "int", "LINE_TOO_LONG", "=", "1", ";", "public", "static", "final", "int", "ALIGN_TOO_SMALL", "=", "2", ";", "private", "static", "final", "long", "serialVersionUID", "=", "-", "3324134986466253314L", ";", "int", "reason", ";", "int", "value", ";", "public", "int", "relativeDepth", ";", "public", "AlignmentException", "(", "int", "reason", ",", "int", "relativeDepth", ")", "{", "this", "(", "reason", ",", "0", ",", "relativeDepth", ")", ";", "}", "public", "AlignmentException", "(", "int", "reason", ",", "int", "value", ",", "int", "relativeDepth", ")", "{", "this", ".", "reason", "=", "reason", ";", "this", ".", "value", "=", "value", ";", "this", ".", "relativeDepth", "=", "relativeDepth", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "10", ")", ";", "switch", "(", "this", ".", "reason", ")", "{", "case", "LINE_TOO_LONG", ":", "buffer", ".", "append", "(", "\"\"", ")", ";", "break", ";", "case", "ALIGN_TOO_SMALL", ":", "buffer", ".", "append", "(", "\"\"", ")", ";", "break", ";", "}", "buffer", ".", "append", "(", "\"\"", ")", ".", "append", "(", "this", ".", "relativeDepth", ")", ".", "append", "(", "\">n\"", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,970
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "align", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "Location", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "Scribe", ";", "public", "class", "Alignment", "{", "public", "int", "kind", ";", "public", "static", "final", "int", "ALLOCATION", "=", "1", ";", "public", "static", "final", "int", "ANNOTATION_MEMBERS_VALUE_PAIRS", "=", "2", ";", "public", "static", "final", "int", "ARRAY_INITIALIZER", "=", "3", ";", "public", "static", "final", "int", "ASSIGNMENT", "=", "4", ";", "public", "static", "final", "int", "BINARY_EXPRESSION", "=", "5", ";", "public", "static", "final", "int", "CASCADING_MESSAGE_SEND", "=", "6", ";", "public", "static", "final", "int", "COMPACT_IF", "=", "7", ";", "public", "static", "final", "int", "COMPOUND_ASSIGNMENT", "=", "8", ";", "public", "static", "final", "int", "CONDITIONAL_EXPRESSION", "=", "9", ";", "public", "static", "final", "int", "ENUM_CONSTANTS", "=", "10", ";", "public", "static", "final", "int", "ENUM_CONSTANTS_ARGUMENTS", "=", "11", ";", "public", "static", "final", "int", "EXPLICIT_CONSTRUCTOR_CALL", "=", "12", ";", "public", "static", "final", "int", "FIELD_DECLARATION_ASSIGNMENT", "=", "13", ";", "public", "static", "final", "int", "LOCAL_DECLARATION_ASSIGNMENT", "=", "14", ";", "public", "static", "final", "int", "MESSAGE_ARGUMENTS", "=", "15", ";", "public", "static", "final", "int", "MESSAGE_SEND", "=", "16", ";", "public", "static", "final", "int", "METHOD_ARGUMENTS", "=", "17", ";", "public", "static", "final", "int", "METHOD_DECLARATION", "=", "18", ";", "public", "static", "final", "int", "MULTIPLE_FIELD", "=", "19", ";", "public", "static", "final", "int", "SUPER_CLASS", "=", "20", ";", "public", "static", "final", "int", "SUPER_INTERFACES", "=", "21", ";", "public", "static", "final", "int", "THROWS", "=", "22", ";", "public", "static", "final", "int", "TYPE_MEMBERS", "=", "23", ";", "public", "static", "final", "int", "STRING_CONCATENATION", "=", "24", ";", "public", "static", "final", "int", "TRY_RESOURCES", "=", "25", ";", "public", "static", "final", "int", "MULTI_CATCH", "=", "26", ";", "public", "String", "name", ";", "public", "static", "final", "String", "[", "]", "NAMES", "=", "{", "\"\"", ",", "\"allocation\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"compactIf\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"\"", ",", "\"superclass\"", ",", "\"\"", ",", "\"throws\"", ",", "\"typeMembers\"", ",", "\"\"", ",", "\"tryResources\"", ",", "\"\"", ",", "}", ";", "public", "Alignment", "enclosing", ";", "public", "Location", "location", ";", "public", "int", "fragmentIndex", ";", "public", "int", "fragmentCount", ";", "public", "int", "[", "]", "fragmentIndentations", ";", "public", "boolean", "needRedoColumnAlignment", ";", "public", "int", "chunkStartIndex", ";", "public", "int", "chunkKind", ";", "public", "int", "originalIndentationLevel", ";", "public", "int", "breakIndentationLevel", ";", "public", "int", "shiftBreakIndentationLevel", ";", "public", "int", "[", "]", "fragmentBreaks", ";", "public", "boolean", "wasSplit", ";", "public", "boolean", "blockAlign", "=", "false", ";", "public", "boolean", "tooLong", "=", "false", ";", "public", "Scribe", "scribe", ";", "private", "boolean", "reset", "=", "false", ";", "public", "static", "final", "int", "M_FORCE", "=", "1", ";", "public", "static", "final", "int", "M_INDENT_ON_COLUMN", "=", "2", ";", "public", "static", "final", "int", "M_INDENT_BY_ONE", "=", "4", ";", "public", "static", "final", "int", "M_COMPACT_SPLIT", "=", "16", ";", "public", "static", "final", "int", "M_COMPACT_FIRST_BREAK_SPLIT", "=", "32", ";", "public", "static", "final", "int", "M_ONE_PER_LINE_SPLIT", "=", "32", "+", "16", ";", "public", "static", "final", "int", "M_NEXT_SHIFTED_SPLIT", "=", "64", ";", "public", "static", "final", "int", "M_NEXT_PER_LINE_SPLIT", "=", "64", "+", "16", ";", "public", "static", "final", "int", "M_MULTICOLUMN", "=", "256", ";", "public", "static", "final", "int", "M_NO_ALIGNMENT", "=", "0", ";", "public", "int", "mode", ";", "public", "static", "final", "int", "SPLIT_MASK", "=", "M_ONE_PER_LINE_SPLIT", "|", "M_NEXT_SHIFTED_SPLIT", "|", "M_COMPACT_SPLIT", "|", "M_COMPACT_FIRST_BREAK_SPLIT", "|", "M_NEXT_PER_LINE_SPLIT", ";", "public", "static", "final", "int", "R_OUTERMOST", "=", "1", ";", "public", "static", "final", "int", "R_INNERMOST", "=", "2", ";", "public", "int", "tieBreakRule", ";", "public", "int", "startingColumn", "=", "-", "1", ";", "public", "static", "final", "int", "NONE", "=", "0", ";", "public", "static", "final", "int", "BREAK", "=", "1", ";", "public", "static", "final", "int", "CHUNK_FIELD", "=", "1", ";", "public", "static", "final", "int", "CHUNK_METHOD", "=", "2", ";", "public", "static", "final", "int", "CHUNK_TYPE", "=", "3", ";", "public", "static", "final", "int", "CHUNK_ENUM", "=", "4", ";", "public", "Alignment", "(", "int", "kind", ",", "int", "mode", ",", "int", "tieBreakRule", ",", "Scribe", "scribe", ",", "int", "fragmentCount", ",", "int", "sourceRestart", ",", "int", "continuationIndent", ")", "{", "Assert", ".", "isTrue", "(", "kind", ">=", "ALLOCATION", "&&", "kind", "<=", "MULTI_CATCH", ")", ";", "this", ".", "kind", "=", "kind", ";", "this", ".", "name", "=", "NAMES", "[", "kind", "]", ";", "this", ".", "location", "=", "new", "Location", "(", "scribe", ",", "sourceRestart", ")", ";", "this", ".", "mode", "=", "mode", ";", "this", ".", "tieBreakRule", "=", "tieBreakRule", ";", "this", ".", "fragmentCount", "=", "fragmentCount", ";", "this", ".", "scribe", "=", "scribe", ";", "this", ".", "originalIndentationLevel", "=", "this", ".", "scribe", ".", "indentationLevel", ";", "this", ".", "wasSplit", "=", "false", ";", "final", "int", "indentSize", "=", "this", ".", "scribe", ".", "indentationSize", ";", "int", "currentColumn", "=", "this", ".", "location", ".", "outputColumn", ";", "if", "(", "currentColumn", "==", "1", ")", "{", "currentColumn", "=", "this", ".", "location", ".", "outputIndentationLevel", "+", "1", ";", "}", "if", "(", "(", "mode", "&", "M_INDENT_ON_COLUMN", ")", "!=", "0", ")", "{", "this", ".", "breakIndentationLevel", "=", "this", ".", "scribe", ".", "getNextIndentationLevel", "(", "currentColumn", ")", ";", "if", "(", "this", ".", "breakIndentationLevel", "==", "this", ".", "location", ".", "outputIndentationLevel", ")", "{", "this", ".", "breakIndentationLevel", "+=", "(", "continuationIndent", "*", "indentSize", ")", ";", "}", "}", "else", "if", "(", "(", "mode", "&", "M_INDENT_BY_ONE", ")", "!=", "0", ")", "{", "this", ".", "breakIndentationLevel", "=", "this", ".", "location", ".", "outputIndentationLevel", "+", "indentSize", ";", "}", "else", "{", "this", ".", "breakIndentationLevel", "=", "this", ".", "location", ".", "outputIndentationLevel", "+", "continuationIndent", "*", "indentSize", ";", "}", "this", ".", "shiftBreakIndentationLevel", "=", "this", ".", "breakIndentationLevel", "+", "indentSize", ";", "this", ".", "fragmentIndentations", "=", "new", "int", "[", "this", ".", "fragmentCount", "]", ";", "this", ".", "fragmentBreaks", "=", "new", "int", "[", "this", ".", "fragmentCount", "]", ";", "if", "(", "(", "this", ".", "mode", "&", "M_FORCE", ")", "!=", "0", ")", "{", "couldBreak", "(", ")", ";", "}", "}", "public", "boolean", "checkChunkStart", "(", "int", "chunk", ",", "int", "startIndex", ",", "int", "sourceRestart", ")", "{", "if", "(", "this", ".", "chunkKind", "!=", "chunk", ")", "{", "this", ".", "chunkKind", "=", "chunk", ";", "if", "(", "startIndex", "!=", "this", ".", "chunkStartIndex", ")", "{", "this", ".", "chunkStartIndex", "=", "startIndex", ";", "this", ".", "location", ".", "update", "(", "this", ".", "scribe", ",", "sourceRestart", ")", ";", "reset", "(", ")", ";", "}", "return", "true", ";", "}", "return", "false", ";", "}", "public", "void", "checkColumn", "(", ")", "{", "if", "(", "(", "this", ".", "mode", "&", "M_MULTICOLUMN", ")", "!=", "0", "&&", "this", ".", "fragmentCount", ">", "0", ")", "{", "int", "currentIndentation", "=", "this", ".", "scribe", ".", "getNextIndentationLevel", "(", "this", ".", "scribe", ".", "column", "+", "(", "this", ".", "scribe", ".", "needSpace", "?", "1", ":", "0", ")", ")", ";", "int", "fragmentIndentation", "=", "this", ".", "fragmentIndentations", "[", "this", ".", "fragmentIndex", "]", ";", "if", "(", "currentIndentation", ">", "fragmentIndentation", ")", "{", "this", ".", "fragmentIndentations", "[", "this", ".", "fragmentIndex", "]", "=", "currentIndentation", ";", "if", "(", "fragmentIndentation", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "this", ".", "fragmentIndex", "+", "1", ";", "i", "<", "this", ".", "fragmentCount", ";", "i", "++", ")", "{", "this", ".", "fragmentIndentations", "[", "i", "]", "=", "0", ";", "}", "this", ".", "needRedoColumnAlignment", "=", "true", ";", "}", "}", "if", "(", "this", ".", "needRedoColumnAlignment", "&&", "this", ".", "fragmentIndex", "==", "this", ".", "fragmentCount", "-", "1", ")", "{", "this", ".", "needRedoColumnAlignment", "=", "false", ";", "int", "relativeDepth", "=", "0", ";", "Alignment", "targetAlignment", "=", "this", ".", "scribe", ".", "memberAlignment", ";", "while", "(", "targetAlignment", "!=", "null", ")", "{", "if", "(", "targetAlignment", "==", "this", ")", "{", "throw", "new", "AlignmentException", "(", "AlignmentException", ".", "ALIGN_TOO_SMALL", ",", "relativeDepth", ")", ";", "}", "targetAlignment", "=", "targetAlignment", ".", "enclosing", ";", "relativeDepth", "++", ";", "}", "}", "}", "}", "public", "int", "depth", "(", ")", "{", "int", "depth", "=", "0", ";", "Alignment", "current", "=", "this", ".", "enclosing", ";", "while", "(", "current", "!=", "null", ")", "{", "depth", "++", ";", "current", "=", "current", ".", "enclosing", ";", "}", "return", "depth", ";", "}", "public", "boolean", "canAlign", "(", ")", "{", "if", "(", "this", ".", "tooLong", ")", "{", "return", "true", ";", "}", "boolean", "canAlign", "=", "true", ";", "Alignment", "enclosingAlignment", "=", "this", ".", "enclosing", ";", "while", "(", "enclosingAlignment", "!=", "null", ")", "{", "switch", "(", "enclosingAlignment", ".", "kind", ")", "{", "case", "Alignment", ".", "ALLOCATION", ":", "case", "Alignment", ".", "MESSAGE_ARGUMENTS", ":", "if", "(", "enclosingAlignment", ".", "isWrapped", "(", ")", "&&", "(", "enclosingAlignment", ".", "fragmentIndex", ">", "0", "||", "enclosingAlignment", ".", "fragmentCount", "<", "2", ")", ")", "{", "return", "!", "this", ".", "blockAlign", ";", "}", "if", "(", "enclosingAlignment", ".", "tooLong", ")", "{", "return", "true", ";", "}", "canAlign", "=", "false", ";", "break", ";", "case", "Alignment", ".", "MESSAGE_SEND", ":", "switch", "(", "this", ".", "kind", ")", "{", "case", "Alignment", ".", "ALLOCATION", ":", "case", "Alignment", ".", "MESSAGE_ARGUMENTS", ":", "case", "Alignment", ".", "MESSAGE_SEND", ":", "Alignment", "superEnclosingAlignment", "=", "enclosingAlignment", ".", "enclosing", ";", "while", "(", "superEnclosingAlignment", "!=", "null", ")", "{", "switch", "(", "superEnclosingAlignment", ".", "kind", ")", "{", "case", "Alignment", ".", "ALLOCATION", ":", "case", "Alignment", ".", "MESSAGE_ARGUMENTS", ":", "case", "Alignment", ".", "MESSAGE_SEND", ":", "if", "(", "this", ".", "scribe", ".", "nlsTagCounter", "==", "0", ")", "{", "enclosingAlignment", ".", "blockAlign", "=", "true", ";", "}", "return", "!", "this", ".", "blockAlign", ";", "}", "superEnclosingAlignment", "=", "superEnclosingAlignment", ".", "enclosing", ";", "}", "break", ";", "}", "return", "!", "this", ".", "blockAlign", ";", "}", "enclosingAlignment", "=", "enclosingAlignment", ".", "enclosing", ";", "}", "return", "canAlign", "&&", "!", "this", ".", "blockAlign", ";", "}", "public", "boolean", "couldBreak", "(", ")", "{", "if", "(", "this", ".", "fragmentCount", "==", "0", ")", "return", "false", ";", "int", "i", ";", "switch", "(", "this", ".", "mode", "&", "SPLIT_MASK", ")", "{", "case", "M_COMPACT_FIRST_BREAK_SPLIT", ":", "if", "(", "this", ".", "fragmentBreaks", "[", "0", "]", "==", "NONE", ")", "{", "this", ".", "fragmentBreaks", "[", "0", "]", "=", "BREAK", ";", "this", ".", "fragmentIndentations", "[", "0", "]", "=", "this", ".", "breakIndentationLevel", ";", "return", "this", ".", "wasSplit", "=", "true", ";", "}", "i", "=", "this", ".", "fragmentIndex", ";", "do", "{", "if", "(", "this", ".", "fragmentBreaks", "[", "i", "]", "==", "NONE", ")", "{", "this", ".", "fragmentBreaks", "[", "i", "]", "=", "BREAK", ";", "this", ".", "fragmentIndentations", "[", "i", "]", "=", "this", ".", "breakIndentationLevel", ";", "return", "this", ".", "wasSplit", "=", "true", ";", "}", "}", "while", "(", "--", "i", ">=", "0", ")", ";", "break", ";", "case", "M_COMPACT_SPLIT", ":", "i", "=", "this", ".", "fragmentIndex", ";", "do", "{", "if", "(", "this", ".", "fragmentBreaks", "[", "i", "]", "==", "NONE", ")", "{", "this", ".", "fragmentBreaks", "[", "i", "]", "=", "BREAK", ";", "this", ".", "fragmentIndentations", "[", "i", "]", "=", "this", ".", "breakIndentationLevel", ";", "return", "this", ".", "wasSplit", "=", "true", ";", "}", "}", "while", "(", "--", "i", ">=", "0", ")", ";", "break", ";", "case", "M_NEXT_SHIFTED_SPLIT", ":", "if", "(", "this", ".", "fragmentBreaks", "[", "0", "]", "==", "NONE", ")", "{", "this", ".", "fragmentBreaks", "[", "0", "]", "=", "BREAK", ";", "this", ".", "fragmentIndentations", "[", "0", "]", "=", "this", ".", "breakIndentationLevel", ";", "for", "(", "i", "=", "1", ";", "i", "<", "this", ".", "fragmentCount", ";", "i", "++", ")", "{", "this", ".", "fragmentBreaks", "[", "i", "]", "=", "BREAK", ";", "this", ".", "fragmentIndentations", "[", "i", "]", "=", "this", ".", "shiftBreakIndentationLevel", ";", "}", "return", "this", ".", "wasSplit", "=", "true", ";", "}", "break", ";", "case", "M_ONE_PER_LINE_SPLIT", ":", "if", "(", "this", ".", "fragmentBreaks", "[", "0", "]", "==", "NONE", ")", "{", "for", "(", "i", "=", "0", ";", "i", "<", "this", ".", "fragmentCount", ";", "i", "++", ")", "{", "this", ".", "fragmentBreaks", "[", "i", "]", "=", "BREAK", ";", "this", ".", "fragmentIndentations", "[", "i", "]", "=", "this", ".", "breakIndentationLevel", ";", "}", "return", "this", ".", "wasSplit", "=", "true", ";", "}", "break", ";", "case", "M_NEXT_PER_LINE_SPLIT", ":", "if", "(", "this", ".", "fragmentBreaks", "[", "0", "]", "==", "NONE", ")", "{", "if", "(", "this", ".", "fragmentCount", ">", "1", "&&", "this", ".", "fragmentBreaks", "[", "1", "]", "==", "NONE", ")", "{", "if", "(", "(", "this", ".", "mode", "&", "M_INDENT_ON_COLUMN", ")", "!=", "0", ")", "{", "this", ".", "fragmentIndentations", "[", "0", "]", "=", "this", ".", "breakIndentationLevel", ";", "}", "for", "(", "i", "=", "1", ";", "i", "<", "this", ".", "fragmentCount", ";", "i", "++", ")", "{", "this", ".", "fragmentBreaks", "[", "i", "]", "=", "BREAK", ";", "this", ".", "fragmentIndentations", "[", "i", "]", "=", "this", ".", "breakIndentationLevel", ";", "}", "return", "this", ".", "wasSplit", "=", "true", ";", "}", "}", "break", ";", "}", "return", "false", ";", "}", "public", "boolean", "isWrapped", "(", ")", "{", "if", "(", "this", ".", "fragmentCount", "==", "0", ")", "return", "false", ";", "return", "this", ".", "fragmentBreaks", "[", "this", ".", "fragmentIndex", "]", "==", "BREAK", ";", "}", "public", "int", "wrappedIndex", "(", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "this", ".", "fragmentCount", ";", "i", "<", "max", ";", "i", "++", ")", "{", "if", "(", "this", ".", "fragmentBreaks", "[", "i", "]", "==", "BREAK", ")", "{", "return", "i", ";", "}", "}", "return", "-", "1", ";", "}", "public", "void", "performFragmentEffect", "(", ")", "{", "if", "(", "this", ".", "fragmentCount", "==", "0", ")", "return", ";", "if", "(", "(", "this", ".", "mode", "&", "M_MULTICOLUMN", ")", "==", "0", ")", "{", "switch", "(", "this", ".", "mode", "&", "SPLIT_MASK", ")", "{", "case", "Alignment", ".", "M_COMPACT_SPLIT", ":", "case", "Alignment", ".", "M_COMPACT_FIRST_BREAK_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ":", "case", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ":", "case", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ":", "break", ";", "default", ":", "return", ";", "}", "}", "int", "fragmentIndentation", "=", "this", ".", "fragmentIndentations", "[", "this", ".", "fragmentIndex", "]", ";", "if", "(", "this", ".", "startingColumn", "<", "0", "||", "(", "fragmentIndentation", "+", "1", ")", "<", "this", ".", "startingColumn", ")", "{", "if", "(", "this", ".", "fragmentBreaks", "[", "this", ".", "fragmentIndex", "]", "==", "BREAK", ")", "{", "this", ".", "scribe", ".", "printNewLine", "(", ")", ";", "}", "if", "(", "fragmentIndentation", ">", "0", ")", "{", "this", ".", "scribe", ".", "indentationLevel", "=", "fragmentIndentation", ";", "}", "}", "}", "public", "void", "reset", "(", ")", "{", "this", ".", "wasSplit", "=", "false", ";", "if", "(", "this", ".", "fragmentCount", ">", "0", ")", "{", "this", ".", "fragmentIndentations", "=", "new", "int", "[", "this", ".", "fragmentCount", "]", ";", "this", ".", "fragmentBreaks", "=", "new", "int", "[", "this", ".", "fragmentCount", "]", ";", "}", "if", "(", "(", "this", ".", "mode", "&", "M_FORCE", ")", "!=", "0", ")", "{", "couldBreak", "(", ")", ";", "}", "this", ".", "reset", "=", "true", ";", "}", "public", "void", "toFragmentsString", "(", "StringBuffer", "buffer", ")", "{", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "10", ")", ";", "return", "toString", "(", "buffer", ",", "-", "1", ")", ";", "}", "public", "String", "toString", "(", "StringBuffer", "buffer", ",", "int", "level", ")", "{", "StringBuffer", "indentation", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "level", ";", "i", "++", ")", "{", "indentation", ".", "append", "(", "'\\t'", ")", ";", "}", "buffer", ".", "append", "(", "indentation", ")", ";", "buffer", ".", "append", "(", "\"<kind:", "\"", ")", ".", "append", "(", "this", ".", "kind", ")", ".", "append", "(", "\">", "\"", ")", ";", "buffer", ".", "append", "(", "\"<name:", "\"", ")", ".", "append", "(", "this", ".", "name", ")", ".", "append", "(", "\">n\"", ")", ";", "buffer", ".", "append", "(", "indentation", ")", ";", "buffer", ".", "append", "(", "\"<depth=\"", ")", ".", "append", "(", "depth", "(", ")", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "this", ".", "breakIndentationLevel", ")", ".", "append", "(", "\"\"", ")", ".", "append", "(", "this", ".", "shiftBreakIndentationLevel", ")", ".", "append", "(", "\">n\"", ")", ";", "buffer", ".", "append", "(", "indentation", ")", ";", "buffer", ".", "append", "(", "\"<location=\"", ")", ".", "append", "(", "this", ".", "location", ".", "toString", "(", ")", ")", ".", "append", "(", "\">n\"", ")", ";", "buffer", ".", "append", "(", "indentation", ")", ".", "append", "(", "\"<fragments:n\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "fragmentCount", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "indentation", ")", ".", "append", "(", "\"", "-", "\"", ")", ".", "append", "(", "i", ")", ".", "append", "(", "\":", "\"", ")", ".", "append", "(", "\"<break:", "\"", ")", ".", "append", "(", "this", ".", "fragmentBreaks", "[", "i", "]", ">", "0", "?", "\"YES\"", ":", "\"NO\"", ")", ".", "append", "(", "\">\"", ")", ".", "append", "(", "\"<indent:", "\"", ")", ".", "append", "(", "this", ".", "fragmentIndentations", "[", "i", "]", ")", ".", "append", "(", "\">n\"", ")", ";", "}", "buffer", ".", "append", "(", "indentation", ")", ".", "append", "(", "\">n\"", ")", ";", "if", "(", "this", ".", "enclosing", "!=", "null", "&&", "level", ">=", "0", ")", "{", "buffer", ".", "append", "(", "indentation", ")", ".", "append", "(", "\"\"", ")", ";", "this", ".", "enclosing", ".", "toString", "(", "buffer", ",", "level", "+", "1", ")", ";", "buffer", ".", "append", "(", "indentation", ")", ".", "append", "(", "\">n\"", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "void", "update", "(", ")", "{", "for", "(", "int", "i", "=", "1", ";", "i", "<", "this", ".", "fragmentCount", ";", "i", "++", ")", "{", "if", "(", "this", ".", "fragmentBreaks", "[", "i", "]", "==", "BREAK", ")", "{", "this", ".", "fragmentIndentations", "[", "i", "]", "=", "this", ".", "breakIndentationLevel", ";", "}", "}", "}", "public", "boolean", "wasReset", "(", ")", "{", "return", "this", ".", "reset", ";", "}", "}", "</s>" ]
3,971
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "public", "class", "AbortFormatting", "extends", "RuntimeException", "{", "Throwable", "nestedException", ";", "private", "static", "final", "long", "serialVersionUID", "=", "-", "5796507276311428526L", ";", "public", "AbortFormatting", "(", "String", "message", ")", "{", "super", "(", "message", ")", ";", "}", "public", "AbortFormatting", "(", "Throwable", "nestedException", ")", "{", "super", "(", "nestedException", ".", "getMessage", "(", ")", ")", ";", "this", ".", "nestedException", "=", "nestedException", ";", "}", "}", "</s>" ]
3,972
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "DefaultCodeFormatterConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "align", ".", "Alignment", ";", "public", "class", "DefaultCodeFormatterOptions", "{", "public", "static", "final", "int", "TAB", "=", "1", ";", "public", "static", "final", "int", "SPACE", "=", "2", ";", "public", "static", "final", "int", "MIXED", "=", "4", ";", "public", "static", "DefaultCodeFormatterOptions", "getDefaultSettings", "(", ")", "{", "DefaultCodeFormatterOptions", "options", "=", "new", "DefaultCodeFormatterOptions", "(", ")", ";", "options", ".", "setDefaultSettings", "(", ")", ";", "return", "options", ";", "}", "public", "static", "DefaultCodeFormatterOptions", "getEclipseDefaultSettings", "(", ")", "{", "DefaultCodeFormatterOptions", "options", "=", "new", "DefaultCodeFormatterOptions", "(", ")", ";", "options", ".", "setEclipseDefaultSettings", "(", ")", ";", "return", "options", ";", "}", "public", "static", "DefaultCodeFormatterOptions", "getJavaConventionsSettings", "(", ")", "{", "DefaultCodeFormatterOptions", "options", "=", "new", "DefaultCodeFormatterOptions", "(", ")", ";", "options", ".", "setJavaConventionsSettings", "(", ")", ";", "return", "options", ";", "}", "public", "int", "alignment_for_arguments_in_allocation_expression", ";", "public", "int", "alignment_for_arguments_in_annotation", ";", "public", "int", "alignment_for_arguments_in_enum_constant", ";", "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_assignment", ";", "public", "int", "alignment_for_binary_expression", ";", "public", "int", "alignment_for_compact_if", ";", "public", "int", "alignment_for_conditional_expression", ";", "public", "int", "alignment_for_enum_constants", ";", "public", "int", "alignment_for_expressions_in_array_initializer", ";", "public", "int", "alignment_for_method_declaration", ";", "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_enum_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", "int", "alignment_for_resources_in_try", ";", "public", "int", "alignment_for_union_type_in_multicatch", ";", "public", "boolean", "align_type_members_on_columns", ";", "public", "String", "brace_position_for_annotation_type_declaration", ";", "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_enum_constant", ";", "public", "String", "brace_position_for_enum_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_import_groups", ";", "public", "int", "blank_lines_between_type_declarations", ";", "public", "int", "blank_lines_at_beginning_of_method_body", ";", "public", "boolean", "comment_clear_blank_lines_in_javadoc_comment", ";", "public", "boolean", "comment_clear_blank_lines_in_block_comment", ";", "public", "boolean", "comment_new_lines_at_block_boundaries", ";", "public", "boolean", "comment_new_lines_at_javadoc_boundaries", ";", "public", "boolean", "comment_format_javadoc_comment", ";", "public", "boolean", "comment_format_line_comment", ";", "public", "boolean", "comment_format_line_comment_starting_on_first_column", ";", "public", "boolean", "comment_format_block_comment", ";", "public", "boolean", "comment_format_header", ";", "public", "boolean", "comment_format_html", ";", "public", "boolean", "comment_format_source", ";", "public", "boolean", "comment_indent_parameter_description", ";", "public", "boolean", "comment_indent_root_tags", ";", "public", "boolean", "comment_insert_empty_line_before_root_tags", ";", "public", "boolean", "comment_insert_new_line_for_parameter", ";", "public", "boolean", "comment_preserve_white_space_between_code_and_line_comments", ";", "public", "int", "comment_line_length", ";", "public", "boolean", "use_tags", ";", "public", "char", "[", "]", "disabling_tag", ";", "public", "char", "[", "]", "enabling_tag", ";", "private", "final", "static", "char", "[", "]", "DEFAULT_DISABLING_TAG", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "private", "final", "static", "char", "[", "]", "DEFAULT_ENABLING_TAG", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "public", "boolean", "indent_statements_compare_to_block", ";", "public", "boolean", "indent_statements_compare_to_body", ";", "public", "boolean", "indent_body_declarations_compare_to_annotation_declaration_header", ";", "public", "boolean", "indent_body_declarations_compare_to_enum_constant_header", ";", "public", "boolean", "indent_body_declarations_compare_to_enum_declaration_header", ";", "public", "boolean", "indent_body_declarations_compare_to_type_header", ";", "public", "boolean", "indent_breaks_compare_to_cases", ";", "public", "boolean", "indent_empty_lines", ";", "public", "boolean", "indent_switchstatements_compare_to_cases", ";", "public", "boolean", "indent_switchstatements_compare_to_switch", ";", "public", "int", "indentation_size", ";", "public", "boolean", "insert_new_line_after_annotation_on_type", ";", "public", "boolean", "insert_new_line_after_annotation_on_field", ";", "public", "boolean", "insert_new_line_after_annotation_on_method", ";", "public", "boolean", "insert_new_line_after_annotation_on_package", ";", "public", "boolean", "insert_new_line_after_annotation_on_parameter", ";", "public", "boolean", "insert_new_line_after_annotation_on_local_variable", ";", "public", "boolean", "insert_new_line_after_label", ";", "public", "boolean", "insert_new_line_after_opening_brace_in_array_initializer", ";", "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_annotation_declaration", ";", "public", "boolean", "insert_new_line_in_empty_enum_constant", ";", "public", "boolean", "insert_new_line_in_empty_enum_declaration", ";", "public", "boolean", "insert_new_line_in_empty_method_body", ";", "public", "boolean", "insert_new_line_in_empty_type_declaration", ";", "public", "boolean", "insert_space_after_and_in_type_parameter", ";", "public", "boolean", "insert_space_after_assignment_operator", ";", "public", "boolean", "insert_space_after_at_in_annotation", ";", "public", "boolean", "insert_space_after_at_in_annotation_type_declaration", ";", "public", "boolean", "insert_space_after_binary_operator", ";", "public", "boolean", "insert_space_after_closing_angle_bracket_in_type_arguments", ";", "public", "boolean", "insert_space_after_closing_angle_bracket_in_type_parameters", ";", "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_for", ";", "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_annotation", ";", "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_enum_constant_arguments", ";", "public", "boolean", "insert_space_after_comma_in_enum_declarations", ";", "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_parameterized_type_reference", ";", "public", "boolean", "insert_space_after_comma_in_superinterfaces", ";", "public", "boolean", "insert_space_after_comma_in_type_arguments", ";", "public", "boolean", "insert_space_after_comma_in_type_parameters", ";", "public", "boolean", "insert_space_after_ellipsis", ";", "public", "boolean", "insert_space_after_opening_angle_bracket_in_parameterized_type_reference", ";", "public", "boolean", "insert_space_after_opening_angle_bracket_in_type_arguments", ";", "public", "boolean", "insert_space_after_opening_angle_bracket_in_type_parameters", ";", "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_annotation", ";", "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_enum_constant", ";", "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_try", ";", "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_question_in_wilcard", ";", "public", "boolean", "insert_space_after_semicolon_in_for", ";", "public", "boolean", "insert_space_after_semicolon_in_try_resources", ";", "public", "boolean", "insert_space_after_unary_operator", ";", "public", "boolean", "insert_space_before_and_in_type_parameter", ";", "public", "boolean", "insert_space_before_at_in_annotation_type_declaration", ";", "public", "boolean", "insert_space_before_assignment_operator", ";", "public", "boolean", "insert_space_before_binary_operator", ";", "public", "boolean", "insert_space_before_closing_angle_bracket_in_parameterized_type_reference", ";", "public", "boolean", "insert_space_before_closing_angle_bracket_in_type_arguments", ";", "public", "boolean", "insert_space_before_closing_angle_bracket_in_type_parameters", ";", "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_annotation", ";", "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_enum_constant", ";", "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_try", ";", "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_for", ";", "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_annotation", ";", "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_enum_constant_arguments", ";", "public", "boolean", "insert_space_before_comma_in_enum_declarations", ";", "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_parameterized_type_reference", ";", "public", "boolean", "insert_space_before_comma_in_superinterfaces", ";", "public", "boolean", "insert_space_before_comma_in_type_arguments", ";", "public", "boolean", "insert_space_before_comma_in_type_parameters", ";", "public", "boolean", "insert_space_before_ellipsis", ";", "public", "boolean", "insert_space_before_parenthesized_expression_in_return", ";", "public", "boolean", "insert_space_before_parenthesized_expression_in_throw", ";", "public", "boolean", "insert_space_before_question_in_wilcard", ";", "public", "boolean", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", ";", "public", "boolean", "insert_space_before_opening_angle_bracket_in_type_arguments", ";", "public", "boolean", "insert_space_before_opening_angle_bracket_in_type_parameters", ";", "public", "boolean", "insert_space_before_opening_brace_in_annotation_type_declaration", ";", "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_enum_constant", ";", "public", "boolean", "insert_space_before_opening_brace_in_enum_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_annotation", ";", "public", "boolean", "insert_space_before_opening_paren_in_annotation_type_member_declaration", ";", "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_enum_constant", ";", "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_paren_in_try", ";", "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_semicolon_in_try_resources", ";", "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_annotation_type_member_declaration", ";", "public", "boolean", "insert_space_between_empty_parens_in_constructor_declaration", ";", "public", "boolean", "insert_space_between_empty_parens_in_enum_constant", ";", "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", "join_wrapped_lines", ";", "public", "boolean", "join_lines_in_comments", ";", "public", "boolean", "put_empty_statement_on_new_line", ";", "public", "int", "tab_size", ";", "public", "final", "char", "filling_space", "=", "'", "'", ";", "public", "int", "page_width", ";", "public", "int", "tab_char", ";", "public", "boolean", "use_tabs_only_for_leading_indentations", ";", "public", "boolean", "wrap_before_binary_operator", ";", "public", "boolean", "wrap_before_or_operator_multicatch", ";", "public", "boolean", "wrap_outer_expressions_when_nested", ";", "public", "int", "initial_indentation_level", ";", "public", "String", "line_separator", ";", "private", "DefaultCodeFormatterOptions", "(", ")", "{", "}", "public", "DefaultCodeFormatterOptions", "(", "Map", "settings", ")", "{", "setDefaultSettings", "(", ")", ";", "if", "(", "settings", "==", "null", ")", "return", ";", "set", "(", "settings", ")", ";", "}", "private", "String", "getAlignment", "(", "int", "alignment", ")", "{", "return", "Integer", ".", "toString", "(", "alignment", ")", ";", "}", "public", "Map", "getMap", "(", ")", "{", "Map", "options", "=", "new", "HashMap", "(", ")", ";", "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_ANNOTATION", ",", "getAlignment", "(", "this", ".", "alignment_for_arguments_in_annotation", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT", ",", "getAlignment", "(", "this", ".", "alignment_for_arguments_in_enum_constant", ")", ")", ";", "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_ASSIGNMENT", ",", "getAlignment", "(", "this", ".", "alignment_for_assignment", ")", ")", ";", "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_ENUM_CONSTANTS", ",", "getAlignment", "(", "this", ".", "alignment_for_enum_constants", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER", ",", "getAlignment", "(", "this", ".", "alignment_for_expressions_in_array_initializer", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_METHOD_DECLARATION", ",", "getAlignment", "(", "this", ".", "alignment_for_method_declaration", ")", ")", ";", "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_RESOURCES_IN_TRY", ",", "getAlignment", "(", "this", ".", "alignment_for_resources_in_try", ")", ")", ";", "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_ENUM_DECLARATION", ",", "getAlignment", "(", "this", ".", "alignment_for_superinterfaces_in_enum_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_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH", ",", "getAlignment", "(", "this", ".", "alignment_for_union_type_in_multicatch", ")", ")", ";", "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_ANNOTATION_TYPE_DECLARATION", ",", "this", ".", "brace_position_for_annotation_type_declaration", ")", ";", "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_ENUM_CONSTANT", ",", "this", ".", "brace_position_for_enum_constant", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION", ",", "this", ".", "brace_position_for_enum_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_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT", ",", "this", ".", "comment_clear_blank_lines_in_block_comment", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT", ",", "this", ".", "comment_clear_blank_lines_in_javadoc_comment", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_NEW_LINES_AT_BLOCK_BOUNDARIES", ",", "this", ".", "comment_new_lines_at_block_boundaries", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_NEW_LINES_AT_JAVADOC_BOUNDARIES", ",", "this", ".", "comment_new_lines_at_javadoc_boundaries", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT", ",", "this", ".", "comment_format_block_comment", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_HEADER", ",", "this", ".", "comment_format_header", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_HTML", ",", "this", ".", "comment_format_html", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT", ",", "this", ".", "comment_format_javadoc_comment", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_LINE_COMMENT", ",", "this", ".", "comment_format_line_comment", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN", ",", "this", ".", "comment_format_line_comment_starting_on_first_column", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_SOURCE", ",", "this", ".", "comment_format_source", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_INDENT_PARAMETER_DESCRIPTION", ",", "this", ".", "comment_indent_parameter_description", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_INDENT_ROOT_TAGS", ",", "this", ".", "comment_indent_root_tags", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS", ",", "this", ".", "comment_insert_empty_line_before_root_tags", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER", ",", "this", ".", "comment_insert_new_line_for_parameter", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT", ",", "this", ".", "comment_preserve_white_space_between_code_and_line_comments", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_LINE_LENGTH", ",", "Integer", ".", "toString", "(", "this", ".", "comment_line_length", ")", ")", ";", "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_IMPORT_GROUPS", ",", "Integer", ".", "toString", "(", "this", ".", "blank_lines_between_import_groups", ")", ")", ";", "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_ANNOTATION_DECLARATION_HEADER", ",", "this", ".", "indent_body_declarations_compare_to_annotation_declaration_header", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER", ",", "this", ".", "indent_body_declarations_compare_to_enum_constant_header", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER", ",", "this", ".", "indent_body_declarations_compare_to_enum_declaration_header", "?", "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_EMPTY_LINES", ",", "this", ".", "indent_empty_lines", "?", "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_INDENTATION_SIZE", ",", "Integer", ".", "toString", "(", "this", ".", "indentation_size", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE", ",", "this", ".", "insert_new_line_after_annotation_on_type", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD", ",", "this", ".", "insert_new_line_after_annotation_on_field", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD", ",", "this", ".", "insert_new_line_after_annotation_on_method", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE", ",", "this", ".", "insert_new_line_after_annotation_on_package", "?", "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_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_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_ANNOTATION_DECLARATION", ",", "this", ".", "insert_new_line_in_empty_annotation_declaration", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT", ",", "this", ".", "insert_new_line_in_empty_enum_constant", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION", ",", "this", ".", "insert_new_line_in_empty_enum_declaration", "?", "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_NEW_LINE_AFTER_LABEL", ",", "this", ".", "insert_new_line_after_label", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER", ",", "this", ".", "insert_space_after_and_in_type_parameter", "?", "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_AT_IN_ANNOTATION", ",", "this", ".", "insert_space_after_at_in_annotation", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION_TYPE_DECLARATION", ",", "this", ".", "insert_space_after_at_in_annotation_type_declaration", "?", "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_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", ",", "this", ".", "insert_space_after_closing_angle_bracket_in_type_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", ",", "this", ".", "insert_space_after_closing_angle_bracket_in_type_parameters", "?", "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_FOR", ",", "this", ".", "insert_space_after_colon_in_for", "?", "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_ANNOTATION", ",", "this", ".", "insert_space_after_comma_in_annotation", "?", "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_ENUM_CONSTANT_ARGUMENTS", ",", "this", ".", "insert_space_after_comma_in_enum_constant_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS", ",", "this", ".", "insert_space_after_comma_in_enum_declarations", "?", "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_PARAMETERIZED_TYPE_REFERENCE", ",", "this", ".", "insert_space_after_comma_in_parameterized_type_reference", "?", "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_COMMA_IN_TYPE_ARGUMENTS", ",", "this", ".", "insert_space_after_comma_in_type_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS", ",", "this", ".", "insert_space_after_comma_in_type_parameters", "?", "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_ELLIPSIS", ",", "this", ".", "insert_space_after_ellipsis", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE", ",", "this", ".", "insert_space_after_opening_angle_bracket_in_parameterized_type_reference", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", ",", "this", ".", "insert_space_after_opening_angle_bracket_in_type_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", ",", "this", ".", "insert_space_after_opening_angle_bracket_in_type_parameters", "?", "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_ANNOTATION", ",", "this", ".", "insert_space_after_opening_paren_in_annotation", "?", "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_ENUM_CONSTANT", ",", "this", ".", "insert_space_after_opening_paren_in_enum_constant", "?", "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_TRY", ",", "this", ".", "insert_space_after_opening_paren_in_try", "?", "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_QUESTION_IN_WILDCARD", ",", "this", ".", "insert_space_after_question_in_wilcard", "?", "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_SEMICOLON_IN_TRY_RESOURCES", ",", "this", ".", "insert_space_after_semicolon_in_try_resources", "?", "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_AND_IN_TYPE_PARAMETER", ",", "this", ".", "insert_space_before_and_in_type_parameter", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_AT_IN_ANNOTATION_TYPE_DECLARATION", ",", "this", ".", "insert_space_before_at_in_annotation_type_declaration", "?", "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_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE", ",", "this", ".", "insert_space_before_closing_angle_bracket_in_parameterized_type_reference", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", ",", "this", ".", "insert_space_before_closing_angle_bracket_in_type_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", ",", "this", ".", "insert_space_before_closing_angle_bracket_in_type_parameters", "?", "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_ANNOTATION", ",", "this", ".", "insert_space_before_closing_paren_in_annotation", "?", "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_ENUM_CONSTANT", ",", "this", ".", "insert_space_before_closing_paren_in_enum_constant", "?", "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_TRY", ",", "this", ".", "insert_space_before_closing_paren_in_try", "?", "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_FOR", ",", "this", ".", "insert_space_before_colon_in_for", "?", "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_ANNOTATION", ",", "this", ".", "insert_space_before_comma_in_annotation", "?", "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_ENUM_CONSTANT_ARGUMENTS", ",", "this", ".", "insert_space_before_comma_in_enum_constant_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS", ",", "this", ".", "insert_space_before_comma_in_enum_declarations", "?", "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_COMMA_IN_TYPE_ARGUMENTS", ",", "this", ".", "insert_space_before_comma_in_type_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS", ",", "this", ".", "insert_space_before_comma_in_type_parameters", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE", ",", "this", ".", "insert_space_before_comma_in_parameterized_type_reference", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS", ",", "this", ".", "insert_space_before_ellipsis", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE", ",", "this", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", ",", "this", ".", "insert_space_before_opening_angle_bracket_in_type_arguments", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", ",", "this", ".", "insert_space_before_opening_angle_bracket_in_type_parameters", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANNOTATION_TYPE_DECLARATION", ",", "this", ".", "insert_space_before_opening_brace_in_annotation_type_declaration", "?", "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_ENUM_CONSTANT", ",", "this", ".", "insert_space_before_opening_brace_in_enum_constant", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION", ",", "this", ".", "insert_space_before_opening_brace_in_enum_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_ANNOTATION", ",", "this", ".", "insert_space_before_opening_paren_in_annotation", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION_TYPE_MEMBER_DECLARATION", ",", "this", ".", "insert_space_before_opening_paren_in_annotation_type_member_declaration", "?", "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_ENUM_CONSTANT", ",", "this", ".", "insert_space_before_opening_paren_in_enum_constant", "?", "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_TRY", ",", "this", ".", "insert_space_before_opening_paren_in_try", "?", "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_PARENTHESIZED_EXPRESSION_IN_RETURN", ",", "this", ".", "insert_space_before_parenthesized_expression_in_return", "?", "JavaCore", ".", "INSERT", ":", "JavaCore", ".", "DO_NOT_INSERT", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW", ",", "this", ".", "insert_space_before_parenthesized_expression_in_throw", "?", "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_QUESTION_IN_WILDCARD", ",", "this", ".", "insert_space_before_question_in_wilcard", "?", "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_SEMICOLON_IN_TRY_RESOURCES", ",", "this", ".", "insert_space_before_semicolon_in_try_resources", "?", "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_ANNOTATION_TYPE_MEMBER_DECLARATION", ",", "this", ".", "insert_space_between_empty_parens_in_annotation_type_member_declaration", "?", "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_ENUM_CONSTANT", ",", "this", ".", "insert_space_between_empty_parens_in_enum_constant", "?", "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_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", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE", ",", "Integer", ".", "toString", "(", "this", ".", "number_of_empty_lines_to_preserve", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_JOIN_WRAPPED_LINES", ",", "this", ".", "join_wrapped_lines", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_JOIN_LINES_IN_COMMENTS", ",", "this", ".", "join_lines_in_comments", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "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", ")", ")", ";", "switch", "(", "this", ".", "tab_char", ")", "{", "case", "SPACE", ":", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_CHAR", ",", "JavaCore", ".", "SPACE", ")", ";", "break", ";", "case", "TAB", ":", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_CHAR", ",", "JavaCore", ".", "TAB", ")", ";", "break", ";", "case", "MIXED", ":", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_CHAR", ",", "DefaultCodeFormatterConstants", ".", "MIXED", ")", ";", "break", ";", "}", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_SIZE", ",", "Integer", ".", "toString", "(", "this", ".", "tab_size", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS", ",", "this", ".", "use_tabs_only_for_leading_indentations", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_WRAP_BEFORE_BINARY_OPERATOR", ",", "this", ".", "wrap_before_binary_operator", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_WRAP_BEFORE_OR_OPERATOR_MULTICATCH", ",", "this", ".", "wrap_before_or_operator_multicatch", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_DISABLING_TAG", ",", "this", ".", "disabling_tag", "==", "null", "?", "Util", ".", "EMPTY_STRING", ":", "new", "String", "(", "this", ".", "disabling_tag", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ENABLING_TAG", ",", "this", ".", "enabling_tag", "==", "null", "?", "Util", ".", "EMPTY_STRING", ":", "new", "String", "(", "this", ".", "enabling_tag", ")", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_USE_ON_OFF_TAGS", ",", "this", ".", "use_tags", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "options", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED", ",", "this", ".", "wrap_outer_expressions_when_nested", "?", "DefaultCodeFormatterConstants", ".", "TRUE", ":", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "return", "options", ";", "}", "public", "void", "set", "(", "Map", "settings", ")", "{", "final", "Object", "alignmentForArgumentsInAllocationExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION", ")", ";", "if", "(", "alignmentForArgumentsInAllocationExpressionOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_arguments_in_allocation_expression", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForArgumentsInAllocationExpressionOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_allocation_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_allocation_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForArgumentsInAnnotationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ANNOTATION", ")", ";", "if", "(", "alignmentForArgumentsInAnnotationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_arguments_in_annotation", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForArgumentsInAnnotationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_annotation", "=", "Alignment", ".", "M_NO_ALIGNMENT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_annotation", "=", "Alignment", ".", "M_NO_ALIGNMENT", ";", "}", "}", "final", "Object", "alignmentForArgumentsInEnumConstantOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT", ")", ";", "if", "(", "alignmentForArgumentsInEnumConstantOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_arguments_in_enum_constant", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForArgumentsInEnumConstantOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_enum_constant", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_enum_constant", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForArgumentsInExplicitConstructorCallOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL", ")", ";", "if", "(", "alignmentForArgumentsInExplicitConstructorCallOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_arguments_in_explicit_constructor_call", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForArgumentsInExplicitConstructorCallOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_explicit_constructor_call", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_explicit_constructor_call", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForArgumentsInMethodInvocationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION", ")", ";", "if", "(", "alignmentForArgumentsInMethodInvocationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_arguments_in_method_invocation", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForArgumentsInMethodInvocationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_method_invocation", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_method_invocation", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForArgumentsInQualifiedAllocationExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION", ")", ";", "if", "(", "alignmentForArgumentsInQualifiedAllocationExpressionOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_arguments_in_qualified_allocation_expression", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForArgumentsInQualifiedAllocationExpressionOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_qualified_allocation_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_arguments_in_qualified_allocation_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForAssignmentOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ASSIGNMENT", ")", ";", "if", "(", "alignmentForAssignmentOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_assignment", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForAssignmentOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_assignment", "=", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_assignment", "=", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ";", "}", "}", "final", "Object", "alignmentForBinaryExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION", ")", ";", "if", "(", "alignmentForBinaryExpressionOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_binary_expression", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForBinaryExpressionOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_binary_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_binary_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForCompactIfOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_COMPACT_IF", ")", ";", "if", "(", "alignmentForCompactIfOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_compact_if", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForCompactIfOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_compact_if", "=", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", "|", "Alignment", ".", "M_INDENT_BY_ONE", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_compact_if", "=", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", "|", "Alignment", ".", "M_INDENT_BY_ONE", ";", "}", "}", "final", "Object", "alignmentForConditionalExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION", ")", ";", "if", "(", "alignmentForConditionalExpressionOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_conditional_expression", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForConditionalExpressionOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_conditional_expression", "=", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_conditional_expression", "=", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ";", "}", "}", "final", "Object", "alignmentForEnumConstantsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS", ")", ";", "if", "(", "alignmentForEnumConstantsOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_enum_constants", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForEnumConstantsOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_enum_constants", "=", "Alignment", ".", "NONE", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_enum_constants", "=", "Alignment", ".", "NONE", ";", "}", "}", "final", "Object", "alignmentForExpressionsInArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER", ")", ";", "if", "(", "alignmentForExpressionsInArrayInitializerOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_expressions_in_array_initializer", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForExpressionsInArrayInitializerOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_expressions_in_array_initializer", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_expressions_in_array_initializer", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForMethodDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_METHOD_DECLARATION", ")", ";", "if", "(", "alignmentForMethodDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_method_declaration", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForMethodDeclarationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_method_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_method_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForMultipleFieldsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS", ")", ";", "if", "(", "alignmentForMultipleFieldsOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_multiple_fields", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForMultipleFieldsOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_multiple_fields", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_multiple_fields", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForParametersInConstructorDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION", ")", ";", "if", "(", "alignmentForParametersInConstructorDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_parameters_in_constructor_declaration", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForParametersInConstructorDeclarationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_parameters_in_constructor_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_parameters_in_constructor_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForParametersInMethodDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION", ")", ";", "if", "(", "alignmentForParametersInMethodDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_parameters_in_method_declaration", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForParametersInMethodDeclarationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_parameters_in_method_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_parameters_in_method_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForResourcesInTry", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY", ")", ";", "if", "(", "alignmentForResourcesInTry", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_resources_in_try", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForResourcesInTry", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_resources_in_try", "=", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_resources_in_try", "=", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ";", "}", "}", "final", "Object", "alignmentForSelectorInMethodInvocationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION", ")", ";", "if", "(", "alignmentForSelectorInMethodInvocationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_selector_in_method_invocation", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForSelectorInMethodInvocationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_selector_in_method_invocation", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_selector_in_method_invocation", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForSuperclassInTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION", ")", ";", "if", "(", "alignmentForSuperclassInTypeDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_superclass_in_type_declaration", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForSuperclassInTypeDeclarationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_superclass_in_type_declaration", "=", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_superclass_in_type_declaration", "=", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ";", "}", "}", "final", "Object", "alignmentForSuperinterfacesInEnumDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION", ")", ";", "if", "(", "alignmentForSuperinterfacesInEnumDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_superinterfaces_in_enum_declaration", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForSuperinterfacesInEnumDeclarationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_superinterfaces_in_enum_declaration", "=", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_superinterfaces_in_enum_declaration", "=", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ";", "}", "}", "final", "Object", "alignmentForSuperinterfacesInTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION", ")", ";", "if", "(", "alignmentForSuperinterfacesInTypeDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_superinterfaces_in_type_declaration", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForSuperinterfacesInTypeDeclarationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_superinterfaces_in_type_declaration", "=", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_superinterfaces_in_type_declaration", "=", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ";", "}", "}", "final", "Object", "alignmentForThrowsClauseInConstructorDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION", ")", ";", "if", "(", "alignmentForThrowsClauseInConstructorDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_throws_clause_in_constructor_declaration", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForThrowsClauseInConstructorDeclarationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_throws_clause_in_constructor_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_throws_clause_in_constructor_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForThrowsClauseInMethodDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION", ")", ";", "if", "(", "alignmentForThrowsClauseInMethodDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_throws_clause_in_method_declaration", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForThrowsClauseInMethodDeclarationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_throws_clause_in_method_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_throws_clause_in_method_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignmentForUnionTypeInMulticatch", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH", ")", ";", "if", "(", "alignmentForUnionTypeInMulticatch", "!=", "null", ")", "{", "try", "{", "this", ".", "alignment_for_union_type_in_multicatch", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "alignmentForUnionTypeInMulticatch", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "alignment_for_union_type_in_multicatch", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "alignment_for_union_type_in_multicatch", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "}", "}", "final", "Object", "alignTypeMembersOnColumnsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS", ")", ";", "if", "(", "alignTypeMembersOnColumnsOption", "!=", "null", ")", "{", "this", ".", "align_type_members_on_columns", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "alignTypeMembersOnColumnsOption", ")", ";", "}", "final", "Object", "bracePositionForAnnotationTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ANNOTATION_TYPE_DECLARATION", ")", ";", "if", "(", "bracePositionForAnnotationTypeDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_annotation_type_declaration", "=", "(", "String", ")", "bracePositionForAnnotationTypeDeclarationOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_annotation_type_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "bracePositionForAnonymousTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION", ")", ";", "if", "(", "bracePositionForAnonymousTypeDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_anonymous_type_declaration", "=", "(", "String", ")", "bracePositionForAnonymousTypeDeclarationOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_anonymous_type_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "bracePositionForArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER", ")", ";", "if", "(", "bracePositionForArrayInitializerOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_array_initializer", "=", "(", "String", ")", "bracePositionForArrayInitializerOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_array_initializer", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "bracePositionForBlockOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_BLOCK", ")", ";", "if", "(", "bracePositionForBlockOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_block", "=", "(", "String", ")", "bracePositionForBlockOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_block", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "bracePositionForBlockInCaseOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE", ")", ";", "if", "(", "bracePositionForBlockInCaseOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_block_in_case", "=", "(", "String", ")", "bracePositionForBlockInCaseOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_block_in_case", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "bracePositionForConstructorDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION", ")", ";", "if", "(", "bracePositionForConstructorDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_constructor_declaration", "=", "(", "String", ")", "bracePositionForConstructorDeclarationOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_constructor_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "bracePositionForEnumConstantOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT", ")", ";", "if", "(", "bracePositionForEnumConstantOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_enum_constant", "=", "(", "String", ")", "bracePositionForEnumConstantOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_enum_constant", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "bracePositionForEnumDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION", ")", ";", "if", "(", "bracePositionForEnumDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_enum_declaration", "=", "(", "String", ")", "bracePositionForEnumDeclarationOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_enum_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "bracePositionForMethodDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION", ")", ";", "if", "(", "bracePositionForMethodDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_method_declaration", "=", "(", "String", ")", "bracePositionForMethodDeclarationOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_method_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "bracePositionForSwitchOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_SWITCH", ")", ";", "if", "(", "bracePositionForSwitchOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_switch", "=", "(", "String", ")", "bracePositionForSwitchOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_switch", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "bracePositionForTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION", ")", ";", "if", "(", "bracePositionForTypeDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "brace_position_for_type_declaration", "=", "(", "String", ")", "bracePositionForTypeDeclarationOption", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "brace_position_for_type_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "}", "}", "final", "Object", "continuationIndentationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_CONTINUATION_INDENTATION", ")", ";", "if", "(", "continuationIndentationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "continuation_indentation", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "continuationIndentationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "continuation_indentation", "=", "2", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "continuation_indentation", "=", "2", ";", "}", "}", "final", "Object", "continuationIndentationForArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER", ")", ";", "if", "(", "continuationIndentationForArrayInitializerOption", "!=", "null", ")", "{", "try", "{", "this", ".", "continuation_indentation_for_array_initializer", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "continuationIndentationForArrayInitializerOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "continuation_indentation_for_array_initializer", "=", "2", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "continuation_indentation_for_array_initializer", "=", "2", ";", "}", "}", "final", "Object", "blankLinesAfterImportsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_AFTER_IMPORTS", ")", ";", "if", "(", "blankLinesAfterImportsOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_after_imports", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesAfterImportsOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_after_imports", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_after_imports", "=", "0", ";", "}", "}", "final", "Object", "blankLinesAfterPackageOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_AFTER_PACKAGE", ")", ";", "if", "(", "blankLinesAfterPackageOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_after_package", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesAfterPackageOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_after_package", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_after_package", "=", "0", ";", "}", "}", "final", "Object", "blankLinesBeforeFieldOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_FIELD", ")", ";", "if", "(", "blankLinesBeforeFieldOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_before_field", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesBeforeFieldOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_before_field", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_before_field", "=", "0", ";", "}", "}", "final", "Object", "blankLinesBeforeFirstClassBodyDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION", ")", ";", "if", "(", "blankLinesBeforeFirstClassBodyDeclarationOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_before_first_class_body_declaration", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesBeforeFirstClassBodyDeclarationOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_before_first_class_body_declaration", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_before_first_class_body_declaration", "=", "0", ";", "}", "}", "final", "Object", "blankLinesBeforeImportsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_IMPORTS", ")", ";", "if", "(", "blankLinesBeforeImportsOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_before_imports", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesBeforeImportsOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_before_imports", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_before_imports", "=", "0", ";", "}", "}", "final", "Object", "blankLinesBeforeMemberTypeOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE", ")", ";", "if", "(", "blankLinesBeforeMemberTypeOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_before_member_type", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesBeforeMemberTypeOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_before_member_type", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_before_member_type", "=", "0", ";", "}", "}", "final", "Object", "blankLinesBeforeMethodOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_METHOD", ")", ";", "if", "(", "blankLinesBeforeMethodOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_before_method", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesBeforeMethodOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_before_method", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_before_method", "=", "0", ";", "}", "}", "final", "Object", "blankLinesBeforeNewChunkOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK", ")", ";", "if", "(", "blankLinesBeforeNewChunkOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_before_new_chunk", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesBeforeNewChunkOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_before_new_chunk", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_before_new_chunk", "=", "0", ";", "}", "}", "final", "Object", "blankLinesBeforePackageOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BEFORE_PACKAGE", ")", ";", "if", "(", "blankLinesBeforePackageOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_before_package", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesBeforePackageOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_before_package", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_before_package", "=", "0", ";", "}", "}", "final", "Object", "blankLinesBetweenImportGroupsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS", ")", ";", "if", "(", "blankLinesBetweenImportGroupsOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_between_import_groups", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesBetweenImportGroupsOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_between_import_groups", "=", "1", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_between_import_groups", "=", "1", ";", "}", "}", "final", "Object", "blankLinesBetweenTypeDeclarationsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS", ")", ";", "if", "(", "blankLinesBetweenTypeDeclarationsOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_between_type_declarations", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesBetweenTypeDeclarationsOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_between_type_declarations", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_between_type_declarations", "=", "0", ";", "}", "}", "final", "Object", "blankLinesAtBeginningOfMethodBodyOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY", ")", ";", "if", "(", "blankLinesAtBeginningOfMethodBodyOption", "!=", "null", ")", "{", "try", "{", "this", ".", "blank_lines_at_beginning_of_method_body", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "blankLinesAtBeginningOfMethodBodyOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "blank_lines_at_beginning_of_method_body", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "blank_lines_at_beginning_of_method_body", "=", "0", ";", "}", "}", "setDeprecatedOptions", "(", "settings", ")", ";", "final", "Object", "commentFormatJavadocCommentOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT", ")", ";", "if", "(", "commentFormatJavadocCommentOption", "!=", "null", ")", "{", "this", ".", "comment_format_javadoc_comment", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentFormatJavadocCommentOption", ")", ";", "}", "final", "Object", "commentFormatBlockCommentOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT", ")", ";", "if", "(", "commentFormatBlockCommentOption", "!=", "null", ")", "{", "this", ".", "comment_format_block_comment", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentFormatBlockCommentOption", ")", ";", "}", "final", "Object", "commentFormatLineCommentOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_LINE_COMMENT", ")", ";", "if", "(", "commentFormatLineCommentOption", "!=", "null", ")", "{", "this", ".", "comment_format_line_comment", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentFormatLineCommentOption", ")", ";", "}", "final", "Object", "formatLineCommentStartingOnFirstColumnOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN", ")", ";", "if", "(", "formatLineCommentStartingOnFirstColumnOption", "!=", "null", ")", "{", "this", ".", "comment_format_line_comment_starting_on_first_column", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "formatLineCommentStartingOnFirstColumnOption", ")", ";", "}", "final", "Object", "commentFormatHeaderOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_HEADER", ")", ";", "if", "(", "commentFormatHeaderOption", "!=", "null", ")", "{", "this", ".", "comment_format_header", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentFormatHeaderOption", ")", ";", "}", "final", "Object", "commentFormatHtmlOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_HTML", ")", ";", "if", "(", "commentFormatHtmlOption", "!=", "null", ")", "{", "this", ".", "comment_format_html", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentFormatHtmlOption", ")", ";", "}", "final", "Object", "commentFormatSourceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_SOURCE", ")", ";", "if", "(", "commentFormatSourceOption", "!=", "null", ")", "{", "this", ".", "comment_format_source", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentFormatSourceOption", ")", ";", "}", "final", "Object", "commentIndentParameterDescriptionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_INDENT_PARAMETER_DESCRIPTION", ")", ";", "if", "(", "commentIndentParameterDescriptionOption", "!=", "null", ")", "{", "this", ".", "comment_indent_parameter_description", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentIndentParameterDescriptionOption", ")", ";", "}", "final", "Object", "commentIndentRootTagsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_INDENT_ROOT_TAGS", ")", ";", "if", "(", "commentIndentRootTagsOption", "!=", "null", ")", "{", "this", ".", "comment_indent_root_tags", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentIndentRootTagsOption", ")", ";", "}", "final", "Object", "commentInsertEmptyLineBeforeRootTagsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS", ")", ";", "if", "(", "commentInsertEmptyLineBeforeRootTagsOption", "!=", "null", ")", "{", "this", ".", "comment_insert_empty_line_before_root_tags", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "commentInsertEmptyLineBeforeRootTagsOption", ")", ";", "}", "final", "Object", "commentInsertNewLineForParameterOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER", ")", ";", "if", "(", "commentInsertNewLineForParameterOption", "!=", "null", ")", "{", "this", ".", "comment_insert_new_line_for_parameter", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "commentInsertNewLineForParameterOption", ")", ";", "}", "final", "Object", "commentPreserveWhiteSpaceBetweenCodeAndLineCommentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT", ")", ";", "if", "(", "commentPreserveWhiteSpaceBetweenCodeAndLineCommentsOption", "!=", "null", ")", "{", "this", ".", "comment_preserve_white_space_between_code_and_line_comments", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentPreserveWhiteSpaceBetweenCodeAndLineCommentsOption", ")", ";", "}", "final", "Object", "commentLineLengthOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_LINE_LENGTH", ")", ";", "if", "(", "commentLineLengthOption", "!=", "null", ")", "{", "try", "{", "this", ".", "comment_line_length", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "commentLineLengthOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "comment_line_length", "=", "80", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "comment_line_length", "=", "80", ";", "}", "}", "final", "Object", "commentNewLinesAtBlockBoundariesOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_NEW_LINES_AT_BLOCK_BOUNDARIES", ")", ";", "if", "(", "commentNewLinesAtBlockBoundariesOption", "!=", "null", ")", "{", "this", ".", "comment_new_lines_at_block_boundaries", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentNewLinesAtBlockBoundariesOption", ")", ";", "}", "final", "Object", "commentNewLinesAtJavadocBoundariesOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_NEW_LINES_AT_JAVADOC_BOUNDARIES", ")", ";", "if", "(", "commentNewLinesAtJavadocBoundariesOption", "!=", "null", ")", "{", "this", ".", "comment_new_lines_at_javadoc_boundaries", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentNewLinesAtJavadocBoundariesOption", ")", ";", "}", "final", "Object", "indentStatementsCompareToBlockOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK", ")", ";", "if", "(", "indentStatementsCompareToBlockOption", "!=", "null", ")", "{", "this", ".", "indent_statements_compare_to_block", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "indentStatementsCompareToBlockOption", ")", ";", "}", "final", "Object", "indentStatementsCompareToBodyOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY", ")", ";", "if", "(", "indentStatementsCompareToBodyOption", "!=", "null", ")", "{", "this", ".", "indent_statements_compare_to_body", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "indentStatementsCompareToBodyOption", ")", ";", "}", "final", "Object", "indentBodyDeclarationsCompareToAnnotationDeclarationHeaderOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER", ")", ";", "if", "(", "indentBodyDeclarationsCompareToAnnotationDeclarationHeaderOption", "!=", "null", ")", "{", "this", ".", "indent_body_declarations_compare_to_annotation_declaration_header", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "indentBodyDeclarationsCompareToAnnotationDeclarationHeaderOption", ")", ";", "}", "final", "Object", "indentBodyDeclarationsCompareToEnumConstantHeaderOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER", ")", ";", "if", "(", "indentBodyDeclarationsCompareToEnumConstantHeaderOption", "!=", "null", ")", "{", "this", ".", "indent_body_declarations_compare_to_enum_constant_header", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "indentBodyDeclarationsCompareToEnumConstantHeaderOption", ")", ";", "}", "final", "Object", "indentBodyDeclarationsCompareToEnumDeclarationHeaderOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER", ")", ";", "if", "(", "indentBodyDeclarationsCompareToEnumDeclarationHeaderOption", "!=", "null", ")", "{", "this", ".", "indent_body_declarations_compare_to_enum_declaration_header", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "indentBodyDeclarationsCompareToEnumDeclarationHeaderOption", ")", ";", "}", "final", "Object", "indentBodyDeclarationsCompareToTypeHeaderOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER", ")", ";", "if", "(", "indentBodyDeclarationsCompareToTypeHeaderOption", "!=", "null", ")", "{", "this", ".", "indent_body_declarations_compare_to_type_header", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "indentBodyDeclarationsCompareToTypeHeaderOption", ")", ";", "}", "final", "Object", "indentBreaksCompareToCasesOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES", ")", ";", "if", "(", "indentBreaksCompareToCasesOption", "!=", "null", ")", "{", "this", ".", "indent_breaks_compare_to_cases", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "indentBreaksCompareToCasesOption", ")", ";", "}", "final", "Object", "indentEmptyLinesOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_EMPTY_LINES", ")", ";", "if", "(", "indentEmptyLinesOption", "!=", "null", ")", "{", "this", ".", "indent_empty_lines", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "indentEmptyLinesOption", ")", ";", "}", "final", "Object", "indentSwitchstatementsCompareToCasesOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES", ")", ";", "if", "(", "indentSwitchstatementsCompareToCasesOption", "!=", "null", ")", "{", "this", ".", "indent_switchstatements_compare_to_cases", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "indentSwitchstatementsCompareToCasesOption", ")", ";", "}", "final", "Object", "indentSwitchstatementsCompareToSwitchOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH", ")", ";", "if", "(", "indentSwitchstatementsCompareToSwitchOption", "!=", "null", ")", "{", "this", ".", "indent_switchstatements_compare_to_switch", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "indentSwitchstatementsCompareToSwitchOption", ")", ";", "}", "final", "Object", "indentationSizeOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENTATION_SIZE", ")", ";", "if", "(", "indentationSizeOption", "!=", "null", ")", "{", "try", "{", "this", ".", "indentation_size", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "indentationSizeOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "indentation_size", "=", "4", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "indentation_size", "=", "4", ";", "}", "}", "final", "Object", "insertNewLineAfterOpeningBraceInArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER", ")", ";", "if", "(", "insertNewLineAfterOpeningBraceInArrayInitializerOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_after_opening_brace_in_array_initializer", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterOpeningBraceInArrayInitializerOption", ")", ";", "}", "final", "Object", "insertNewLineAtEndOfFileIfMissingOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING", ")", ";", "if", "(", "insertNewLineAtEndOfFileIfMissingOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_at_end_of_file_if_missing", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAtEndOfFileIfMissingOption", ")", ";", "}", "final", "Object", "insertNewLineBeforeCatchInTryStatementOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT", ")", ";", "if", "(", "insertNewLineBeforeCatchInTryStatementOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_before_catch_in_try_statement", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineBeforeCatchInTryStatementOption", ")", ";", "}", "final", "Object", "insertNewLineBeforeClosingBraceInArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER", ")", ";", "if", "(", "insertNewLineBeforeClosingBraceInArrayInitializerOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_before_closing_brace_in_array_initializer", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineBeforeClosingBraceInArrayInitializerOption", ")", ";", "}", "final", "Object", "insertNewLineBeforeElseInIfStatementOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT", ")", ";", "if", "(", "insertNewLineBeforeElseInIfStatementOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_before_else_in_if_statement", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineBeforeElseInIfStatementOption", ")", ";", "}", "final", "Object", "insertNewLineBeforeFinallyInTryStatementOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT", ")", ";", "if", "(", "insertNewLineBeforeFinallyInTryStatementOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_before_finally_in_try_statement", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineBeforeFinallyInTryStatementOption", ")", ";", "}", "final", "Object", "insertNewLineBeforeWhileInDoStatementOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT", ")", ";", "if", "(", "insertNewLineBeforeWhileInDoStatementOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_before_while_in_do_statement", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineBeforeWhileInDoStatementOption", ")", ";", "}", "final", "Object", "insertNewLineInEmptyAnonymousTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION", ")", ";", "if", "(", "insertNewLineInEmptyAnonymousTypeDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_in_empty_anonymous_type_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineInEmptyAnonymousTypeDeclarationOption", ")", ";", "}", "final", "Object", "insertNewLineInEmptyBlockOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK", ")", ";", "if", "(", "insertNewLineInEmptyBlockOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_in_empty_block", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineInEmptyBlockOption", ")", ";", "}", "final", "Object", "insertNewLineInEmptyAnnotationDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION", ")", ";", "if", "(", "insertNewLineInEmptyAnnotationDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_in_empty_annotation_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineInEmptyAnnotationDeclarationOption", ")", ";", "}", "final", "Object", "insertNewLineInEmptyEnumConstantOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT", ")", ";", "if", "(", "insertNewLineInEmptyEnumConstantOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_in_empty_enum_constant", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineInEmptyEnumConstantOption", ")", ";", "}", "final", "Object", "insertNewLineInEmptyEnumDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION", ")", ";", "if", "(", "insertNewLineInEmptyEnumDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_in_empty_enum_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineInEmptyEnumDeclarationOption", ")", ";", "}", "final", "Object", "insertNewLineInEmptyMethodBodyOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY", ")", ";", "if", "(", "insertNewLineInEmptyMethodBodyOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_in_empty_method_body", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineInEmptyMethodBodyOption", ")", ";", "}", "final", "Object", "insertNewLineInEmptyTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION", ")", ";", "if", "(", "insertNewLineInEmptyTypeDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_in_empty_type_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineInEmptyTypeDeclarationOption", ")", ";", "}", "final", "Object", "insertNewLineAfterLabelOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_LABEL", ")", ";", "if", "(", "insertNewLineAfterLabelOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_after_label", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterLabelOption", ")", ";", "}", "final", "Object", "insertSpaceAfterAndInWildcardOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER", ")", ";", "if", "(", "insertSpaceAfterAndInWildcardOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_and_in_type_parameter", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterAndInWildcardOption", ")", ";", "}", "final", "Object", "insertSpaceAfterAssignmentOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR", ")", ";", "if", "(", "insertSpaceAfterAssignmentOperatorOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_assignment_operator", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterAssignmentOperatorOption", ")", ";", "}", "final", "Object", "insertSpaceAfterAtInAnnotationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION", ")", ";", "if", "(", "insertSpaceAfterAtInAnnotationOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_at_in_annotation", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterAtInAnnotationOption", ")", ";", "}", "final", "Object", "insertSpaceAfterAtInAnnotationTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION_TYPE_DECLARATION", ")", ";", "if", "(", "insertSpaceAfterAtInAnnotationTypeDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_at_in_annotation_type_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterAtInAnnotationTypeDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceAfterBinaryOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR", ")", ";", "if", "(", "insertSpaceAfterBinaryOperatorOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_binary_operator", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterBinaryOperatorOption", ")", ";", "}", "final", "Object", "insertSpaceAfterClosingAngleBracketInTypeArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", ")", ";", "if", "(", "insertSpaceAfterClosingAngleBracketInTypeArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_closing_angle_bracket_in_type_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterClosingAngleBracketInTypeArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterClosingAngleBracketInTypeParametersOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", ")", ";", "if", "(", "insertSpaceAfterClosingAngleBracketInTypeParametersOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_closing_angle_bracket_in_type_parameters", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterClosingAngleBracketInTypeParametersOption", ")", ";", "}", "final", "Object", "insertSpaceAfterClosingParenInCastOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST", ")", ";", "if", "(", "insertSpaceAfterClosingParenInCastOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_closing_paren_in_cast", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterClosingParenInCastOption", ")", ";", "}", "final", "Object", "insertSpaceAfterClosingBraceInBlockOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK", ")", ";", "if", "(", "insertSpaceAfterClosingBraceInBlockOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_closing_brace_in_block", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterClosingBraceInBlockOption", ")", ";", "}", "final", "Object", "insertSpaceAfterColonInAssertOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT", ")", ";", "if", "(", "insertSpaceAfterColonInAssertOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_colon_in_assert", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterColonInAssertOption", ")", ";", "}", "final", "Object", "insertSpaceAfterColonInCaseOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE", ")", ";", "if", "(", "insertSpaceAfterColonInCaseOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_colon_in_case", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterColonInCaseOption", ")", ";", "}", "final", "Object", "insertSpaceAfterColonInConditionalOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL", ")", ";", "if", "(", "insertSpaceAfterColonInConditionalOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_colon_in_conditional", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterColonInConditionalOption", ")", ";", "}", "final", "Object", "insertSpaceAfterColonInForOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR", ")", ";", "if", "(", "insertSpaceAfterColonInForOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_colon_in_for", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterColonInForOption", ")", ";", "}", "final", "Object", "insertSpaceAfterColonInLabeledStatementOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT", ")", ";", "if", "(", "insertSpaceAfterColonInLabeledStatementOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_colon_in_labeled_statement", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterColonInLabeledStatementOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInAllocationExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION", ")", ";", "if", "(", "insertSpaceAfterCommaInAllocationExpressionOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_allocation_expression", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInAllocationExpressionOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInAnnotationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ANNOTATION", ")", ";", "if", "(", "insertSpaceAfterCommaInAnnotationOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_annotation", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInAnnotationOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER", ")", ";", "if", "(", "insertSpaceAfterCommaInArrayInitializerOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_array_initializer", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInArrayInitializerOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInConstructorDeclarationParametersOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS", ")", ";", "if", "(", "insertSpaceAfterCommaInConstructorDeclarationParametersOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_constructor_declaration_parameters", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInConstructorDeclarationParametersOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInConstructorDeclarationThrowsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS", ")", ";", "if", "(", "insertSpaceAfterCommaInConstructorDeclarationThrowsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_constructor_declaration_throws", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInConstructorDeclarationThrowsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInEnumConstantArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS", ")", ";", "if", "(", "insertSpaceAfterCommaInEnumConstantArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_enum_constant_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInEnumConstantArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInEnumDeclarationsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS", ")", ";", "if", "(", "insertSpaceAfterCommaInEnumDeclarationsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_enum_declarations", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInEnumDeclarationsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS", ")", ";", "if", "(", "insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_explicit_constructor_call_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInExplicitConstructorCallArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInForIncrementsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS", ")", ";", "if", "(", "insertSpaceAfterCommaInForIncrementsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_for_increments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInForIncrementsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInForInitsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS", ")", ";", "if", "(", "insertSpaceAfterCommaInForInitsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_for_inits", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInForInitsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInMethodInvocationArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS", ")", ";", "if", "(", "insertSpaceAfterCommaInMethodInvocationArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_method_invocation_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInMethodInvocationArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInMethodDeclarationParametersOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS", ")", ";", "if", "(", "insertSpaceAfterCommaInMethodDeclarationParametersOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_method_declaration_parameters", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInMethodDeclarationParametersOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInMethodDeclarationThrowsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS", ")", ";", "if", "(", "insertSpaceAfterCommaInMethodDeclarationThrowsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_method_declaration_throws", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInMethodDeclarationThrowsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInMultipleFieldDeclarationsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS", ")", ";", "if", "(", "insertSpaceAfterCommaInMultipleFieldDeclarationsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_multiple_field_declarations", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInMultipleFieldDeclarationsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInMultipleLocalDeclarationsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS", ")", ";", "if", "(", "insertSpaceAfterCommaInMultipleLocalDeclarationsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_multiple_local_declarations", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInMultipleLocalDeclarationsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInParameterizedTypeReferenceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE", ")", ";", "if", "(", "insertSpaceAfterCommaInParameterizedTypeReferenceOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_parameterized_type_reference", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInParameterizedTypeReferenceOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInSuperinterfacesOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES", ")", ";", "if", "(", "insertSpaceAfterCommaInSuperinterfacesOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_superinterfaces", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInSuperinterfacesOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInTypeArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS", ")", ";", "if", "(", "insertSpaceAfterCommaInTypeArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_type_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInTypeArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterCommaInTypeParametersOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS", ")", ";", "if", "(", "insertSpaceAfterCommaInTypeParametersOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_comma_in_type_parameters", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterCommaInTypeParametersOption", ")", ";", "}", "final", "Object", "insertSpaceAfterEllipsisOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS", ")", ";", "if", "(", "insertSpaceAfterEllipsisOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_ellipsis", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterEllipsisOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE", ")", ";", "if", "(", "insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_angle_bracket_in_parameterized_type_reference", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningAngleBracketInParameterizedTypeReferenceOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", ")", ";", "if", "(", "insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_angle_bracket_in_type_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningAngleBracketInTypeArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningAngleBracketInTypeParametersOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", ")", ";", "if", "(", "insertSpaceAfterOpeningAngleBracketInTypeParametersOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_angle_bracket_in_type_parameters", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningAngleBracketInTypeParametersOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION", ")", ";", "if", "(", "insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_bracket_in_array_allocation_expression", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningBracketInArrayAllocationExpressionOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningBracketInArrayReferenceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE", ")", ";", "if", "(", "insertSpaceAfterOpeningBracketInArrayReferenceOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_bracket_in_array_reference", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningBracketInArrayReferenceOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningBraceInArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER", ")", ";", "if", "(", "insertSpaceAfterOpeningBraceInArrayInitializerOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_brace_in_array_initializer", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningBraceInArrayInitializerOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInAnnotationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ANNOTATION", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInAnnotationOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_annotation", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInAnnotationOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInCastOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInCastOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_cast", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInCastOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInCatchOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInCatchOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_catch", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInCatchOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInConstructorDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInConstructorDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_constructor_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInConstructorDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInEnumConstantOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInEnumConstantOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_enum_constant", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInEnumConstantOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInForOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInForOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_for", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInForOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInIfOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInIfOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_if", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInIfOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInMethodDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInMethodDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_method_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInMethodDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInMethodInvocationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInMethodInvocationOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_method_invocation", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInMethodInvocationOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInParenthesizedExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInParenthesizedExpressionOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_parenthesized_expression", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInParenthesizedExpressionOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInSwitchOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInSwitchOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_switch", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInSwitchOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInSynchronizedOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInSynchronizedOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_synchronized", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInSynchronizedOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInTryOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_TRY", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInTryOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_try", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInTryOption", ")", ";", "}", "final", "Object", "insertSpaceAfterOpeningParenInWhileOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE", ")", ";", "if", "(", "insertSpaceAfterOpeningParenInWhileOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_opening_paren_in_while", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterOpeningParenInWhileOption", ")", ";", "}", "final", "Object", "insertSpaceAfterPostfixOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR", ")", ";", "if", "(", "insertSpaceAfterPostfixOperatorOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_postfix_operator", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterPostfixOperatorOption", ")", ";", "}", "final", "Object", "insertSpaceAfterPrefixOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR", ")", ";", "if", "(", "insertSpaceAfterPrefixOperatorOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_prefix_operator", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterPrefixOperatorOption", ")", ";", "}", "final", "Object", "insertSpaceAfterQuestionInConditionalOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL", ")", ";", "if", "(", "insertSpaceAfterQuestionInConditionalOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_question_in_conditional", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterQuestionInConditionalOption", ")", ";", "}", "final", "Object", "insertSpaceAfterQuestionInWildcardOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD", ")", ";", "if", "(", "insertSpaceAfterQuestionInWildcardOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_question_in_wilcard", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterQuestionInWildcardOption", ")", ";", "}", "final", "Object", "insertSpaceAfterSemicolonInForOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR", ")", ";", "if", "(", "insertSpaceAfterSemicolonInForOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_semicolon_in_for", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterSemicolonInForOption", ")", ";", "}", "final", "Object", "insertSpaceAfterSemicolonInTryOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_TRY_RESOURCES", ")", ";", "if", "(", "insertSpaceAfterSemicolonInTryOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_semicolon_in_try_resources", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterSemicolonInTryOption", ")", ";", "}", "final", "Object", "insertSpaceAfterUnaryOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR", ")", ";", "if", "(", "insertSpaceAfterUnaryOperatorOption", "!=", "null", ")", "{", "this", ".", "insert_space_after_unary_operator", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceAfterUnaryOperatorOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeAndInWildcardOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER", ")", ";", "if", "(", "insertSpaceBeforeAndInWildcardOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_and_in_type_parameter", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeAndInWildcardOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeAtInAnnotationTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_AT_IN_ANNOTATION_TYPE_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeAtInAnnotationTypeDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_at_in_annotation_type_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeAtInAnnotationTypeDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeAssignmentOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR", ")", ";", "if", "(", "insertSpaceBeforeAssignmentOperatorOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_assignment_operator", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeAssignmentOperatorOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeBinaryOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR", ")", ";", "if", "(", "insertSpaceBeforeBinaryOperatorOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_binary_operator", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeBinaryOperatorOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE", ")", ";", "if", "(", "insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_angle_bracket_in_parameterized_type_reference", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingAngleBracketInParameterizedTypeReferenceOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", ")", ";", "if", "(", "insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_angle_bracket_in_type_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingAngleBracketInTypeArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingAngleBracketInTypeParametersOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", ")", ";", "if", "(", "insertSpaceBeforeClosingAngleBracketInTypeParametersOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_angle_bracket_in_type_parameters", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingAngleBracketInTypeParametersOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingBraceInArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER", ")", ";", "if", "(", "insertSpaceBeforeClosingBraceInArrayInitializerOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_brace_in_array_initializer", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingBraceInArrayInitializerOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION", ")", ";", "if", "(", "insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_bracket_in_array_allocation_expression", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingBracketInArrayAllocationExpressionOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingBracketInArrayReferenceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE", ")", ";", "if", "(", "insertSpaceBeforeClosingBracketInArrayReferenceOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_bracket_in_array_reference", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingBracketInArrayReferenceOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInAnnotationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ANNOTATION", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInAnnotationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_annotation", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInAnnotationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInCastOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInCastOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_cast", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInCastOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInCatchOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInCatchOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_catch", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInCatchOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInConstructorDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInConstructorDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_constructor_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInConstructorDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInEnumConstantOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInEnumConstantOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_enum_constant", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInEnumConstantOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInForOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInForOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_for", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInForOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInIfOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInIfOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_if", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInIfOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInMethodDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInMethodDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_method_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInMethodDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInMethodInvocationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInMethodInvocationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_method_invocation", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInMethodInvocationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInParenthesizedExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInParenthesizedExpressionOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_parenthesized_expression", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInParenthesizedExpressionOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInSwitchOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInSwitchOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_switch", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInSwitchOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInSynchronizedOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInSynchronizedOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_synchronized", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInSynchronizedOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInTryOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_TRY", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInTryOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_try", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInTryOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeClosingParenInWhileOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE", ")", ";", "if", "(", "insertSpaceBeforeClosingParenInWhileOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_closing_paren_in_while", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeClosingParenInWhileOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeColonInAssertOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT", ")", ";", "if", "(", "insertSpaceBeforeColonInAssertOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_colon_in_assert", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeColonInAssertOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeColonInCaseOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE", ")", ";", "if", "(", "insertSpaceBeforeColonInCaseOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_colon_in_case", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeColonInCaseOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeColonInConditionalOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL", ")", ";", "if", "(", "insertSpaceBeforeColonInConditionalOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_colon_in_conditional", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeColonInConditionalOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeColonInDefaultOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT", ")", ";", "if", "(", "insertSpaceBeforeColonInDefaultOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_colon_in_default", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeColonInDefaultOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeColonInForOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR", ")", ";", "if", "(", "insertSpaceBeforeColonInForOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_colon_in_for", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeColonInForOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeColonInLabeledStatementOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT", ")", ";", "if", "(", "insertSpaceBeforeColonInLabeledStatementOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_colon_in_labeled_statement", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeColonInLabeledStatementOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInAllocationExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION", ")", ";", "if", "(", "insertSpaceBeforeCommaInAllocationExpressionOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_allocation_expression", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInAllocationExpressionOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInAnnotationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ANNOTATION", ")", ";", "if", "(", "insertSpaceBeforeCommaInAnnotationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_annotation", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInAnnotationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER", ")", ";", "if", "(", "insertSpaceBeforeCommaInArrayInitializerOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_array_initializer", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInArrayInitializerOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInConstructorDeclarationParametersOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS", ")", ";", "if", "(", "insertSpaceBeforeCommaInConstructorDeclarationParametersOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_constructor_declaration_parameters", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInConstructorDeclarationParametersOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInConstructorDeclarationThrowsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS", ")", ";", "if", "(", "insertSpaceBeforeCommaInConstructorDeclarationThrowsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_constructor_declaration_throws", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInConstructorDeclarationThrowsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInEnumConstantArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS", ")", ";", "if", "(", "insertSpaceBeforeCommaInEnumConstantArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_enum_constant_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInEnumConstantArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInEnumDeclarationsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS", ")", ";", "if", "(", "insertSpaceBeforeCommaInEnumDeclarationsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_enum_declarations", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInEnumDeclarationsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS", ")", ";", "if", "(", "insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_explicit_constructor_call_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInExplicitConstructorCallArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInForIncrementsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS", ")", ";", "if", "(", "insertSpaceBeforeCommaInForIncrementsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_for_increments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInForIncrementsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInForInitsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS", ")", ";", "if", "(", "insertSpaceBeforeCommaInForInitsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_for_inits", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInForInitsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInMethodInvocationArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS", ")", ";", "if", "(", "insertSpaceBeforeCommaInMethodInvocationArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_method_invocation_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInMethodInvocationArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInMethodDeclarationParametersOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS", ")", ";", "if", "(", "insertSpaceBeforeCommaInMethodDeclarationParametersOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_method_declaration_parameters", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInMethodDeclarationParametersOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInMethodDeclarationThrowsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS", ")", ";", "if", "(", "insertSpaceBeforeCommaInMethodDeclarationThrowsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_method_declaration_throws", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInMethodDeclarationThrowsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInMultipleFieldDeclarationsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS", ")", ";", "if", "(", "insertSpaceBeforeCommaInMultipleFieldDeclarationsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_multiple_field_declarations", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInMultipleFieldDeclarationsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInMultipleLocalDeclarationsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS", ")", ";", "if", "(", "insertSpaceBeforeCommaInMultipleLocalDeclarationsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_multiple_local_declarations", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInMultipleLocalDeclarationsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInParameterizedTypeReferenceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE", ")", ";", "if", "(", "insertSpaceBeforeCommaInParameterizedTypeReferenceOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_parameterized_type_reference", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInParameterizedTypeReferenceOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInSuperinterfacesOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES", ")", ";", "if", "(", "insertSpaceBeforeCommaInSuperinterfacesOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_superinterfaces", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInSuperinterfacesOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInTypeArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS", ")", ";", "if", "(", "insertSpaceBeforeCommaInTypeArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_type_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInTypeArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeCommaInTypeParametersOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS", ")", ";", "if", "(", "insertSpaceBeforeCommaInTypeParametersOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_comma_in_type_parameters", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeCommaInTypeParametersOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeEllipsisOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS", ")", ";", "if", "(", "insertSpaceBeforeEllipsisOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_ellipsis", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeEllipsisOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE", ")", ";", "if", "(", "insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningAngleBrackerInParameterizedTypeReferenceOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", ")", ";", "if", "(", "insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_angle_bracket_in_type_arguments", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningAngleBrackerInTypeArgumentsOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", ")", ";", "if", "(", "insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_angle_bracket_in_type_parameters", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningAngleBrackerInTypeParametersOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBraceInAnnotationTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANNOTATION_TYPE_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningBraceInAnnotationTypeDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_brace_in_annotation_type_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBraceInAnnotationTypeDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBraceInAnonymousTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANONYMOUS_TYPE_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningBraceInAnonymousTypeDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_brace_in_anonymous_type_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBraceInAnonymousTypeDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBraceInArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER", ")", ";", "if", "(", "insertSpaceBeforeOpeningBraceInArrayInitializerOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_brace_in_array_initializer", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBraceInArrayInitializerOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBraceInBlockOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK", ")", ";", "if", "(", "insertSpaceBeforeOpeningBraceInBlockOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_brace_in_block", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBraceInBlockOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBraceInConstructorDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningBraceInConstructorDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_brace_in_constructor_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBraceInConstructorDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBraceInEnumDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningBraceInEnumDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_brace_in_enum_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBraceInEnumDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBraceInEnumConstantOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT", ")", ";", "if", "(", "insertSpaceBeforeOpeningBraceInEnumConstantOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_brace_in_enum_constant", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBraceInEnumConstantOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBraceInMethodDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningBraceInMethodDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_brace_in_method_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBraceInMethodDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBraceInTypeDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningBraceInTypeDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_brace_in_type_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBraceInTypeDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION", ")", ";", "if", "(", "insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_bracket_in_array_allocation_expression", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBracketInArrayAllocationExpressionOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBracketInArrayReferenceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE", ")", ";", "if", "(", "insertSpaceBeforeOpeningBracketInArrayReferenceOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_bracket_in_array_reference", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBracketInArrayReferenceOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE", ")", ";", "if", "(", "insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_bracket_in_array_type_reference", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBracketInArrayTypeReferenceOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInAnnotationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInAnnotationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_annotation", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInAnnotationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInAnnotationTypeMemberDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION_TYPE_MEMBER_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInAnnotationTypeMemberDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_annotation_type_member_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInAnnotationTypeMemberDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInCatchOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInCatchOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_catch", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInCatchOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInConstructorDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInConstructorDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_constructor_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInConstructorDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInEnumConstantOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInEnumConstantOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_enum_constant", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInEnumConstantOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInForOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInForOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_for", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInForOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInIfOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInIfOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_if", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInIfOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInMethodInvocationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInMethodInvocationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_method_invocation", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInMethodInvocationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInMethodDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInMethodDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_method_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInMethodDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInSwitchOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInSwitchOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_switch", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInSwitchOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningBraceInSwitchOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH", ")", ";", "if", "(", "insertSpaceBeforeOpeningBraceInSwitchOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_brace_in_switch", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningBraceInSwitchOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInSynchronizedOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInSynchronizedOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_synchronized", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInSynchronizedOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInTryOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_TRY", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInTryOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_try", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInTryOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInParenthesizedExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInParenthesizedExpressionOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_parenthesized_expression", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInParenthesizedExpressionOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeOpeningParenInWhileOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE", ")", ";", "if", "(", "insertSpaceBeforeOpeningParenInWhileOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_opening_paren_in_while", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeOpeningParenInWhileOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeParenthesizedExpressionInReturnOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN", ")", ";", "if", "(", "insertSpaceBeforeParenthesizedExpressionInReturnOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_parenthesized_expression_in_return", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeParenthesizedExpressionInReturnOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeParenthesizedExpressionInThrowOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW", ")", ";", "if", "(", "insertSpaceBeforeParenthesizedExpressionInThrowOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_parenthesized_expression_in_throw", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeParenthesizedExpressionInThrowOption", ")", ";", "}", "final", "Object", "insertSpaceBeforePostfixOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR", ")", ";", "if", "(", "insertSpaceBeforePostfixOperatorOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_postfix_operator", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforePostfixOperatorOption", ")", ";", "}", "final", "Object", "insertSpaceBeforePrefixOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR", ")", ";", "if", "(", "insertSpaceBeforePrefixOperatorOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_prefix_operator", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforePrefixOperatorOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeQuestionInConditionalOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL", ")", ";", "if", "(", "insertSpaceBeforeQuestionInConditionalOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_question_in_conditional", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeQuestionInConditionalOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeQuestionInWildcardOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD", ")", ";", "if", "(", "insertSpaceBeforeQuestionInWildcardOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_question_in_wilcard", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeQuestionInWildcardOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeSemicolonOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON", ")", ";", "if", "(", "insertSpaceBeforeSemicolonOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_semicolon", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeSemicolonOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeSemicolonInForOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR", ")", ";", "if", "(", "insertSpaceBeforeSemicolonInForOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_semicolon_in_for", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeSemicolonInForOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeSemicolonInTryOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_TRY_RESOURCES", ")", ";", "if", "(", "insertSpaceBeforeSemicolonInTryOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_semicolon_in_try_resources", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeSemicolonInTryOption", ")", ";", "}", "final", "Object", "insertSpaceBeforeUnaryOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR", ")", ";", "if", "(", "insertSpaceBeforeUnaryOperatorOption", "!=", "null", ")", "{", "this", ".", "insert_space_before_unary_operator", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBeforeUnaryOperatorOption", ")", ";", "}", "final", "Object", "insertSpaceBetweenBracketsInArrayTypeReferenceOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE", ")", ";", "if", "(", "insertSpaceBetweenBracketsInArrayTypeReferenceOption", "!=", "null", ")", "{", "this", ".", "insert_space_between_brackets_in_array_type_reference", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBetweenBracketsInArrayTypeReferenceOption", ")", ";", "}", "final", "Object", "insertSpaceBetweenEmptyBracesInArrayInitializerOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER", ")", ";", "if", "(", "insertSpaceBetweenEmptyBracesInArrayInitializerOption", "!=", "null", ")", "{", "this", ".", "insert_space_between_empty_braces_in_array_initializer", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBetweenEmptyBracesInArrayInitializerOption", ")", ";", "}", "final", "Object", "insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION", ")", ";", "if", "(", "insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption", "!=", "null", ")", "{", "this", ".", "insert_space_between_empty_brackets_in_array_allocation_expression", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBetweenEmptyBracketsInArrayAllocationExpressionOption", ")", ";", "}", "final", "Object", "insertSpaceBetweenEmptyParensInConstructorDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION", ")", ";", "if", "(", "insertSpaceBetweenEmptyParensInConstructorDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_between_empty_parens_in_constructor_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBetweenEmptyParensInConstructorDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBetweenEmptyParensInAnnotationTypeMemberDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ANNOTATION_TYPE_MEMBER_DECLARATION", ")", ";", "if", "(", "insertSpaceBetweenEmptyParensInAnnotationTypeMemberDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_between_empty_parens_in_annotation_type_member_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBetweenEmptyParensInAnnotationTypeMemberDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBetweenEmptyParensInEnumConstantOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT", ")", ";", "if", "(", "insertSpaceBetweenEmptyParensInEnumConstantOption", "!=", "null", ")", "{", "this", ".", "insert_space_between_empty_parens_in_enum_constant", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBetweenEmptyParensInEnumConstantOption", ")", ";", "}", "final", "Object", "insertSpaceBetweenEmptyParensInMethodDeclarationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION", ")", ";", "if", "(", "insertSpaceBetweenEmptyParensInMethodDeclarationOption", "!=", "null", ")", "{", "this", ".", "insert_space_between_empty_parens_in_method_declaration", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBetweenEmptyParensInMethodDeclarationOption", ")", ";", "}", "final", "Object", "insertSpaceBetweenEmptyParensInMethodInvocationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION", ")", ";", "if", "(", "insertSpaceBetweenEmptyParensInMethodInvocationOption", "!=", "null", ")", "{", "this", ".", "insert_space_between_empty_parens_in_method_invocation", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertSpaceBetweenEmptyParensInMethodInvocationOption", ")", ";", "}", "final", "Object", "compactElseIfOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMPACT_ELSE_IF", ")", ";", "if", "(", "compactElseIfOption", "!=", "null", ")", "{", "this", ".", "compact_else_if", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "compactElseIfOption", ")", ";", "}", "final", "Object", "keepGuardianClauseOnOneLineOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE", ")", ";", "if", "(", "keepGuardianClauseOnOneLineOption", "!=", "null", ")", "{", "this", ".", "keep_guardian_clause_on_one_line", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "keepGuardianClauseOnOneLineOption", ")", ";", "}", "final", "Object", "keepElseStatementOnSameLineOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE", ")", ";", "if", "(", "keepElseStatementOnSameLineOption", "!=", "null", ")", "{", "this", ".", "keep_else_statement_on_same_line", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "keepElseStatementOnSameLineOption", ")", ";", "}", "final", "Object", "keepEmptyArrayInitializerOnOneLineOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE", ")", ";", "if", "(", "keepEmptyArrayInitializerOnOneLineOption", "!=", "null", ")", "{", "this", ".", "keep_empty_array_initializer_on_one_line", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "keepEmptyArrayInitializerOnOneLineOption", ")", ";", "}", "final", "Object", "keepSimpleIfOnOneLineOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE", ")", ";", "if", "(", "keepSimpleIfOnOneLineOption", "!=", "null", ")", "{", "this", ".", "keep_simple_if_on_one_line", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "keepSimpleIfOnOneLineOption", ")", ";", "}", "final", "Object", "keepThenStatementOnSameLineOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE", ")", ";", "if", "(", "keepThenStatementOnSameLineOption", "!=", "null", ")", "{", "this", ".", "keep_then_statement_on_same_line", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "keepThenStatementOnSameLineOption", ")", ";", "}", "final", "Object", "neverIndentBlockCommentOnFirstColumnOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN", ")", ";", "if", "(", "neverIndentBlockCommentOnFirstColumnOption", "!=", "null", ")", "{", "this", ".", "never_indent_block_comments_on_first_column", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "neverIndentBlockCommentOnFirstColumnOption", ")", ";", "}", "final", "Object", "neverIndentLineCommentOnFirstColumnOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN", ")", ";", "if", "(", "neverIndentLineCommentOnFirstColumnOption", "!=", "null", ")", "{", "this", ".", "never_indent_line_comments_on_first_column", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "neverIndentLineCommentOnFirstColumnOption", ")", ";", "}", "final", "Object", "numberOfEmptyLinesToPreserveOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE", ")", ";", "if", "(", "numberOfEmptyLinesToPreserveOption", "!=", "null", ")", "{", "try", "{", "this", ".", "number_of_empty_lines_to_preserve", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "numberOfEmptyLinesToPreserveOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "number_of_empty_lines_to_preserve", "=", "0", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "number_of_empty_lines_to_preserve", "=", "0", ";", "}", "}", "final", "Object", "joinLinesInCommentsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_JOIN_LINES_IN_COMMENTS", ")", ";", "if", "(", "joinLinesInCommentsOption", "!=", "null", ")", "{", "this", ".", "join_lines_in_comments", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "joinLinesInCommentsOption", ")", ";", "}", "final", "Object", "joinWrappedLinesOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_JOIN_WRAPPED_LINES", ")", ";", "if", "(", "joinWrappedLinesOption", "!=", "null", ")", "{", "this", ".", "join_wrapped_lines", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "joinWrappedLinesOption", ")", ";", "}", "final", "Object", "putEmptyStatementOnNewLineOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE", ")", ";", "if", "(", "putEmptyStatementOnNewLineOption", "!=", "null", ")", "{", "this", ".", "put_empty_statement_on_new_line", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "putEmptyStatementOnNewLineOption", ")", ";", "}", "final", "Object", "tabSizeOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_SIZE", ")", ";", "if", "(", "tabSizeOption", "!=", "null", ")", "{", "try", "{", "this", ".", "tab_size", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "tabSizeOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "tab_size", "=", "4", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "tab_size", "=", "4", ";", "}", "}", "final", "Object", "useTabsOnlyForLeadingIndentationsOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS", ")", ";", "if", "(", "useTabsOnlyForLeadingIndentationsOption", "!=", "null", ")", "{", "this", ".", "use_tabs_only_for_leading_indentations", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "useTabsOnlyForLeadingIndentationsOption", ")", ";", "}", "final", "Object", "pageWidthOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_LINE_SPLIT", ")", ";", "if", "(", "pageWidthOption", "!=", "null", ")", "{", "try", "{", "this", ".", "page_width", "=", "Integer", ".", "parseInt", "(", "(", "String", ")", "pageWidthOption", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "this", ".", "page_width", "=", "80", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "this", ".", "page_width", "=", "80", ";", "}", "}", "final", "Object", "useTabOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_CHAR", ")", ";", "if", "(", "useTabOption", "!=", "null", ")", "{", "if", "(", "JavaCore", ".", "TAB", ".", "equals", "(", "useTabOption", ")", ")", "{", "this", ".", "tab_char", "=", "TAB", ";", "}", "else", "if", "(", "JavaCore", ".", "SPACE", ".", "equals", "(", "useTabOption", ")", ")", "{", "this", ".", "tab_char", "=", "SPACE", ";", "}", "else", "{", "this", ".", "tab_char", "=", "MIXED", ";", "}", "}", "final", "Object", "wrapBeforeBinaryOperatorOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_WRAP_BEFORE_BINARY_OPERATOR", ")", ";", "if", "(", "wrapBeforeBinaryOperatorOption", "!=", "null", ")", "{", "this", ".", "wrap_before_binary_operator", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "wrapBeforeBinaryOperatorOption", ")", ";", "}", "final", "Object", "wrapBeforeOrOperatorMulticatchOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_WRAP_BEFORE_OR_OPERATOR_MULTICATCH", ")", ";", "if", "(", "wrapBeforeOrOperatorMulticatchOption", "!=", "null", ")", "{", "this", ".", "wrap_before_or_operator_multicatch", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "wrapBeforeOrOperatorMulticatchOption", ")", ";", "}", "final", "Object", "useTags", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_USE_ON_OFF_TAGS", ")", ";", "if", "(", "useTags", "!=", "null", ")", "{", "this", ".", "use_tags", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "useTags", ")", ";", "}", "final", "Object", "disableTagOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_DISABLING_TAG", ")", ";", "if", "(", "disableTagOption", "!=", "null", ")", "{", "if", "(", "disableTagOption", "instanceof", "String", ")", "{", "String", "stringValue", "=", "(", "String", ")", "disableTagOption", ";", "int", "idx", "=", "stringValue", ".", "indexOf", "(", "'\\n'", ")", ";", "if", "(", "idx", "==", "0", ")", "{", "this", ".", "disabling_tag", "=", "null", ";", "}", "else", "{", "String", "tag", "=", "idx", "<", "0", "?", "stringValue", ".", "trim", "(", ")", ":", "stringValue", ".", "substring", "(", "0", ",", "idx", ")", ".", "trim", "(", ")", ";", "if", "(", "tag", ".", "length", "(", ")", "==", "0", ")", "{", "this", ".", "disabling_tag", "=", "null", ";", "}", "else", "{", "this", ".", "disabling_tag", "=", "tag", ".", "toCharArray", "(", ")", ";", "}", "}", "}", "}", "final", "Object", "enableTagOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_ENABLING_TAG", ")", ";", "if", "(", "enableTagOption", "!=", "null", ")", "{", "if", "(", "enableTagOption", "instanceof", "String", ")", "{", "String", "stringValue", "=", "(", "String", ")", "enableTagOption", ";", "int", "idx", "=", "stringValue", ".", "indexOf", "(", "'\\n'", ")", ";", "if", "(", "idx", "==", "0", ")", "{", "this", ".", "enabling_tag", "=", "null", ";", "}", "else", "{", "String", "tag", "=", "idx", "<", "0", "?", "stringValue", ".", "trim", "(", ")", ":", "stringValue", ".", "substring", "(", "0", ",", "idx", ")", ".", "trim", "(", ")", ";", "if", "(", "tag", ".", "length", "(", ")", "==", "0", ")", "{", "this", ".", "enabling_tag", "=", "null", ";", "}", "else", "{", "this", ".", "enabling_tag", "=", "tag", ".", "toCharArray", "(", ")", ";", "}", "}", "}", "}", "final", "Object", "wrapWrapOuterExpressionsWhenNestedOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED", ")", ";", "if", "(", "wrapWrapOuterExpressionsWhenNestedOption", "!=", "null", ")", "{", "this", ".", "wrap_outer_expressions_when_nested", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "wrapWrapOuterExpressionsWhenNestedOption", ")", ";", "}", "}", "private", "void", "setDeprecatedOptions", "(", "Map", "settings", ")", "{", "final", "Object", "commentClearBlankLinesOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_CLEAR_BLANK_LINES", ")", ";", "if", "(", "commentClearBlankLinesOption", "!=", "null", ")", "{", "this", ".", "comment_clear_blank_lines_in_javadoc_comment", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentClearBlankLinesOption", ")", ";", "this", ".", "comment_clear_blank_lines_in_block_comment", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentClearBlankLinesOption", ")", ";", "}", "else", "{", "final", "Object", "commentClearBlankLinesInJavadocCommentOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT", ")", ";", "if", "(", "commentClearBlankLinesInJavadocCommentOption", "!=", "null", ")", "{", "this", ".", "comment_clear_blank_lines_in_javadoc_comment", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentClearBlankLinesInJavadocCommentOption", ")", ";", "}", "final", "Object", "commentClearBlankLinesInBlockCommentOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT", ")", ";", "if", "(", "commentClearBlankLinesInBlockCommentOption", "!=", "null", ")", "{", "this", ".", "comment_clear_blank_lines_in_block_comment", "=", "DefaultCodeFormatterConstants", ".", "TRUE", ".", "equals", "(", "commentClearBlankLinesInBlockCommentOption", ")", ";", "}", "}", "final", "Object", "insertNewLineAfterAnnotationOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION", ")", ";", "final", "Object", "insertNewLineAfterAnnotationOnMemberOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER", ")", ";", "final", "Object", "insertNewLineAfterAnnotationOnTypeOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE", ")", ";", "final", "Object", "insertNewLineAfterAnnotationOnFieldOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD", ")", ";", "final", "Object", "insertNewLineAfterAnnotationOnMethodOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD", ")", ";", "final", "Object", "insertNewLineAfterAnnotationOnPackageOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE", ")", ";", "final", "Object", "insertNewLineAfterAnnotationOnParameterOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER", ")", ";", "final", "Object", "insertNewLineAfterAnnotationOnLocalVariableOption", "=", "settings", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE", ")", ";", "if", "(", "insertNewLineAfterAnnotationOnTypeOption", "==", "null", "&&", "insertNewLineAfterAnnotationOnFieldOption", "==", "null", "&&", "insertNewLineAfterAnnotationOnMethodOption", "==", "null", "&&", "insertNewLineAfterAnnotationOnPackageOption", "==", "null", ")", "{", "if", "(", "insertNewLineAfterAnnotationOnMemberOption", "!=", "null", ")", "{", "boolean", "insert", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterAnnotationOnMemberOption", ")", ";", "this", ".", "insert_new_line_after_annotation_on_type", "=", "insert", ";", "this", ".", "insert_new_line_after_annotation_on_field", "=", "insert", ";", "this", ".", "insert_new_line_after_annotation_on_method", "=", "insert", ";", "this", ".", "insert_new_line_after_annotation_on_package", "=", "insert", ";", "if", "(", "insertNewLineAfterAnnotationOnParameterOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_after_annotation_on_parameter", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterAnnotationOnParameterOption", ")", ";", "}", "if", "(", "insertNewLineAfterAnnotationOnLocalVariableOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_after_annotation_on_local_variable", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterAnnotationOnLocalVariableOption", ")", ";", "}", "}", "else", "if", "(", "insertNewLineAfterAnnotationOnParameterOption", "==", "null", "&&", "insertNewLineAfterAnnotationOnLocalVariableOption", "==", "null", ")", "{", "if", "(", "insertNewLineAfterAnnotationOption", "!=", "null", ")", "{", "boolean", "insert", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterAnnotationOption", ")", ";", "this", ".", "insert_new_line_after_annotation_on_type", "=", "insert", ";", "this", ".", "insert_new_line_after_annotation_on_field", "=", "insert", ";", "this", ".", "insert_new_line_after_annotation_on_method", "=", "insert", ";", "this", ".", "insert_new_line_after_annotation_on_package", "=", "insert", ";", "this", ".", "insert_new_line_after_annotation_on_parameter", "=", "insert", ";", "this", ".", "insert_new_line_after_annotation_on_local_variable", "=", "insert", ";", "}", "}", "}", "else", "{", "if", "(", "insertNewLineAfterAnnotationOnTypeOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_after_annotation_on_type", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterAnnotationOnTypeOption", ")", ";", "}", "if", "(", "insertNewLineAfterAnnotationOnFieldOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_after_annotation_on_field", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterAnnotationOnFieldOption", ")", ";", "}", "if", "(", "insertNewLineAfterAnnotationOnMethodOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_after_annotation_on_method", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterAnnotationOnMethodOption", ")", ";", "}", "if", "(", "insertNewLineAfterAnnotationOnPackageOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_after_annotation_on_package", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterAnnotationOnPackageOption", ")", ";", "}", "if", "(", "insertNewLineAfterAnnotationOnParameterOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_after_annotation_on_parameter", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterAnnotationOnParameterOption", ")", ";", "}", "if", "(", "insertNewLineAfterAnnotationOnLocalVariableOption", "!=", "null", ")", "{", "this", ".", "insert_new_line_after_annotation_on_local_variable", "=", "JavaCore", ".", "INSERT", ".", "equals", "(", "insertNewLineAfterAnnotationOnLocalVariableOption", ")", ";", "}", "}", "}", "public", "void", "setDefaultSettings", "(", ")", "{", "this", ".", "alignment_for_arguments_in_allocation_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_arguments_in_annotation", "=", "Alignment", ".", "M_NO_ALIGNMENT", ";", "this", ".", "alignment_for_arguments_in_enum_constant", "=", "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_assignment", "=", "Alignment", ".", "M_NO_ALIGNMENT", ";", "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_enum_constants", "=", "Alignment", ".", "NONE", ";", "this", ".", "alignment_for_expressions_in_array_initializer", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_method_declaration", "=", "Alignment", ".", "M_NO_ALIGNMENT", ";", "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_resources_in_try", "=", "Alignment", ".", "M_NEXT_PER_LINE_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_enum_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", ".", "alignment_for_union_type_in_multicatch", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "align_type_members_on_columns", "=", "false", ";", "this", ".", "brace_position_for_annotation_type_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "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_enum_constant", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "this", ".", "brace_position_for_enum_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", ".", "comment_clear_blank_lines_in_block_comment", "=", "false", ";", "this", ".", "comment_clear_blank_lines_in_javadoc_comment", "=", "false", ";", "this", ".", "comment_format_block_comment", "=", "true", ";", "this", ".", "comment_format_javadoc_comment", "=", "true", ";", "this", ".", "comment_format_line_comment", "=", "true", ";", "this", ".", "comment_format_line_comment_starting_on_first_column", "=", "true", ";", "this", ".", "comment_format_header", "=", "false", ";", "this", ".", "comment_format_html", "=", "true", ";", "this", ".", "comment_format_source", "=", "true", ";", "this", ".", "comment_indent_parameter_description", "=", "true", ";", "this", ".", "comment_indent_root_tags", "=", "true", ";", "this", ".", "comment_insert_empty_line_before_root_tags", "=", "true", ";", "this", ".", "comment_insert_new_line_for_parameter", "=", "true", ";", "this", ".", "comment_new_lines_at_block_boundaries", "=", "true", ";", "this", ".", "comment_new_lines_at_javadoc_boundaries", "=", "true", ";", "this", ".", "comment_line_length", "=", "80", ";", "this", ".", "comment_preserve_white_space_between_code_and_line_comments", "=", "false", ";", "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_import_groups", "=", "1", ";", "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_annotation_declaration_header", "=", "true", ";", "this", ".", "indent_body_declarations_compare_to_enum_constant_header", "=", "true", ";", "this", ".", "indent_body_declarations_compare_to_enum_declaration_header", "=", "true", ";", "this", ".", "indent_body_declarations_compare_to_type_header", "=", "true", ";", "this", ".", "indent_breaks_compare_to_cases", "=", "true", ";", "this", ".", "indent_empty_lines", "=", "false", ";", "this", ".", "indent_switchstatements_compare_to_cases", "=", "true", ";", "this", ".", "indent_switchstatements_compare_to_switch", "=", "true", ";", "this", ".", "indentation_size", "=", "4", ";", "this", ".", "insert_new_line_after_annotation_on_type", "=", "true", ";", "this", ".", "insert_new_line_after_annotation_on_field", "=", "true", ";", "this", ".", "insert_new_line_after_annotation_on_method", "=", "true", ";", "this", ".", "insert_new_line_after_annotation_on_package", "=", "true", ";", "this", ".", "insert_new_line_after_annotation_on_parameter", "=", "false", ";", "this", ".", "insert_new_line_after_annotation_on_local_variable", "=", "true", ";", "this", ".", "insert_new_line_after_opening_brace_in_array_initializer", "=", "false", ";", "this", ".", "insert_new_line_at_end_of_file_if_missing", "=", "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_annotation_declaration", "=", "true", ";", "this", ".", "insert_new_line_in_empty_enum_constant", "=", "true", ";", "this", ".", "insert_new_line_in_empty_enum_declaration", "=", "true", ";", "this", ".", "insert_new_line_in_empty_method_body", "=", "true", ";", "this", ".", "insert_new_line_in_empty_type_declaration", "=", "true", ";", "this", ".", "insert_space_after_and_in_type_parameter", "=", "true", ";", "this", ".", "insert_space_after_assignment_operator", "=", "true", ";", "this", ".", "insert_space_after_at_in_annotation", "=", "false", ";", "this", ".", "insert_space_after_at_in_annotation_type_declaration", "=", "false", ";", "this", ".", "insert_space_after_binary_operator", "=", "true", ";", "this", ".", "insert_space_after_closing_angle_bracket_in_type_arguments", "=", "true", ";", "this", ".", "insert_space_after_closing_angle_bracket_in_type_parameters", "=", "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_for", "=", "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_annotation", "=", "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_enum_constant_arguments", "=", "true", ";", "this", ".", "insert_space_after_comma_in_enum_declarations", "=", "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_parameterized_type_reference", "=", "true", ";", "this", ".", "insert_space_after_comma_in_superinterfaces", "=", "true", ";", "this", ".", "insert_space_after_comma_in_type_arguments", "=", "true", ";", "this", ".", "insert_space_after_comma_in_type_parameters", "=", "true", ";", "this", ".", "insert_space_after_ellipsis", "=", "true", ";", "this", ".", "insert_space_after_opening_angle_bracket_in_parameterized_type_reference", "=", "false", ";", "this", ".", "insert_space_after_opening_angle_bracket_in_type_arguments", "=", "false", ";", "this", ".", "insert_space_after_opening_angle_bracket_in_type_parameters", "=", "false", ";", "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_annotation", "=", "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_enum_constant", "=", "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_try", "=", "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_question_in_wilcard", "=", "false", ";", "this", ".", "insert_space_after_semicolon_in_for", "=", "true", ";", "this", ".", "insert_space_after_semicolon_in_try_resources", "=", "true", ";", "this", ".", "insert_space_after_unary_operator", "=", "false", ";", "this", ".", "insert_space_before_and_in_type_parameter", "=", "true", ";", "this", ".", "insert_space_before_at_in_annotation_type_declaration", "=", "true", ";", "this", ".", "insert_space_before_assignment_operator", "=", "true", ";", "this", ".", "insert_space_before_binary_operator", "=", "true", ";", "this", ".", "insert_space_before_closing_angle_bracket_in_parameterized_type_reference", "=", "false", ";", "this", ".", "insert_space_before_closing_angle_bracket_in_type_arguments", "=", "false", ";", "this", ".", "insert_space_before_closing_angle_bracket_in_type_parameters", "=", "false", ";", "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_annotation", "=", "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_enum_constant", "=", "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_try", "=", "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_for", "=", "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_enum_constant_arguments", "=", "false", ";", "this", ".", "insert_space_before_comma_in_enum_declarations", "=", "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_parameterized_type_reference", "=", "false", ";", "this", ".", "insert_space_before_comma_in_superinterfaces", "=", "false", ";", "this", ".", "insert_space_before_comma_in_type_arguments", "=", "false", ";", "this", ".", "insert_space_before_comma_in_type_parameters", "=", "false", ";", "this", ".", "insert_space_before_ellipsis", "=", "false", ";", "this", ".", "insert_space_before_parenthesized_expression_in_return", "=", "true", ";", "this", ".", "insert_space_before_parenthesized_expression_in_throw", "=", "true", ";", "this", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", "=", "false", ";", "this", ".", "insert_space_before_opening_angle_bracket_in_type_arguments", "=", "false", ";", "this", ".", "insert_space_before_opening_angle_bracket_in_type_parameters", "=", "false", ";", "this", ".", "insert_space_before_opening_brace_in_annotation_type_declaration", "=", "true", ";", "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_enum_constant", "=", "true", ";", "this", ".", "insert_space_before_opening_brace_in_enum_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_annotation", "=", "false", ";", "this", ".", "insert_space_before_opening_paren_in_annotation_type_member_declaration", "=", "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_enum_constant", "=", "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_try", "=", "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_question_in_wilcard", "=", "false", ";", "this", ".", "insert_space_before_semicolon", "=", "false", ";", "this", ".", "insert_space_before_semicolon_in_for", "=", "false", ";", "this", ".", "insert_space_before_semicolon_in_try_resources", "=", "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_annotation_type_member_declaration", "=", "false", ";", "this", ".", "insert_space_between_empty_parens_in_constructor_declaration", "=", "false", ";", "this", ".", "insert_space_between_empty_parens_in_enum_constant", "=", "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", "=", "false", ";", "this", ".", "keep_simple_if_on_one_line", "=", "false", ";", "this", ".", "keep_then_statement_on_same_line", "=", "false", ";", "this", ".", "never_indent_block_comments_on_first_column", "=", "false", ";", "this", ".", "never_indent_line_comments_on_first_column", "=", "false", ";", "this", ".", "number_of_empty_lines_to_preserve", "=", "1", ";", "this", ".", "join_lines_in_comments", "=", "true", ";", "this", ".", "join_wrapped_lines", "=", "true", ";", "this", ".", "put_empty_statement_on_new_line", "=", "false", ";", "this", ".", "tab_size", "=", "4", ";", "this", ".", "page_width", "=", "80", ";", "this", ".", "tab_char", "=", "TAB", ";", "this", ".", "use_tabs_only_for_leading_indentations", "=", "false", ";", "this", ".", "wrap_before_binary_operator", "=", "true", ";", "this", ".", "wrap_before_or_operator_multicatch", "=", "true", ";", "this", ".", "use_tags", "=", "false", ";", "this", ".", "disabling_tag", "=", "DEFAULT_DISABLING_TAG", ";", "this", ".", "enabling_tag", "=", "DEFAULT_ENABLING_TAG", ";", "this", ".", "wrap_outer_expressions_when_nested", "=", "true", ";", "}", "public", "void", "setEclipseDefaultSettings", "(", ")", "{", "setJavaConventionsSettings", "(", ")", ";", "this", ".", "tab_char", "=", "TAB", ";", "this", ".", "tab_size", "=", "4", ";", "}", "public", "void", "setJavaConventionsSettings", "(", ")", "{", "this", ".", "alignment_for_arguments_in_allocation_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_arguments_in_annotation", "=", "Alignment", ".", "M_NO_ALIGNMENT", ";", "this", ".", "alignment_for_arguments_in_enum_constant", "=", "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_assignment", "=", "Alignment", ".", "M_NO_ALIGNMENT", ";", "this", ".", "alignment_for_binary_expression", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_compact_if", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_conditional_expression", "=", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ";", "this", ".", "alignment_for_enum_constants", "=", "Alignment", ".", "NONE", ";", "this", ".", "alignment_for_expressions_in_array_initializer", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_method_declaration", "=", "Alignment", ".", "M_NO_ALIGNMENT", ";", "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_resources_in_try", "=", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ";", "this", ".", "alignment_for_selector_in_method_invocation", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_superclass_in_type_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_superinterfaces_in_enum_declaration", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "alignment_for_superinterfaces_in_type_declaration", "=", "Alignment", ".", "M_COMPACT_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", ".", "alignment_for_union_type_in_multicatch", "=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "this", ".", "align_type_members_on_columns", "=", "false", ";", "this", ".", "brace_position_for_annotation_type_declaration", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "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_enum_constant", "=", "DefaultCodeFormatterConstants", ".", "END_OF_LINE", ";", "this", ".", "brace_position_for_enum_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", ".", "comment_clear_blank_lines_in_block_comment", "=", "false", ";", "this", ".", "comment_clear_blank_lines_in_javadoc_comment", "=", "false", ";", "this", ".", "comment_format_block_comment", "=", "true", ";", "this", ".", "comment_format_javadoc_comment", "=", "true", ";", "this", ".", "comment_format_line_comment", "=", "true", ";", "this", ".", "comment_format_line_comment_starting_on_first_column", "=", "true", ";", "this", ".", "comment_format_header", "=", "false", ";", "this", ".", "comment_format_html", "=", "true", ";", "this", ".", "comment_format_source", "=", "true", ";", "this", ".", "comment_indent_parameter_description", "=", "true", ";", "this", ".", "comment_indent_root_tags", "=", "true", ";", "this", ".", "comment_insert_empty_line_before_root_tags", "=", "true", ";", "this", ".", "comment_insert_new_line_for_parameter", "=", "true", ";", "this", ".", "comment_new_lines_at_block_boundaries", "=", "true", ";", "this", ".", "comment_new_lines_at_javadoc_boundaries", "=", "true", ";", "this", ".", "comment_line_length", "=", "80", ";", "this", ".", "comment_preserve_white_space_between_code_and_line_comments", "=", "false", ";", "this", ".", "continuation_indentation", "=", "2", ";", "this", ".", "continuation_indentation_for_array_initializer", "=", "2", ";", "this", ".", "blank_lines_after_imports", "=", "1", ";", "this", ".", "blank_lines_after_package", "=", "1", ";", "this", ".", "blank_lines_before_field", "=", "0", ";", "this", ".", "blank_lines_before_first_class_body_declaration", "=", "0", ";", "this", ".", "blank_lines_before_imports", "=", "1", ";", "this", ".", "blank_lines_before_member_type", "=", "1", ";", "this", ".", "blank_lines_before_method", "=", "1", ";", "this", ".", "blank_lines_before_new_chunk", "=", "1", ";", "this", ".", "blank_lines_before_package", "=", "0", ";", "this", ".", "blank_lines_between_import_groups", "=", "1", ";", "this", ".", "blank_lines_between_type_declarations", "=", "1", ";", "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_annotation_declaration_header", "=", "true", ";", "this", ".", "indent_body_declarations_compare_to_enum_constant_header", "=", "true", ";", "this", ".", "indent_body_declarations_compare_to_enum_declaration_header", "=", "true", ";", "this", ".", "indent_body_declarations_compare_to_type_header", "=", "true", ";", "this", ".", "indent_breaks_compare_to_cases", "=", "true", ";", "this", ".", "indent_empty_lines", "=", "false", ";", "this", ".", "indent_switchstatements_compare_to_cases", "=", "true", ";", "this", ".", "indent_switchstatements_compare_to_switch", "=", "false", ";", "this", ".", "indentation_size", "=", "4", ";", "this", ".", "insert_new_line_after_annotation_on_type", "=", "true", ";", "this", ".", "insert_new_line_after_annotation_on_field", "=", "true", ";", "this", ".", "insert_new_line_after_annotation_on_method", "=", "true", ";", "this", ".", "insert_new_line_after_annotation_on_package", "=", "true", ";", "this", ".", "insert_new_line_after_annotation_on_parameter", "=", "false", ";", "this", ".", "insert_new_line_after_annotation_on_local_variable", "=", "true", ";", "this", ".", "insert_new_line_after_opening_brace_in_array_initializer", "=", "false", ";", "this", ".", "insert_new_line_at_end_of_file_if_missing", "=", "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_annotation_declaration", "=", "true", ";", "this", ".", "insert_new_line_in_empty_enum_constant", "=", "true", ";", "this", ".", "insert_new_line_in_empty_enum_declaration", "=", "true", ";", "this", ".", "insert_new_line_in_empty_method_body", "=", "true", ";", "this", ".", "insert_new_line_in_empty_type_declaration", "=", "true", ";", "this", ".", "insert_space_after_and_in_type_parameter", "=", "true", ";", "this", ".", "insert_space_after_assignment_operator", "=", "true", ";", "this", ".", "insert_space_after_at_in_annotation", "=", "false", ";", "this", ".", "insert_space_after_at_in_annotation_type_declaration", "=", "false", ";", "this", ".", "insert_space_after_binary_operator", "=", "true", ";", "this", ".", "insert_space_after_closing_angle_bracket_in_type_arguments", "=", "true", ";", "this", ".", "insert_space_after_closing_angle_bracket_in_type_parameters", "=", "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_for", "=", "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_annotation", "=", "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_enum_constant_arguments", "=", "true", ";", "this", ".", "insert_space_after_comma_in_enum_declarations", "=", "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_parameterized_type_reference", "=", "true", ";", "this", ".", "insert_space_after_comma_in_superinterfaces", "=", "true", ";", "this", ".", "insert_space_after_comma_in_type_arguments", "=", "true", ";", "this", ".", "insert_space_after_comma_in_type_parameters", "=", "true", ";", "this", ".", "insert_space_after_ellipsis", "=", "true", ";", "this", ".", "insert_space_after_opening_angle_bracket_in_parameterized_type_reference", "=", "false", ";", "this", ".", "insert_space_after_opening_angle_bracket_in_type_arguments", "=", "false", ";", "this", ".", "insert_space_after_opening_angle_bracket_in_type_parameters", "=", "false", ";", "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", "=", "true", ";", "this", ".", "insert_space_after_opening_paren_in_annotation", "=", "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_enum_constant", "=", "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_try", "=", "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_question_in_wilcard", "=", "false", ";", "this", ".", "insert_space_after_semicolon_in_for", "=", "true", ";", "this", ".", "insert_space_after_semicolon_in_try_resources", "=", "true", ";", "this", ".", "insert_space_after_unary_operator", "=", "false", ";", "this", ".", "insert_space_before_and_in_type_parameter", "=", "true", ";", "this", ".", "insert_space_before_at_in_annotation_type_declaration", "=", "true", ";", "this", ".", "insert_space_before_assignment_operator", "=", "true", ";", "this", ".", "insert_space_before_binary_operator", "=", "true", ";", "this", ".", "insert_space_before_closing_angle_bracket_in_parameterized_type_reference", "=", "false", ";", "this", ".", "insert_space_before_closing_angle_bracket_in_type_arguments", "=", "false", ";", "this", ".", "insert_space_before_closing_angle_bracket_in_type_parameters", "=", "false", ";", "this", ".", "insert_space_before_closing_brace_in_array_initializer", "=", "true", ";", "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_annotation", "=", "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_enum_constant", "=", "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_try", "=", "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", "=", "false", ";", "this", ".", "insert_space_before_colon_in_conditional", "=", "true", ";", "this", ".", "insert_space_before_colon_in_default", "=", "false", ";", "this", ".", "insert_space_before_colon_in_for", "=", "true", ";", "this", ".", "insert_space_before_colon_in_labeled_statement", "=", "false", ";", "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_enum_constant_arguments", "=", "false", ";", "this", ".", "insert_space_before_comma_in_enum_declarations", "=", "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_parameterized_type_reference", "=", "false", ";", "this", ".", "insert_space_before_comma_in_superinterfaces", "=", "false", ";", "this", ".", "insert_space_before_comma_in_type_arguments", "=", "false", ";", "this", ".", "insert_space_before_comma_in_type_parameters", "=", "false", ";", "this", ".", "insert_space_before_ellipsis", "=", "false", ";", "this", ".", "insert_space_before_parenthesized_expression_in_return", "=", "true", ";", "this", ".", "insert_space_before_parenthesized_expression_in_throw", "=", "true", ";", "this", ".", "insert_space_before_opening_angle_bracket_in_parameterized_type_reference", "=", "false", ";", "this", ".", "insert_space_before_opening_angle_bracket_in_type_arguments", "=", "false", ";", "this", ".", "insert_space_before_opening_angle_bracket_in_type_parameters", "=", "false", ";", "this", ".", "insert_space_before_opening_brace_in_annotation_type_declaration", "=", "true", ";", "this", ".", "insert_space_before_opening_brace_in_anonymous_type_declaration", "=", "true", ";", "this", ".", "insert_space_before_opening_brace_in_array_initializer", "=", "true", ";", "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_enum_constant", "=", "true", ";", "this", ".", "insert_space_before_opening_brace_in_enum_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_annotation", "=", "false", ";", "this", ".", "insert_space_before_opening_paren_in_annotation_type_member_declaration", "=", "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_enum_constant", "=", "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_try", "=", "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_question_in_wilcard", "=", "false", ";", "this", ".", "insert_space_before_semicolon", "=", "false", ";", "this", ".", "insert_space_before_semicolon_in_for", "=", "false", ";", "this", ".", "insert_space_before_semicolon_in_try_resources", "=", "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_annotation_type_member_declaration", "=", "false", ";", "this", ".", "insert_space_between_empty_parens_in_constructor_declaration", "=", "false", ";", "this", ".", "insert_space_between_empty_parens_in_enum_constant", "=", "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", "=", "false", ";", "this", ".", "keep_simple_if_on_one_line", "=", "false", ";", "this", ".", "keep_then_statement_on_same_line", "=", "false", ";", "this", ".", "never_indent_block_comments_on_first_column", "=", "false", ";", "this", ".", "never_indent_line_comments_on_first_column", "=", "false", ";", "this", ".", "number_of_empty_lines_to_preserve", "=", "1", ";", "this", ".", "join_lines_in_comments", "=", "true", ";", "this", ".", "join_wrapped_lines", "=", "true", ";", "this", ".", "put_empty_statement_on_new_line", "=", "true", ";", "this", ".", "tab_size", "=", "8", ";", "this", ".", "page_width", "=", "80", ";", "this", ".", "tab_char", "=", "MIXED", ";", "this", ".", "use_tabs_only_for_leading_indentations", "=", "false", ";", "this", ".", "wrap_before_binary_operator", "=", "true", ";", "this", ".", "wrap_before_or_operator_multicatch", "=", "true", ";", "this", ".", "use_tags", "=", "false", ";", "this", ".", "disabling_tag", "=", "DEFAULT_DISABLING_TAG", ";", "this", ".", "enabling_tag", "=", "DEFAULT_ENABLING_TAG", ";", "this", ".", "wrap_outer_expressions_when_nested", "=", "true", ";", "}", "}", "</s>" ]
3,973
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Javadoc", ";", "public", "class", "FormatJavadoc", "extends", "Javadoc", "{", "FormatJavadocBlock", "[", "]", "blocks", ";", "int", "textStart", ",", "textEnd", ";", "int", "lineStart", ",", "lineEnd", ";", "public", "FormatJavadoc", "(", "int", "sourceStart", ",", "int", "sourceEnd", ",", "int", "length", ")", "{", "super", "(", "sourceStart", ",", "sourceEnd", ")", ";", "if", "(", "length", ">", "0", ")", "{", "this", ".", "blocks", "=", "new", "FormatJavadocBlock", "[", "length", "]", ";", "}", "}", "public", "FormatJavadocBlock", "getFirstBlock", "(", ")", "{", "if", "(", "this", ".", "blocks", "!=", "null", ")", "{", "return", "this", ".", "blocks", "[", "0", "]", ";", "}", "return", "null", ";", "}", "public", "boolean", "isMultiLine", "(", ")", "{", "return", "this", ".", "lineStart", "<", "this", ".", "lineEnd", ";", "}", "public", "String", "toDebugString", "(", "char", "[", "]", "source", ")", "{", "if", "(", "this", ".", "blocks", "==", "null", ")", "{", "return", "\"\"", ";", "}", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "int", "length", "=", "this", ".", "blocks", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "this", ".", "blocks", "[", "i", "]", ".", "toStringDebug", "(", "buffer", ",", "source", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,974
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IRegion", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "public", "abstract", "class", "CodeFormatter", "{", "public", "static", "final", "int", "K_UNKNOWN", "=", "0x00", ";", "public", "static", "final", "int", "K_EXPRESSION", "=", "0x01", ";", "public", "static", "final", "int", "K_STATEMENTS", "=", "0x02", ";", "public", "static", "final", "int", "K_CLASS_BODY_DECLARATIONS", "=", "0x04", ";", "public", "static", "final", "int", "K_COMPILATION_UNIT", "=", "0x08", ";", "public", "static", "final", "int", "K_SINGLE_LINE_COMMENT", "=", "0x10", ";", "public", "static", "final", "int", "K_MULTI_LINE_COMMENT", "=", "0x20", ";", "public", "static", "final", "int", "K_JAVA_DOC", "=", "0x40", ";", "public", "static", "final", "int", "F_INCLUDE_COMMENTS", "=", "0x1000", ";", "public", "abstract", "TextEdit", "format", "(", "int", "kind", ",", "String", "source", ",", "int", "offset", ",", "int", "length", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ")", ";", "public", "abstract", "TextEdit", "format", "(", "int", "kind", ",", "String", "source", ",", "IRegion", "[", "]", "regions", ",", "int", "indentationLevel", ",", "String", "lineSeparator", ")", ";", "public", "String", "createIndentationString", "(", "int", "indentationLevel", ")", "{", "return", "Util", ".", "EMPTY_STRING", ";", "}", "}", "</s>" ]
3,975
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ToolFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "DefaultCodeFormatterOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "align", ".", "Alignment", ";", "public", "class", "DefaultCodeFormatterConstants", "{", "public", "static", "final", "String", "END_OF_LINE", "=", "\"end_of_line\"", ";", "public", "static", "final", "String", "FALSE", "=", "\"false\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGN_TYPE_MEMBERS_ON_COLUMNS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ALLOCATION_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ENUM_CONSTANT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_ANNOTATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_EXPLICIT_CONSTRUCTOR_CALL", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_METHOD_INVOCATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_ARGUMENTS_IN_QUALIFIED_ALLOCATION_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_ASSIGNMENT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_BINARY_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_COMPACT_IF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_CONDITIONAL_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_ENUM_CONSTANTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_EXPRESSIONS_IN_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_METHOD_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_MULTIPLE_FIELDS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_CONSTRUCTOR_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_PARAMETERS_IN_METHOD_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_RESOURCES_IN_TRY", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_SELECTOR_IN_METHOD_INVOCATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_SUPERCLASS_IN_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_ENUM_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_SUPERINTERFACES_IN_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_CONSTRUCTOR_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_THROWS_CLAUSE_IN_METHOD_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ALIGNMENT_FOR_UNION_TYPE_IN_MULTICATCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_AFTER_IMPORTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_AFTER_PACKAGE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_AT_BEGINNING_OF_METHOD_BODY", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_BEFORE_FIELD", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_BEFORE_FIRST_CLASS_BODY_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_BEFORE_IMPORTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_BEFORE_MEMBER_TYPE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_BEFORE_METHOD", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_BEFORE_NEW_CHUNK", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_BEFORE_PACKAGE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_BETWEEN_IMPORT_GROUPS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BLANK_LINES_BETWEEN_TYPE_DECLARATIONS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_ANNOTATION_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_ANONYMOUS_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_BLOCK", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_BLOCK_IN_CASE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_CONSTRUCTOR_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_ENUM_CONSTANT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_ENUM_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_METHOD_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_SWITCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_BRACE_POSITION_FOR_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_CLEAR_BLANK_LINES", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_JAVADOC_COMMENT", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_CLEAR_BLANK_LINES_IN_BLOCK_COMMENT", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_FORMAT", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_FORMAT_LINE_COMMENT", "=", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_PRESERVE_WHITE_SPACE_BETWEEN_CODE_AND_LINE_COMMENT", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_FORMAT_BLOCK_COMMENT", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_FORMAT_JAVADOC_COMMENT", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_FORMAT_HEADER", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_FORMAT_HTML", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_FORMAT_SOURCE", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_INDENT_PARAMETER_DESCRIPTION", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_INDENT_ROOT_TAGS", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_INSERT_EMPTY_LINE_BEFORE_ROOT_TAGS", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_INSERT_NEW_LINE_FOR_PARAMETER", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_LINE_LENGTH", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_NEW_LINES_AT_BLOCK_BOUNDARIES", "=", "\"\"", ";", "public", "final", "static", "String", "FORMATTER_COMMENT_NEW_LINES_AT_JAVADOC_BOUNDARIES", "=", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_COMPACT_ELSE_IF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_CONTINUATION_INDENTATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_CONTINUATION_INDENTATION_FOR_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_USE_ON_OFF_TAGS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_DISABLING_TAG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_ENABLING_TAG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ANNOTATION_DECLARATION_HEADER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_CONSTANT_HEADER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_ENUM_DECLARATION_HEADER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENT_BODY_DECLARATIONS_COMPARE_TO_TYPE_HEADER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENT_BREAKS_COMPARE_TO_CASES", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENT_EMPTY_LINES", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BLOCK", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENT_STATEMENTS_COMPARE_TO_BODY", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_CASES", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENT_SWITCHSTATEMENTS_COMPARE_TO_SWITCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INDENTATION_SIZE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_MEMBER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_FIELD", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_METHOD", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PACKAGE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_TYPE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_PARAMETER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AFTER_ANNOTATION_ON_LOCAL_VARIABLE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AFTER_LABEL", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_AT_END_OF_FILE_IF_MISSING", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_BEFORE_CATCH_IN_TRY_STATEMENT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_BEFORE_ELSE_IN_IF_STATEMENT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_BEFORE_FINALLY_IN_TRY_STATEMENT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_BEFORE_WHILE_IN_DO_STATEMENT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANNOTATION_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ANONYMOUS_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_BLOCK", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_CONSTANT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_ENUM_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_METHOD_BODY", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_NEW_LINE_IN_EMPTY_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_AND_IN_TYPE_PARAMETER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_ASSIGNMENT_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_AT_IN_ANNOTATION_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_BINARY_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_BRACE_IN_BLOCK", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_CLOSING_PAREN_IN_CAST", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_ASSERT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CASE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_CONDITIONAL", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_FOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COLON_IN_LABELED_STATEMENT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ALLOCATION_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ANNOTATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_CONSTANT_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_ENUM_DECLARATIONS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INCREMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_FOR_INITS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_PARAMETERS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_DECLARATION_THROWS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_METHOD_INVOCATION_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_SUPERINTERFACES", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_COMMA_IN_TYPE_PARAMETERS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_ELLIPSIS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACE_IN_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_BRACKET_IN_ARRAY_REFERENCE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ANNOTATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CAST", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CATCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_ENUM_CONSTANT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_FOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_IF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_METHOD_INVOCATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SWITCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_SYNCHRONIZED", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_TRY", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_OPENING_PAREN_IN_WHILE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_POSTFIX_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_PREFIX_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_CONDITIONAL", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_QUESTION_IN_WILDCARD", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_FOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_SEMICOLON_IN_TRY_RESOURCES", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_AFTER_UNARY_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_AND_IN_TYPE_PARAMETER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_ASSIGNMENT_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_AT_IN_ANNOTATION_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_BINARY_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACE_IN_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_BRACKET_IN_ARRAY_REFERENCE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ANNOTATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CAST", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CATCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_CONSTRUCTOR_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_ENUM_CONSTANT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_FOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_IF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_METHOD_INVOCATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_PARENTHESIZED_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SWITCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_SYNCHRONIZED", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_TRY", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_CLOSING_PAREN_IN_WHILE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_ASSERT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CASE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_CONDITIONAL", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_DEFAULT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_FOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COLON_IN_LABELED_STATEMENT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ALLOCATION_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ANNOTATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_PARAMETERS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_CONSTRUCTOR_DECLARATION_THROWS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_CONSTANT_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_ENUM_DECLARATIONS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_EXPLICIT_CONSTRUCTOR_CALL_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INCREMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_FOR_INITS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_PARAMETERS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_DECLARATION_THROWS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_METHOD_INVOCATION_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_FIELD_DECLARATIONS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_MULTIPLE_LOCAL_DECLARATIONS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_PARAMETERIZED_TYPE_REFERENCE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_SUPERINTERFACES", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_COMMA_IN_TYPE_PARAMETERS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_ELLIPSIS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_PARAMETERIZED_TYPE_REFERENCE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_ARGUMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETERS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANNOTATION_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ANONYMOUS_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_BLOCK", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_CONSTRUCTOR_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_CONSTANT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_ENUM_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_METHOD_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_SWITCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACE_IN_TYPE_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_ALLOCATION_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_REFERENCE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_BRACKET_IN_ARRAY_TYPE_REFERENCE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ANNOTATION_TYPE_MEMBER_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CATCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_CONSTRUCTOR_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_ENUM_CONSTANT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_FOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_IF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_METHOD_INVOCATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_PARENTHESIZED_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SWITCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_SYNCHRONIZED", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_TRY", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_OPENING_PAREN_IN_WHILE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_RETURN", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_PARENTHESIZED_EXPRESSION_IN_THROW", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_POSTFIX_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_PREFIX_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_CONDITIONAL", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_QUESTION_IN_WILDCARD", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_FOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_SEMICOLON_IN_TRY_RESOURCES", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BEFORE_UNARY_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BETWEEN_BRACKETS_IN_ARRAY_TYPE_REFERENCE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACES_IN_ARRAY_INITIALIZER", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_BRACKETS_IN_ARRAY_ALLOCATION_EXPRESSION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ANNOTATION_TYPE_MEMBER_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_CONSTRUCTOR_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_ENUM_CONSTANT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_DECLARATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_INSERT_SPACE_BETWEEN_EMPTY_PARENS_IN_METHOD_INVOCATION", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_KEEP_ELSE_STATEMENT_ON_SAME_LINE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_KEEP_EMPTY_ARRAY_INITIALIZER_ON_ONE_LINE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_KEEP_GUARDIAN_CLAUSE_ON_ONE_LINE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_KEEP_SIMPLE_IF_ON_ONE_LINE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_KEEP_THEN_STATEMENT_ON_SAME_LINE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_LINE_SPLIT", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_NUMBER_OF_EMPTY_LINES_TO_PRESERVE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_JOIN_WRAPPED_LINES", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_JOIN_LINES_IN_COMMENTS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_PUT_EMPTY_STATEMENT_ON_NEW_LINE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_TAB_CHAR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_TAB_SIZE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_USE_TABS_ONLY_FOR_LEADING_INDENTATIONS", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_WRAP_BEFORE_BINARY_OPERATOR", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_WRAP_BEFORE_OR_OPERATOR_MULTICATCH", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_WRAP_OUTER_EXPRESSIONS_WHEN_NESTED", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "int", "INDENT_BY_ONE", "=", "2", ";", "public", "static", "final", "int", "INDENT_DEFAULT", "=", "0", ";", "public", "static", "final", "int", "INDENT_ON_COLUMN", "=", "1", ";", "public", "static", "final", "String", "MIXED", "=", "\"mixed\"", ";", "public", "static", "final", "String", "NEXT_LINE", "=", "\"next_line\"", ";", "public", "static", "final", "String", "NEXT_LINE_ON_WRAP", "=", "\"\"", ";", "public", "static", "final", "String", "NEXT_LINE_SHIFTED", "=", "\"\"", ";", "public", "static", "final", "String", "TRUE", "=", "\"true\"", ";", "public", "static", "final", "int", "WRAP_COMPACT", "=", "1", ";", "public", "static", "final", "int", "WRAP_COMPACT_FIRST_BREAK", "=", "2", ";", "public", "static", "final", "int", "WRAP_NEXT_PER_LINE", "=", "5", ";", "public", "static", "final", "int", "WRAP_NEXT_SHIFTED", "=", "4", ";", "public", "static", "final", "int", "WRAP_NO_SPLIT", "=", "0", ";", "public", "static", "final", "int", "WRAP_ONE_PER_LINE", "=", "3", ";", "private", "static", "final", "IllegalArgumentException", "WRONG_ARGUMENT", "=", "new", "IllegalArgumentException", "(", ")", ";", "public", "static", "String", "createAlignmentValue", "(", "boolean", "forceSplit", ",", "int", "wrapStyle", ",", "int", "indentStyle", ")", "{", "int", "alignmentValue", "=", "0", ";", "switch", "(", "wrapStyle", ")", "{", "case", "WRAP_COMPACT", ":", "alignmentValue", "|=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "break", ";", "case", "WRAP_COMPACT_FIRST_BREAK", ":", "alignmentValue", "|=", "Alignment", ".", "M_COMPACT_FIRST_BREAK_SPLIT", ";", "break", ";", "case", "WRAP_NEXT_PER_LINE", ":", "alignmentValue", "|=", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ";", "break", ";", "case", "WRAP_NEXT_SHIFTED", ":", "alignmentValue", "|=", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ";", "break", ";", "case", "WRAP_ONE_PER_LINE", ":", "alignmentValue", "|=", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ";", "break", ";", "}", "if", "(", "forceSplit", ")", "{", "alignmentValue", "|=", "Alignment", ".", "M_FORCE", ";", "}", "switch", "(", "indentStyle", ")", "{", "case", "INDENT_BY_ONE", ":", "alignmentValue", "|=", "Alignment", ".", "M_INDENT_BY_ONE", ";", "break", ";", "case", "INDENT_ON_COLUMN", ":", "alignmentValue", "|=", "Alignment", ".", "M_INDENT_ON_COLUMN", ";", "}", "return", "String", ".", "valueOf", "(", "alignmentValue", ")", ";", "}", "public", "static", "Map", "getEclipse21Settings", "(", ")", "{", "return", "DefaultCodeFormatterOptions", ".", "getDefaultSettings", "(", ")", ".", "getMap", "(", ")", ";", "}", "public", "static", "Map", "getEclipseDefaultSettings", "(", ")", "{", "return", "DefaultCodeFormatterOptions", ".", "getEclipseDefaultSettings", "(", ")", ".", "getMap", "(", ")", ";", "}", "public", "static", "boolean", "getForceWrapping", "(", "String", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "try", "{", "int", "existingValue", "=", "Integer", ".", "parseInt", "(", "value", ")", ";", "return", "(", "existingValue", "&", "Alignment", ".", "M_FORCE", ")", "!=", "0", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "}", "public", "static", "int", "getIndentStyle", "(", "String", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "try", "{", "int", "existingValue", "=", "Integer", ".", "parseInt", "(", "value", ")", ";", "if", "(", "(", "existingValue", "&", "Alignment", ".", "M_INDENT_BY_ONE", ")", "!=", "0", ")", "{", "return", "INDENT_BY_ONE", ";", "}", "else", "if", "(", "(", "existingValue", "&", "Alignment", ".", "M_INDENT_ON_COLUMN", ")", "!=", "0", ")", "{", "return", "INDENT_ON_COLUMN", ";", "}", "else", "{", "return", "INDENT_DEFAULT", ";", "}", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "}", "public", "static", "Map", "getJavaConventionsSettings", "(", ")", "{", "return", "DefaultCodeFormatterOptions", ".", "getJavaConventionsSettings", "(", ")", ".", "getMap", "(", ")", ";", "}", "public", "static", "int", "getWrappingStyle", "(", "String", "value", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "try", "{", "int", "existingValue", "=", "Integer", ".", "parseInt", "(", "value", ")", "&", "Alignment", ".", "SPLIT_MASK", ";", "switch", "(", "existingValue", ")", "{", "case", "Alignment", ".", "M_COMPACT_SPLIT", ":", "return", "WRAP_COMPACT", ";", "case", "Alignment", ".", "M_COMPACT_FIRST_BREAK_SPLIT", ":", "return", "WRAP_COMPACT_FIRST_BREAK", ";", "case", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ":", "return", "WRAP_NEXT_PER_LINE", ";", "case", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ":", "return", "WRAP_NEXT_SHIFTED", ";", "case", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ":", "return", "WRAP_ONE_PER_LINE", ";", "default", ":", "return", "WRAP_NO_SPLIT", ";", "}", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "}", "public", "static", "String", "setForceWrapping", "(", "String", "value", ",", "boolean", "force", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "try", "{", "int", "existingValue", "=", "Integer", ".", "parseInt", "(", "value", ")", ";", "existingValue", "&=", "~", "Alignment", ".", "M_FORCE", ";", "if", "(", "force", ")", "{", "existingValue", "|=", "Alignment", ".", "M_FORCE", ";", "}", "return", "String", ".", "valueOf", "(", "existingValue", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "}", "public", "static", "String", "setIndentStyle", "(", "String", "value", ",", "int", "indentStyle", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "switch", "(", "indentStyle", ")", "{", "case", "INDENT_BY_ONE", ":", "case", "INDENT_DEFAULT", ":", "case", "INDENT_ON_COLUMN", ":", "break", ";", "default", ":", "throw", "WRONG_ARGUMENT", ";", "}", "try", "{", "int", "existingValue", "=", "Integer", ".", "parseInt", "(", "value", ")", ";", "existingValue", "&=", "~", "(", "Alignment", ".", "M_INDENT_BY_ONE", "|", "Alignment", ".", "M_INDENT_ON_COLUMN", ")", ";", "switch", "(", "indentStyle", ")", "{", "case", "INDENT_BY_ONE", ":", "existingValue", "|=", "Alignment", ".", "M_INDENT_BY_ONE", ";", "break", ";", "case", "INDENT_ON_COLUMN", ":", "existingValue", "|=", "Alignment", ".", "M_INDENT_ON_COLUMN", ";", "}", "return", "String", ".", "valueOf", "(", "existingValue", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "}", "public", "static", "String", "setWrappingStyle", "(", "String", "value", ",", "int", "wrappingStyle", ")", "{", "if", "(", "value", "==", "null", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "switch", "(", "wrappingStyle", ")", "{", "case", "WRAP_COMPACT", ":", "case", "WRAP_COMPACT_FIRST_BREAK", ":", "case", "WRAP_NEXT_PER_LINE", ":", "case", "WRAP_NEXT_SHIFTED", ":", "case", "WRAP_NO_SPLIT", ":", "case", "WRAP_ONE_PER_LINE", ":", "break", ";", "default", ":", "throw", "WRONG_ARGUMENT", ";", "}", "try", "{", "int", "existingValue", "=", "Integer", ".", "parseInt", "(", "value", ")", ";", "existingValue", "&=", "~", "(", "Alignment", ".", "SPLIT_MASK", ")", ";", "switch", "(", "wrappingStyle", ")", "{", "case", "WRAP_COMPACT", ":", "existingValue", "|=", "Alignment", ".", "M_COMPACT_SPLIT", ";", "break", ";", "case", "WRAP_COMPACT_FIRST_BREAK", ":", "existingValue", "|=", "Alignment", ".", "M_COMPACT_FIRST_BREAK_SPLIT", ";", "break", ";", "case", "WRAP_NEXT_PER_LINE", ":", "existingValue", "|=", "Alignment", ".", "M_NEXT_PER_LINE_SPLIT", ";", "break", ";", "case", "WRAP_NEXT_SHIFTED", ":", "existingValue", "|=", "Alignment", ".", "M_NEXT_SHIFTED_SPLIT", ";", "break", ";", "case", "WRAP_ONE_PER_LINE", ":", "existingValue", "|=", "Alignment", ".", "M_ONE_PER_LINE_SPLIT", ";", "break", ";", "}", "return", "String", ".", "valueOf", "(", "existingValue", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "throw", "WRONG_ARGUMENT", ";", "}", "}", "}", "</s>" ]
3,976
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ";", "import", "java", ".", "io", ".", "BufferedInputStream", ";", "import", "java", ".", "io", ".", "BufferedWriter", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "FileInputStream", ";", "import", "java", ".", "io", ".", "FileWriter", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "text", ".", "MessageFormat", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Properties", ";", "import", "org", ".", "eclipse", ".", "equinox", ".", "app", ".", "IApplication", ";", "import", "org", ".", "eclipse", ".", "equinox", ".", "app", ".", "IApplicationContext", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ToolFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadLocationException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Document", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IDocument", ";", "import", "org", ".", "eclipse", ".", "osgi", ".", "util", ".", "NLS", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "public", "class", "CodeFormatterApplication", "implements", "IApplication", "{", "private", "final", "static", "class", "Messages", "extends", "NLS", "{", "private", "static", "final", "String", "BUNDLE_NAME", "=", "\"\"", ";", "public", "static", "String", "CommandLineConfigFile", ";", "public", "static", "String", "CommandLineDone", ";", "public", "static", "String", "CommandLineErrorConfig", ";", "public", "static", "String", "CommandLineErrorFileTryFullPath", ";", "public", "static", "String", "CommandLineErrorFile", ";", "public", "static", "String", "CommandLineErrorFileDir", ";", "public", "static", "String", "CommandLineErrorQuietVerbose", ";", "public", "static", "String", "CommandLineErrorNoConfigFile", ";", "public", "static", "String", "CommandLineFormatting", ";", "public", "static", "String", "CommandLineStart", ";", "public", "static", "String", "CommandLineUsage", ";", "public", "static", "String", "ConfigFileNotFoundErrorTryFullPath", ";", "public", "static", "String", "ConfigFileReadingError", ";", "public", "static", "String", "FormatProblem", ";", "public", "static", "String", "CaughtException", ";", "public", "static", "String", "ExceptionSkip", ";", "static", "{", "NLS", ".", "initializeMessages", "(", "BUNDLE_NAME", ",", "Messages", ".", "class", ")", ";", "}", "public", "static", "String", "bind", "(", "String", "message", ")", "{", "return", "bind", "(", "message", ",", "null", ")", ";", "}", "public", "static", "String", "bind", "(", "String", "message", ",", "Object", "binding", ")", "{", "return", "bind", "(", "message", ",", "new", "Object", "[", "]", "{", "binding", "}", ")", ";", "}", "public", "static", "String", "bind", "(", "String", "message", ",", "Object", "binding1", ",", "Object", "binding2", ")", "{", "return", "bind", "(", "message", ",", "new", "Object", "[", "]", "{", "binding1", ",", "binding2", "}", ")", ";", "}", "public", "static", "String", "bind", "(", "String", "message", ",", "Object", "[", "]", "bindings", ")", "{", "return", "MessageFormat", ".", "format", "(", "message", ",", "bindings", ")", ";", "}", "}", "private", "static", "final", "String", "ARG_CONFIG", "=", "\"-config\"", ";", "private", "static", "final", "String", "ARG_HELP", "=", "\"-help\"", ";", "private", "static", "final", "String", "ARG_QUIET", "=", "\"-quiet\"", ";", "private", "static", "final", "String", "ARG_VERBOSE", "=", "\"-verbose\"", ";", "private", "String", "configName", ";", "private", "Map", "options", "=", "null", ";", "private", "static", "final", "String", "PDE_LAUNCH", "=", "\"-pdelaunch\"", ";", "private", "boolean", "quiet", "=", "false", ";", "private", "boolean", "verbose", "=", "false", ";", "private", "void", "displayHelp", "(", ")", "{", "System", ".", "out", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineUsage", ")", ")", ";", "}", "private", "void", "displayHelp", "(", "String", "message", ")", "{", "System", ".", "err", ".", "println", "(", "message", ")", ";", "System", ".", "out", ".", "println", "(", ")", ";", "displayHelp", "(", ")", ";", "}", "private", "void", "formatDirTree", "(", "File", "dir", ",", "CodeFormatter", "codeFormatter", ")", "{", "File", "[", "]", "files", "=", "dir", ".", "listFiles", "(", ")", ";", "if", "(", "files", "==", "null", ")", "return", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "files", ".", "length", ";", "i", "++", ")", "{", "File", "file", "=", "files", "[", "i", "]", ";", "if", "(", "file", ".", "isDirectory", "(", ")", ")", "{", "formatDirTree", "(", "file", ",", "codeFormatter", ")", ";", "}", "else", "if", "(", "Util", ".", "isJavaLikeFileName", "(", "file", ".", "getPath", "(", ")", ")", ")", "{", "formatFile", "(", "file", ",", "codeFormatter", ")", ";", "}", "}", "}", "private", "void", "formatFile", "(", "File", "file", ",", "CodeFormatter", "codeFormatter", ")", "{", "IDocument", "doc", "=", "new", "Document", "(", ")", ";", "try", "{", "if", "(", "this", ".", "verbose", ")", "{", "System", ".", "out", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineFormatting", ",", "file", ".", "getAbsolutePath", "(", ")", ")", ")", ";", "}", "String", "contents", "=", "new", "String", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "getFileCharContent", "(", "file", ",", "null", ")", ")", ";", "doc", ".", "set", "(", "contents", ")", ";", "TextEdit", "edit", "=", "codeFormatter", ".", "format", "(", "CodeFormatter", ".", "K_COMPILATION_UNIT", "|", "CodeFormatter", ".", "F_INCLUDE_COMMENTS", ",", "contents", ",", "0", ",", "contents", ".", "length", "(", ")", ",", "0", ",", "null", ")", ";", "if", "(", "edit", "!=", "null", ")", "{", "edit", ".", "apply", "(", "doc", ")", ";", "}", "else", "{", "System", ".", "err", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "FormatProblem", ",", "file", ".", "getAbsolutePath", "(", ")", ")", ")", ";", "return", ";", "}", "final", "BufferedWriter", "out", "=", "new", "BufferedWriter", "(", "new", "FileWriter", "(", "file", ")", ")", ";", "try", "{", "out", ".", "write", "(", "doc", ".", "get", "(", ")", ")", ";", "out", ".", "flush", "(", ")", ";", "}", "finally", "{", "try", "{", "out", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "catch", "(", "IOException", "e", ")", "{", "String", "errorMessage", "=", "Messages", ".", "bind", "(", "Messages", ".", "CaughtException", ",", "\"IOException\"", ",", "e", ".", "getLocalizedMessage", "(", ")", ")", ";", "Util", ".", "log", "(", "e", ",", "errorMessage", ")", ";", "System", ".", "err", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "ExceptionSkip", ",", "errorMessage", ")", ")", ";", "}", "catch", "(", "BadLocationException", "e", ")", "{", "String", "errorMessage", "=", "Messages", ".", "bind", "(", "Messages", ".", "CaughtException", ",", "\"\"", ",", "e", ".", "getLocalizedMessage", "(", ")", ")", ";", "Util", ".", "log", "(", "e", ",", "errorMessage", ")", ";", "System", ".", "err", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "ExceptionSkip", ",", "errorMessage", ")", ")", ";", "}", "}", "private", "File", "[", "]", "processCommandLine", "(", "String", "[", "]", "argsArray", ")", "{", "ArrayList", "args", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "argsArray", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "args", ".", "add", "(", "argsArray", "[", "i", "]", ")", ";", "}", "int", "index", "=", "0", ";", "final", "int", "argCount", "=", "argsArray", ".", "length", ";", "final", "int", "DEFAULT_MODE", "=", "0", ";", "final", "int", "CONFIG_MODE", "=", "1", ";", "int", "mode", "=", "DEFAULT_MODE", ";", "final", "int", "INITIAL_SIZE", "=", "1", ";", "int", "fileCounter", "=", "0", ";", "File", "[", "]", "filesToFormat", "=", "new", "File", "[", "INITIAL_SIZE", "]", ";", "loop", ":", "while", "(", "index", "<", "argCount", ")", "{", "String", "currentArg", "=", "argsArray", "[", "index", "++", "]", ";", "switch", "(", "mode", ")", "{", "case", "DEFAULT_MODE", ":", "if", "(", "PDE_LAUNCH", ".", "equals", "(", "currentArg", ")", ")", "{", "continue", "loop", ";", "}", "if", "(", "ARG_HELP", ".", "equals", "(", "currentArg", ")", ")", "{", "displayHelp", "(", ")", ";", "return", "null", ";", "}", "if", "(", "ARG_VERBOSE", ".", "equals", "(", "currentArg", ")", ")", "{", "this", ".", "verbose", "=", "true", ";", "continue", "loop", ";", "}", "if", "(", "ARG_QUIET", ".", "equals", "(", "currentArg", ")", ")", "{", "this", ".", "quiet", "=", "true", ";", "continue", "loop", ";", "}", "if", "(", "ARG_CONFIG", ".", "equals", "(", "currentArg", ")", ")", "{", "mode", "=", "CONFIG_MODE", ";", "continue", "loop", ";", "}", "File", "file", "=", "new", "File", "(", "currentArg", ")", ";", "if", "(", "file", ".", "exists", "(", ")", ")", "{", "if", "(", "filesToFormat", ".", "length", "==", "fileCounter", ")", "{", "System", ".", "arraycopy", "(", "filesToFormat", ",", "0", ",", "(", "filesToFormat", "=", "new", "File", "[", "fileCounter", "*", "2", "]", ")", ",", "0", ",", "fileCounter", ")", ";", "}", "filesToFormat", "[", "fileCounter", "++", "]", "=", "file", ";", "}", "else", "{", "String", "canonicalPath", ";", "try", "{", "canonicalPath", "=", "file", ".", "getCanonicalPath", "(", ")", ";", "}", "catch", "(", "IOException", "e2", ")", "{", "canonicalPath", "=", "file", ".", "getAbsolutePath", "(", ")", ";", "}", "String", "errorMsg", "=", "file", ".", "isAbsolute", "(", ")", "?", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineErrorFile", ",", "canonicalPath", ")", ":", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineErrorFileTryFullPath", ",", "canonicalPath", ")", ";", "displayHelp", "(", "errorMsg", ")", ";", "return", "null", ";", "}", "break", ";", "case", "CONFIG_MODE", ":", "this", ".", "configName", "=", "currentArg", ";", "this", ".", "options", "=", "readConfig", "(", "currentArg", ")", ";", "if", "(", "this", ".", "options", "==", "null", ")", "{", "displayHelp", "(", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineErrorConfig", ",", "currentArg", ")", ")", ";", "return", "null", ";", "}", "mode", "=", "DEFAULT_MODE", ";", "continue", "loop", ";", "}", "}", "if", "(", "mode", "==", "CONFIG_MODE", "||", "this", ".", "options", "==", "null", ")", "{", "displayHelp", "(", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineErrorNoConfigFile", ")", ")", ";", "return", "null", ";", "}", "if", "(", "this", ".", "quiet", "&&", "this", ".", "verbose", ")", "{", "displayHelp", "(", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineErrorQuietVerbose", ",", "new", "String", "[", "]", "{", "ARG_QUIET", ",", "ARG_VERBOSE", "}", ")", ")", ";", "return", "null", ";", "}", "if", "(", "fileCounter", "==", "0", ")", "{", "displayHelp", "(", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineErrorFileDir", ")", ")", ";", "return", "null", ";", "}", "if", "(", "filesToFormat", ".", "length", "!=", "fileCounter", ")", "{", "System", ".", "arraycopy", "(", "filesToFormat", ",", "0", ",", "(", "filesToFormat", "=", "new", "File", "[", "fileCounter", "]", ")", ",", "0", ",", "fileCounter", ")", ";", "}", "return", "filesToFormat", ";", "}", "private", "Properties", "readConfig", "(", "String", "filename", ")", "{", "BufferedInputStream", "stream", "=", "null", ";", "File", "configFile", "=", "new", "File", "(", "filename", ")", ";", "try", "{", "stream", "=", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "configFile", ")", ")", ";", "final", "Properties", "formatterOptions", "=", "new", "Properties", "(", ")", ";", "formatterOptions", ".", "load", "(", "stream", ")", ";", "return", "formatterOptions", ";", "}", "catch", "(", "IOException", "e", ")", "{", "String", "canonicalPath", "=", "null", ";", "try", "{", "canonicalPath", "=", "configFile", ".", "getCanonicalPath", "(", ")", ";", "}", "catch", "(", "IOException", "e2", ")", "{", "canonicalPath", "=", "configFile", ".", "getAbsolutePath", "(", ")", ";", "}", "String", "errorMessage", ";", "if", "(", "!", "configFile", ".", "exists", "(", ")", "&&", "!", "configFile", ".", "isAbsolute", "(", ")", ")", "{", "errorMessage", "=", "Messages", ".", "bind", "(", "Messages", ".", "ConfigFileNotFoundErrorTryFullPath", ",", "new", "Object", "[", "]", "{", "canonicalPath", ",", "System", ".", "getProperty", "(", "\"user.dir\"", ")", "}", ")", ";", "}", "else", "{", "errorMessage", "=", "Messages", ".", "bind", "(", "Messages", ".", "ConfigFileReadingError", ",", "canonicalPath", ")", ";", "}", "Util", ".", "log", "(", "e", ",", "errorMessage", ")", ";", "System", ".", "err", ".", "println", "(", "errorMessage", ")", ";", "}", "finally", "{", "if", "(", "stream", "!=", "null", ")", "{", "try", "{", "stream", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "return", "null", ";", "}", "public", "Object", "start", "(", "IApplicationContext", "context", ")", "throws", "Exception", "{", "File", "[", "]", "filesToFormat", "=", "processCommandLine", "(", "(", "String", "[", "]", ")", "context", ".", "getArguments", "(", ")", ".", "get", "(", "IApplicationContext", ".", "APPLICATION_ARGS", ")", ")", ";", "if", "(", "filesToFormat", "==", "null", ")", "{", "return", "IApplication", ".", "EXIT_OK", ";", "}", "if", "(", "!", "this", ".", "quiet", ")", "{", "if", "(", "this", ".", "configName", "!=", "null", ")", "{", "System", ".", "out", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineConfigFile", ",", "this", ".", "configName", ")", ")", ";", "}", "System", ".", "out", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineStart", ")", ")", ";", "}", "final", "CodeFormatter", "codeFormatter", "=", "ToolFactory", ".", "createCodeFormatter", "(", "this", ".", "options", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "filesToFormat", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "final", "File", "file", "=", "filesToFormat", "[", "i", "]", ";", "if", "(", "file", ".", "isDirectory", "(", ")", ")", "{", "formatDirTree", "(", "file", ",", "codeFormatter", ")", ";", "}", "else", "if", "(", "Util", ".", "isJavaLikeFileName", "(", "file", ".", "getPath", "(", ")", ")", ")", "{", "formatFile", "(", "file", ",", "codeFormatter", ")", ";", "}", "}", "if", "(", "!", "this", ".", "quiet", ")", "{", "System", ".", "out", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "CommandLineDone", ")", ")", ";", "}", "return", "IApplication", ".", "EXIT_OK", ";", "}", "public", "void", "stop", "(", ")", "{", "}", "}", "</s>" ]
3,977
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Arrays", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "DefaultCodeFormatterConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadLocationException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "DefaultLineTracker", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "ILineTracker", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "IRegion", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "ReplaceEdit", ";", "public", "final", "class", "IndentManipulation", "{", "private", "IndentManipulation", "(", ")", "{", "}", "public", "static", "boolean", "isIndentChar", "(", "char", "ch", ")", "{", "return", "ScannerHelper", ".", "isWhitespace", "(", "ch", ")", "&&", "!", "isLineDelimiterChar", "(", "ch", ")", ";", "}", "public", "static", "boolean", "isLineDelimiterChar", "(", "char", "ch", ")", "{", "return", "ch", "==", "'\\n'", "||", "ch", "==", "'\\r'", ";", "}", "public", "static", "int", "measureIndentUnits", "(", "CharSequence", "line", ",", "int", "tabWidth", ",", "int", "indentWidth", ")", "{", "if", "(", "indentWidth", "<", "0", "||", "tabWidth", "<", "0", "||", "line", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "if", "(", "indentWidth", "==", "0", ")", "return", "0", ";", "int", "visualLength", "=", "measureIndentInSpaces", "(", "line", ",", "tabWidth", ")", ";", "return", "visualLength", "/", "indentWidth", ";", "}", "public", "static", "int", "measureIndentInSpaces", "(", "CharSequence", "line", ",", "int", "tabWidth", ")", "{", "if", "(", "tabWidth", "<", "0", "||", "line", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "int", "length", "=", "0", ";", "int", "max", "=", "line", ".", "length", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "max", ";", "i", "++", ")", "{", "char", "ch", "=", "line", ".", "charAt", "(", "i", ")", ";", "if", "(", "ch", "==", "'\\t'", ")", "{", "length", "=", "calculateSpaceEquivalents", "(", "tabWidth", ",", "length", ")", ";", "}", "else", "if", "(", "isIndentChar", "(", "ch", ")", ")", "{", "length", "++", ";", "}", "else", "{", "return", "length", ";", "}", "}", "return", "length", ";", "}", "public", "static", "String", "extractIndentString", "(", "String", "line", ",", "int", "tabWidth", ",", "int", "indentWidth", ")", "{", "if", "(", "tabWidth", "<", "0", "||", "indentWidth", "<", "0", "||", "line", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "int", "size", "=", "line", ".", "length", "(", ")", ";", "int", "end", "=", "0", ";", "int", "spaceEquivs", "=", "0", ";", "int", "characters", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "char", "c", "=", "line", ".", "charAt", "(", "i", ")", ";", "if", "(", "c", "==", "'\\t'", ")", "{", "spaceEquivs", "=", "calculateSpaceEquivalents", "(", "tabWidth", ",", "spaceEquivs", ")", ";", "characters", "++", ";", "}", "else", "if", "(", "isIndentChar", "(", "c", ")", ")", "{", "spaceEquivs", "++", ";", "characters", "++", ";", "}", "else", "{", "break", ";", "}", "if", "(", "spaceEquivs", ">=", "indentWidth", ")", "{", "end", "+=", "characters", ";", "characters", "=", "0", ";", "if", "(", "indentWidth", "==", "0", ")", "{", "spaceEquivs", "=", "0", ";", "}", "else", "{", "spaceEquivs", "=", "spaceEquivs", "%", "indentWidth", ";", "}", "}", "}", "if", "(", "end", "==", "0", ")", "{", "return", "Util", ".", "EMPTY_STRING", ";", "}", "else", "if", "(", "end", "==", "size", ")", "{", "return", "line", ";", "}", "else", "{", "return", "line", ".", "substring", "(", "0", ",", "end", ")", ";", "}", "}", "public", "static", "String", "trimIndent", "(", "String", "line", ",", "int", "indentUnitsToRemove", ",", "int", "tabWidth", ",", "int", "indentWidth", ")", "{", "if", "(", "tabWidth", "<", "0", "||", "indentWidth", "<", "0", "||", "line", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "if", "(", "indentUnitsToRemove", "<=", "0", "||", "indentWidth", "==", "0", ")", "{", "return", "line", ";", "}", "final", "int", "spaceEquivalentsToRemove", "=", "indentUnitsToRemove", "*", "indentWidth", ";", "int", "start", "=", "0", ";", "int", "spaceEquivalents", "=", "0", ";", "int", "size", "=", "line", ".", "length", "(", ")", ";", "String", "prefix", "=", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "char", "c", "=", "line", ".", "charAt", "(", "i", ")", ";", "if", "(", "c", "==", "'\\t'", ")", "{", "spaceEquivalents", "=", "calculateSpaceEquivalents", "(", "tabWidth", ",", "spaceEquivalents", ")", ";", "}", "else", "if", "(", "isIndentChar", "(", "c", ")", ")", "{", "spaceEquivalents", "++", ";", "}", "else", "{", "start", "=", "i", ";", "break", ";", "}", "if", "(", "spaceEquivalents", "==", "spaceEquivalentsToRemove", ")", "{", "start", "=", "i", "+", "1", ";", "break", ";", "}", "if", "(", "spaceEquivalents", ">", "spaceEquivalentsToRemove", ")", "{", "start", "=", "i", "+", "1", ";", "char", "[", "]", "missing", "=", "new", "char", "[", "spaceEquivalents", "-", "spaceEquivalentsToRemove", "]", ";", "Arrays", ".", "fill", "(", "missing", ",", "'", "'", ")", ";", "prefix", "=", "new", "String", "(", "missing", ")", ";", "break", ";", "}", "}", "String", "trimmed", ";", "if", "(", "start", "==", "size", ")", "trimmed", "=", "Util", ".", "EMPTY_STRING", ";", "else", "trimmed", "=", "line", ".", "substring", "(", "start", ")", ";", "if", "(", "prefix", "==", "null", ")", "return", "trimmed", ";", "return", "prefix", "+", "trimmed", ";", "}", "public", "static", "String", "changeIndent", "(", "String", "code", ",", "int", "indentUnitsToRemove", ",", "int", "tabWidth", ",", "int", "indentWidth", ",", "String", "newIndentString", ",", "String", "lineDelim", ")", "{", "if", "(", "tabWidth", "<", "0", "||", "indentWidth", "<", "0", "||", "code", "==", "null", "||", "indentUnitsToRemove", "<", "0", "||", "newIndentString", "==", "null", "||", "lineDelim", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "try", "{", "ILineTracker", "tracker", "=", "new", "DefaultLineTracker", "(", ")", ";", "tracker", ".", "set", "(", "code", ")", ";", "int", "nLines", "=", "tracker", ".", "getNumberOfLines", "(", ")", ";", "if", "(", "nLines", "==", "1", ")", "{", "return", "code", ";", "}", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nLines", ";", "i", "++", ")", "{", "IRegion", "region", "=", "tracker", ".", "getLineInformation", "(", "i", ")", ";", "int", "start", "=", "region", ".", "getOffset", "(", ")", ";", "int", "end", "=", "start", "+", "region", ".", "getLength", "(", ")", ";", "String", "line", "=", "code", ".", "substring", "(", "start", ",", "end", ")", ";", "if", "(", "i", "==", "0", ")", "{", "buf", ".", "append", "(", "line", ")", ";", "}", "else", "{", "buf", ".", "append", "(", "lineDelim", ")", ";", "buf", ".", "append", "(", "newIndentString", ")", ";", "if", "(", "indentWidth", "!=", "0", ")", "{", "buf", ".", "append", "(", "trimIndent", "(", "line", ",", "indentUnitsToRemove", ",", "tabWidth", ",", "indentWidth", ")", ")", ";", "}", "else", "{", "buf", ".", "append", "(", "line", ")", ";", "}", "}", "}", "return", "buf", ".", "toString", "(", ")", ";", "}", "catch", "(", "BadLocationException", "e", ")", "{", "return", "code", ";", "}", "}", "public", "static", "ReplaceEdit", "[", "]", "getChangeIndentEdits", "(", "String", "source", ",", "int", "indentUnitsToRemove", ",", "int", "tabWidth", ",", "int", "indentWidth", ",", "String", "newIndentString", ")", "{", "if", "(", "tabWidth", "<", "0", "||", "indentWidth", "<", "0", "||", "source", "==", "null", "||", "indentUnitsToRemove", "<", "0", "||", "newIndentString", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "ArrayList", "result", "=", "new", "ArrayList", "(", ")", ";", "try", "{", "ILineTracker", "tracker", "=", "new", "DefaultLineTracker", "(", ")", ";", "tracker", ".", "set", "(", "source", ")", ";", "int", "nLines", "=", "tracker", ".", "getNumberOfLines", "(", ")", ";", "if", "(", "nLines", "==", "1", ")", "return", "(", "ReplaceEdit", "[", "]", ")", "result", ".", "toArray", "(", "new", "ReplaceEdit", "[", "result", ".", "size", "(", ")", "]", ")", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "nLines", ";", "i", "++", ")", "{", "IRegion", "region", "=", "tracker", ".", "getLineInformation", "(", "i", ")", ";", "int", "offset", "=", "region", ".", "getOffset", "(", ")", ";", "String", "line", "=", "source", ".", "substring", "(", "offset", ",", "offset", "+", "region", ".", "getLength", "(", ")", ")", ";", "int", "length", "=", "indexOfIndent", "(", "line", ",", "indentUnitsToRemove", ",", "tabWidth", ",", "indentWidth", ")", ";", "if", "(", "length", ">=", "0", ")", "{", "result", ".", "add", "(", "new", "ReplaceEdit", "(", "offset", ",", "length", ",", "newIndentString", ")", ")", ";", "}", "else", "{", "length", "=", "measureIndentUnits", "(", "line", ",", "tabWidth", ",", "indentWidth", ")", ";", "result", ".", "add", "(", "new", "ReplaceEdit", "(", "offset", ",", "length", ",", "\"\"", ")", ")", ";", "}", "}", "}", "catch", "(", "BadLocationException", "cannotHappen", ")", "{", "}", "return", "(", "ReplaceEdit", "[", "]", ")", "result", ".", "toArray", "(", "new", "ReplaceEdit", "[", "result", ".", "size", "(", ")", "]", ")", ";", "}", "private", "static", "int", "indexOfIndent", "(", "CharSequence", "line", ",", "int", "numberOfIndentUnits", ",", "int", "tabWidth", ",", "int", "indentWidth", ")", "{", "int", "spaceEquivalents", "=", "numberOfIndentUnits", "*", "indentWidth", ";", "int", "size", "=", "line", ".", "length", "(", ")", ";", "int", "result", "=", "-", "1", ";", "int", "blanks", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", "&&", "blanks", "<", "spaceEquivalents", ";", "i", "++", ")", "{", "char", "c", "=", "line", ".", "charAt", "(", "i", ")", ";", "if", "(", "c", "==", "'\\t'", ")", "{", "blanks", "=", "calculateSpaceEquivalents", "(", "tabWidth", ",", "blanks", ")", ";", "}", "else", "if", "(", "isIndentChar", "(", "c", ")", ")", "{", "blanks", "++", ";", "}", "else", "{", "break", ";", "}", "result", "=", "i", ";", "}", "if", "(", "blanks", "<", "spaceEquivalents", ")", "return", "-", "1", ";", "return", "result", "+", "1", ";", "}", "private", "static", "int", "calculateSpaceEquivalents", "(", "int", "tabWidth", ",", "int", "spaceEquivalents", ")", "{", "if", "(", "tabWidth", "==", "0", ")", "{", "return", "spaceEquivalents", ";", "}", "int", "remainder", "=", "spaceEquivalents", "%", "tabWidth", ";", "spaceEquivalents", "+=", "tabWidth", "-", "remainder", ";", "return", "spaceEquivalents", ";", "}", "public", "static", "int", "getTabWidth", "(", "Map", "options", ")", "{", "if", "(", "options", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "return", "getIntValue", "(", "options", ",", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_SIZE", ",", "4", ")", ";", "}", "public", "static", "int", "getIndentWidth", "(", "Map", "options", ")", "{", "if", "(", "options", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "int", "tabWidth", "=", "getTabWidth", "(", "options", ")", ";", "boolean", "isMixedMode", "=", "DefaultCodeFormatterConstants", ".", "MIXED", ".", "equals", "(", "options", ".", "get", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_TAB_CHAR", ")", ")", ";", "if", "(", "isMixedMode", ")", "{", "return", "getIntValue", "(", "options", ",", "DefaultCodeFormatterConstants", ".", "FORMATTER_INDENTATION_SIZE", ",", "tabWidth", ")", ";", "}", "return", "tabWidth", ";", "}", "private", "static", "int", "getIntValue", "(", "Map", "options", ",", "String", "key", ",", "int", "def", ")", "{", "try", "{", "return", "Integer", ".", "parseInt", "(", "(", "String", ")", "options", ".", "get", "(", "key", ")", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "return", "def", ";", "}", "}", "}", "</s>" ]
3,978
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "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", ".", "env", ".", "INameEnvironment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "public", "class", "CodeSnippetCompiler", "extends", "Compiler", "{", "EvaluationContext", "evaluationContext", ";", "int", "codeSnippetStart", ";", "int", "codeSnippetEnd", ";", "public", "CodeSnippetCompiler", "(", "INameEnvironment", "environment", ",", "IErrorHandlingPolicy", "policy", ",", "CompilerOptions", "compilerOptions", ",", "ICompilerRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ",", "EvaluationContext", "evaluationContext", ",", "int", "codeSnippetStart", ",", "int", "codeSnippetEnd", ")", "{", "super", "(", "environment", ",", "policy", ",", "compilerOptions", ",", "requestor", ",", "problemFactory", ")", ";", "this", ".", "codeSnippetStart", "=", "codeSnippetStart", ";", "this", ".", "codeSnippetEnd", "=", "codeSnippetEnd", ";", "this", ".", "evaluationContext", "=", "evaluationContext", ";", "this", ".", "parser", "=", "new", "CodeSnippetParser", "(", "this", ".", "problemReporter", ",", "evaluationContext", ",", "this", ".", "options", ".", "parseLiteralExpressionsAsConstants", ",", "codeSnippetStart", ",", "codeSnippetEnd", ")", ";", "this", ".", "parseThreshold", "=", "1", ";", "}", "public", "void", "initializeParser", "(", ")", "{", "this", ".", "parser", "=", "new", "CodeSnippetParser", "(", "this", ".", "problemReporter", ",", "this", ".", "evaluationContext", ",", "this", ".", "options", ".", "parseLiteralExpressionsAsConstants", ",", "this", ".", "codeSnippetStart", ",", "this", ".", "codeSnippetEnd", ")", ";", "}", "}", "</s>" ]
3,979
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ClassFile", ";", "public", "interface", "IRequestor", "{", "boolean", "acceptClassFiles", "(", "ClassFile", "[", "]", "classFiles", ",", "char", "[", "]", "codeSnippetClassName", ")", ";", "void", "acceptProblem", "(", "CategorizedProblem", "problem", ",", "char", "[", "]", "fragmentSource", ",", "int", "fragmentKind", ")", ";", "}", "</s>" ]
3,980
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SuperReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "InvocationSite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeBinding", ";", "public", "class", "CodeSnippetSuperReference", "extends", "SuperReference", "implements", "EvaluationConstants", ",", "InvocationSite", "{", "public", "CodeSnippetSuperReference", "(", "int", "pos", ",", "int", "sourceEnd", ")", "{", "super", "(", "pos", ",", "sourceEnd", ")", ";", "}", "public", "TypeBinding", "[", "]", "genericTypeArguments", "(", ")", "{", "return", "null", ";", "}", "public", "TypeBinding", "resolveType", "(", "BlockScope", "scope", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "cannotUseSuperInCodeSnippet", "(", "this", ".", "sourceStart", ",", "this", ".", "sourceEnd", ")", ";", "return", "null", ";", "}", "public", "boolean", "isSuperAccess", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isTypeAccess", "(", ")", "{", "return", "false", ";", "}", "public", "void", "setActualReceiverType", "(", "ReferenceBinding", "receiverType", ")", "{", "}", "public", "void", "setDepth", "(", "int", "depth", ")", "{", "}", "public", "void", "setFieldIndex", "(", "int", "index", ")", "{", "}", "}", "</s>" ]
3,981
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryAnnotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryNestedType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "CodeSnippetSkeleton", "implements", "IBinaryType", ",", "EvaluationConstants", "{", "public", "static", "class", "BinaryMethodSkeleton", "implements", "IBinaryMethod", "{", "char", "[", "]", "[", "]", "exceptionTypeNames", ";", "char", "[", "]", "methodDescriptor", ";", "char", "[", "]", "selector", ";", "boolean", "isConstructor", ";", "public", "BinaryMethodSkeleton", "(", "char", "[", "]", "selector", ",", "char", "[", "]", "methodDescriptor", ",", "char", "[", "]", "[", "]", "exceptionTypeNames", ",", "boolean", "isConstructor", ")", "{", "this", ".", "selector", "=", "selector", ";", "this", ".", "methodDescriptor", "=", "methodDescriptor", ";", "this", ".", "exceptionTypeNames", "=", "exceptionTypeNames", ";", "this", ".", "isConstructor", "=", "isConstructor", ";", "}", "public", "IBinaryAnnotation", "[", "]", "getAnnotations", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "[", "]", "getArgumentNames", "(", ")", "{", "return", "null", ";", "}", "public", "Object", "getDefaultValue", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "[", "]", "getExceptionTypeNames", "(", ")", "{", "return", "this", ".", "exceptionTypeNames", ";", "}", "public", "char", "[", "]", "getGenericSignature", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getMethodDescriptor", "(", ")", "{", "return", "this", ".", "methodDescriptor", ";", "}", "public", "int", "getModifiers", "(", ")", "{", "return", "ClassFileConstants", ".", "AccPublic", ";", "}", "public", "IBinaryAnnotation", "[", "]", "getParameterAnnotations", "(", "int", "index", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getSelector", "(", ")", "{", "return", "this", ".", "selector", ";", "}", "public", "long", "getTagBits", "(", ")", "{", "return", "0", ";", "}", "public", "boolean", "isClinit", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isConstructor", "(", ")", "{", "return", "this", ".", "isConstructor", ";", "}", "}", "IBinaryMethod", "[", "]", "methods", "=", "new", "IBinaryMethod", "[", "]", "{", "new", "BinaryMethodSkeleton", "(", "\"<init>\"", ".", "toCharArray", "(", ")", ",", "\"()V\"", ".", "toCharArray", "(", ")", ",", "new", "char", "[", "]", "[", "]", "{", "}", ",", "true", ")", ",", "new", "BinaryMethodSkeleton", "(", "\"run\"", ".", "toCharArray", "(", ")", ",", "\"()V\"", ".", "toCharArray", "(", ")", ",", "new", "char", "[", "]", "[", "]", "{", "\"\"", ".", "toCharArray", "(", ")", "}", ",", "false", ")", ",", "new", "BinaryMethodSkeleton", "(", "\"setResult\"", ".", "toCharArray", "(", ")", ",", "\"\"", ".", "toCharArray", "(", ")", ",", "new", "char", "[", "]", "[", "]", "{", "}", ",", "false", ")", "}", ";", "public", "CodeSnippetSkeleton", "(", ")", "{", "super", "(", ")", ";", "}", "public", "IBinaryAnnotation", "[", "]", "getAnnotations", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getEnclosingMethod", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getEnclosingTypeName", "(", ")", "{", "return", "null", ";", "}", "public", "IBinaryField", "[", "]", "getFields", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getFileName", "(", ")", "{", "return", "CharOperation", ".", "concat", "(", "CODE_SNIPPET_NAME", ",", "Util", ".", "defaultJavaExtension", "(", ")", ".", "toCharArray", "(", ")", ")", ";", "}", "public", "char", "[", "]", "getGenericSignature", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "[", "]", "getInterfaceNames", "(", ")", "{", "return", "null", ";", "}", "public", "String", "getJavadocContents", "(", ")", "{", "return", "null", ";", "}", "public", "String", "getJavadocContents", "(", "IProgressMonitor", "monitor", ",", "String", "defaultEncoding", ")", "throws", "JavaModelException", "{", "return", "null", ";", "}", "public", "IBinaryNestedType", "[", "]", "getMemberTypes", "(", ")", "{", "return", "null", ";", "}", "public", "IBinaryMethod", "[", "]", "getMethods", "(", ")", "{", "return", "this", ".", "methods", ";", "}", "public", "int", "getModifiers", "(", ")", "{", "return", "ClassFileConstants", ".", "AccPublic", ";", "}", "public", "char", "[", "]", "[", "]", "[", "]", "getMissingTypeNames", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getName", "(", ")", "{", "return", "CODE_SNIPPET_NAME", ";", "}", "public", "char", "[", "]", "getSourceName", "(", ")", "{", "return", "ROOT_CLASS_NAME", ";", "}", "public", "char", "[", "]", "getSuperclassName", "(", ")", "{", "return", "null", ";", "}", "public", "long", "getTagBits", "(", ")", "{", "return", "0", ";", "}", "public", "String", "getURLContents", "(", "String", "docUrlValue", ",", "String", "defaultEncoding", ")", "{", "return", "null", ";", "}", "public", "boolean", "isAnonymous", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isBinaryType", "(", ")", "{", "return", "true", ";", "}", "public", "boolean", "isLocal", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isMember", "(", ")", "{", "return", "false", ";", "}", "public", "char", "[", "]", "sourceFileName", "(", ")", "{", "return", "null", ";", "}", "}", "</s>" ]
3,982
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Assignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "BinaryExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompoundAssignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "IntLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "SingleNameReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "CodeStream", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "Opcodes", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "flow", ".", "FlowContext", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "flow", ".", "FlowInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "Constant", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Binding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ClassScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "FieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "LocalVariableBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ParameterizedFieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemFieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemReasons", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Scope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TagBits", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeIds", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "VariableBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "AbortMethod", ";", "public", "class", "CodeSnippetSingleNameReference", "extends", "SingleNameReference", "implements", "EvaluationConstants", ",", "ProblemReasons", "{", "EvaluationContext", "evaluationContext", ";", "FieldBinding", "delegateThis", ";", "public", "CodeSnippetSingleNameReference", "(", "char", "[", "]", "source", ",", "long", "pos", ",", "EvaluationContext", "evaluationContext", ")", "{", "super", "(", "source", ",", "pos", ")", ";", "this", ".", "evaluationContext", "=", "evaluationContext", ";", "}", "public", "FlowInfo", "analyseCode", "(", "BlockScope", "currentScope", ",", "FlowContext", "flowContext", ",", "FlowInfo", "flowInfo", ",", "boolean", "valueRequired", ")", "{", "switch", "(", "this", ".", "bits", "&", "RestrictiveFlagMASK", ")", "{", "case", "Binding", ".", "FIELD", ":", "FieldBinding", "fieldBinding", ";", "if", "(", "(", "fieldBinding", "=", "(", "FieldBinding", ")", "this", ".", "binding", ")", ".", "isBlankFinal", "(", ")", "&&", "currentScope", ".", "needBlankFinalFieldInitializationCheck", "(", "fieldBinding", ")", ")", "{", "FlowInfo", "fieldInits", "=", "flowContext", ".", "getInitsForFinalBlankInitializationCheck", "(", "fieldBinding", ".", "declaringClass", ".", "original", "(", ")", ",", "flowInfo", ")", ";", "if", "(", "!", "fieldInits", ".", "isDefinitelyAssigned", "(", "fieldBinding", ")", ")", "{", "currentScope", ".", "problemReporter", "(", ")", ".", "uninitializedBlankFinalField", "(", "fieldBinding", ",", "this", ")", ";", "}", "}", "break", ";", "case", "Binding", ".", "LOCAL", ":", "LocalVariableBinding", "localBinding", ";", "if", "(", "!", "flowInfo", ".", "isDefinitelyAssigned", "(", "localBinding", "=", "(", "LocalVariableBinding", ")", "this", ".", "binding", ")", ")", "{", "currentScope", ".", "problemReporter", "(", ")", ".", "uninitializedLocalVariable", "(", "localBinding", ",", "this", ")", ";", "}", "if", "(", "(", "flowInfo", ".", "tagBits", "&", "FlowInfo", ".", "UNREACHABLE", ")", "==", "0", ")", "{", "localBinding", ".", "useFlag", "=", "LocalVariableBinding", ".", "USED", ";", "}", "else", "if", "(", "localBinding", ".", "useFlag", "==", "LocalVariableBinding", ".", "UNUSED", ")", "{", "localBinding", ".", "useFlag", "=", "LocalVariableBinding", ".", "FAKE_USED", ";", "}", "}", "return", "flowInfo", ";", "}", "public", "TypeBinding", "checkFieldAccess", "(", "BlockScope", "scope", ")", "{", "if", "(", "this", ".", "delegateThis", "==", "null", ")", "{", "return", "super", ".", "checkFieldAccess", "(", "scope", ")", ";", "}", "FieldBinding", "fieldBinding", "=", "(", "FieldBinding", ")", "this", ".", "binding", ";", "this", ".", "bits", "&=", "~", "RestrictiveFlagMASK", ";", "this", ".", "bits", "|=", "Binding", ".", "FIELD", ";", "if", "(", "!", "fieldBinding", ".", "isStatic", "(", ")", ")", "{", "if", "(", "this", ".", "evaluationContext", ".", "isStatic", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "staticFieldAccessToNonStaticVariable", "(", "this", ",", "fieldBinding", ")", ";", "this", ".", "constant", "=", "Constant", ".", "NotAConstant", ";", "return", "null", ";", "}", "}", "this", ".", "constant", "=", "fieldBinding", ".", "constant", "(", ")", ";", "if", "(", "isFieldUseDeprecated", "(", "fieldBinding", ",", "scope", ",", "this", ".", "bits", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "deprecatedField", "(", "fieldBinding", ",", "this", ")", ";", "}", "return", "fieldBinding", ".", "type", ";", "}", "public", "void", "generateAssignment", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "Assignment", "assignment", ",", "boolean", "valueRequired", ")", "{", "if", "(", "assignment", ".", "expression", ".", "isCompactableOperation", "(", ")", ")", "{", "BinaryExpression", "operation", "=", "(", "BinaryExpression", ")", "assignment", ".", "expression", ";", "int", "operator", "=", "(", "operation", ".", "bits", "&", "OperatorMASK", ")", ">>", "OperatorSHIFT", ";", "SingleNameReference", "variableReference", ";", "if", "(", "(", "operation", ".", "left", "instanceof", "SingleNameReference", ")", "&&", "(", "(", "variableReference", "=", "(", "SingleNameReference", ")", "operation", ".", "left", ")", ".", "binding", "==", "this", ".", "binding", ")", ")", "{", "variableReference", ".", "generateCompoundAssignment", "(", "currentScope", ",", "codeStream", ",", "this", ".", "syntheticAccessors", "==", "null", "?", "null", ":", "this", ".", "syntheticAccessors", "[", "WRITE", "]", ",", "operation", ".", "right", ",", "operator", ",", "operation", ".", "implicitConversion", ",", "valueRequired", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateImplicitConversion", "(", "assignment", ".", "implicitConversion", ")", ";", "}", "return", ";", "}", "if", "(", "(", "operation", ".", "right", "instanceof", "SingleNameReference", ")", "&&", "(", "(", "operator", "==", "PLUS", ")", "||", "(", "operator", "==", "MULTIPLY", ")", ")", "&&", "(", "(", "variableReference", "=", "(", "SingleNameReference", ")", "operation", ".", "right", ")", ".", "binding", "==", "this", ".", "binding", ")", "&&", "(", "operation", ".", "left", ".", "constant", "!=", "Constant", ".", "NotAConstant", ")", "&&", "(", "(", "(", "operation", ".", "left", ".", "implicitConversion", "&", "IMPLICIT_CONVERSION_MASK", ")", ">>", "4", ")", "!=", "T_JavaLangString", ")", "&&", "(", "(", "(", "operation", ".", "right", ".", "implicitConversion", "&", "IMPLICIT_CONVERSION_MASK", ")", ">>", "4", ")", "!=", "T_JavaLangString", ")", ")", "{", "variableReference", ".", "generateCompoundAssignment", "(", "currentScope", ",", "codeStream", ",", "this", ".", "syntheticAccessors", "==", "null", "?", "null", ":", "this", ".", "syntheticAccessors", "[", "WRITE", "]", ",", "operation", ".", "left", ",", "operator", ",", "operation", ".", "implicitConversion", ",", "valueRequired", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateImplicitConversion", "(", "assignment", ".", "implicitConversion", ")", ";", "}", "return", ";", "}", "}", "switch", "(", "this", ".", "bits", "&", "RestrictiveFlagMASK", ")", "{", "case", "Binding", ".", "FIELD", ":", "FieldBinding", "codegenField", "=", "(", "(", "FieldBinding", ")", "this", ".", "binding", ")", ".", "original", "(", ")", ";", "if", "(", "codegenField", ".", "canBeSeenBy", "(", "getReceiverType", "(", "currentScope", ")", ",", "this", ",", "currentScope", ")", ")", "{", "if", "(", "!", "codegenField", ".", "isStatic", "(", ")", ")", "{", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "ReferenceBinding", "targetType", "=", "currentScope", ".", "enclosingSourceType", "(", ")", ".", "enclosingTypeAt", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", ">>", "DepthSHIFT", ")", ";", "Object", "[", "]", "emulationPath", "=", "currentScope", ".", "getEmulationPath", "(", "targetType", ",", "true", ",", "false", ")", ";", "codeStream", ".", "generateOuterAccess", "(", "emulationPath", ",", "this", ",", "targetType", ",", "currentScope", ")", ";", "}", "else", "{", "generateReceiver", "(", "codeStream", ")", ";", "}", "}", "assignment", ".", "expression", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "true", ")", ";", "fieldStore", "(", "currentScope", ",", "codeStream", ",", "codegenField", ",", "null", ",", "this", ".", "actualReceiverType", ",", "this", ".", "delegateThis", "==", "null", ",", "valueRequired", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateImplicitConversion", "(", "assignment", ".", "implicitConversion", ")", ";", "}", "}", "else", "{", "codeStream", ".", "generateEmulationForField", "(", "codegenField", ")", ";", "if", "(", "!", "codegenField", ".", "isStatic", "(", ")", ")", "{", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "currentScope", ".", "problemReporter", "(", ")", ".", "needImplementation", "(", "this", ")", ";", "}", "else", "{", "generateReceiver", "(", "codeStream", ")", ";", "}", "}", "else", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "}", "assignment", ".", "expression", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "true", ")", ";", "if", "(", "valueRequired", ")", "{", "if", "(", "(", "codegenField", ".", "type", "==", "TypeBinding", ".", "LONG", ")", "||", "(", "codegenField", ".", "type", "==", "TypeBinding", ".", "DOUBLE", ")", ")", "{", "codeStream", ".", "dup2_x2", "(", ")", ";", "}", "else", "{", "codeStream", ".", "dup_x2", "(", ")", ";", "}", "}", "codeStream", ".", "generateEmulatedWriteAccessForField", "(", "codegenField", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateImplicitConversion", "(", "assignment", ".", "implicitConversion", ")", ";", "}", "}", "return", ";", "case", "Binding", ".", "LOCAL", ":", "LocalVariableBinding", "localBinding", "=", "(", "LocalVariableBinding", ")", "this", ".", "binding", ";", "if", "(", "localBinding", ".", "resolvedPosition", "!=", "-", "1", ")", "{", "assignment", ".", "expression", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "true", ")", ";", "}", "else", "{", "if", "(", "assignment", ".", "expression", ".", "constant", "!=", "Constant", ".", "NotAConstant", ")", "{", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateConstant", "(", "assignment", ".", "expression", ".", "constant", ",", "assignment", ".", "implicitConversion", ")", ";", "}", "}", "else", "{", "assignment", ".", "expression", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "true", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateImplicitConversion", "(", "assignment", ".", "implicitConversion", ")", ";", "}", "else", "{", "if", "(", "(", "localBinding", ".", "type", "==", "TypeBinding", ".", "LONG", ")", "||", "(", "localBinding", ".", "type", "==", "TypeBinding", ".", "DOUBLE", ")", ")", "{", "codeStream", ".", "pop2", "(", ")", ";", "}", "else", "{", "codeStream", ".", "pop", "(", ")", ";", "}", "}", "}", "return", ";", "}", "codeStream", ".", "store", "(", "localBinding", ",", "valueRequired", ")", ";", "if", "(", "(", "this", ".", "bits", "&", "FirstAssignmentToLocal", ")", "!=", "0", ")", "{", "localBinding", ".", "recordInitializationStartPC", "(", "codeStream", ".", "position", ")", ";", "}", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateImplicitConversion", "(", "assignment", ".", "implicitConversion", ")", ";", "}", "}", "}", "public", "void", "generateCode", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "boolean", "valueRequired", ")", "{", "int", "pc", "=", "codeStream", ".", "position", ";", "if", "(", "this", ".", "constant", "!=", "Constant", ".", "NotAConstant", ")", "{", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateConstant", "(", "this", ".", "constant", ",", "this", ".", "implicitConversion", ")", ";", "}", "}", "else", "{", "switch", "(", "this", ".", "bits", "&", "RestrictiveFlagMASK", ")", "{", "case", "Binding", ".", "FIELD", ":", "if", "(", "!", "valueRequired", ")", "break", ";", "FieldBinding", "codegenField", "=", "(", "(", "FieldBinding", ")", "this", ".", "binding", ")", ".", "original", "(", ")", ";", "Constant", "fieldConstant", "=", "codegenField", ".", "constant", "(", ")", ";", "if", "(", "fieldConstant", "==", "Constant", ".", "NotAConstant", ")", "{", "if", "(", "codegenField", ".", "canBeSeenBy", "(", "getReceiverType", "(", "currentScope", ")", ",", "this", ",", "currentScope", ")", ")", "{", "TypeBinding", "someReceiverType", "=", "this", ".", "delegateThis", "!=", "null", "?", "this", ".", "delegateThis", ".", "type", ":", "this", ".", "actualReceiverType", ";", "TypeBinding", "constantPoolDeclaringClass", "=", "CodeStream", ".", "getConstantPoolDeclaringClass", "(", "currentScope", ",", "codegenField", ",", "someReceiverType", ",", "true", ")", ";", "if", "(", "codegenField", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "fieldAccess", "(", "Opcodes", ".", "OPC_getstatic", ",", "codegenField", ",", "constantPoolDeclaringClass", ")", ";", "}", "else", "{", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "ReferenceBinding", "targetType", "=", "currentScope", ".", "enclosingSourceType", "(", ")", ".", "enclosingTypeAt", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", ">>", "DepthSHIFT", ")", ";", "Object", "[", "]", "emulationPath", "=", "currentScope", ".", "getEmulationPath", "(", "targetType", ",", "true", ",", "false", ")", ";", "codeStream", ".", "generateOuterAccess", "(", "emulationPath", ",", "this", ",", "targetType", ",", "currentScope", ")", ";", "}", "else", "{", "generateReceiver", "(", "codeStream", ")", ";", "}", "codeStream", ".", "fieldAccess", "(", "Opcodes", ".", "OPC_getfield", ",", "codegenField", ",", "constantPoolDeclaringClass", ")", ";", "}", "}", "else", "{", "if", "(", "!", "codegenField", ".", "isStatic", "(", ")", ")", "{", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "currentScope", ".", "problemReporter", "(", ")", ".", "needImplementation", "(", "this", ")", ";", "}", "else", "{", "generateReceiver", "(", "codeStream", ")", ";", "}", "}", "else", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "}", "codeStream", ".", "generateEmulatedReadAccessForField", "(", "codegenField", ")", ";", "}", "if", "(", "this", ".", "genericCast", "!=", "null", ")", "codeStream", ".", "checkcast", "(", "this", ".", "genericCast", ")", ";", "codeStream", ".", "generateImplicitConversion", "(", "this", ".", "implicitConversion", ")", ";", "}", "else", "{", "codeStream", ".", "generateConstant", "(", "fieldConstant", ",", "this", ".", "implicitConversion", ")", ";", "}", "break", ";", "case", "Binding", ".", "LOCAL", ":", "LocalVariableBinding", "localBinding", "=", "(", "LocalVariableBinding", ")", "this", ".", "binding", ";", "if", "(", "localBinding", ".", "resolvedPosition", "==", "-", "1", ")", "{", "if", "(", "valueRequired", ")", "{", "localBinding", ".", "useFlag", "=", "LocalVariableBinding", ".", "USED", ";", "throw", "new", "AbortMethod", "(", "CodeStream", ".", "RESTART_CODE_GEN_FOR_UNUSED_LOCALS_MODE", ",", "null", ")", ";", "}", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "this", ".", "sourceStart", ")", ";", "return", ";", "}", "if", "(", "!", "valueRequired", ")", "break", ";", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "VariableBinding", "[", "]", "path", "=", "currentScope", ".", "getEmulationPath", "(", "localBinding", ")", ";", "codeStream", ".", "generateOuterAccess", "(", "path", ",", "this", ",", "localBinding", ",", "currentScope", ")", ";", "}", "else", "{", "codeStream", ".", "load", "(", "localBinding", ")", ";", "}", "codeStream", ".", "generateImplicitConversion", "(", "this", ".", "implicitConversion", ")", ";", "break", ";", "}", "}", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "this", ".", "sourceStart", ")", ";", "}", "public", "void", "generateCompoundAssignment", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "MethodBinding", "writeAccessor", ",", "Expression", "expression", ",", "int", "operator", ",", "int", "assignmentImplicitConversion", ",", "boolean", "valueRequired", ")", "{", "switch", "(", "this", ".", "bits", "&", "RestrictiveFlagMASK", ")", "{", "case", "Binding", ".", "FIELD", ":", "FieldBinding", "codegenField", "=", "(", "(", "FieldBinding", ")", "this", ".", "binding", ")", ".", "original", "(", ")", ";", "if", "(", "codegenField", ".", "isStatic", "(", ")", ")", "{", "if", "(", "codegenField", ".", "canBeSeenBy", "(", "getReceiverType", "(", "currentScope", ")", ",", "this", ",", "currentScope", ")", ")", "{", "TypeBinding", "someReceiverType", "=", "this", ".", "delegateThis", "!=", "null", "?", "this", ".", "delegateThis", ".", "type", ":", "this", ".", "actualReceiverType", ";", "TypeBinding", "constantPoolDeclaringClass", "=", "CodeStream", ".", "getConstantPoolDeclaringClass", "(", "currentScope", ",", "codegenField", ",", "someReceiverType", ",", "true", ")", ";", "codeStream", ".", "fieldAccess", "(", "Opcodes", ".", "OPC_getstatic", ",", "codegenField", ",", "constantPoolDeclaringClass", ")", ";", "}", "else", "{", "codeStream", ".", "generateEmulationForField", "(", "codegenField", ")", ";", "codeStream", ".", "aconst_null", "(", ")", ";", "codeStream", ".", "aconst_null", "(", ")", ";", "codeStream", ".", "generateEmulatedReadAccessForField", "(", "codegenField", ")", ";", "}", "}", "else", "{", "if", "(", "codegenField", ".", "canBeSeenBy", "(", "getReceiverType", "(", "currentScope", ")", ",", "this", ",", "currentScope", ")", ")", "{", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "ReferenceBinding", "targetType", "=", "currentScope", ".", "enclosingSourceType", "(", ")", ".", "enclosingTypeAt", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", ">>", "DepthSHIFT", ")", ";", "Object", "[", "]", "emulationPath", "=", "currentScope", ".", "getEmulationPath", "(", "targetType", ",", "true", ",", "false", ")", ";", "codeStream", ".", "generateOuterAccess", "(", "emulationPath", ",", "this", ",", "targetType", ",", "currentScope", ")", ";", "}", "else", "{", "generateReceiver", "(", "codeStream", ")", ";", "}", "codeStream", ".", "dup", "(", ")", ";", "TypeBinding", "someReceiverType", "=", "this", ".", "delegateThis", "!=", "null", "?", "this", ".", "delegateThis", ".", "type", ":", "this", ".", "actualReceiverType", ";", "TypeBinding", "constantPoolDeclaringClass", "=", "CodeStream", ".", "getConstantPoolDeclaringClass", "(", "currentScope", ",", "codegenField", ",", "someReceiverType", ",", "true", ")", ";", "codeStream", ".", "fieldAccess", "(", "Opcodes", ".", "OPC_getfield", ",", "codegenField", ",", "constantPoolDeclaringClass", ")", ";", "}", "else", "{", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "currentScope", ".", "problemReporter", "(", ")", ".", "needImplementation", "(", "this", ")", ";", "}", "codeStream", ".", "generateEmulationForField", "(", "codegenField", ")", ";", "generateReceiver", "(", "codeStream", ")", ";", "codeStream", ".", "dup", "(", ")", ";", "codeStream", ".", "generateEmulatedReadAccessForField", "(", "codegenField", ")", ";", "}", "}", "break", ";", "case", "Binding", ".", "LOCAL", ":", "LocalVariableBinding", "localBinding", "=", "(", "LocalVariableBinding", ")", "this", ".", "binding", ";", "Constant", "assignConstant", ";", "switch", "(", "localBinding", ".", "type", ".", "id", ")", "{", "case", "T_JavaLangString", ":", "codeStream", ".", "generateStringConcatenationAppend", "(", "currentScope", ",", "this", ",", "expression", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "dup", "(", ")", ";", "}", "codeStream", ".", "store", "(", "localBinding", ",", "false", ")", ";", "return", ";", "case", "T_int", ":", "assignConstant", "=", "expression", ".", "constant", ";", "if", "(", "localBinding", ".", "resolvedPosition", "==", "-", "1", ")", "{", "if", "(", "valueRequired", ")", "{", "localBinding", ".", "useFlag", "=", "LocalVariableBinding", ".", "USED", ";", "throw", "new", "AbortMethod", "(", "CodeStream", ".", "RESTART_CODE_GEN_FOR_UNUSED_LOCALS_MODE", ",", "null", ")", ";", "}", "else", "if", "(", "assignConstant", "==", "Constant", ".", "NotAConstant", ")", "{", "expression", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "false", ")", ";", "}", "return", ";", "}", "if", "(", "(", "assignConstant", "!=", "Constant", ".", "NotAConstant", ")", "&&", "(", "assignConstant", ".", "typeID", "(", ")", "!=", "TypeIds", ".", "T_float", ")", "&&", "(", "assignConstant", ".", "typeID", "(", ")", "!=", "TypeIds", ".", "T_double", ")", ")", "{", "switch", "(", "operator", ")", "{", "case", "PLUS", ":", "int", "increment", "=", "assignConstant", ".", "intValue", "(", ")", ";", "if", "(", "increment", "!=", "(", "short", ")", "increment", ")", "break", ";", "codeStream", ".", "iinc", "(", "localBinding", ".", "resolvedPosition", ",", "increment", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "load", "(", "localBinding", ")", ";", "}", "return", ";", "case", "MINUS", ":", "increment", "=", "-", "assignConstant", ".", "intValue", "(", ")", ";", "if", "(", "increment", "!=", "(", "short", ")", "increment", ")", "break", ";", "codeStream", ".", "iinc", "(", "localBinding", ".", "resolvedPosition", ",", "increment", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "load", "(", "localBinding", ")", ";", "}", "return", ";", "}", "}", "default", ":", "if", "(", "localBinding", ".", "resolvedPosition", "==", "-", "1", ")", "{", "assignConstant", "=", "expression", ".", "constant", ";", "if", "(", "valueRequired", ")", "{", "localBinding", ".", "useFlag", "=", "LocalVariableBinding", ".", "USED", ";", "throw", "new", "AbortMethod", "(", "CodeStream", ".", "RESTART_CODE_GEN_FOR_UNUSED_LOCALS_MODE", ",", "null", ")", ";", "}", "else", "if", "(", "assignConstant", "==", "Constant", ".", "NotAConstant", ")", "{", "expression", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "false", ")", ";", "}", "return", ";", "}", "codeStream", ".", "load", "(", "localBinding", ")", ";", "}", "}", "int", "operationTypeID", ";", "switch", "(", "operationTypeID", "=", "(", "this", ".", "implicitConversion", "&", "IMPLICIT_CONVERSION_MASK", ")", ">>", "4", ")", "{", "case", "T_JavaLangString", ":", "case", "T_JavaLangObject", ":", "case", "T_undefined", ":", "codeStream", ".", "generateStringConcatenationAppend", "(", "currentScope", ",", "null", ",", "expression", ")", ";", "break", ";", "default", ":", "codeStream", ".", "generateImplicitConversion", "(", "this", ".", "implicitConversion", ")", ";", "if", "(", "expression", "==", "IntLiteral", ".", "One", ")", "{", "codeStream", ".", "generateConstant", "(", "expression", ".", "constant", ",", "this", ".", "implicitConversion", ")", ";", "}", "else", "{", "expression", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "true", ")", ";", "}", "codeStream", ".", "sendOperator", "(", "operator", ",", "operationTypeID", ")", ";", "codeStream", ".", "generateImplicitConversion", "(", "assignmentImplicitConversion", ")", ";", "}", "switch", "(", "this", ".", "bits", "&", "RestrictiveFlagMASK", ")", "{", "case", "Binding", ".", "FIELD", ":", "FieldBinding", "codegenField", "=", "(", "(", "FieldBinding", ")", "this", ".", "binding", ")", ".", "original", "(", ")", ";", "if", "(", "codegenField", ".", "canBeSeenBy", "(", "getReceiverType", "(", "currentScope", ")", ",", "this", ",", "currentScope", ")", ")", "{", "fieldStore", "(", "currentScope", ",", "codeStream", ",", "codegenField", ",", "writeAccessor", ",", "this", ".", "actualReceiverType", ",", "this", ".", "delegateThis", "==", "null", ",", "valueRequired", ")", ";", "}", "else", "{", "if", "(", "valueRequired", ")", "{", "switch", "(", "codegenField", ".", "type", ".", "id", ")", "{", "case", "TypeIds", ".", "T_long", ":", "case", "TypeIds", ".", "T_double", ":", "codeStream", ".", "dup2_x2", "(", ")", ";", "break", ";", "default", ":", "codeStream", ".", "dup_x2", "(", ")", ";", "break", ";", "}", "}", "codeStream", ".", "generateEmulatedWriteAccessForField", "(", "codegenField", ")", ";", "}", "return", ";", "case", "Binding", ".", "LOCAL", ":", "LocalVariableBinding", "localBinding", "=", "(", "LocalVariableBinding", ")", "this", ".", "binding", ";", "if", "(", "valueRequired", ")", "{", "switch", "(", "localBinding", ".", "type", ".", "id", ")", "{", "case", "TypeIds", ".", "T_long", ":", "case", "TypeIds", ".", "T_double", ":", "codeStream", ".", "dup2", "(", ")", ";", "break", ";", "default", ":", "codeStream", ".", "dup", "(", ")", ";", "break", ";", "}", "}", "codeStream", ".", "store", "(", "localBinding", ",", "false", ")", ";", "}", "}", "public", "void", "generatePostIncrement", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "CompoundAssignment", "postIncrement", ",", "boolean", "valueRequired", ")", "{", "switch", "(", "this", ".", "bits", "&", "RestrictiveFlagMASK", ")", "{", "case", "Binding", ".", "FIELD", ":", "FieldBinding", "codegenField", "=", "(", "(", "FieldBinding", ")", "this", ".", "binding", ")", ".", "original", "(", ")", ";", "if", "(", "codegenField", ".", "canBeSeenBy", "(", "getReceiverType", "(", "currentScope", ")", ",", "this", ",", "currentScope", ")", ")", "{", "super", ".", "generatePostIncrement", "(", "currentScope", ",", "codeStream", ",", "postIncrement", ",", "valueRequired", ")", ";", "}", "else", "{", "if", "(", "codegenField", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "}", "else", "{", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "currentScope", ".", "problemReporter", "(", ")", ".", "needImplementation", "(", "this", ")", ";", "}", "else", "{", "generateReceiver", "(", "codeStream", ")", ";", "}", "}", "codeStream", ".", "generateEmulatedReadAccessForField", "(", "codegenField", ")", ";", "if", "(", "valueRequired", ")", "{", "switch", "(", "codegenField", ".", "type", ".", "id", ")", "{", "case", "TypeIds", ".", "T_long", ":", "case", "TypeIds", ".", "T_double", ":", "codeStream", ".", "dup2", "(", ")", ";", "break", ";", "default", ":", "codeStream", ".", "dup", "(", ")", ";", "break", ";", "}", "}", "codeStream", ".", "generateEmulationForField", "(", "codegenField", ")", ";", "switch", "(", "codegenField", ".", "type", ".", "id", ")", "{", "case", "TypeIds", ".", "T_long", ":", "case", "TypeIds", ".", "T_double", ":", "codeStream", ".", "dup_x2", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "if", "(", "codegenField", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "}", "else", "{", "generateReceiver", "(", "codeStream", ")", ";", "}", "codeStream", ".", "dup_x2", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "break", ";", "default", ":", "codeStream", ".", "dup_x1", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "if", "(", "codegenField", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "}", "else", "{", "generateReceiver", "(", "codeStream", ")", ";", "}", "codeStream", ".", "dup_x1", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "break", ";", "}", "codeStream", ".", "generateConstant", "(", "postIncrement", ".", "expression", ".", "constant", ",", "this", ".", "implicitConversion", ")", ";", "codeStream", ".", "sendOperator", "(", "postIncrement", ".", "operator", ",", "codegenField", ".", "type", ".", "id", ")", ";", "codeStream", ".", "generateImplicitConversion", "(", "postIncrement", ".", "preAssignImplicitConversion", ")", ";", "codeStream", ".", "generateEmulatedWriteAccessForField", "(", "codegenField", ")", ";", "}", "return", ";", "case", "Binding", ".", "LOCAL", ":", "super", ".", "generatePostIncrement", "(", "currentScope", ",", "codeStream", ",", "postIncrement", ",", "valueRequired", ")", ";", "}", "}", "public", "void", "generateReceiver", "(", "CodeStream", "codeStream", ")", "{", "codeStream", ".", "aload_0", "(", ")", ";", "if", "(", "this", ".", "delegateThis", "!=", "null", ")", "{", "codeStream", ".", "fieldAccess", "(", "Opcodes", ".", "OPC_getfield", ",", "this", ".", "delegateThis", ",", "null", ")", ";", "}", "}", "public", "TypeBinding", "getReceiverType", "(", "BlockScope", "currentScope", ")", "{", "Scope", "scope", "=", "currentScope", ".", "parent", ";", "while", "(", "true", ")", "{", "switch", "(", "scope", ".", "kind", ")", "{", "case", "Scope", ".", "CLASS_SCOPE", ":", "return", "(", "(", "ClassScope", ")", "scope", ")", ".", "referenceContext", ".", "binding", ";", "default", ":", "scope", "=", "scope", ".", "parent", ";", "}", "}", "}", "public", "void", "manageSyntheticAccessIfNecessary", "(", "BlockScope", "currentScope", ",", "FlowInfo", "flowInfo", ",", "boolean", "isReadAccess", ")", "{", "if", "(", "this", ".", "delegateThis", "==", "null", ")", "{", "super", ".", "manageSyntheticAccessIfNecessary", "(", "currentScope", ",", "flowInfo", ",", "isReadAccess", ")", ";", "return", ";", "}", "if", "(", "(", "flowInfo", ".", "tagBits", "&", "FlowInfo", ".", "UNREACHABLE_OR_DEAD", ")", "!=", "0", ")", "return", ";", "if", "(", "this", ".", "constant", "!=", "Constant", ".", "NotAConstant", ")", "return", ";", "if", "(", "this", ".", "binding", "instanceof", "ParameterizedFieldBinding", ")", "{", "ParameterizedFieldBinding", "parameterizedField", "=", "(", "ParameterizedFieldBinding", ")", "this", ".", "binding", ";", "FieldBinding", "codegenField", "=", "parameterizedField", ".", "originalField", ";", "if", "(", "(", "codegenField", ".", "type", ".", "tagBits", "&", "TagBits", ".", "HasTypeVariable", ")", "!=", "0", ")", "{", "this", ".", "genericCast", "=", "codegenField", ".", "type", ".", "genericCast", "(", "currentScope", ".", "boxing", "(", "parameterizedField", ".", "type", ")", ")", ";", "}", "}", "}", "public", "TypeBinding", "reportError", "(", "BlockScope", "scope", ")", "{", "this", ".", "constant", "=", "Constant", ".", "NotAConstant", ";", "if", "(", "this", ".", "binding", "instanceof", "ProblemFieldBinding", "&&", "(", "(", "ProblemFieldBinding", ")", "this", ".", "binding", ")", ".", "problemId", "(", ")", "==", "NotFound", ")", "{", "if", "(", "this", ".", "evaluationContext", ".", "declaringTypeName", "!=", "null", ")", "{", "this", ".", "delegateThis", "=", "scope", ".", "getField", "(", "scope", ".", "enclosingSourceType", "(", ")", ",", "DELEGATE_THIS", ",", "this", ")", ";", "if", "(", "this", ".", "delegateThis", "!=", "null", ")", "{", "this", ".", "actualReceiverType", "=", "this", ".", "delegateThis", ".", "type", ";", "this", ".", "binding", "=", "scope", ".", "getField", "(", "this", ".", "delegateThis", ".", "type", ",", "this", ".", "token", ",", "this", ")", ";", "if", "(", "!", "this", ".", "binding", ".", "isValidBinding", "(", ")", ")", "{", "return", "super", ".", "reportError", "(", "scope", ")", ";", "}", "return", "checkFieldAccess", "(", "scope", ")", ";", "}", "}", "}", "if", "(", "this", ".", "binding", "instanceof", "ProblemBinding", "&&", "(", "(", "ProblemBinding", ")", "this", ".", "binding", ")", ".", "problemId", "(", ")", "==", "NotFound", ")", "{", "if", "(", "this", ".", "evaluationContext", ".", "declaringTypeName", "!=", "null", ")", "{", "this", ".", "delegateThis", "=", "scope", ".", "getField", "(", "scope", ".", "enclosingSourceType", "(", ")", ",", "DELEGATE_THIS", ",", "this", ")", ";", "if", "(", "this", ".", "delegateThis", "!=", "null", ")", "{", "this", ".", "actualReceiverType", "=", "this", ".", "delegateThis", ".", "type", ";", "FieldBinding", "fieldBinding", "=", "scope", ".", "getField", "(", "this", ".", "delegateThis", ".", "type", ",", "this", ".", "token", ",", "this", ")", ";", "if", "(", "!", "fieldBinding", ".", "isValidBinding", "(", ")", ")", "{", "if", "(", "(", "(", "ProblemFieldBinding", ")", "fieldBinding", ")", ".", "problemId", "(", ")", "==", "NotVisible", ")", "{", "CodeSnippetScope", "localScope", "=", "new", "CodeSnippetScope", "(", "scope", ")", ";", "this", ".", "binding", "=", "localScope", ".", "getFieldForCodeSnippet", "(", "this", ".", "delegateThis", ".", "type", ",", "this", ".", "token", ",", "this", ")", ";", "return", "checkFieldAccess", "(", "scope", ")", ";", "}", "else", "{", "return", "super", ".", "reportError", "(", "scope", ")", ";", "}", "}", "this", ".", "binding", "=", "fieldBinding", ";", "return", "checkFieldAccess", "(", "scope", ")", ";", "}", "}", "}", "return", "super", ".", "reportError", "(", "scope", ")", ";", "}", "}", "</s>" ]
3,983
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "Compiler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ICompilerRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "IProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFormatException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "INameEnvironment", ";", "public", "class", "VariablesEvaluator", "extends", "Evaluator", "implements", "EvaluationConstants", "{", "VariablesEvaluator", "(", "EvaluationContext", "context", ",", "INameEnvironment", "environment", ",", "Map", "options", ",", "IRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ")", "{", "super", "(", "context", ",", "environment", ",", "options", ",", "requestor", ",", "problemFactory", ")", ";", "}", "protected", "void", "addEvaluationResultForCompilationProblem", "(", "Map", "resultsByIDs", ",", "CategorizedProblem", "problem", ",", "char", "[", "]", "cuSource", ")", "{", "char", "[", "]", "evaluationID", "=", "cuSource", ";", "int", "evaluationType", "=", "EvaluationResult", ".", "T_INTERNAL", ";", "int", "pbLine", "=", "problem", ".", "getSourceLineNumber", "(", ")", ";", "int", "currentLine", "=", "1", ";", "char", "[", "]", "packageName", "=", "getPackageName", "(", ")", ";", "if", "(", "packageName", ".", "length", ">", "0", ")", "{", "if", "(", "pbLine", "==", "1", ")", "{", "evaluationID", "=", "packageName", ";", "evaluationType", "=", "EvaluationResult", ".", "T_PACKAGE", ";", "problem", ".", "setSourceLineNumber", "(", "1", ")", ";", "problem", ".", "setSourceStart", "(", "0", ")", ";", "problem", ".", "setSourceEnd", "(", "evaluationID", ".", "length", "-", "1", ")", ";", "}", "currentLine", "++", ";", "}", "char", "[", "]", "[", "]", "imports", "=", "this", ".", "context", ".", "imports", ";", "if", "(", "(", "currentLine", "<=", "pbLine", ")", "&&", "(", "pbLine", "<", "(", "currentLine", "+", "imports", ".", "length", ")", ")", ")", "{", "evaluationID", "=", "imports", "[", "pbLine", "-", "currentLine", "]", ";", "evaluationType", "=", "EvaluationResult", ".", "T_IMPORT", ";", "problem", ".", "setSourceLineNumber", "(", "1", ")", ";", "problem", ".", "setSourceStart", "(", "0", ")", ";", "problem", ".", "setSourceEnd", "(", "evaluationID", ".", "length", "-", "1", ")", ";", "}", "currentLine", "+=", "imports", ".", "length", "+", "1", ";", "int", "varCount", "=", "this", ".", "context", ".", "variableCount", ";", "if", "(", "(", "currentLine", "<=", "pbLine", ")", "&&", "(", "pbLine", "<", "currentLine", "+", "varCount", ")", ")", "{", "GlobalVariable", "var", "=", "this", ".", "context", ".", "variables", "[", "pbLine", "-", "currentLine", "]", ";", "evaluationID", "=", "var", ".", "getName", "(", ")", ";", "evaluationType", "=", "EvaluationResult", ".", "T_VARIABLE", ";", "int", "pbStart", "=", "problem", ".", "getSourceStart", "(", ")", "-", "var", ".", "declarationStart", ";", "int", "pbEnd", "=", "problem", ".", "getSourceEnd", "(", ")", "-", "var", ".", "declarationStart", ";", "int", "typeLength", "=", "var", ".", "getTypeName", "(", ")", ".", "length", ";", "if", "(", "(", "0", "<=", "pbStart", ")", "&&", "(", "pbEnd", "<", "typeLength", ")", ")", "{", "problem", ".", "setSourceLineNumber", "(", "-", "1", ")", ";", "}", "else", "{", "pbStart", "-=", "typeLength", "+", "1", ";", "pbEnd", "-=", "typeLength", "+", "1", ";", "problem", ".", "setSourceLineNumber", "(", "0", ")", ";", "}", "problem", ".", "setSourceStart", "(", "pbStart", ")", ";", "problem", ".", "setSourceEnd", "(", "pbEnd", ")", ";", "}", "currentLine", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "varCount", ";", "i", "++", ")", "{", "GlobalVariable", "var", "=", "this", ".", "context", ".", "variables", "[", "i", "]", ";", "char", "[", "]", "initializer", "=", "var", ".", "getInitializer", "(", ")", ";", "int", "initializerLength", "=", "initializer", "==", "null", "?", "0", ":", "initializer", ".", "length", ";", "if", "(", "(", "var", ".", "initializerStart", "<=", "problem", ".", "getSourceStart", "(", ")", ")", "&&", "(", "problem", ".", "getSourceEnd", "(", ")", "<", "var", ".", "initializerStart", "+", "var", ".", "name", ".", "length", ")", ")", "{", "return", ";", "}", "else", "if", "(", "(", "var", ".", "initExpressionStart", "<=", "problem", ".", "getSourceStart", "(", ")", ")", "&&", "(", "problem", ".", "getSourceEnd", "(", ")", "<", "var", ".", "initExpressionStart", "+", "initializerLength", ")", ")", "{", "evaluationID", "=", "var", ".", "name", ";", "evaluationType", "=", "EvaluationResult", ".", "T_VARIABLE", ";", "problem", ".", "setSourceLineNumber", "(", "pbLine", "-", "var", ".", "initializerLineStart", "+", "1", ")", ";", "problem", ".", "setSourceStart", "(", "problem", ".", "getSourceStart", "(", ")", "-", "var", ".", "initExpressionStart", ")", ";", "problem", ".", "setSourceEnd", "(", "problem", ".", "getSourceEnd", "(", ")", "-", "var", ".", "initExpressionStart", ")", ";", "break", ";", "}", "}", "EvaluationResult", "result", "=", "(", "EvaluationResult", ")", "resultsByIDs", ".", "get", "(", "evaluationID", ")", ";", "if", "(", "result", "==", "null", ")", "{", "resultsByIDs", ".", "put", "(", "evaluationID", ",", "new", "EvaluationResult", "(", "evaluationID", ",", "evaluationType", ",", "new", "CategorizedProblem", "[", "]", "{", "problem", "}", ")", ")", ";", "}", "else", "{", "result", ".", "addProblem", "(", "problem", ")", ";", "}", "}", "protected", "char", "[", "]", "getClassName", "(", ")", "{", "return", "CharOperation", ".", "concat", "(", "EvaluationConstants", ".", "GLOBAL_VARS_CLASS_NAME_PREFIX", ",", "Integer", ".", "toString", "(", "EvaluationContext", ".", "VAR_CLASS_COUNTER", "+", "1", ")", ".", "toCharArray", "(", ")", ")", ";", "}", "Compiler", "getCompiler", "(", "ICompilerRequestor", "compilerRequestor", ")", "{", "Compiler", "compiler", "=", "super", ".", "getCompiler", "(", "compilerRequestor", ")", ";", "IBinaryType", "binaryType", "=", "this", ".", "context", ".", "getRootCodeSnippetBinary", "(", ")", ";", "if", "(", "binaryType", "!=", "null", ")", "{", "compiler", ".", "lookupEnvironment", ".", "cacheBinaryType", "(", "binaryType", ",", "null", ")", ";", "}", "VariablesInfo", "installedVars", "=", "this", ".", "context", ".", "installedVars", ";", "if", "(", "installedVars", "!=", "null", ")", "{", "ClassFile", "[", "]", "classFiles", "=", "installedVars", ".", "classFiles", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classFiles", ".", "length", ";", "i", "++", ")", "{", "ClassFile", "classFile", "=", "classFiles", "[", "i", "]", ";", "IBinaryType", "binary", "=", "null", ";", "try", "{", "binary", "=", "new", "ClassFileReader", "(", "classFile", ".", "getBytes", "(", ")", ",", "null", ")", ";", "}", "catch", "(", "ClassFormatException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "compiler", ".", "lookupEnvironment", ".", "cacheBinaryType", "(", "binary", ",", "null", ")", ";", "}", "}", "return", "compiler", ";", "}", "protected", "char", "[", "]", "getPackageName", "(", ")", "{", "return", "this", ".", "context", ".", "packageName", ";", "}", "protected", "char", "[", "]", "getSource", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "int", "lineNumberOffset", "=", "1", ";", "char", "[", "]", "packageName", "=", "getPackageName", "(", ")", ";", "if", "(", "packageName", ".", "length", "!=", "0", ")", "{", "buffer", ".", "append", "(", "\"package", "\"", ")", ";", "buffer", ".", "append", "(", "packageName", ")", ";", "buffer", ".", "append", "(", "';'", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "lineNumberOffset", "++", ";", "}", "char", "[", "]", "[", "]", "imports", "=", "this", ".", "context", ".", "imports", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "imports", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "\"import", "\"", ")", ";", "buffer", ".", "append", "(", "imports", "[", "i", "]", ")", ";", "buffer", ".", "append", "(", "';'", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "lineNumberOffset", "++", ";", "}", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "getClassName", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"", "extends", "\"", ")", ";", "buffer", ".", "append", "(", "PACKAGE_NAME", ")", ";", "buffer", ".", "append", "(", "\".\"", ")", ";", "buffer", ".", "append", "(", "ROOT_CLASS_NAME", ")", ";", "buffer", ".", "append", "(", "\"", "{\"", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "lineNumberOffset", "++", ";", "GlobalVariable", "[", "]", "vars", "=", "this", ".", "context", ".", "variables", ";", "VariablesInfo", "installedVars", "=", "this", ".", "context", ".", "installedVars", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "context", ".", "variableCount", ";", "i", "++", ")", "{", "GlobalVariable", "var", "=", "vars", "[", "i", "]", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "var", ".", "declarationStart", "=", "buffer", ".", "length", "(", ")", ";", "buffer", ".", "append", "(", "var", ".", "typeName", ")", ";", "buffer", ".", "append", "(", "\"", "\"", ")", ";", "char", "[", "]", "varName", "=", "var", ".", "name", ";", "buffer", ".", "append", "(", "varName", ")", ";", "buffer", ".", "append", "(", "';'", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "lineNumberOffset", "++", ";", "}", "buffer", ".", "append", "(", "\"tstatic", "{\"", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "lineNumberOffset", "++", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "context", ".", "variableCount", ";", "i", "++", ")", "{", "GlobalVariable", "var", "=", "vars", "[", "i", "]", ";", "char", "[", "]", "varName", "=", "var", ".", "name", ";", "GlobalVariable", "installedVar", "=", "installedVars", "==", "null", "?", "null", ":", "installedVars", ".", "varNamed", "(", "varName", ")", ";", "if", "(", "installedVar", "==", "null", "||", "!", "CharOperation", ".", "equals", "(", "installedVar", ".", "typeName", ",", "var", ".", "typeName", ")", ")", "{", "char", "[", "]", "initializer", "=", "var", ".", "initializer", ";", "if", "(", "initializer", "!=", "null", ")", "{", "buffer", ".", "append", "(", "\"tttry", "{\"", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "lineNumberOffset", "++", ";", "var", ".", "initializerLineStart", "=", "lineNumberOffset", ";", "buffer", ".", "append", "(", "\"ttt\"", ")", ";", "var", ".", "initializerStart", "=", "buffer", ".", "length", "(", ")", ";", "buffer", ".", "append", "(", "varName", ")", ";", "buffer", ".", "append", "(", "\"=", "\"", ")", ";", "var", ".", "initExpressionStart", "=", "buffer", ".", "length", "(", ")", ";", "buffer", ".", "append", "(", "initializer", ")", ";", "lineNumberOffset", "+=", "numberOfCRs", "(", "initializer", ")", ";", "buffer", ".", "append", "(", "';'", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "buffer", ".", "append", "(", "\"tt}\"", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "lineNumberOffset", "+=", "4", ";", "}", "}", "else", "{", "buffer", ".", "append", "(", "\"tt\"", ")", ";", "buffer", ".", "append", "(", "varName", ")", ";", "buffer", ".", "append", "(", "\"=", "\"", ")", ";", "char", "[", "]", "installedPackageName", "=", "installedVars", ".", "packageName", ";", "if", "(", "installedPackageName", "!=", "null", "&&", "installedPackageName", ".", "length", "!=", "0", ")", "{", "buffer", ".", "append", "(", "installedPackageName", ")", ";", "buffer", ".", "append", "(", "\".\"", ")", ";", "}", "buffer", ".", "append", "(", "installedVars", ".", "className", ")", ";", "buffer", ".", "append", "(", "\".\"", ")", ";", "buffer", ".", "append", "(", "varName", ")", ";", "buffer", ".", "append", "(", "';'", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "lineNumberOffset", "++", ";", "}", "}", "buffer", ".", "append", "(", "\"t}\"", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "buffer", ".", "append", "(", "'}'", ")", ".", "append", "(", "this", ".", "context", ".", "lineSeparator", ")", ";", "int", "length", "=", "buffer", ".", "length", "(", ")", ";", "char", "[", "]", "result", "=", "new", "char", "[", "length", "]", ";", "buffer", ".", "getChars", "(", "0", ",", "length", ",", "result", ",", "0", ")", ";", "return", "result", ";", "}", "private", "int", "numberOfCRs", "(", "char", "[", "]", "source", ")", "{", "int", "numberOfCRs", "=", "0", ";", "boolean", "lastWasCR", "=", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "source", ".", "length", ";", "i", "++", ")", "{", "char", "currentChar", "=", "source", "[", "i", "]", ";", "switch", "(", "currentChar", ")", "{", "case", "'\\r'", ":", "lastWasCR", "=", "true", ";", "numberOfCRs", "++", ";", "break", ";", "case", "'\\n'", ":", "if", "(", "!", "lastWasCR", ")", "numberOfCRs", "++", ";", "lastWasCR", "=", "false", ";", "break", ";", "default", ":", "lastWasCR", "=", "false", ";", "}", "}", "return", "numberOfCRs", ";", "}", "}", "</s>" ]
3,984
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "CompilationResult", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AbstractMethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "CodeStream", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "ConstantPool", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "StackMapFrameCodeStream", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Binding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "FieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "SourceTypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TagBits", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeVariableBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "public", "class", "CodeSnippetClassFile", "extends", "ClassFile", "{", "public", "CodeSnippetClassFile", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "SourceTypeBinding", "aType", ",", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ClassFile", "enclosingClassFile", ",", "boolean", "creatingProblemType", ")", "{", "this", ".", "referenceBinding", "=", "aType", ";", "initByteArrays", "(", ")", ";", "this", ".", "header", "[", "this", ".", "headerOffset", "++", "]", "=", "(", "byte", ")", "(", "0xCAFEBABEL", ">>", "24", ")", ";", "this", ".", "header", "[", "this", ".", "headerOffset", "++", "]", "=", "(", "byte", ")", "(", "0xCAFEBABEL", ">>", "16", ")", ";", "this", ".", "header", "[", "this", ".", "headerOffset", "++", "]", "=", "(", "byte", ")", "(", "0xCAFEBABEL", ">>", "8", ")", ";", "this", ".", "header", "[", "this", ".", "headerOffset", "++", "]", "=", "(", "byte", ")", "(", "0xCAFEBABEL", ">>", "0", ")", ";", "long", "targetVersion", "=", "this", ".", "targetJDK", "=", "this", ".", "referenceBinding", ".", "scope", ".", "compilerOptions", "(", ")", ".", "targetJDK", ";", "this", ".", "header", "[", "this", ".", "headerOffset", "++", "]", "=", "(", "byte", ")", "(", "targetVersion", ">>", "8", ")", ";", "this", ".", "header", "[", "this", ".", "headerOffset", "++", "]", "=", "(", "byte", ")", "(", "targetVersion", ">>", "0", ")", ";", "this", ".", "header", "[", "this", ".", "headerOffset", "++", "]", "=", "(", "byte", ")", "(", "targetVersion", ">>", "24", ")", ";", "this", ".", "header", "[", "this", ".", "headerOffset", "++", "]", "=", "(", "byte", ")", "(", "targetVersion", ">>", "16", ")", ";", "this", ".", "constantPoolOffset", "=", "this", ".", "headerOffset", ";", "this", ".", "headerOffset", "+=", "2", ";", "this", ".", "constantPool", "=", "new", "ConstantPool", "(", "this", ")", ";", "int", "accessFlags", "=", "aType", ".", "getAccessFlags", "(", ")", ";", "if", "(", "!", "aType", ".", "isInterface", "(", ")", ")", "{", "accessFlags", "|=", "ClassFileConstants", ".", "AccSuper", ";", "}", "if", "(", "aType", ".", "isNestedType", "(", ")", ")", "{", "if", "(", "aType", ".", "isStatic", "(", ")", ")", "{", "accessFlags", "&=", "~", "ClassFileConstants", ".", "AccStatic", ";", "}", "if", "(", "aType", ".", "isPrivate", "(", ")", ")", "{", "accessFlags", "&=", "~", "(", "ClassFileConstants", ".", "AccPrivate", "|", "ClassFileConstants", ".", "AccPublic", ")", ";", "}", "if", "(", "aType", ".", "isProtected", "(", ")", ")", "{", "accessFlags", "&=", "~", "ClassFileConstants", ".", "AccProtected", ";", "accessFlags", "|=", "ClassFileConstants", ".", "AccPublic", ";", "}", "}", "accessFlags", "&=", "~", "ClassFileConstants", ".", "AccStrictfp", ";", "this", ".", "enclosingClassFile", "=", "enclosingClassFile", ";", "this", ".", "contents", "[", "this", ".", "contentsOffset", "++", "]", "=", "(", "byte", ")", "(", "accessFlags", ">>", "8", ")", ";", "this", ".", "contents", "[", "this", ".", "contentsOffset", "++", "]", "=", "(", "byte", ")", "accessFlags", ";", "int", "classNameIndex", "=", "this", ".", "constantPool", ".", "literalIndexForType", "(", "aType", ")", ";", "this", ".", "contents", "[", "this", ".", "contentsOffset", "++", "]", "=", "(", "byte", ")", "(", "classNameIndex", ">>", "8", ")", ";", "this", ".", "contents", "[", "this", ".", "contentsOffset", "++", "]", "=", "(", "byte", ")", "classNameIndex", ";", "int", "superclassNameIndex", ";", "if", "(", "aType", ".", "isInterface", "(", ")", ")", "{", "superclassNameIndex", "=", "this", ".", "constantPool", ".", "literalIndexForType", "(", "ConstantPool", ".", "JavaLangObjectConstantPoolName", ")", ";", "}", "else", "{", "superclassNameIndex", "=", "(", "aType", ".", "superclass", "==", "null", "?", "0", ":", "this", ".", "constantPool", ".", "literalIndexForType", "(", "aType", ".", "superclass", ")", ")", ";", "}", "this", ".", "contents", "[", "this", ".", "contentsOffset", "++", "]", "=", "(", "byte", ")", "(", "superclassNameIndex", ">>", "8", ")", ";", "this", ".", "contents", "[", "this", ".", "contentsOffset", "++", "]", "=", "(", "byte", ")", "superclassNameIndex", ";", "ReferenceBinding", "[", "]", "superInterfacesBinding", "=", "aType", ".", "superInterfaces", "(", ")", ";", "int", "interfacesCount", "=", "superInterfacesBinding", ".", "length", ";", "this", ".", "contents", "[", "this", ".", "contentsOffset", "++", "]", "=", "(", "byte", ")", "(", "interfacesCount", ">>", "8", ")", ";", "this", ".", "contents", "[", "this", ".", "contentsOffset", "++", "]", "=", "(", "byte", ")", "interfacesCount", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfacesCount", ";", "i", "++", ")", "{", "int", "interfaceIndex", "=", "this", ".", "constantPool", ".", "literalIndexForType", "(", "superInterfacesBinding", "[", "i", "]", ")", ";", "this", ".", "contents", "[", "this", ".", "contentsOffset", "++", "]", "=", "(", "byte", ")", "(", "interfaceIndex", ">>", "8", ")", ";", "this", ".", "contents", "[", "this", ".", "contentsOffset", "++", "]", "=", "(", "byte", ")", "interfaceIndex", ";", "}", "this", ".", "produceAttributes", "=", "this", ".", "referenceBinding", ".", "scope", ".", "compilerOptions", "(", ")", ".", "produceDebugAttributes", ";", "this", ".", "creatingProblemType", "=", "creatingProblemType", ";", "if", "(", "this", ".", "targetJDK", ">=", "ClassFileConstants", ".", "JDK1_6", ")", "{", "this", ".", "codeStream", "=", "new", "StackMapFrameCodeStream", "(", "this", ")", ";", "this", ".", "produceAttributes", "|=", "ClassFileConstants", ".", "ATTR_STACK_MAP_TABLE", ";", "}", "else", "if", "(", "this", ".", "targetJDK", "==", "ClassFileConstants", ".", "CLDC_1_1", ")", "{", "this", ".", "targetJDK", "=", "ClassFileConstants", ".", "JDK1_1", ";", "this", ".", "produceAttributes", "|=", "ClassFileConstants", ".", "ATTR_STACK_MAP", ";", "this", ".", "codeStream", "=", "new", "StackMapFrameCodeStream", "(", "this", ")", ";", "}", "else", "{", "this", ".", "codeStream", "=", "new", "CodeStream", "(", "this", ")", ";", "}", "this", ".", "codeStream", ".", "maxFieldCount", "=", "aType", ".", "scope", ".", "outerMostClassScope", "(", ")", ".", "referenceType", "(", ")", ".", "maxFieldCount", ";", "}", "public", "static", "void", "createProblemType", "(", "TypeDeclaration", "typeDeclaration", ",", "CompilationResult", "unitResult", ")", "{", "SourceTypeBinding", "typeBinding", "=", "typeDeclaration", ".", "binding", ";", "ClassFile", "classFile", "=", "new", "CodeSnippetClassFile", "(", "typeBinding", ",", "null", ",", "true", ")", ";", "if", "(", "typeBinding", ".", "hasMemberTypes", "(", ")", ")", "{", "ReferenceBinding", "[", "]", "members", "=", "typeBinding", ".", "memberTypes", ";", "for", "(", "int", "i", "=", "0", ",", "l", "=", "members", ".", "length", ";", "i", "<", "l", ";", "i", "++", ")", "classFile", ".", "recordInnerClasses", "(", "members", "[", "i", "]", ")", ";", "}", "if", "(", "typeBinding", ".", "isNestedType", "(", ")", ")", "{", "classFile", ".", "recordInnerClasses", "(", "typeBinding", ")", ";", "}", "TypeVariableBinding", "[", "]", "typeVariables", "=", "typeBinding", ".", "typeVariables", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "typeVariables", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "TypeVariableBinding", "typeVariableBinding", "=", "typeVariables", "[", "i", "]", ";", "if", "(", "(", "typeVariableBinding", ".", "tagBits", "&", "TagBits", ".", "ContainsNestedTypeReferences", ")", "!=", "0", ")", "{", "Util", ".", "recordNestedType", "(", "classFile", ",", "typeVariableBinding", ")", ";", "}", "}", "FieldBinding", "[", "]", "fields", "=", "typeBinding", ".", "fields", "(", ")", ";", "if", "(", "(", "fields", "!=", "null", ")", "&&", "(", "fields", "!=", "Binding", ".", "NO_FIELDS", ")", ")", "{", "classFile", ".", "addFieldInfos", "(", ")", ";", "}", "else", "{", "classFile", ".", "contents", "[", "classFile", ".", "contentsOffset", "++", "]", "=", "0", ";", "classFile", ".", "contents", "[", "classFile", ".", "contentsOffset", "++", "]", "=", "0", ";", "}", "classFile", ".", "setForMethodInfos", "(", ")", ";", "int", "problemsLength", ";", "CategorizedProblem", "[", "]", "problems", "=", "unitResult", ".", "getErrors", "(", ")", ";", "if", "(", "problems", "==", "null", ")", "{", "problems", "=", "new", "CategorizedProblem", "[", "0", "]", ";", "}", "CategorizedProblem", "[", "]", "problemsCopy", "=", "new", "CategorizedProblem", "[", "problemsLength", "=", "problems", ".", "length", "]", ";", "System", ".", "arraycopy", "(", "problems", ",", "0", ",", "problemsCopy", ",", "0", ",", "problemsLength", ")", ";", "AbstractMethodDeclaration", "[", "]", "methodDecls", "=", "typeDeclaration", ".", "methods", ";", "if", "(", "methodDecls", "!=", "null", ")", "{", "if", "(", "typeBinding", ".", "isInterface", "(", ")", ")", "{", "classFile", ".", "addProblemClinit", "(", "problemsCopy", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "methodDecls", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "AbstractMethodDeclaration", "methodDecl", "=", "methodDecls", "[", "i", "]", ";", "MethodBinding", "method", "=", "methodDecl", ".", "binding", ";", "if", "(", "method", "==", "null", "||", "method", ".", "isConstructor", "(", ")", ")", "continue", ";", "method", ".", "modifiers", "=", "ClassFileConstants", ".", "AccPublic", "|", "ClassFileConstants", ".", "AccAbstract", ";", "classFile", ".", "addAbstractMethod", "(", "methodDecl", ",", "method", ")", ";", "}", "}", "else", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "methodDecls", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "AbstractMethodDeclaration", "methodDecl", "=", "methodDecls", "[", "i", "]", ";", "MethodBinding", "method", "=", "methodDecl", ".", "binding", ";", "if", "(", "method", "==", "null", ")", "continue", ";", "if", "(", "method", ".", "isConstructor", "(", ")", ")", "{", "classFile", ".", "addProblemConstructor", "(", "methodDecl", ",", "method", ",", "problemsCopy", ")", ";", "}", "else", "if", "(", "method", ".", "isAbstract", "(", ")", ")", "{", "classFile", ".", "addAbstractMethod", "(", "methodDecl", ",", "method", ")", ";", "}", "else", "{", "classFile", ".", "addProblemMethod", "(", "methodDecl", ",", "method", ",", "problemsCopy", ")", ";", "}", "}", "}", "classFile", ".", "addDefaultAbstractMethods", "(", ")", ";", "}", "if", "(", "typeDeclaration", ".", "memberTypes", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "typeDeclaration", ".", "memberTypes", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "TypeDeclaration", "memberType", "=", "typeDeclaration", ".", "memberTypes", "[", "i", "]", ";", "if", "(", "memberType", ".", "binding", "!=", "null", ")", "{", "ClassFile", ".", "createProblemType", "(", "memberType", ",", "unitResult", ")", ";", "}", "}", "}", "classFile", ".", "addAttributes", "(", ")", ";", "unitResult", ".", "record", "(", "typeBinding", ".", "constantPoolName", "(", ")", ",", "classFile", ")", ";", "}", "}", "</s>" ]
3,985
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "*", ";", "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", ".", "DefaultErrorHandlingPolicies", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ICompilerRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "IProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "INameEnvironment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "abstract", "class", "Evaluator", "{", "EvaluationContext", "context", ";", "INameEnvironment", "environment", ";", "Map", "options", ";", "IRequestor", "requestor", ";", "IProblemFactory", "problemFactory", ";", "Evaluator", "(", "EvaluationContext", "context", ",", "INameEnvironment", "environment", ",", "Map", "options", ",", "IRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ")", "{", "this", ".", "context", "=", "context", ";", "this", ".", "environment", "=", "environment", ";", "this", ".", "options", "=", "options", ";", "this", ".", "requestor", "=", "requestor", ";", "this", ".", "problemFactory", "=", "problemFactory", ";", "}", "protected", "abstract", "void", "addEvaluationResultForCompilationProblem", "(", "Map", "resultsByIDs", ",", "CategorizedProblem", "problem", ",", "char", "[", "]", "cuSource", ")", ";", "protected", "EvaluationResult", "[", "]", "evaluationResultsForCompilationProblems", "(", "CompilationResult", "result", ",", "char", "[", "]", "cuSource", ")", "{", "CategorizedProblem", "[", "]", "problems", "=", "result", ".", "getAllProblems", "(", ")", ";", "HashMap", "resultsByIDs", "=", "new", "HashMap", "(", "5", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "problems", ".", "length", ";", "i", "++", ")", "{", "addEvaluationResultForCompilationProblem", "(", "resultsByIDs", ",", "problems", "[", "i", "]", ",", "cuSource", ")", ";", "}", "int", "size", "=", "resultsByIDs", ".", "size", "(", ")", ";", "EvaluationResult", "[", "]", "evalResults", "=", "new", "EvaluationResult", "[", "size", "]", ";", "Iterator", "results", "=", "resultsByIDs", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "evalResults", "[", "i", "]", "=", "(", "EvaluationResult", ")", "results", ".", "next", "(", ")", ";", "}", "return", "evalResults", ";", "}", "ClassFile", "[", "]", "getClasses", "(", ")", "{", "final", "char", "[", "]", "source", "=", "getSource", "(", ")", ";", "final", "ArrayList", "classDefinitions", "=", "new", "ArrayList", "(", ")", ";", "class", "CompilerRequestor", "implements", "ICompilerRequestor", "{", "boolean", "hasErrors", "=", "false", ";", "public", "void", "acceptResult", "(", "CompilationResult", "result", ")", "{", "if", "(", "result", ".", "hasProblems", "(", ")", ")", "{", "EvaluationResult", "[", "]", "evalResults", "=", "evaluationResultsForCompilationProblems", "(", "result", ",", "source", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "evalResults", ".", "length", ";", "i", "++", ")", "{", "EvaluationResult", "evalResult", "=", "evalResults", "[", "i", "]", ";", "CategorizedProblem", "[", "]", "problems", "=", "evalResult", ".", "getProblems", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "problems", ".", "length", ";", "j", "++", ")", "{", "Evaluator", ".", "this", ".", "requestor", ".", "acceptProblem", "(", "problems", "[", "j", "]", ",", "evalResult", ".", "getEvaluationID", "(", ")", ",", "evalResult", ".", "getEvaluationType", "(", ")", ")", ";", "}", "}", "}", "if", "(", "result", ".", "hasErrors", "(", ")", ")", "{", "this", ".", "hasErrors", "=", "true", ";", "}", "else", "{", "ClassFile", "[", "]", "classFiles", "=", "result", ".", "getClassFiles", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classFiles", ".", "length", ";", "i", "++", ")", "{", "ClassFile", "classFile", "=", "classFiles", "[", "i", "]", ";", "classDefinitions", ".", "add", "(", "classFile", ")", ";", "}", "}", "}", "}", "CompilerRequestor", "compilerRequestor", "=", "new", "CompilerRequestor", "(", ")", ";", "Compiler", "compiler", "=", "getCompiler", "(", "compilerRequestor", ")", ";", "compiler", ".", "compile", "(", "new", "ICompilationUnit", "[", "]", "{", "new", "ICompilationUnit", "(", ")", "{", "public", "char", "[", "]", "getFileName", "(", ")", "{", "return", "CharOperation", ".", "concat", "(", "Evaluator", ".", "this", ".", "getClassName", "(", ")", ",", "Util", ".", "defaultJavaExtension", "(", ")", ".", "toCharArray", "(", ")", ")", ";", "}", "public", "char", "[", "]", "getContents", "(", ")", "{", "return", "source", ";", "}", "public", "char", "[", "]", "getMainTypeName", "(", ")", "{", "return", "Evaluator", ".", "this", ".", "getClassName", "(", ")", ";", "}", "public", "char", "[", "]", "[", "]", "getPackageName", "(", ")", "{", "return", "null", ";", "}", "}", "}", ")", ";", "if", "(", "compilerRequestor", ".", "hasErrors", ")", "{", "return", "null", ";", "}", "else", "{", "ClassFile", "[", "]", "result", "=", "new", "ClassFile", "[", "classDefinitions", ".", "size", "(", ")", "]", ";", "classDefinitions", ".", "toArray", "(", "result", ")", ";", "return", "result", ";", "}", "}", "protected", "abstract", "char", "[", "]", "getClassName", "(", ")", ";", "Compiler", "getCompiler", "(", "ICompilerRequestor", "compilerRequestor", ")", "{", "CompilerOptions", "compilerOptions", "=", "new", "CompilerOptions", "(", "this", ".", "options", ")", ";", "compilerOptions", ".", "performMethodsFullRecovery", "=", "true", ";", "compilerOptions", ".", "performStatementsRecovery", "=", "true", ";", "return", "new", "Compiler", "(", "this", ".", "environment", ",", "DefaultErrorHandlingPolicies", ".", "exitAfterAllProblems", "(", ")", ",", "compilerOptions", ",", "compilerRequestor", ",", "this", ".", "problemFactory", ")", ";", "}", "protected", "abstract", "char", "[", "]", "getSource", "(", ")", ";", "}", "</s>" ]
3,986
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "Compiler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "DefaultErrorHandlingPolicies", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ICompilerRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "IProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFormatException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "INameEnvironment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "public", "class", "CodeSnippetEvaluator", "extends", "Evaluator", "implements", "EvaluationConstants", "{", "static", "final", "boolean", "DEVELOPMENT_MODE", "=", "false", ";", "char", "[", "]", "codeSnippet", ";", "CodeSnippetToCuMapper", "mapper", ";", "CodeSnippetEvaluator", "(", "char", "[", "]", "codeSnippet", ",", "EvaluationContext", "context", ",", "INameEnvironment", "environment", ",", "Map", "options", ",", "IRequestor", "requestor", ",", "IProblemFactory", "problemFactory", ")", "{", "super", "(", "context", ",", "environment", ",", "options", ",", "requestor", ",", "problemFactory", ")", ";", "this", ".", "codeSnippet", "=", "codeSnippet", ";", "}", "protected", "void", "addEvaluationResultForCompilationProblem", "(", "Map", "resultsByIDs", ",", "CategorizedProblem", "problem", ",", "char", "[", "]", "cuSource", ")", "{", "CodeSnippetToCuMapper", "sourceMapper", "=", "getMapper", "(", ")", ";", "int", "pbLineNumber", "=", "problem", ".", "getSourceLineNumber", "(", ")", ";", "int", "evaluationType", "=", "sourceMapper", ".", "getEvaluationType", "(", "pbLineNumber", ")", ";", "char", "[", "]", "evaluationID", "=", "null", ";", "switch", "(", "evaluationType", ")", "{", "case", "EvaluationResult", ".", "T_PACKAGE", ":", "evaluationID", "=", "this", ".", "context", ".", "packageName", ";", "problem", ".", "setSourceLineNumber", "(", "1", ")", ";", "problem", ".", "setSourceStart", "(", "0", ")", ";", "problem", ".", "setSourceEnd", "(", "evaluationID", ".", "length", "-", "1", ")", ";", "break", ";", "case", "EvaluationResult", ".", "T_IMPORT", ":", "evaluationID", "=", "sourceMapper", ".", "getImport", "(", "pbLineNumber", ")", ";", "problem", ".", "setSourceLineNumber", "(", "1", ")", ";", "problem", ".", "setSourceStart", "(", "0", ")", ";", "problem", ".", "setSourceEnd", "(", "evaluationID", ".", "length", "-", "1", ")", ";", "break", ";", "case", "EvaluationResult", ".", "T_CODE_SNIPPET", ":", "evaluationID", "=", "this", ".", "codeSnippet", ";", "problem", ".", "setSourceLineNumber", "(", "pbLineNumber", "-", "this", ".", "mapper", ".", "lineNumberOffset", ")", ";", "problem", ".", "setSourceStart", "(", "problem", ".", "getSourceStart", "(", ")", "-", "this", ".", "mapper", ".", "startPosOffset", ")", ";", "problem", ".", "setSourceEnd", "(", "problem", ".", "getSourceEnd", "(", ")", "-", "this", ".", "mapper", ".", "startPosOffset", ")", ";", "break", ";", "case", "EvaluationResult", ".", "T_INTERNAL", ":", "evaluationID", "=", "cuSource", ";", "break", ";", "}", "EvaluationResult", "result", "=", "(", "EvaluationResult", ")", "resultsByIDs", ".", "get", "(", "evaluationID", ")", ";", "if", "(", "result", "==", "null", ")", "{", "resultsByIDs", ".", "put", "(", "evaluationID", ",", "new", "EvaluationResult", "(", "evaluationID", ",", "evaluationType", ",", "new", "CategorizedProblem", "[", "]", "{", "problem", "}", ")", ")", ";", "}", "else", "{", "result", ".", "addProblem", "(", "problem", ")", ";", "}", "}", "protected", "char", "[", "]", "getClassName", "(", ")", "{", "return", "CharOperation", ".", "concat", "(", "CODE_SNIPPET_CLASS_NAME_PREFIX", ",", "Integer", ".", "toString", "(", "EvaluationContext", ".", "CODE_SNIPPET_COUNTER", "+", "1", ")", ".", "toCharArray", "(", ")", ")", ";", "}", "Compiler", "getCompiler", "(", "ICompilerRequestor", "compilerRequestor", ")", "{", "Compiler", "compiler", "=", "null", ";", "if", "(", "!", "DEVELOPMENT_MODE", ")", "{", "CompilerOptions", "compilerOptions", "=", "new", "CompilerOptions", "(", "this", ".", "options", ")", ";", "compilerOptions", ".", "performMethodsFullRecovery", "=", "true", ";", "compilerOptions", ".", "performStatementsRecovery", "=", "true", ";", "compiler", "=", "new", "CodeSnippetCompiler", "(", "this", ".", "environment", ",", "DefaultErrorHandlingPolicies", ".", "exitAfterAllProblems", "(", ")", ",", "compilerOptions", ",", "compilerRequestor", ",", "this", ".", "problemFactory", ",", "this", ".", "context", ",", "getMapper", "(", ")", ".", "startPosOffset", ",", "getMapper", "(", ")", ".", "startPosOffset", "+", "this", ".", "codeSnippet", ".", "length", "-", "1", ")", ";", "(", "(", "CodeSnippetParser", ")", "compiler", ".", "parser", ")", ".", "lineSeparatorLength", "=", "this", ".", "context", ".", "lineSeparator", ".", "length", "(", ")", ";", "IBinaryType", "binary", "=", "this", ".", "context", ".", "getRootCodeSnippetBinary", "(", ")", ";", "if", "(", "binary", "!=", "null", ")", "{", "compiler", ".", "lookupEnvironment", ".", "cacheBinaryType", "(", "binary", ",", "null", ")", ";", "}", "VariablesInfo", "installedVars", "=", "this", ".", "context", ".", "installedVars", ";", "if", "(", "installedVars", "!=", "null", ")", "{", "ClassFile", "[", "]", "globalClassFiles", "=", "installedVars", ".", "classFiles", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "globalClassFiles", ".", "length", ";", "i", "++", ")", "{", "ClassFileReader", "binaryType", "=", "null", ";", "try", "{", "binaryType", "=", "new", "ClassFileReader", "(", "globalClassFiles", "[", "i", "]", ".", "getBytes", "(", ")", ",", "null", ")", ";", "}", "catch", "(", "ClassFormatException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "compiler", ".", "lookupEnvironment", ".", "cacheBinaryType", "(", "binaryType", ",", "null", ")", ";", "}", "}", "}", "else", "{", "CompilerOptions", "compilerOptions", "=", "new", "CompilerOptions", "(", "this", ".", "options", ")", ";", "compilerOptions", ".", "performMethodsFullRecovery", "=", "true", ";", "compilerOptions", ".", "performStatementsRecovery", "=", "true", ";", "compiler", "=", "new", "Compiler", "(", "getWrapperEnvironment", "(", ")", ",", "DefaultErrorHandlingPolicies", ".", "exitAfterAllProblems", "(", ")", ",", "compilerOptions", ",", "compilerRequestor", ",", "this", ".", "problemFactory", ")", ";", "}", "return", "compiler", ";", "}", "private", "CodeSnippetToCuMapper", "getMapper", "(", ")", "{", "if", "(", "this", ".", "mapper", "==", "null", ")", "{", "char", "[", "]", "varClassName", "=", "null", ";", "VariablesInfo", "installedVars", "=", "this", ".", "context", ".", "installedVars", ";", "if", "(", "installedVars", "!=", "null", ")", "{", "char", "[", "]", "superPackageName", "=", "installedVars", ".", "packageName", ";", "if", "(", "superPackageName", "!=", "null", "&&", "superPackageName", ".", "length", "!=", "0", ")", "{", "varClassName", "=", "CharOperation", ".", "concat", "(", "superPackageName", ",", "installedVars", ".", "className", ",", "'.'", ")", ";", "}", "else", "{", "varClassName", "=", "installedVars", ".", "className", ";", "}", "}", "this", ".", "mapper", "=", "new", "CodeSnippetToCuMapper", "(", "this", ".", "codeSnippet", ",", "this", ".", "context", ".", "packageName", ",", "this", ".", "context", ".", "imports", ",", "getClassName", "(", ")", ",", "varClassName", ",", "this", ".", "context", ".", "localVariableNames", ",", "this", ".", "context", ".", "localVariableTypeNames", ",", "this", ".", "context", ".", "localVariableModifiers", ",", "this", ".", "context", ".", "declaringTypeName", ",", "this", ".", "context", ".", "lineSeparator", ",", "CompilerOptions", ".", "versionToJdkLevel", "(", "this", ".", "options", ".", "get", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ")", ")", ")", ";", "}", "return", "this", ".", "mapper", ";", "}", "protected", "char", "[", "]", "getSource", "(", ")", "{", "return", "getMapper", "(", ")", ".", "cuSource", ";", "}", "private", "INameEnvironment", "getWrapperEnvironment", "(", ")", "{", "return", "new", "CodeSnippetEnvironment", "(", "this", ".", "environment", ",", "this", ".", "context", ")", ";", "}", "}", "</s>" ]
3,987
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "public", "interface", "EvaluationConstants", "{", "public", "static", "final", "char", "[", "]", "CODE_SNIPPET_CLASS_NAME_PREFIX", "=", "\"CodeSnippet_\"", ".", "toCharArray", "(", ")", ";", "public", "static", "final", "char", "[", "]", "GLOBAL_VARS_CLASS_NAME_PREFIX", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "public", "static", "final", "char", "[", "]", "PACKAGE_NAME", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "public", "static", "final", "char", "[", "]", "CODE_SNIPPET_NAME", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "public", "static", "final", "char", "[", "]", "ROOT_CLASS_NAME", "=", "\"CodeSnippet\"", ".", "toCharArray", "(", ")", ";", "public", "static", "final", "String", "ROOT_FULL_CLASS_NAME", "=", "new", "String", "(", "PACKAGE_NAME", ")", "+", "\".\"", "+", "new", "String", "(", "ROOT_CLASS_NAME", ")", ";", "public", "static", "final", "char", "[", "]", "SETRESULT_SELECTOR", "=", "\"setResult\"", ".", "toCharArray", "(", ")", ";", "public", "static", "final", "char", "[", "]", "SETRESULT_ARGUMENTS", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "public", "static", "final", "char", "[", "]", "[", "]", "ROOT_COMPOUND_NAME", "=", "CharOperation", ".", "arrayConcat", "(", "CharOperation", ".", "splitOn", "(", "'.'", ",", "PACKAGE_NAME", ")", ",", "ROOT_CLASS_NAME", ")", ";", "public", "static", "final", "String", "RUN_METHOD", "=", "\"run\"", ";", "public", "static", "final", "String", "RESULT_VALUE_FIELD", "=", "\"resultValue\"", ";", "public", "static", "final", "String", "RESULT_TYPE_FIELD", "=", "\"resultType\"", ";", "public", "static", "final", "char", "[", "]", "LOCAL_VAR_PREFIX", "=", "\"val$\"", ".", "toCharArray", "(", ")", ";", "public", "static", "final", "char", "[", "]", "DELEGATE_THIS", "=", "\"val$this\"", ".", "toCharArray", "(", ")", ";", "}", "</s>" ]
3,988
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ReturnStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TryStatement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "CodeStream", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "Opcodes", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "flow", ".", "FlowContext", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "flow", ".", "FlowInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "Constant", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "InvocationSite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeBinding", ";", "public", "class", "CodeSnippetReturnStatement", "extends", "ReturnStatement", "implements", "InvocationSite", ",", "EvaluationConstants", "{", "MethodBinding", "setResultMethod", ";", "public", "CodeSnippetReturnStatement", "(", "Expression", "expr", ",", "int", "s", ",", "int", "e", ")", "{", "super", "(", "expr", ",", "s", ",", "e", ")", ";", "}", "public", "FlowInfo", "analyseCode", "(", "BlockScope", "currentScope", ",", "FlowContext", "flowContext", ",", "FlowInfo", "flowInfo", ")", "{", "FlowInfo", "info", "=", "super", ".", "analyseCode", "(", "currentScope", ",", "flowContext", ",", "flowInfo", ")", ";", "this", ".", "expression", ".", "bits", "&=", "~", "IsReturnedValue", ";", "return", "info", ";", "}", "public", "void", "generateReturnBytecode", "(", "CodeStream", "codeStream", ")", "{", "codeStream", ".", "return_", "(", ")", ";", "}", "public", "void", "generateStoreSaveValueIfNecessary", "(", "CodeStream", "codeStream", ")", "{", "codeStream", ".", "aload_0", "(", ")", ";", "if", "(", "this", ".", "expression", "==", "null", "||", "this", ".", "expression", ".", "resolvedType", "==", "TypeBinding", ".", "VOID", ")", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "codeStream", ".", "generateClassLiteralAccessForType", "(", "TypeBinding", ".", "VOID", ",", "null", ")", ";", "}", "else", "{", "int", "valueTypeID", "=", "this", ".", "expression", ".", "resolvedType", ".", "id", ";", "if", "(", "valueTypeID", "==", "T_long", "||", "valueTypeID", "==", "T_double", ")", "{", "codeStream", ".", "dup_x2", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "}", "else", "{", "codeStream", ".", "swap", "(", ")", ";", "}", "if", "(", "this", ".", "expression", ".", "resolvedType", ".", "isBaseType", "(", ")", "&&", "this", ".", "expression", ".", "resolvedType", "!=", "TypeBinding", ".", "NULL", ")", "{", "codeStream", ".", "generateBoxingConversion", "(", "this", ".", "expression", ".", "resolvedType", ".", "id", ")", ";", "}", "codeStream", ".", "generateClassLiteralAccessForType", "(", "this", ".", "expression", ".", "resolvedType", ",", "null", ")", ";", "}", "codeStream", ".", "invoke", "(", "Opcodes", ".", "OPC_invokevirtual", ",", "this", ".", "setResultMethod", ",", "null", ")", ";", "}", "public", "TypeBinding", "[", "]", "genericTypeArguments", "(", ")", "{", "return", "null", ";", "}", "public", "boolean", "isSuperAccess", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isTypeAccess", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "needValue", "(", ")", "{", "return", "true", ";", "}", "public", "void", "prepareSaveValueLocation", "(", "TryStatement", "targetTryStatement", ")", "{", "}", "public", "void", "resolve", "(", "BlockScope", "scope", ")", "{", "if", "(", "this", ".", "expression", "!=", "null", ")", "{", "if", "(", "this", ".", "expression", ".", "resolveType", "(", "scope", ")", "!=", "null", ")", "{", "TypeBinding", "javaLangClass", "=", "scope", ".", "getJavaLangClass", "(", ")", ";", "if", "(", "!", "javaLangClass", ".", "isValidBinding", "(", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "codeSnippetMissingClass", "(", "\"\"", ",", "this", ".", "sourceStart", ",", "this", ".", "sourceEnd", ")", ";", "return", ";", "}", "TypeBinding", "javaLangObject", "=", "scope", ".", "getJavaLangObject", "(", ")", ";", "if", "(", "!", "javaLangObject", ".", "isValidBinding", "(", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "codeSnippetMissingClass", "(", "\"\"", ",", "this", ".", "sourceStart", ",", "this", ".", "sourceEnd", ")", ";", "return", ";", "}", "TypeBinding", "[", "]", "argumentTypes", "=", "new", "TypeBinding", "[", "]", "{", "javaLangObject", ",", "javaLangClass", "}", ";", "this", ".", "setResultMethod", "=", "scope", ".", "getImplicitMethod", "(", "SETRESULT_SELECTOR", ",", "argumentTypes", ",", "this", ")", ";", "if", "(", "!", "this", ".", "setResultMethod", ".", "isValidBinding", "(", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "codeSnippetMissingMethod", "(", "ROOT_FULL_CLASS_NAME", ",", "new", "String", "(", "SETRESULT_SELECTOR", ")", ",", "new", "String", "(", "SETRESULT_ARGUMENTS", ")", ",", "this", ".", "sourceStart", ",", "this", ".", "sourceEnd", ")", ";", "return", ";", "}", "if", "(", "this", ".", "expression", ".", "constant", "!=", "Constant", ".", "NotAConstant", ")", "{", "this", ".", "expression", ".", "implicitConversion", "=", "this", ".", "expression", ".", "constant", ".", "typeID", "(", ")", "<<", "4", ";", "}", "}", "}", "}", "public", "void", "setActualReceiverType", "(", "ReferenceBinding", "receiverType", ")", "{", "}", "public", "void", "setDepth", "(", "int", "depth", ")", "{", "}", "public", "void", "setFieldIndex", "(", "int", "depth", ")", "{", "}", "}", "</s>" ]
3,989
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "CompletionContext", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "CompletionProposal", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "CompletionRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Flags", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Signature", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "ISelectionRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "class", "CodeSnippetToCuMapper", "implements", "EvaluationConstants", "{", "public", "char", "[", "]", "cuSource", ";", "public", "int", "lineNumberOffset", "=", "0", ";", "public", "int", "startPosOffset", "=", "0", ";", "char", "[", "]", "codeSnippet", ";", "char", "[", "]", "snippetPackageName", ";", "char", "[", "]", "[", "]", "snippetImports", ";", "char", "[", "]", "snippetClassName", ";", "char", "[", "]", "snippetVarClassName", ";", "char", "[", "]", "snippetDeclaringTypeName", ";", "char", "[", "]", "[", "]", "localVarNames", ";", "char", "[", "]", "[", "]", "localVarTypeNames", ";", "long", "complianceVersion", ";", "public", "CodeSnippetToCuMapper", "(", "char", "[", "]", "codeSnippet", ",", "char", "[", "]", "packageName", ",", "char", "[", "]", "[", "]", "imports", ",", "char", "[", "]", "className", ",", "char", "[", "]", "varClassName", ",", "char", "[", "]", "[", "]", "localVarNames", ",", "char", "[", "]", "[", "]", "localVarTypeNames", ",", "int", "[", "]", "localVarModifiers", ",", "char", "[", "]", "declaringTypeName", ",", "String", "lineSeparator", ",", "long", "complianceVersion", ")", "{", "this", ".", "codeSnippet", "=", "codeSnippet", ";", "this", ".", "snippetPackageName", "=", "packageName", ";", "this", ".", "snippetImports", "=", "imports", ";", "this", ".", "snippetClassName", "=", "className", ";", "this", ".", "snippetVarClassName", "=", "varClassName", ";", "this", ".", "localVarNames", "=", "localVarNames", ";", "this", ".", "localVarTypeNames", "=", "localVarTypeNames", ";", "this", ".", "snippetDeclaringTypeName", "=", "declaringTypeName", ";", "this", ".", "complianceVersion", "=", "complianceVersion", ";", "buildCUSource", "(", "lineSeparator", ")", ";", "}", "private", "void", "buildCUSource", "(", "String", "lineSeparator", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "if", "(", "this", ".", "snippetPackageName", "!=", "null", "&&", "this", ".", "snippetPackageName", ".", "length", "!=", "0", ")", "{", "buffer", ".", "append", "(", "\"package", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "snippetPackageName", ")", ";", "buffer", ".", "append", "(", "\";\"", ")", ".", "append", "(", "lineSeparator", ")", ";", "this", ".", "lineNumberOffset", "++", ";", "}", "char", "[", "]", "[", "]", "imports", "=", "this", ".", "snippetImports", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "imports", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "\"import", "\"", ")", ";", "buffer", ".", "append", "(", "imports", "[", "i", "]", ")", ";", "buffer", ".", "append", "(", "';'", ")", ".", "append", "(", "lineSeparator", ")", ";", "this", ".", "lineNumberOffset", "++", ";", "}", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "snippetClassName", ")", ";", "if", "(", "this", ".", "snippetVarClassName", "!=", "null", ")", "{", "buffer", ".", "append", "(", "\"", "extends", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "snippetVarClassName", ")", ";", "}", "else", "{", "buffer", ".", "append", "(", "\"", "extends", "\"", ")", ";", "buffer", ".", "append", "(", "PACKAGE_NAME", ")", ";", "buffer", ".", "append", "(", "\".\"", ")", ";", "buffer", ".", "append", "(", "ROOT_CLASS_NAME", ")", ";", "}", "buffer", ".", "append", "(", "\"", "{\"", ")", ".", "append", "(", "lineSeparator", ")", ";", "this", ".", "lineNumberOffset", "++", ";", "if", "(", "this", ".", "snippetDeclaringTypeName", "!=", "null", ")", "{", "buffer", ".", "append", "(", "\"", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "snippetDeclaringTypeName", ")", ";", "buffer", ".", "append", "(", "\"", "\"", ")", ";", "buffer", ".", "append", "(", "DELEGATE_THIS", ")", ";", "buffer", ".", "append", "(", "';'", ")", ".", "append", "(", "lineSeparator", ")", ";", "this", ".", "lineNumberOffset", "++", ";", "}", "if", "(", "this", ".", "localVarNames", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "this", ".", "localVarNames", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "\"", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "localVarTypeNames", "[", "i", "]", ")", ";", "buffer", ".", "append", "(", "\"", "\"", ")", ";", "buffer", ".", "append", "(", "LOCAL_VAR_PREFIX", ")", ";", "buffer", ".", "append", "(", "this", ".", "localVarNames", "[", "i", "]", ")", ";", "buffer", ".", "append", "(", "';'", ")", ".", "append", "(", "lineSeparator", ")", ";", "this", ".", "lineNumberOffset", "++", ";", "}", "}", "if", "(", "this", ".", "complianceVersion", ">=", "ClassFileConstants", ".", "JDK1_5", ")", "{", "buffer", ".", "append", "(", "\"@Override", "\"", ")", ";", "}", "buffer", ".", "append", "(", "\"\"", ")", ".", "append", "(", "lineSeparator", ")", ";", "this", ".", "lineNumberOffset", "++", ";", "this", ".", "startPosOffset", "=", "buffer", ".", "length", "(", ")", ";", "buffer", ".", "append", "(", "this", ".", "codeSnippet", ")", ";", "buffer", ".", "append", "(", "lineSeparator", ")", ".", "append", "(", "'}'", ")", ".", "append", "(", "lineSeparator", ")", ";", "buffer", ".", "append", "(", "'}'", ")", ".", "append", "(", "lineSeparator", ")", ";", "int", "length", "=", "buffer", ".", "length", "(", ")", ";", "this", ".", "cuSource", "=", "new", "char", "[", "length", "]", ";", "buffer", ".", "getChars", "(", "0", ",", "length", ",", "this", ".", "cuSource", ",", "0", ")", ";", "}", "public", "CompletionRequestor", "getCompletionRequestor", "(", "final", "CompletionRequestor", "originalRequestor", ")", "{", "return", "new", "CompletionRequestor", "(", ")", "{", "public", "void", "accept", "(", "CompletionProposal", "proposal", ")", "{", "switch", "(", "proposal", ".", "getKind", "(", ")", ")", "{", "case", "CompletionProposal", ".", "TYPE_REF", ":", "int", "flags", "=", "proposal", ".", "getFlags", "(", ")", ";", "if", "(", "(", "flags", "&", "Flags", ".", "AccEnum", ")", "==", "0", "&&", "(", "flags", "&", "Flags", ".", "AccInterface", ")", "==", "0", ")", "{", "char", "[", "]", "packageName", "=", "proposal", ".", "getDeclarationSignature", "(", ")", ";", "char", "[", "]", "className", "=", "Signature", ".", "getSignatureSimpleName", "(", "proposal", ".", "getSignature", "(", ")", ")", ";", "if", "(", "CharOperation", ".", "equals", "(", "packageName", ",", "CodeSnippetToCuMapper", ".", "this", ".", "snippetPackageName", ")", "&&", "(", "CharOperation", ".", "equals", "(", "className", ",", "CodeSnippetToCuMapper", ".", "this", ".", "snippetClassName", ")", "||", "CharOperation", ".", "equals", "(", "className", ",", "CodeSnippetToCuMapper", ".", "this", ".", "snippetVarClassName", ")", ")", ")", "return", ";", "if", "(", "CharOperation", ".", "equals", "(", "packageName", ",", "PACKAGE_NAME", ")", "&&", "CharOperation", ".", "equals", "(", "className", ",", "ROOT_CLASS_NAME", ")", ")", "return", ";", "}", "break", ";", "case", "CompletionProposal", ".", "METHOD_REF", ":", "case", "CompletionProposal", ".", "METHOD_DECLARATION", ":", "case", "CompletionProposal", ".", "METHOD_REF_WITH_CASTED_RECEIVER", ":", "char", "[", "]", "declaringTypePackageName", "=", "Signature", ".", "getSignatureQualifier", "(", "proposal", ".", "getDeclarationSignature", "(", ")", ")", ";", "char", "[", "]", "declaringTypeName", "=", "Signature", ".", "getSignatureSimpleName", "(", "proposal", ".", "getDeclarationSignature", "(", ")", ")", ";", "if", "(", "CharOperation", ".", "equals", "(", "declaringTypePackageName", ",", "CodeSnippetToCuMapper", ".", "this", ".", "snippetPackageName", ")", "&&", "CharOperation", ".", "equals", "(", "declaringTypeName", ",", "CodeSnippetToCuMapper", ".", "this", ".", "snippetClassName", ")", ")", "return", ";", "if", "(", "CharOperation", ".", "equals", "(", "declaringTypePackageName", ",", "PACKAGE_NAME", ")", "&&", "CharOperation", ".", "equals", "(", "declaringTypeName", ",", "ROOT_CLASS_NAME", ")", ")", "return", ";", "break", ";", "}", "originalRequestor", ".", "accept", "(", "proposal", ")", ";", "}", "public", "void", "completionFailure", "(", "IProblem", "problem", ")", "{", "problem", ".", "setSourceStart", "(", "problem", ".", "getSourceStart", "(", ")", "-", "CodeSnippetToCuMapper", ".", "this", ".", "startPosOffset", ")", ";", "problem", ".", "setSourceEnd", "(", "problem", ".", "getSourceEnd", "(", ")", "-", "CodeSnippetToCuMapper", ".", "this", ".", "startPosOffset", ")", ";", "problem", ".", "setSourceLineNumber", "(", "problem", ".", "getSourceLineNumber", "(", ")", "-", "CodeSnippetToCuMapper", ".", "this", ".", "lineNumberOffset", ")", ";", "originalRequestor", ".", "completionFailure", "(", "problem", ")", ";", "}", "public", "void", "acceptContext", "(", "CompletionContext", "context", ")", "{", "originalRequestor", ".", "acceptContext", "(", "context", ")", ";", "}", "public", "void", "beginReporting", "(", ")", "{", "originalRequestor", ".", "beginReporting", "(", ")", ";", "}", "public", "void", "endReporting", "(", ")", "{", "originalRequestor", ".", "endReporting", "(", ")", ";", "}", "public", "boolean", "isIgnored", "(", "int", "completionProposalKind", ")", "{", "return", "originalRequestor", ".", "isIgnored", "(", "completionProposalKind", ")", ";", "}", "public", "void", "setIgnored", "(", "int", "completionProposalKind", ",", "boolean", "ignore", ")", "{", "originalRequestor", ".", "setIgnored", "(", "completionProposalKind", ",", "ignore", ")", ";", "}", "public", "boolean", "isAllowingRequiredProposals", "(", "int", "mainKind", ",", "int", "requiredKind", ")", "{", "return", "originalRequestor", ".", "isAllowingRequiredProposals", "(", "mainKind", ",", "requiredKind", ")", ";", "}", "public", "void", "setAllowsRequiredProposals", "(", "int", "mainKind", ",", "int", "requiredKind", ",", "boolean", "allow", ")", "{", "originalRequestor", ".", "setAllowsRequiredProposals", "(", "mainKind", ",", "requiredKind", ",", "allow", ")", ";", "}", "}", ";", "}", "public", "char", "[", "]", "getCUSource", "(", "String", "lineSeparator", ")", "{", "if", "(", "this", ".", "cuSource", "==", "null", ")", "{", "buildCUSource", "(", "lineSeparator", ")", ";", "}", "return", "this", ".", "cuSource", ";", "}", "public", "int", "getEvaluationType", "(", "int", "lineNumber", ")", "{", "int", "currentLine", "=", "1", ";", "if", "(", "this", ".", "snippetPackageName", "!=", "null", "&&", "this", ".", "snippetPackageName", ".", "length", "!=", "0", ")", "{", "if", "(", "lineNumber", "==", "1", ")", "{", "return", "EvaluationResult", ".", "T_PACKAGE", ";", "}", "currentLine", "++", ";", "}", "char", "[", "]", "[", "]", "imports", "=", "this", ".", "snippetImports", ";", "if", "(", "(", "currentLine", "<=", "lineNumber", ")", "&&", "(", "lineNumber", "<", "(", "currentLine", "+", "imports", ".", "length", ")", ")", ")", "{", "return", "EvaluationResult", ".", "T_IMPORT", ";", "}", "currentLine", "+=", "imports", ".", "length", "+", "1", ";", "currentLine", "+=", "(", "this", ".", "snippetDeclaringTypeName", "==", "null", "?", "0", ":", "1", ")", "+", "(", "this", ".", "localVarNames", "==", "null", "?", "0", ":", "this", ".", "localVarNames", ".", "length", ")", ";", "if", "(", "currentLine", ">", "lineNumber", ")", "{", "return", "EvaluationResult", ".", "T_INTERNAL", ";", "}", "currentLine", "++", ";", "if", "(", "currentLine", ">=", "this", ".", "lineNumberOffset", ")", "{", "return", "EvaluationResult", ".", "T_CODE_SNIPPET", ";", "}", "return", "EvaluationResult", ".", "T_INTERNAL", ";", "}", "public", "char", "[", "]", "getImport", "(", "int", "lineNumber", ")", "{", "int", "importStartLine", "=", "this", ".", "lineNumberOffset", "-", "1", "-", "this", ".", "snippetImports", ".", "length", ";", "return", "this", ".", "snippetImports", "[", "lineNumber", "-", "importStartLine", "]", ";", "}", "public", "ISelectionRequestor", "getSelectionRequestor", "(", "final", "ISelectionRequestor", "originalRequestor", ")", "{", "return", "new", "ISelectionRequestor", "(", ")", "{", "public", "void", "acceptType", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "typeName", ",", "int", "modifiers", ",", "boolean", "isDeclaration", ",", "char", "[", "]", "uniqueKey", ",", "int", "start", ",", "int", "end", ")", "{", "originalRequestor", ".", "acceptType", "(", "packageName", ",", "typeName", ",", "modifiers", ",", "isDeclaration", ",", "uniqueKey", ",", "start", ",", "end", ")", ";", "}", "public", "void", "acceptError", "(", "CategorizedProblem", "error", ")", "{", "error", ".", "setSourceLineNumber", "(", "error", ".", "getSourceLineNumber", "(", ")", "-", "CodeSnippetToCuMapper", ".", "this", ".", "lineNumberOffset", ")", ";", "error", ".", "setSourceStart", "(", "error", ".", "getSourceStart", "(", ")", "-", "CodeSnippetToCuMapper", ".", "this", ".", "startPosOffset", ")", ";", "error", ".", "setSourceEnd", "(", "error", ".", "getSourceEnd", "(", ")", "-", "CodeSnippetToCuMapper", ".", "this", ".", "startPosOffset", ")", ";", "originalRequestor", ".", "acceptError", "(", "error", ")", ";", "}", "public", "void", "acceptField", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "name", ",", "boolean", "isDeclaration", ",", "char", "[", "]", "uniqueKey", ",", "int", "start", ",", "int", "end", ")", "{", "originalRequestor", ".", "acceptField", "(", "declaringTypePackageName", ",", "declaringTypeName", ",", "name", ",", "isDeclaration", ",", "uniqueKey", ",", "start", ",", "end", ")", ";", "}", "public", "void", "acceptMethod", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "String", "enclosingDeclaringTypeSignature", ",", "char", "[", "]", "selector", ",", "char", "[", "]", "[", "]", "parameterPackageNames", ",", "char", "[", "]", "[", "]", "parameterTypeNames", ",", "String", "[", "]", "parameterSignatures", ",", "char", "[", "]", "[", "]", "typeParameterNames", ",", "char", "[", "]", "[", "]", "[", "]", "typeParameterBoundNames", ",", "boolean", "isConstructor", ",", "boolean", "isDeclaration", ",", "char", "[", "]", "uniqueKey", ",", "int", "start", ",", "int", "end", ")", "{", "originalRequestor", ".", "acceptMethod", "(", "declaringTypePackageName", ",", "declaringTypeName", ",", "enclosingDeclaringTypeSignature", ",", "selector", ",", "parameterPackageNames", ",", "parameterTypeNames", ",", "parameterSignatures", ",", "typeParameterNames", ",", "typeParameterBoundNames", ",", "isConstructor", ",", "isDeclaration", ",", "uniqueKey", ",", "start", ",", "end", ")", ";", "}", "public", "void", "acceptPackage", "(", "char", "[", "]", "packageName", ")", "{", "originalRequestor", ".", "acceptPackage", "(", "packageName", ")", ";", "}", "public", "void", "acceptTypeParameter", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "typeParameterName", ",", "boolean", "isDeclaration", ",", "int", "start", ",", "int", "end", ")", "{", "originalRequestor", ".", "acceptTypeParameter", "(", "declaringTypePackageName", ",", "declaringTypeName", ",", "typeParameterName", ",", "isDeclaration", ",", "start", ",", "end", ")", ";", "}", "public", "void", "acceptMethodTypeParameter", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "selector", ",", "int", "selectorStart", ",", "int", "selectorEnd", ",", "char", "[", "]", "typeParameterName", ",", "boolean", "isDeclaration", ",", "int", "start", ",", "int", "end", ")", "{", "originalRequestor", ".", "acceptMethodTypeParameter", "(", "declaringTypePackageName", ",", "declaringTypeName", ",", "selector", ",", "selectorStart", ",", "selectorEnd", ",", "typeParameterName", ",", "isDeclaration", ",", "start", ",", "end", ")", ";", "}", "}", ";", "}", "}", "</s>" ]
3,990
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ClassFile", ";", "public", "class", "VariablesInfo", "{", "GlobalVariable", "[", "]", "variables", ";", "int", "variableCount", ";", "char", "[", "]", "packageName", ";", "char", "[", "]", "className", ";", "ClassFile", "[", "]", "classFiles", ";", "public", "VariablesInfo", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "className", ",", "ClassFile", "[", "]", "classFiles", ",", "GlobalVariable", "[", "]", "variables", ",", "int", "variableCount", ")", "{", "this", ".", "packageName", "=", "packageName", ";", "this", ".", "className", "=", "className", ";", "this", ".", "classFiles", "=", "classFiles", ";", "this", ".", "variables", "=", "variables", ";", "this", ".", "variableCount", "=", "variableCount", ";", "}", "int", "indexOf", "(", "GlobalVariable", "var", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "variableCount", ";", "i", "++", ")", "{", "if", "(", "var", ".", "equals", "(", "this", ".", "variables", "[", "i", "]", ")", ")", "{", "return", "i", ";", "}", "}", "return", "-", "1", ";", "}", "GlobalVariable", "varNamed", "(", "char", "[", "]", "name", ")", "{", "GlobalVariable", "[", "]", "vars", "=", "this", ".", "variables", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "variableCount", ";", "i", "++", ")", "{", "GlobalVariable", "var", "=", "vars", "[", "i", "]", ";", "if", "(", "CharOperation", ".", "equals", "(", "name", ",", "var", ".", "name", ")", ")", "{", "return", "var", ";", "}", "}", "return", "null", ";", "}", "}", "</s>" ]
3,991
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "CompilationResult", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Binding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Parser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemReporter", ";", "public", "class", "CodeSnippetParser", "extends", "Parser", "implements", "EvaluationConstants", "{", "int", "codeSnippetStart", ",", "codeSnippetEnd", ";", "EvaluationContext", "evaluationContext", ";", "boolean", "hasRecoveredOnExpression", ";", "int", "lastStatement", "=", "-", "1", ";", "int", "lineSeparatorLength", ";", "int", "problemCountBeforeRecovery", "=", "0", ";", "public", "CodeSnippetParser", "(", "ProblemReporter", "problemReporter", ",", "EvaluationContext", "evaluationContext", ",", "boolean", "optimizeStringLiterals", ",", "int", "codeSnippetStart", ",", "int", "codeSnippetEnd", ")", "{", "super", "(", "problemReporter", ",", "optimizeStringLiterals", ")", ";", "this", ".", "codeSnippetStart", "=", "codeSnippetStart", ";", "this", ".", "codeSnippetEnd", "=", "codeSnippetEnd", ";", "this", ".", "evaluationContext", "=", "evaluationContext", ";", "this", ".", "reportOnlyOneSyntaxError", "=", "true", ";", "this", ".", "javadocParser", ".", "checkDocComment", "=", "false", ";", "}", "protected", "void", "classInstanceCreation", "(", "boolean", "alwaysQualified", ")", "{", "AllocationExpression", "alloc", ";", "int", "length", ";", "if", "(", "(", "(", "length", "=", "this", ".", "astLengthStack", "[", "this", ".", "astLengthPtr", "--", "]", ")", "==", "1", ")", "&&", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", "==", "null", ")", ")", "{", "this", ".", "astPtr", "--", ";", "if", "(", "alwaysQualified", ")", "{", "alloc", "=", "new", "QualifiedAllocationExpression", "(", ")", ";", "}", "else", "{", "alloc", "=", "new", "CodeSnippetAllocationExpression", "(", "this", ".", "evaluationContext", ")", ";", "}", "alloc", ".", "sourceEnd", "=", "this", ".", "endPosition", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "this", ".", "expressionPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "this", ".", "expressionPtr", "+", "1", ",", "alloc", ".", "arguments", "=", "new", "Expression", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "alloc", ".", "type", "=", "getTypeReference", "(", "0", ")", ";", "checkForDiamond", "(", "alloc", ".", "type", ")", ";", "alloc", ".", "sourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "pushOnExpressionStack", "(", "alloc", ")", ";", "}", "else", "{", "dispatchDeclarationInto", "(", "length", ")", ";", "TypeDeclaration", "anonymousTypeDeclaration", "=", "(", "TypeDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "anonymousTypeDeclaration", ".", "declarationSourceEnd", "=", "this", ".", "endStatementPosition", ";", "if", "(", "anonymousTypeDeclaration", ".", "allocation", "!=", "null", ")", "{", "anonymousTypeDeclaration", ".", "allocation", ".", "sourceEnd", "=", "this", ".", "endStatementPosition", ";", "}", "this", ".", "astPtr", "--", ";", "this", ".", "astLengthPtr", "--", ";", "}", "}", "protected", "void", "consumeClassInstanceCreationExpressionWithTypeArguments", "(", ")", "{", "AllocationExpression", "alloc", ";", "int", "length", ";", "if", "(", "(", "(", "length", "=", "this", ".", "astLengthStack", "[", "this", ".", "astLengthPtr", "--", "]", ")", "==", "1", ")", "&&", "(", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", "==", "null", ")", ")", "{", "this", ".", "astPtr", "--", ";", "alloc", "=", "new", "CodeSnippetAllocationExpression", "(", "this", ".", "evaluationContext", ")", ";", "alloc", ".", "sourceEnd", "=", "this", ".", "endPosition", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "this", ".", "expressionPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "this", ".", "expressionPtr", "+", "1", ",", "alloc", ".", "arguments", "=", "new", "Expression", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "alloc", ".", "type", "=", "getTypeReference", "(", "0", ")", ";", "length", "=", "this", ".", "genericsLengthStack", "[", "this", ".", "genericsLengthPtr", "--", "]", ";", "this", ".", "genericsPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "genericsStack", ",", "this", ".", "genericsPtr", "+", "1", ",", "alloc", ".", "typeArguments", "=", "new", "TypeReference", "[", "length", "]", ",", "0", ",", "length", ")", ";", "this", ".", "intPtr", "--", ";", "alloc", ".", "sourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "pushOnExpressionStack", "(", "alloc", ")", ";", "}", "else", "{", "dispatchDeclarationInto", "(", "length", ")", ";", "TypeDeclaration", "anonymousTypeDeclaration", "=", "(", "TypeDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "anonymousTypeDeclaration", ".", "declarationSourceEnd", "=", "this", ".", "endStatementPosition", ";", "anonymousTypeDeclaration", ".", "bodyEnd", "=", "this", ".", "endStatementPosition", ";", "if", "(", "length", "==", "0", "&&", "!", "containsComment", "(", "anonymousTypeDeclaration", ".", "bodyStart", ",", "anonymousTypeDeclaration", ".", "bodyEnd", ")", ")", "{", "anonymousTypeDeclaration", ".", "bits", "|=", "ASTNode", ".", "UndocumentedEmptyBlock", ";", "}", "this", ".", "astPtr", "--", ";", "this", ".", "astLengthPtr", "--", ";", "QualifiedAllocationExpression", "allocationExpression", "=", "anonymousTypeDeclaration", ".", "allocation", ";", "if", "(", "allocationExpression", "!=", "null", ")", "{", "allocationExpression", ".", "sourceEnd", "=", "this", ".", "endStatementPosition", ";", "length", "=", "this", ".", "genericsLengthStack", "[", "this", ".", "genericsLengthPtr", "--", "]", ";", "this", ".", "genericsPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "genericsStack", ",", "this", ".", "genericsPtr", "+", "1", ",", "allocationExpression", ".", "typeArguments", "=", "new", "TypeReference", "[", "length", "]", ",", "0", ",", "length", ")", ";", "allocationExpression", ".", "sourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "}", "}", "}", "protected", "void", "consumeClassDeclaration", "(", ")", "{", "super", ".", "consumeClassDeclaration", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeClassHeaderName1", "(", ")", "{", "TypeDeclaration", "typeDecl", ";", "if", "(", "this", ".", "nestedMethod", "[", "this", ".", "nestedType", "]", "==", "0", ")", "{", "if", "(", "this", ".", "nestedType", "!=", "0", ")", "{", "typeDecl", "=", "new", "TypeDeclaration", "(", "this", ".", "compilationUnit", ".", "compilationResult", ")", ";", "typeDecl", ".", "bits", "|=", "ASTNode", ".", "IsMemberType", ";", "}", "else", "{", "typeDecl", "=", "new", "CodeSnippetTypeDeclaration", "(", "this", ".", "compilationUnit", ".", "compilationResult", ")", ";", "}", "}", "else", "{", "typeDecl", "=", "new", "TypeDeclaration", "(", "this", ".", "compilationUnit", ".", "compilationResult", ")", ";", "typeDecl", ".", "bits", "|=", "ASTNode", ".", "IsLocalType", ";", "markEnclosingMemberWithLocalType", "(", ")", ";", "blockReal", "(", ")", ";", "}", "long", "pos", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ";", "typeDecl", ".", "sourceEnd", "=", "(", "int", ")", "pos", ";", "typeDecl", ".", "sourceStart", "=", "(", "int", ")", "(", "pos", ">>>", "32", ")", ";", "typeDecl", ".", "name", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "this", ".", "identifierLengthPtr", "--", ";", "typeDecl", ".", "declarationSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "this", ".", "intPtr", "--", ";", "typeDecl", ".", "modifiersSourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "typeDecl", ".", "modifiers", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "if", "(", "typeDecl", ".", "modifiersSourceStart", ">=", "0", ")", "{", "typeDecl", ".", "declarationSourceStart", "=", "typeDecl", ".", "modifiersSourceStart", ";", "}", "typeDecl", ".", "bodyStart", "=", "typeDecl", ".", "sourceEnd", "+", "1", ";", "pushOnAstStack", "(", "typeDecl", ")", ";", "this", ".", "listLength", "=", "0", ";", "if", "(", "this", ".", "currentElement", "!=", "null", ")", "{", "this", ".", "lastCheckPoint", "=", "typeDecl", ".", "bodyStart", ";", "this", ".", "currentElement", "=", "this", ".", "currentElement", ".", "add", "(", "typeDecl", ",", "0", ")", ";", "this", ".", "lastIgnoredToken", "=", "-", "1", ";", "}", "typeDecl", ".", "javadoc", "=", "this", ".", "javadoc", ";", "this", ".", "javadoc", "=", "null", ";", "}", "protected", "void", "consumeEmptyStatement", "(", ")", "{", "super", ".", "consumeEmptyStatement", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeEnhancedForStatement", "(", ")", "{", "super", ".", "consumeEnhancedForStatement", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeExpressionStatement", "(", ")", "{", "super", ".", "consumeExpressionStatement", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeFieldAccess", "(", "boolean", "isSuperAccess", ")", "{", "FieldReference", "fr", "=", "new", "CodeSnippetFieldReference", "(", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ",", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ",", "this", ".", "evaluationContext", ")", ";", "this", ".", "identifierLengthPtr", "--", ";", "if", "(", "isSuperAccess", ")", "{", "fr", ".", "sourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "problemReporter", "(", ")", ".", "codeSnippetMissingClass", "(", "null", ",", "0", ",", "0", ")", ";", "fr", ".", "receiver", "=", "new", "CodeSnippetSuperReference", "(", "fr", ".", "sourceStart", ",", "this", ".", "endPosition", ")", ";", "pushOnExpressionStack", "(", "fr", ")", ";", "}", "else", "{", "if", "(", "(", "fr", ".", "receiver", "=", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", ")", ".", "isThis", "(", ")", ")", "{", "fr", ".", "sourceStart", "=", "fr", ".", "receiver", ".", "sourceStart", ";", "}", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "]", "=", "fr", ";", "}", "}", "protected", "void", "consumeInternalCompilationUnit", "(", ")", "{", "}", "protected", "void", "consumeInternalCompilationUnitWithTypes", "(", ")", "{", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "astLengthStack", "[", "this", ".", "astLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "this", ".", "compilationUnit", ".", "types", "=", "new", "TypeDeclaration", "[", "length", "]", ";", "this", ".", "astPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "astStack", ",", "this", ".", "astPtr", "+", "1", ",", "this", ".", "compilationUnit", ".", "types", ",", "0", ",", "length", ")", ";", "}", "}", "protected", "void", "consumeLocalVariableDeclarationStatement", "(", ")", "{", "super", ".", "consumeLocalVariableDeclarationStatement", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeMethodDeclaration", "(", "boolean", "isNotAbstract", ")", "{", "super", ".", "consumeMethodDeclaration", "(", "isNotAbstract", ")", ";", "MethodDeclaration", "methodDecl", "=", "(", "MethodDeclaration", ")", "this", ".", "astStack", "[", "this", ".", "astPtr", "]", ";", "if", "(", "isTopLevelType", "(", ")", ")", "{", "int", "last", "=", "methodDecl", ".", "statements", "==", "null", "?", "-", "1", ":", "methodDecl", ".", "statements", ".", "length", "-", "1", ";", "if", "(", "last", ">=", "0", "&&", "methodDecl", ".", "statements", "[", "last", "]", "instanceof", "Expression", ")", "{", "Expression", "lastExpression", "=", "(", "Expression", ")", "methodDecl", ".", "statements", "[", "last", "]", ";", "methodDecl", ".", "statements", "[", "last", "]", "=", "new", "CodeSnippetReturnStatement", "(", "lastExpression", ",", "lastExpression", ".", "sourceStart", ",", "lastExpression", ".", "sourceEnd", ")", ";", "}", "}", "int", "start", "=", "methodDecl", ".", "bodyStart", "-", "1", ",", "end", "=", "start", ";", "long", "position", "=", "(", "(", "long", ")", "start", "<<", "32", ")", "+", "end", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "]", "{", "position", "}", ";", "if", "(", "this", ".", "evaluationContext", ".", "localVariableNames", "!=", "null", ")", "{", "int", "varCount", "=", "this", ".", "evaluationContext", ".", "localVariableNames", ".", "length", ";", "Statement", "[", "]", "newStatements", "=", "new", "Statement", "[", "varCount", "+", "1", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "varCount", ";", "i", "++", ")", "{", "char", "[", "]", "trimmedTypeName", "=", "this", ".", "evaluationContext", ".", "localVariableTypeNames", "[", "i", "]", ";", "int", "nameEnd", "=", "CharOperation", ".", "indexOf", "(", "'['", ",", "trimmedTypeName", ")", ";", "if", "(", "nameEnd", ">=", "0", ")", "{", "trimmedTypeName", "=", "CharOperation", ".", "subarray", "(", "trimmedTypeName", ",", "0", ",", "nameEnd", ")", ";", "}", "nameEnd", "=", "CharOperation", ".", "indexOf", "(", "'", "'", ",", "trimmedTypeName", ")", ";", "if", "(", "nameEnd", ">=", "0", ")", "{", "trimmedTypeName", "=", "CharOperation", ".", "subarray", "(", "trimmedTypeName", ",", "0", ",", "nameEnd", ")", ";", "}", "TypeReference", "typeReference", ";", "if", "(", "CharOperation", ".", "indexOf", "(", "'.'", ",", "trimmedTypeName", ")", "==", "-", "1", ")", "{", "typeReference", "=", "new", "SingleTypeReference", "(", "trimmedTypeName", ",", "position", ")", ";", "}", "else", "{", "typeReference", "=", "new", "QualifiedTypeReference", "(", "CharOperation", ".", "splitOn", "(", "'.'", ",", "trimmedTypeName", ")", ",", "positions", ")", ";", "}", "int", "dimCount", "=", "CharOperation", ".", "occurencesOf", "(", "'['", ",", "this", ".", "evaluationContext", ".", "localVariableTypeNames", "[", "i", "]", ")", ";", "if", "(", "dimCount", ">", "0", ")", "{", "typeReference", "=", "copyDims", "(", "typeReference", ",", "dimCount", ")", ";", "}", "NameReference", "init", "=", "new", "SingleNameReference", "(", "CharOperation", ".", "concat", "(", "LOCAL_VAR_PREFIX", ",", "this", ".", "evaluationContext", ".", "localVariableNames", "[", "i", "]", ")", ",", "position", ")", ";", "LocalDeclaration", "declaration", "=", "new", "LocalDeclaration", "(", "this", ".", "evaluationContext", ".", "localVariableNames", "[", "i", "]", ",", "start", ",", "end", ")", ";", "declaration", ".", "initialization", "=", "init", ";", "declaration", ".", "type", "=", "typeReference", ";", "declaration", ".", "modifiers", "=", "this", ".", "evaluationContext", ".", "localVariableModifiers", "[", "i", "]", ";", "newStatements", "[", "i", "]", "=", "declaration", ";", "}", "TryStatement", "tryStatement", "=", "new", "TryStatement", "(", ")", ";", "Block", "tryBlock", "=", "new", "Block", "(", "methodDecl", ".", "explicitDeclarations", ")", ";", "tryBlock", ".", "sourceStart", "=", "start", ";", "tryBlock", ".", "sourceEnd", "=", "end", ";", "tryBlock", ".", "statements", "=", "methodDecl", ".", "statements", ";", "tryStatement", ".", "tryBlock", "=", "tryBlock", ";", "Block", "finallyBlock", "=", "new", "Block", "(", "0", ")", ";", "finallyBlock", ".", "sourceStart", "=", "start", ";", "finallyBlock", ".", "sourceEnd", "=", "end", ";", "finallyBlock", ".", "statements", "=", "new", "Statement", "[", "varCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "varCount", ";", "i", "++", ")", "{", "SingleNameReference", "nameRef", "=", "new", "SingleNameReference", "(", "this", ".", "evaluationContext", ".", "localVariableNames", "[", "i", "]", ",", "position", ")", ";", "finallyBlock", ".", "statements", "[", "i", "]", "=", "new", "Assignment", "(", "new", "SingleNameReference", "(", "CharOperation", ".", "concat", "(", "LOCAL_VAR_PREFIX", ",", "this", ".", "evaluationContext", ".", "localVariableNames", "[", "i", "]", ")", ",", "position", ")", ",", "nameRef", ",", "nameRef", ".", "sourceEnd", ")", ";", "}", "tryStatement", ".", "finallyBlock", "=", "finallyBlock", ";", "newStatements", "[", "varCount", "]", "=", "tryStatement", ";", "methodDecl", ".", "statements", "=", "newStatements", ";", "}", "}", "protected", "void", "consumeMethodInvocationName", "(", ")", "{", "if", "(", "this", ".", "scanner", ".", "startPosition", ">=", "this", ".", "codeSnippetStart", "&&", "this", ".", "scanner", ".", "startPosition", "<=", "this", ".", "codeSnippetEnd", "+", "1", "+", "this", ".", "lineSeparatorLength", "&&", "isTopLevelType", "(", ")", ")", "{", "MessageSend", "m", "=", "newMessageSend", "(", ")", ";", "m", ".", "sourceEnd", "=", "this", ".", "rParenPos", ";", "m", ".", "sourceStart", "=", "(", "int", ")", "(", "(", "m", ".", "nameSourcePosition", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ")", ">>>", "32", ")", ";", "m", ".", "selector", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "if", "(", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "]", "==", "1", ")", "{", "m", ".", "receiver", "=", "new", "CodeSnippetThisReference", "(", "0", ",", "0", ",", "this", ".", "evaluationContext", ",", "true", ")", ";", "this", ".", "identifierLengthPtr", "--", ";", "}", "else", "{", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "]", "--", ";", "m", ".", "receiver", "=", "getUnspecifiedReference", "(", ")", ";", "m", ".", "sourceStart", "=", "m", ".", "receiver", ".", "sourceStart", ";", "}", "pushOnExpressionStack", "(", "m", ")", ";", "}", "else", "{", "super", ".", "consumeMethodInvocationName", "(", ")", ";", "}", "}", "protected", "void", "consumeMethodInvocationNameWithTypeArguments", "(", ")", "{", "if", "(", "this", ".", "scanner", ".", "startPosition", ">=", "this", ".", "codeSnippetStart", "&&", "this", ".", "scanner", ".", "startPosition", "<=", "this", ".", "codeSnippetEnd", "+", "1", "+", "this", ".", "lineSeparatorLength", "&&", "isTopLevelType", "(", ")", ")", "{", "MessageSend", "m", "=", "newMessageSendWithTypeArguments", "(", ")", ";", "m", ".", "sourceEnd", "=", "this", ".", "rParenPos", ";", "m", ".", "sourceStart", "=", "(", "int", ")", "(", "(", "m", ".", "nameSourcePosition", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ")", ">>>", "32", ")", ";", "m", ".", "selector", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "this", ".", "identifierLengthPtr", "--", ";", "int", "length", "=", "this", ".", "genericsLengthStack", "[", "this", ".", "genericsLengthPtr", "--", "]", ";", "this", ".", "genericsPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "genericsStack", ",", "this", ".", "genericsPtr", "+", "1", ",", "m", ".", "typeArguments", "=", "new", "TypeReference", "[", "length", "]", ",", "0", ",", "length", ")", ";", "this", ".", "intPtr", "--", ";", "m", ".", "receiver", "=", "getUnspecifiedReference", "(", ")", ";", "m", ".", "sourceStart", "=", "m", ".", "receiver", ".", "sourceStart", ";", "pushOnExpressionStack", "(", "m", ")", ";", "}", "else", "{", "super", ".", "consumeMethodInvocationNameWithTypeArguments", "(", ")", ";", "}", "}", "protected", "void", "consumeMethodInvocationSuper", "(", ")", "{", "MessageSend", "m", "=", "newMessageSend", "(", ")", ";", "m", ".", "sourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "m", ".", "sourceEnd", "=", "this", ".", "rParenPos", ";", "m", ".", "nameSourcePosition", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ";", "m", ".", "selector", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "this", ".", "identifierLengthPtr", "--", ";", "m", ".", "receiver", "=", "new", "CodeSnippetSuperReference", "(", "m", ".", "sourceStart", ",", "this", ".", "endPosition", ")", ";", "pushOnExpressionStack", "(", "m", ")", ";", "}", "protected", "void", "consumeMethodInvocationSuperWithTypeArguments", "(", ")", "{", "MessageSend", "m", "=", "newMessageSendWithTypeArguments", "(", ")", ";", "this", ".", "intPtr", "--", ";", "m", ".", "sourceEnd", "=", "this", ".", "rParenPos", ";", "m", ".", "nameSourcePosition", "=", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "]", ";", "m", ".", "selector", "=", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "--", "]", ";", "this", ".", "identifierLengthPtr", "--", ";", "int", "length", "=", "this", ".", "genericsLengthStack", "[", "this", ".", "genericsLengthPtr", "--", "]", ";", "this", ".", "genericsPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "genericsStack", ",", "this", ".", "genericsPtr", "+", "1", ",", "m", ".", "typeArguments", "=", "new", "TypeReference", "[", "length", "]", ",", "0", ",", "length", ")", ";", "m", ".", "sourceStart", "=", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ";", "m", ".", "receiver", "=", "new", "CodeSnippetSuperReference", "(", "m", ".", "sourceStart", ",", "this", ".", "endPosition", ")", ";", "pushOnExpressionStack", "(", "m", ")", ";", "}", "protected", "void", "consumePrimaryNoNewArrayThis", "(", ")", "{", "if", "(", "this", ".", "scanner", ".", "startPosition", ">=", "this", ".", "codeSnippetStart", "&&", "this", ".", "scanner", ".", "startPosition", "<=", "this", ".", "codeSnippetEnd", "+", "1", "+", "this", ".", "lineSeparatorLength", "&&", "isTopLevelType", "(", ")", ")", "{", "pushOnExpressionStack", "(", "new", "CodeSnippetThisReference", "(", "this", ".", "intStack", "[", "this", ".", "intPtr", "--", "]", ",", "this", ".", "endPosition", ",", "this", ".", "evaluationContext", ",", "false", ")", ")", ";", "}", "else", "{", "super", ".", "consumePrimaryNoNewArrayThis", "(", ")", ";", "}", "}", "protected", "void", "consumeStatementBreak", "(", ")", "{", "super", ".", "consumeStatementBreak", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementBreakWithLabel", "(", ")", "{", "super", ".", "consumeStatementBreakWithLabel", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementCatch", "(", ")", "{", "super", ".", "consumeStatementCatch", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementContinue", "(", ")", "{", "super", ".", "consumeStatementContinue", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementContinueWithLabel", "(", ")", "{", "super", ".", "consumeStatementContinueWithLabel", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementDo", "(", ")", "{", "super", ".", "consumeStatementDo", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementFor", "(", ")", "{", "super", ".", "consumeStatementFor", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementIfNoElse", "(", ")", "{", "super", ".", "consumeStatementIfNoElse", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementIfWithElse", "(", ")", "{", "super", ".", "consumeStatementIfWithElse", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementLabel", "(", ")", "{", "super", ".", "consumeStatementLabel", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementReturn", "(", ")", "{", "if", "(", "(", "this", ".", "hasRecoveredOnExpression", "||", "(", "this", ".", "scanner", ".", "startPosition", ">=", "this", ".", "codeSnippetStart", "&&", "this", ".", "scanner", ".", "startPosition", "<=", "this", ".", "codeSnippetEnd", "+", "1", "+", "this", ".", "lineSeparatorLength", ")", ")", "&&", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "]", "!=", "0", "&&", "isTopLevelType", "(", ")", ")", "{", "this", ".", "expressionLengthPtr", "--", ";", "Expression", "expression", "=", "this", ".", "expressionStack", "[", "this", ".", "expressionPtr", "--", "]", ";", "pushOnAstStack", "(", "new", "CodeSnippetReturnStatement", "(", "expression", ",", "expression", ".", "sourceStart", ",", "expression", ".", "sourceEnd", ")", ")", ";", "}", "else", "{", "super", ".", "consumeStatementReturn", "(", ")", ";", "}", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementSwitch", "(", ")", "{", "super", ".", "consumeStatementSwitch", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementSynchronized", "(", ")", "{", "super", ".", "consumeStatementSynchronized", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementThrow", "(", ")", "{", "super", ".", "consumeStatementThrow", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementTry", "(", "boolean", "arg_0", ",", "boolean", "arg_1", ")", "{", "super", ".", "consumeStatementTry", "(", "arg_0", ",", "arg_1", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "void", "consumeStatementWhile", "(", ")", "{", "super", ".", "consumeStatementWhile", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "protected", "CompilationUnitDeclaration", "endParse", "(", "int", "act", ")", "{", "if", "(", "this", ".", "hasRecoveredOnExpression", ")", "{", "CompilationResult", "unitResult", "=", "this", ".", "compilationUnit", ".", "compilationResult", ";", "if", "(", "act", "!=", "ERROR_ACTION", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "unitResult", ".", "problemCount", ";", "i", "++", ")", "{", "unitResult", ".", "problems", "[", "i", "]", "=", "null", ";", "}", "unitResult", ".", "problemCount", "=", "0", ";", "if", "(", "this", ".", "referenceContext", "instanceof", "AbstractMethodDeclaration", ")", "{", "(", "(", "AbstractMethodDeclaration", ")", "this", ".", "referenceContext", ")", ".", "ignoreFurtherInvestigation", "=", "false", ";", "}", "if", "(", "this", ".", "referenceContext", "instanceof", "CompilationUnitDeclaration", ")", "{", "(", "(", "CompilationUnitDeclaration", ")", "this", ".", "referenceContext", ")", ".", "ignoreFurtherInvestigation", "=", "false", ";", "}", "consumeStatementReturn", "(", ")", ";", "int", "fieldsCount", "=", "(", "this", ".", "evaluationContext", ".", "localVariableNames", "==", "null", "?", "0", ":", "this", ".", "evaluationContext", ".", "localVariableNames", ".", "length", ")", "+", "(", "this", ".", "evaluationContext", ".", "declaringTypeName", "==", "null", "?", "0", ":", "1", ")", ";", "if", "(", "this", ".", "astPtr", ">", "(", "this", ".", "diet", "?", "0", ":", "2", "+", "fieldsCount", ")", ")", "{", "consumeBlockStatements", "(", ")", ";", "}", "consumeMethodBody", "(", ")", ";", "if", "(", "!", "this", ".", "diet", ")", "{", "consumeMethodDeclaration", "(", "true", ")", ";", "if", "(", "fieldsCount", ">", "0", ")", "{", "consumeClassBodyDeclarations", "(", ")", ";", "}", "consumeClassBodyDeclarationsopt", "(", ")", ";", "consumeClassDeclaration", "(", ")", ";", "consumeInternalCompilationUnitWithTypes", "(", ")", ";", "consumeCompilationUnit", "(", ")", ";", "}", "this", ".", "lastAct", "=", "ACCEPT_ACTION", ";", "}", "else", "{", "int", "maxRegularPos", "=", "0", ",", "problemCount", "=", "unitResult", ".", "problemCount", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "problemCountBeforeRecovery", ";", "i", "++", ")", "{", "if", "(", "unitResult", ".", "problems", "[", "i", "]", ".", "getID", "(", ")", "==", "IProblem", ".", "UnmatchedBracket", ")", "continue", ";", "int", "start", "=", "unitResult", ".", "problems", "[", "i", "]", ".", "getSourceStart", "(", ")", ";", "if", "(", "start", ">", "maxRegularPos", "&&", "start", "<=", "this", ".", "codeSnippetEnd", ")", "{", "maxRegularPos", "=", "start", ";", "}", "}", "int", "maxRecoveryPos", "=", "0", ";", "for", "(", "int", "i", "=", "this", ".", "problemCountBeforeRecovery", ";", "i", "<", "problemCount", ";", "i", "++", ")", "{", "if", "(", "unitResult", ".", "problems", "[", "i", "]", ".", "getID", "(", ")", "==", "IProblem", ".", "UnmatchedBracket", ")", "continue", ";", "int", "start", "=", "unitResult", ".", "problems", "[", "i", "]", ".", "getSourceStart", "(", ")", ";", "if", "(", "start", ">", "maxRecoveryPos", "&&", "start", "<=", "this", ".", "codeSnippetEnd", ")", "{", "maxRecoveryPos", "=", "start", ";", "}", "}", "if", "(", "maxRecoveryPos", ">", "maxRegularPos", ")", "{", "System", ".", "arraycopy", "(", "unitResult", ".", "problems", ",", "this", ".", "problemCountBeforeRecovery", ",", "unitResult", ".", "problems", ",", "0", ",", "problemCount", "-", "this", ".", "problemCountBeforeRecovery", ")", ";", "unitResult", ".", "problemCount", "-=", "this", ".", "problemCountBeforeRecovery", ";", "}", "else", "{", "unitResult", ".", "problemCount", "-=", "(", "problemCount", "-", "this", ".", "problemCountBeforeRecovery", ")", ";", "}", "for", "(", "int", "i", "=", "unitResult", ".", "problemCount", ";", "i", "<", "problemCount", ";", "i", "++", ")", "{", "unitResult", ".", "problems", "[", "i", "]", "=", "null", ";", "}", "}", "}", "return", "super", ".", "endParse", "(", "act", ")", ";", "}", "protected", "NameReference", "getUnspecifiedReference", "(", ")", "{", "if", "(", "this", ".", "scanner", ".", "startPosition", ">=", "this", ".", "codeSnippetStart", "&&", "this", ".", "scanner", ".", "startPosition", "<=", "this", ".", "codeSnippetEnd", "+", "1", "+", "this", ".", "lineSeparatorLength", ")", "{", "int", "length", ";", "NameReference", "ref", ";", "if", "(", "(", "length", "=", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "--", "]", ")", "==", "1", ")", "{", "ref", "=", "new", "CodeSnippetSingleNameReference", "(", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ",", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ",", "this", ".", "evaluationContext", ")", ";", "}", "else", "{", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "length", "]", "[", "]", ";", "this", ".", "identifierPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "tokens", ",", "0", ",", "length", ")", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "positions", ",", "0", ",", "length", ")", ";", "ref", "=", "new", "CodeSnippetQualifiedNameReference", "(", "tokens", ",", "positions", ",", "(", "int", ")", "(", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "+", "1", "]", ">>", "32", ")", ",", "(", "int", ")", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "+", "length", "]", ",", "this", ".", "evaluationContext", ")", ";", "}", "return", "ref", ";", "}", "else", "{", "return", "super", ".", "getUnspecifiedReference", "(", ")", ";", "}", "}", "protected", "NameReference", "getUnspecifiedReferenceOptimized", "(", ")", "{", "if", "(", "this", ".", "scanner", ".", "startPosition", ">=", "this", ".", "codeSnippetStart", "&&", "this", ".", "scanner", ".", "startPosition", "<=", "this", ".", "codeSnippetEnd", "+", "1", "+", "this", ".", "lineSeparatorLength", ")", "{", "int", "length", ";", "NameReference", "ref", ";", "if", "(", "(", "length", "=", "this", ".", "identifierLengthStack", "[", "this", ".", "identifierLengthPtr", "--", "]", ")", "==", "1", ")", "{", "ref", "=", "new", "CodeSnippetSingleNameReference", "(", "this", ".", "identifierStack", "[", "this", ".", "identifierPtr", "]", ",", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "--", "]", ",", "this", ".", "evaluationContext", ")", ";", "ref", ".", "bits", "&=", "~", "ASTNode", ".", "RestrictiveFlagMASK", ";", "ref", ".", "bits", "|=", "Binding", ".", "LOCAL", "|", "Binding", ".", "FIELD", ";", "return", "ref", ";", "}", "char", "[", "]", "[", "]", "tokens", "=", "new", "char", "[", "length", "]", "[", "]", ";", "this", ".", "identifierPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "tokens", ",", "0", ",", "length", ")", ";", "long", "[", "]", "positions", "=", "new", "long", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "identifierPositionStack", ",", "this", ".", "identifierPtr", "+", "1", ",", "positions", ",", "0", ",", "length", ")", ";", "ref", "=", "new", "CodeSnippetQualifiedNameReference", "(", "tokens", ",", "positions", ",", "(", "int", ")", "(", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "+", "1", "]", ">>", "32", ")", ",", "(", "int", ")", "this", ".", "identifierPositionStack", "[", "this", ".", "identifierPtr", "+", "length", "]", ",", "this", ".", "evaluationContext", ")", ";", "ref", ".", "bits", "&=", "~", "ASTNode", ".", "RestrictiveFlagMASK", ";", "ref", ".", "bits", "|=", "Binding", ".", "LOCAL", "|", "Binding", ".", "FIELD", ";", "return", "ref", ";", "}", "else", "{", "return", "super", ".", "getUnspecifiedReferenceOptimized", "(", ")", ";", "}", "}", "protected", "void", "ignoreExpressionAssignment", "(", ")", "{", "super", ".", "ignoreExpressionAssignment", "(", ")", ";", "recordLastStatementIfNeeded", "(", ")", ";", "}", "private", "boolean", "isTopLevelType", "(", ")", "{", "return", "this", ".", "nestedType", "==", "(", "this", ".", "diet", "?", "0", ":", "1", ")", ";", "}", "protected", "MessageSend", "newMessageSend", "(", ")", "{", "CodeSnippetMessageSend", "m", "=", "new", "CodeSnippetMessageSend", "(", "this", ".", "evaluationContext", ")", ";", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "this", ".", "expressionPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "this", ".", "expressionPtr", "+", "1", ",", "m", ".", "arguments", "=", "new", "Expression", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "return", "m", ";", "}", "protected", "MessageSend", "newMessageSendWithTypeArguments", "(", ")", "{", "CodeSnippetMessageSend", "m", "=", "new", "CodeSnippetMessageSend", "(", "this", ".", "evaluationContext", ")", ";", "int", "length", ";", "if", "(", "(", "length", "=", "this", ".", "expressionLengthStack", "[", "this", ".", "expressionLengthPtr", "--", "]", ")", "!=", "0", ")", "{", "this", ".", "expressionPtr", "-=", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "expressionStack", ",", "this", ".", "expressionPtr", "+", "1", ",", "m", ".", "arguments", "=", "new", "Expression", "[", "length", "]", ",", "0", ",", "length", ")", ";", "}", "return", "m", ";", "}", "private", "void", "recordLastStatementIfNeeded", "(", ")", "{", "if", "(", "(", "isTopLevelType", "(", ")", ")", "&&", "(", "this", ".", "scanner", ".", "startPosition", "<=", "this", ".", "codeSnippetEnd", "+", "this", ".", "lineSeparatorLength", ")", ")", "{", "this", ".", "lastStatement", "=", "this", ".", "scanner", ".", "startPosition", ";", "}", "}", "protected", "void", "reportSyntaxErrors", "(", "boolean", "isDietParse", ",", "int", "oldFirstToken", ")", "{", "if", "(", "!", "isDietParse", ")", "{", "this", ".", "scanner", ".", "initialPosition", "=", "this", ".", "lastStatement", ";", "this", ".", "scanner", ".", "eofPosition", "=", "this", ".", "codeSnippetEnd", "+", "1", ";", "oldFirstToken", "=", "TokenNameTWIDDLE", ";", "}", "super", ".", "reportSyntaxErrors", "(", "isDietParse", ",", "oldFirstToken", ")", ";", "}", "protected", "boolean", "resumeOnSyntaxError", "(", ")", "{", "if", "(", "this", ".", "diet", "||", "this", ".", "hasRecoveredOnExpression", ")", "{", "return", "false", ";", "}", "this", ".", "problemCountBeforeRecovery", "=", "this", ".", "compilationUnit", ".", "compilationResult", ".", "problemCount", ";", "if", "(", "this", ".", "lastStatement", "<", "0", ")", "{", "this", ".", "lastStatement", "=", "this", ".", "codeSnippetStart", ";", "}", "this", ".", "scanner", ".", "initialPosition", "=", "this", ".", "lastStatement", ";", "this", ".", "scanner", ".", "startPosition", "=", "this", ".", "lastStatement", ";", "this", ".", "scanner", ".", "currentPosition", "=", "this", ".", "lastStatement", ";", "this", ".", "scanner", ".", "eofPosition", "=", "this", ".", "codeSnippetEnd", "<", "Integer", ".", "MAX_VALUE", "?", "this", ".", "codeSnippetEnd", "+", "1", ":", "this", ".", "codeSnippetEnd", ";", "this", ".", "scanner", ".", "commentPtr", "=", "-", "1", ";", "this", ".", "expressionPtr", "=", "-", "1", ";", "this", ".", "identifierPtr", "=", "-", "1", ";", "this", ".", "identifierLengthPtr", "=", "-", "1", ";", "goForExpression", "(", ")", ";", "this", ".", "hasRecoveredOnExpression", "=", "true", ";", "this", ".", "hasReportedError", "=", "false", ";", "this", ".", "hasError", "=", "false", ";", "return", "true", ";", "}", "}", "</s>" ]
3,992
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "public", "class", "EvaluationResult", "{", "static", "final", "CategorizedProblem", "[", "]", "NO_PROBLEMS", "=", "new", "CategorizedProblem", "[", "0", "]", ";", "char", "[", "]", "evaluationID", ";", "int", "evaluationType", ";", "CategorizedProblem", "[", "]", "problems", ";", "char", "[", "]", "displayString", ";", "char", "[", "]", "typeName", ";", "public", "static", "final", "int", "T_VARIABLE", "=", "1", ";", "public", "static", "final", "int", "T_CODE_SNIPPET", "=", "2", ";", "public", "static", "final", "int", "T_IMPORT", "=", "3", ";", "public", "static", "final", "int", "T_PACKAGE", "=", "4", ";", "public", "static", "final", "int", "T_INTERNAL", "=", "5", ";", "public", "EvaluationResult", "(", "char", "[", "]", "evaluationID", ",", "int", "evaluationType", ",", "char", "[", "]", "displayString", ",", "char", "[", "]", "typeName", ")", "{", "this", ".", "evaluationID", "=", "evaluationID", ";", "this", ".", "evaluationType", "=", "evaluationType", ";", "this", ".", "displayString", "=", "displayString", ";", "this", ".", "typeName", "=", "typeName", ";", "this", ".", "problems", "=", "NO_PROBLEMS", ";", "}", "public", "EvaluationResult", "(", "char", "[", "]", "evaluationID", ",", "int", "evaluationType", ",", "CategorizedProblem", "[", "]", "problems", ")", "{", "this", ".", "evaluationID", "=", "evaluationID", ";", "this", ".", "evaluationType", "=", "evaluationType", ";", "this", ".", "problems", "=", "problems", ";", "}", "void", "addProblem", "(", "CategorizedProblem", "problem", ")", "{", "CategorizedProblem", "[", "]", "existingProblems", "=", "this", ".", "problems", ";", "int", "existingLength", "=", "existingProblems", ".", "length", ";", "this", ".", "problems", "=", "new", "CategorizedProblem", "[", "existingLength", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "existingProblems", ",", "0", ",", "this", ".", "problems", ",", "0", ",", "existingLength", ")", ";", "this", ".", "problems", "[", "existingLength", "]", "=", "problem", ";", "}", "public", "char", "[", "]", "getEvaluationID", "(", ")", "{", "return", "this", ".", "evaluationID", ";", "}", "public", "int", "getEvaluationType", "(", ")", "{", "return", "this", ".", "evaluationType", ";", "}", "public", "CategorizedProblem", "[", "]", "getProblems", "(", ")", "{", "return", "this", ".", "problems", ";", "}", "public", "Object", "getValue", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getValueDisplayString", "(", ")", "{", "return", "this", ".", "displayString", ";", "}", "public", "char", "[", "]", "getValueTypeName", "(", ")", "{", "return", "this", ".", "typeName", ";", "}", "public", "boolean", "hasErrors", "(", ")", "{", "if", "(", "this", ".", "problems", "==", "null", ")", "{", "return", "false", ";", "}", "else", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "problems", ".", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "problems", "[", "i", "]", ".", "isError", "(", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "}", "public", "boolean", "hasProblems", "(", ")", "{", "return", "(", "this", ".", "problems", "!=", "null", ")", "&&", "(", "this", ".", "problems", ".", "length", "!=", "0", ")", ";", "}", "public", "boolean", "hasValue", "(", ")", "{", "return", "this", ".", "displayString", "!=", "null", ";", "}", "public", "boolean", "hasWarnings", "(", ")", "{", "if", "(", "this", ".", "problems", "==", "null", ")", "{", "return", "false", ";", "}", "else", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "problems", ".", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "problems", "[", "i", "]", ".", "isWarning", "(", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "switch", "(", "this", ".", "evaluationType", ")", "{", "case", "T_CODE_SNIPPET", ":", "buffer", ".", "append", "(", "\"Code", "snippet\"", ")", ";", "break", ";", "case", "T_IMPORT", ":", "buffer", ".", "append", "(", "\"Import\"", ")", ";", "break", ";", "case", "T_INTERNAL", ":", "buffer", ".", "append", "(", "\"\"", ")", ";", "break", ";", "case", "T_PACKAGE", ":", "buffer", ".", "append", "(", "\"Package\"", ")", ";", "break", ";", "case", "T_VARIABLE", ":", "buffer", ".", "append", "(", "\"\"", ")", ";", "break", ";", "}", "buffer", ".", "append", "(", "\":", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "evaluationID", "==", "null", "?", "\"<unknown>\"", ".", "toCharArray", "(", ")", ":", "this", ".", "evaluationID", ")", ";", "buffer", ".", "append", "(", "\"n\"", ")", ";", "if", "(", "hasProblems", "(", ")", ")", "{", "buffer", ".", "append", "(", "\"Problems:n\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "problems", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "this", ".", "problems", "[", "i", "]", ".", "toString", "(", ")", ")", ";", "}", "}", "else", "{", "if", "(", "hasValue", "(", ")", ")", "{", "buffer", ".", "append", "(", "\"(\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "typeName", ")", ";", "buffer", ".", "append", "(", "\")", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "displayString", ")", ";", "}", "else", "{", "buffer", ".", "append", "(", "\"\"", ")", ";", "}", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,993
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ArrayBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Binding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "FieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "InvocationSite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "PackageBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemFieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemMethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemReasons", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Scope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "VariableBinding", ";", "public", "class", "CodeSnippetScope", "extends", "BlockScope", "{", "protected", "CodeSnippetScope", "(", "int", "kind", ",", "Scope", "parent", ")", "{", "super", "(", "kind", ",", "parent", ")", ";", "}", "public", "CodeSnippetScope", "(", "BlockScope", "parent", ")", "{", "super", "(", "parent", ")", ";", "}", "public", "CodeSnippetScope", "(", "BlockScope", "parent", ",", "int", "variableCount", ")", "{", "super", "(", "parent", ",", "variableCount", ")", ";", "}", "public", "final", "boolean", "canBeSeenByForCodeSnippet", "(", "FieldBinding", "fieldBinding", ",", "TypeBinding", "receiverType", ",", "InvocationSite", "invocationSite", ",", "Scope", "scope", ")", "{", "if", "(", "fieldBinding", ".", "isPublic", "(", ")", ")", "return", "true", ";", "ReferenceBinding", "invocationType", "=", "(", "ReferenceBinding", ")", "receiverType", ";", "if", "(", "invocationType", "==", "fieldBinding", ".", "declaringClass", ")", "return", "true", ";", "if", "(", "fieldBinding", ".", "isProtected", "(", ")", ")", "{", "if", "(", "invocationType", "==", "fieldBinding", ".", "declaringClass", ")", "return", "true", ";", "if", "(", "invocationType", ".", "fPackage", "==", "fieldBinding", ".", "declaringClass", ".", "fPackage", ")", "return", "true", ";", "if", "(", "fieldBinding", ".", "declaringClass", ".", "isSuperclassOf", "(", "invocationType", ")", ")", "{", "if", "(", "invocationSite", ".", "isSuperAccess", "(", ")", ")", "return", "true", ";", "if", "(", "receiverType", "instanceof", "ArrayBinding", ")", "return", "false", ";", "if", "(", "invocationType", ".", "isSuperclassOf", "(", "(", "ReferenceBinding", ")", "receiverType", ")", ")", "return", "true", ";", "if", "(", "fieldBinding", ".", "isStatic", "(", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "if", "(", "fieldBinding", ".", "isPrivate", "(", ")", ")", "{", "if", "(", "receiverType", "!=", "fieldBinding", ".", "declaringClass", ")", "return", "false", ";", "if", "(", "invocationType", "!=", "fieldBinding", ".", "declaringClass", ")", "{", "ReferenceBinding", "outerInvocationType", "=", "invocationType", ";", "ReferenceBinding", "temp", "=", "outerInvocationType", ".", "enclosingType", "(", ")", ";", "while", "(", "temp", "!=", "null", ")", "{", "outerInvocationType", "=", "temp", ";", "temp", "=", "temp", ".", "enclosingType", "(", ")", ";", "}", "ReferenceBinding", "outerDeclaringClass", "=", "fieldBinding", ".", "declaringClass", ";", "temp", "=", "outerDeclaringClass", ".", "enclosingType", "(", ")", ";", "while", "(", "temp", "!=", "null", ")", "{", "outerDeclaringClass", "=", "temp", ";", "temp", "=", "temp", ".", "enclosingType", "(", ")", ";", "}", "if", "(", "outerInvocationType", "!=", "outerDeclaringClass", ")", "return", "false", ";", "}", "return", "true", ";", "}", "if", "(", "invocationType", ".", "fPackage", "!=", "fieldBinding", ".", "declaringClass", ".", "fPackage", ")", "return", "false", ";", "if", "(", "receiverType", "instanceof", "ArrayBinding", ")", "return", "false", ";", "ReferenceBinding", "type", "=", "(", "ReferenceBinding", ")", "receiverType", ";", "PackageBinding", "declaringPackage", "=", "fieldBinding", ".", "declaringClass", ".", "fPackage", ";", "TypeBinding", "originalDeclaringClass", "=", "fieldBinding", ".", "declaringClass", ".", "original", "(", ")", ";", "do", "{", "if", "(", "type", ".", "isCapture", "(", ")", ")", "{", "if", "(", "originalDeclaringClass", "==", "type", ".", "erasure", "(", ")", ".", "original", "(", ")", ")", "return", "true", ";", "}", "else", "{", "if", "(", "originalDeclaringClass", "==", "type", ".", "original", "(", ")", ")", "return", "true", ";", "}", "if", "(", "declaringPackage", "!=", "type", ".", "fPackage", ")", "return", "false", ";", "}", "while", "(", "(", "type", "=", "type", ".", "superclass", "(", ")", ")", "!=", "null", ")", ";", "return", "false", ";", "}", "public", "final", "boolean", "canBeSeenByForCodeSnippet", "(", "MethodBinding", "methodBinding", ",", "TypeBinding", "receiverType", ",", "InvocationSite", "invocationSite", ",", "Scope", "scope", ")", "{", "if", "(", "methodBinding", ".", "isPublic", "(", ")", ")", "return", "true", ";", "ReferenceBinding", "invocationType", "=", "(", "ReferenceBinding", ")", "receiverType", ";", "if", "(", "invocationType", "==", "methodBinding", ".", "declaringClass", ")", "return", "true", ";", "if", "(", "methodBinding", ".", "isProtected", "(", ")", ")", "{", "if", "(", "invocationType", "==", "methodBinding", ".", "declaringClass", ")", "return", "true", ";", "if", "(", "invocationType", ".", "fPackage", "==", "methodBinding", ".", "declaringClass", ".", "fPackage", ")", "return", "true", ";", "if", "(", "methodBinding", ".", "declaringClass", ".", "isSuperclassOf", "(", "invocationType", ")", ")", "{", "if", "(", "invocationSite", ".", "isSuperAccess", "(", ")", ")", "return", "true", ";", "if", "(", "receiverType", "instanceof", "ArrayBinding", ")", "return", "false", ";", "if", "(", "invocationType", ".", "isSuperclassOf", "(", "(", "ReferenceBinding", ")", "receiverType", ")", ")", "return", "true", ";", "if", "(", "methodBinding", ".", "isStatic", "(", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "if", "(", "methodBinding", ".", "isPrivate", "(", ")", ")", "{", "if", "(", "receiverType", "!=", "methodBinding", ".", "declaringClass", ")", "return", "false", ";", "if", "(", "invocationType", "!=", "methodBinding", ".", "declaringClass", ")", "{", "ReferenceBinding", "outerInvocationType", "=", "invocationType", ";", "ReferenceBinding", "temp", "=", "outerInvocationType", ".", "enclosingType", "(", ")", ";", "while", "(", "temp", "!=", "null", ")", "{", "outerInvocationType", "=", "temp", ";", "temp", "=", "temp", ".", "enclosingType", "(", ")", ";", "}", "ReferenceBinding", "outerDeclaringClass", "=", "methodBinding", ".", "declaringClass", ";", "temp", "=", "outerDeclaringClass", ".", "enclosingType", "(", ")", ";", "while", "(", "temp", "!=", "null", ")", "{", "outerDeclaringClass", "=", "temp", ";", "temp", "=", "temp", ".", "enclosingType", "(", ")", ";", "}", "if", "(", "outerInvocationType", "!=", "outerDeclaringClass", ")", "return", "false", ";", "}", "return", "true", ";", "}", "if", "(", "invocationType", ".", "fPackage", "!=", "methodBinding", ".", "declaringClass", ".", "fPackage", ")", "return", "false", ";", "if", "(", "receiverType", "instanceof", "ArrayBinding", ")", "return", "false", ";", "ReferenceBinding", "type", "=", "(", "ReferenceBinding", ")", "receiverType", ";", "PackageBinding", "declaringPackage", "=", "methodBinding", ".", "declaringClass", ".", "fPackage", ";", "TypeBinding", "originalDeclaringClass", "=", "methodBinding", ".", "declaringClass", ".", "original", "(", ")", ";", "do", "{", "if", "(", "type", ".", "isCapture", "(", ")", ")", "{", "if", "(", "originalDeclaringClass", "==", "type", ".", "erasure", "(", ")", ".", "original", "(", ")", ")", "return", "true", ";", "}", "else", "{", "if", "(", "originalDeclaringClass", "==", "type", ".", "original", "(", ")", ")", "return", "true", ";", "}", "if", "(", "declaringPackage", "!=", "type", ".", "fPackage", ")", "return", "false", ";", "}", "while", "(", "(", "type", "=", "type", ".", "superclass", "(", ")", ")", "!=", "null", ")", ";", "return", "false", ";", "}", "public", "final", "boolean", "canBeSeenByForCodeSnippet", "(", "ReferenceBinding", "referenceBinding", ",", "ReferenceBinding", "receiverType", ")", "{", "if", "(", "referenceBinding", ".", "isPublic", "(", ")", ")", "return", "true", ";", "if", "(", "receiverType", "==", "referenceBinding", ")", "return", "true", ";", "if", "(", "referenceBinding", ".", "isProtected", "(", ")", ")", "{", "return", "receiverType", ".", "fPackage", "==", "referenceBinding", ".", "fPackage", "||", "referenceBinding", ".", "isSuperclassOf", "(", "receiverType", ")", "||", "referenceBinding", ".", "enclosingType", "(", ")", ".", "isSuperclassOf", "(", "receiverType", ")", ";", "}", "if", "(", "referenceBinding", ".", "isPrivate", "(", ")", ")", "{", "ReferenceBinding", "outerInvocationType", "=", "receiverType", ";", "ReferenceBinding", "temp", "=", "outerInvocationType", ".", "enclosingType", "(", ")", ";", "while", "(", "temp", "!=", "null", ")", "{", "outerInvocationType", "=", "temp", ";", "temp", "=", "temp", ".", "enclosingType", "(", ")", ";", "}", "ReferenceBinding", "outerDeclaringClass", "=", "referenceBinding", ";", "temp", "=", "outerDeclaringClass", ".", "enclosingType", "(", ")", ";", "while", "(", "temp", "!=", "null", ")", "{", "outerDeclaringClass", "=", "temp", ";", "temp", "=", "temp", ".", "enclosingType", "(", ")", ";", "}", "return", "outerInvocationType", "==", "outerDeclaringClass", ";", "}", "return", "receiverType", ".", "fPackage", "==", "referenceBinding", ".", "fPackage", ";", "}", "public", "MethodBinding", "findExactMethod", "(", "ReferenceBinding", "receiverType", ",", "char", "[", "]", "selector", ",", "TypeBinding", "[", "]", "argumentTypes", ",", "InvocationSite", "invocationSite", ")", "{", "MethodBinding", "exactMethod", "=", "receiverType", ".", "getExactMethod", "(", "selector", ",", "argumentTypes", ",", "null", ")", ";", "if", "(", "exactMethod", "!=", "null", ")", "{", "if", "(", "receiverType", ".", "isInterface", "(", ")", "||", "canBeSeenByForCodeSnippet", "(", "exactMethod", ",", "receiverType", ",", "invocationSite", ",", "this", ")", ")", "return", "exactMethod", ";", "}", "return", "null", ";", "}", "public", "FieldBinding", "findFieldForCodeSnippet", "(", "TypeBinding", "receiverType", ",", "char", "[", "]", "fieldName", ",", "InvocationSite", "invocationSite", ")", "{", "if", "(", "receiverType", ".", "isBaseType", "(", ")", ")", "return", "null", ";", "if", "(", "receiverType", ".", "isArrayType", "(", ")", ")", "{", "TypeBinding", "leafType", "=", "receiverType", ".", "leafComponentType", "(", ")", ";", "if", "(", "leafType", "instanceof", "ReferenceBinding", ")", "if", "(", "!", "(", "(", "ReferenceBinding", ")", "leafType", ")", ".", "canBeSeenBy", "(", "this", ")", ")", "{", "return", "new", "ProblemFieldBinding", "(", "(", "ReferenceBinding", ")", "leafType", ",", "fieldName", ",", "ProblemReasons", ".", "ReceiverTypeNotVisible", ")", ";", "}", "if", "(", "CharOperation", ".", "equals", "(", "fieldName", ",", "TypeConstants", ".", "LENGTH", ")", ")", "return", "ArrayBinding", ".", "ArrayLength", ";", "return", "null", ";", "}", "ReferenceBinding", "currentType", "=", "(", "ReferenceBinding", ")", "receiverType", ";", "if", "(", "!", "currentType", ".", "canBeSeenBy", "(", "this", ")", ")", "return", "new", "ProblemFieldBinding", "(", "currentType", ",", "fieldName", ",", "ProblemReasons", ".", "ReceiverTypeNotVisible", ")", ";", "FieldBinding", "field", "=", "currentType", ".", "getField", "(", "fieldName", ",", "true", ")", ";", "if", "(", "field", "!=", "null", ")", "{", "if", "(", "canBeSeenByForCodeSnippet", "(", "field", ",", "currentType", ",", "invocationSite", ",", "this", ")", ")", "return", "field", ";", "else", "return", "new", "ProblemFieldBinding", "(", "field", ",", "field", ".", "declaringClass", ",", "fieldName", ",", "ProblemReasons", ".", "NotVisible", ")", ";", "}", "ReferenceBinding", "[", "]", "[", "]", "interfacesToVisit", "=", "null", ";", "int", "lastPosition", "=", "-", "1", ";", "FieldBinding", "visibleField", "=", "null", ";", "boolean", "keepLooking", "=", "true", ";", "boolean", "notVisible", "=", "false", ";", "while", "(", "keepLooking", ")", "{", "ReferenceBinding", "[", "]", "itsInterfaces", "=", "currentType", ".", "superInterfaces", "(", ")", ";", "if", "(", "itsInterfaces", "!=", "Binding", ".", "NO_SUPERINTERFACES", ")", "{", "if", "(", "interfacesToVisit", "==", "null", ")", "interfacesToVisit", "=", "new", "ReferenceBinding", "[", "5", "]", "[", "]", ";", "if", "(", "++", "lastPosition", "==", "interfacesToVisit", ".", "length", ")", "System", ".", "arraycopy", "(", "interfacesToVisit", ",", "0", ",", "interfacesToVisit", "=", "new", "ReferenceBinding", "[", "lastPosition", "*", "2", "]", "[", "]", ",", "0", ",", "lastPosition", ")", ";", "interfacesToVisit", "[", "lastPosition", "]", "=", "itsInterfaces", ";", "}", "if", "(", "(", "currentType", "=", "currentType", ".", "superclass", "(", ")", ")", "==", "null", ")", "break", ";", "if", "(", "(", "field", "=", "currentType", ".", "getField", "(", "fieldName", ",", "true", ")", ")", "!=", "null", ")", "{", "keepLooking", "=", "false", ";", "if", "(", "canBeSeenByForCodeSnippet", "(", "field", ",", "receiverType", ",", "invocationSite", ",", "this", ")", ")", "{", "if", "(", "visibleField", "==", "null", ")", "visibleField", "=", "field", ";", "else", "return", "new", "ProblemFieldBinding", "(", "visibleField", ",", "visibleField", ".", "declaringClass", ",", "fieldName", ",", "ProblemReasons", ".", "Ambiguous", ")", ";", "}", "else", "{", "notVisible", "=", "true", ";", "}", "}", "}", "if", "(", "interfacesToVisit", "!=", "null", ")", "{", "ProblemFieldBinding", "ambiguous", "=", "null", ";", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SimpleSet", "interfacesSeen", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SimpleSet", "(", "lastPosition", "*", "2", ")", ";", "done", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "lastPosition", ";", "i", "++", ")", "{", "ReferenceBinding", "[", "]", "interfaces", "=", "interfacesToVisit", "[", "i", "]", ";", "for", "(", "int", "j", "=", "0", ",", "length", "=", "interfaces", ".", "length", ";", "j", "<", "length", ";", "j", "++", ")", "{", "ReferenceBinding", "anInterface", "=", "interfaces", "[", "j", "]", ";", "if", "(", "interfacesSeen", ".", "addIfNotIncluded", "(", "anInterface", ")", "==", "anInterface", ")", "{", "if", "(", "(", "field", "=", "anInterface", ".", "getField", "(", "fieldName", ",", "true", ")", ")", "!=", "null", ")", "{", "if", "(", "visibleField", "==", "null", ")", "{", "visibleField", "=", "field", ";", "}", "else", "{", "ambiguous", "=", "new", "ProblemFieldBinding", "(", "visibleField", ",", "visibleField", ".", "declaringClass", ",", "fieldName", ",", "ProblemReasons", ".", "Ambiguous", ")", ";", "break", "done", ";", "}", "}", "else", "{", "ReferenceBinding", "[", "]", "itsInterfaces", "=", "anInterface", ".", "superInterfaces", "(", ")", ";", "if", "(", "itsInterfaces", "!=", "Binding", ".", "NO_SUPERINTERFACES", ")", "{", "if", "(", "++", "lastPosition", "==", "interfacesToVisit", ".", "length", ")", "System", ".", "arraycopy", "(", "interfacesToVisit", ",", "0", ",", "interfacesToVisit", "=", "new", "ReferenceBinding", "[", "lastPosition", "*", "2", "]", "[", "]", ",", "0", ",", "lastPosition", ")", ";", "interfacesToVisit", "[", "lastPosition", "]", "=", "itsInterfaces", ";", "}", "}", "}", "}", "}", "if", "(", "ambiguous", "!=", "null", ")", "return", "ambiguous", ";", "}", "if", "(", "visibleField", "!=", "null", ")", "return", "visibleField", ";", "if", "(", "notVisible", ")", "return", "new", "ProblemFieldBinding", "(", "currentType", ",", "fieldName", ",", "ProblemReasons", ".", "NotVisible", ")", ";", "return", "null", ";", "}", "public", "MethodBinding", "findMethod", "(", "ReferenceBinding", "receiverType", ",", "char", "[", "]", "selector", ",", "TypeBinding", "[", "]", "argumentTypes", ",", "InvocationSite", "invocationSite", ")", "{", "MethodBinding", "methodBinding", "=", "super", ".", "findMethod", "(", "receiverType", ",", "selector", ",", "argumentTypes", ",", "invocationSite", ")", ";", "if", "(", "methodBinding", "!=", "null", "&&", "methodBinding", ".", "isValidBinding", "(", ")", ")", "if", "(", "!", "canBeSeenByForCodeSnippet", "(", "methodBinding", ",", "receiverType", ",", "invocationSite", ",", "this", ")", ")", "return", "new", "ProblemMethodBinding", "(", "methodBinding", ",", "selector", ",", "argumentTypes", ",", "ProblemReasons", ".", "NotVisible", ")", ";", "return", "methodBinding", ";", "}", "public", "MethodBinding", "findMethodForArray", "(", "ArrayBinding", "receiverType", ",", "char", "[", "]", "selector", ",", "TypeBinding", "[", "]", "argumentTypes", ",", "InvocationSite", "invocationSite", ")", "{", "ReferenceBinding", "object", "=", "getJavaLangObject", "(", ")", ";", "MethodBinding", "methodBinding", "=", "object", ".", "getExactMethod", "(", "selector", ",", "argumentTypes", ",", "null", ")", ";", "if", "(", "methodBinding", "!=", "null", ")", "{", "if", "(", "argumentTypes", "==", "Binding", ".", "NO_PARAMETERS", "&&", "CharOperation", ".", "equals", "(", "selector", ",", "TypeConstants", ".", "CLONE", ")", ")", "return", "new", "MethodBinding", "(", "(", "methodBinding", ".", "modifiers", "&", "~", "ClassFileConstants", ".", "AccProtected", ")", "|", "ClassFileConstants", ".", "AccPublic", ",", "TypeConstants", ".", "CLONE", ",", "methodBinding", ".", "returnType", ",", "argumentTypes", ",", "null", ",", "object", ")", ";", "if", "(", "canBeSeenByForCodeSnippet", "(", "methodBinding", ",", "receiverType", ",", "invocationSite", ",", "this", ")", ")", "return", "methodBinding", ";", "}", "methodBinding", "=", "findMethod", "(", "object", ",", "selector", ",", "argumentTypes", ",", "invocationSite", ")", ";", "if", "(", "methodBinding", "==", "null", ")", "return", "new", "ProblemMethodBinding", "(", "selector", ",", "argumentTypes", ",", "ProblemReasons", ".", "NotFound", ")", ";", "if", "(", "methodBinding", ".", "isValidBinding", "(", ")", ")", "{", "MethodBinding", "compatibleMethod", "=", "computeCompatibleMethod", "(", "methodBinding", ",", "argumentTypes", ",", "invocationSite", ")", ";", "if", "(", "compatibleMethod", "==", "null", ")", "return", "new", "ProblemMethodBinding", "(", "methodBinding", ",", "selector", ",", "argumentTypes", ",", "ProblemReasons", ".", "NotFound", ")", ";", "methodBinding", "=", "compatibleMethod", ";", "if", "(", "!", "canBeSeenByForCodeSnippet", "(", "methodBinding", ",", "receiverType", ",", "invocationSite", ",", "this", ")", ")", "return", "new", "ProblemMethodBinding", "(", "methodBinding", ",", "selector", ",", "methodBinding", ".", "parameters", ",", "ProblemReasons", ".", "NotVisible", ")", ";", "}", "return", "methodBinding", ";", "}", "public", "Binding", "getBinding", "(", "char", "[", "]", "[", "]", "compoundName", ",", "int", "mask", ",", "InvocationSite", "invocationSite", ",", "ReferenceBinding", "receiverType", ")", "{", "Binding", "binding", "=", "getBinding", "(", "compoundName", "[", "0", "]", ",", "mask", "|", "Binding", ".", "TYPE", "|", "Binding", ".", "PACKAGE", ",", "invocationSite", ",", "true", ")", ";", "invocationSite", ".", "setFieldIndex", "(", "1", ")", ";", "if", "(", "!", "binding", ".", "isValidBinding", "(", ")", "||", "binding", "instanceof", "VariableBinding", ")", "return", "binding", ";", "int", "length", "=", "compoundName", ".", "length", ";", "int", "currentIndex", "=", "1", ";", "foundType", ":", "if", "(", "binding", "instanceof", "PackageBinding", ")", "{", "PackageBinding", "packageBinding", "=", "(", "PackageBinding", ")", "binding", ";", "while", "(", "currentIndex", "<", "length", ")", "{", "binding", "=", "packageBinding", ".", "getTypeOrPackage", "(", "compoundName", "[", "currentIndex", "++", "]", ")", ";", "invocationSite", ".", "setFieldIndex", "(", "currentIndex", ")", ";", "if", "(", "binding", "==", "null", ")", "{", "if", "(", "currentIndex", "==", "length", ")", "return", "new", "ProblemReferenceBinding", "(", "CharOperation", ".", "subarray", "(", "compoundName", ",", "0", ",", "currentIndex", ")", ",", "null", ",", "ProblemReasons", ".", "NotFound", ")", ";", "else", "return", "new", "ProblemBinding", "(", "CharOperation", ".", "subarray", "(", "compoundName", ",", "0", ",", "currentIndex", ")", ",", "ProblemReasons", ".", "NotFound", ")", ";", "}", "if", "(", "binding", "instanceof", "ReferenceBinding", ")", "{", "if", "(", "!", "binding", ".", "isValidBinding", "(", ")", ")", "return", "new", "ProblemReferenceBinding", "(", "CharOperation", ".", "subarray", "(", "compoundName", ",", "0", ",", "currentIndex", ")", ",", "(", "ReferenceBinding", ")", "(", "(", "ReferenceBinding", ")", "binding", ")", ".", "closestMatch", "(", ")", ",", "binding", ".", "problemId", "(", ")", ")", ";", "if", "(", "!", "this", ".", "canBeSeenByForCodeSnippet", "(", "(", "ReferenceBinding", ")", "binding", ",", "receiverType", ")", ")", "return", "new", "ProblemReferenceBinding", "(", "CharOperation", ".", "subarray", "(", "compoundName", ",", "0", ",", "currentIndex", ")", ",", "(", "ReferenceBinding", ")", "binding", ",", "ProblemReasons", ".", "NotVisible", ")", ";", "break", "foundType", ";", "}", "packageBinding", "=", "(", "PackageBinding", ")", "binding", ";", "}", "return", "new", "ProblemReferenceBinding", "(", "CharOperation", ".", "subarray", "(", "compoundName", ",", "0", ",", "currentIndex", ")", ",", "null", ",", "ProblemReasons", ".", "NotFound", ")", ";", "}", "while", "(", "currentIndex", "<", "length", ")", "{", "ReferenceBinding", "typeBinding", "=", "(", "ReferenceBinding", ")", "binding", ";", "char", "[", "]", "nextName", "=", "compoundName", "[", "currentIndex", "++", "]", ";", "invocationSite", ".", "setFieldIndex", "(", "currentIndex", ")", ";", "if", "(", "(", "binding", "=", "findFieldForCodeSnippet", "(", "typeBinding", ",", "nextName", ",", "invocationSite", ")", ")", "!=", "null", ")", "{", "if", "(", "!", "binding", ".", "isValidBinding", "(", ")", ")", "{", "return", "new", "ProblemFieldBinding", "(", "(", "FieldBinding", ")", "binding", ",", "(", "(", "FieldBinding", ")", "binding", ")", ".", "declaringClass", ",", "CharOperation", ".", "concatWith", "(", "CharOperation", ".", "subarray", "(", "compoundName", ",", "0", ",", "currentIndex", ")", ",", "'.'", ")", ",", "binding", ".", "problemId", "(", ")", ")", ";", "}", "break", ";", "}", "if", "(", "(", "binding", "=", "findMemberType", "(", "nextName", ",", "typeBinding", ")", ")", "==", "null", ")", "return", "new", "ProblemBinding", "(", "CharOperation", ".", "subarray", "(", "compoundName", ",", "0", ",", "currentIndex", ")", ",", "typeBinding", ",", "ProblemReasons", ".", "NotFound", ")", ";", "if", "(", "!", "binding", ".", "isValidBinding", "(", ")", ")", "return", "new", "ProblemReferenceBinding", "(", "CharOperation", ".", "subarray", "(", "compoundName", ",", "0", ",", "currentIndex", ")", ",", "(", "ReferenceBinding", ")", "(", "(", "ReferenceBinding", ")", "binding", ")", ".", "closestMatch", "(", ")", ",", "binding", ".", "problemId", "(", ")", ")", ";", "}", "if", "(", "(", "mask", "&", "Binding", ".", "FIELD", ")", "!=", "0", "&&", "(", "binding", "instanceof", "FieldBinding", ")", ")", "{", "FieldBinding", "field", "=", "(", "FieldBinding", ")", "binding", ";", "if", "(", "!", "field", ".", "isStatic", "(", ")", ")", "{", "return", "new", "ProblemFieldBinding", "(", "field", ",", "field", ".", "declaringClass", ",", "CharOperation", ".", "concatWith", "(", "CharOperation", ".", "subarray", "(", "compoundName", ",", "0", ",", "currentIndex", ")", ",", "'.'", ")", ",", "ProblemReasons", ".", "NonStaticReferenceInStaticContext", ")", ";", "}", "return", "binding", ";", "}", "if", "(", "(", "mask", "&", "Binding", ".", "TYPE", ")", "!=", "0", "&&", "(", "binding", "instanceof", "ReferenceBinding", ")", ")", "{", "return", "binding", ";", "}", "return", "new", "ProblemBinding", "(", "CharOperation", ".", "subarray", "(", "compoundName", ",", "0", ",", "currentIndex", ")", ",", "ProblemReasons", ".", "NotFound", ")", ";", "}", "public", "MethodBinding", "getConstructor", "(", "ReferenceBinding", "receiverType", ",", "TypeBinding", "[", "]", "argumentTypes", ",", "InvocationSite", "invocationSite", ")", "{", "MethodBinding", "methodBinding", "=", "receiverType", ".", "getExactConstructor", "(", "argumentTypes", ")", ";", "if", "(", "methodBinding", "!=", "null", ")", "{", "if", "(", "canBeSeenByForCodeSnippet", "(", "methodBinding", ",", "receiverType", ",", "invocationSite", ",", "this", ")", ")", "{", "return", "methodBinding", ";", "}", "}", "MethodBinding", "[", "]", "methods", "=", "receiverType", ".", "getMethods", "(", "TypeConstants", ".", "INIT", ")", ";", "if", "(", "methods", "==", "Binding", ".", "NO_METHODS", ")", "{", "return", "new", "ProblemMethodBinding", "(", "TypeConstants", ".", "INIT", ",", "argumentTypes", ",", "ProblemReasons", ".", "NotFound", ")", ";", "}", "MethodBinding", "[", "]", "compatible", "=", "new", "MethodBinding", "[", "methods", ".", "length", "]", ";", "int", "compatibleIndex", "=", "0", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "methods", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "MethodBinding", "compatibleMethod", "=", "computeCompatibleMethod", "(", "methods", "[", "i", "]", ",", "argumentTypes", ",", "invocationSite", ")", ";", "if", "(", "compatibleMethod", "!=", "null", ")", "compatible", "[", "compatibleIndex", "++", "]", "=", "compatibleMethod", ";", "}", "if", "(", "compatibleIndex", "==", "0", ")", "return", "new", "ProblemMethodBinding", "(", "TypeConstants", ".", "INIT", ",", "argumentTypes", ",", "ProblemReasons", ".", "NotFound", ")", ";", "MethodBinding", "[", "]", "visible", "=", "new", "MethodBinding", "[", "compatibleIndex", "]", ";", "int", "visibleIndex", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "compatibleIndex", ";", "i", "++", ")", "{", "MethodBinding", "method", "=", "compatible", "[", "i", "]", ";", "if", "(", "canBeSeenByForCodeSnippet", "(", "method", ",", "receiverType", ",", "invocationSite", ",", "this", ")", ")", "{", "visible", "[", "visibleIndex", "++", "]", "=", "method", ";", "}", "}", "if", "(", "visibleIndex", "==", "1", ")", "{", "return", "visible", "[", "0", "]", ";", "}", "if", "(", "visibleIndex", "==", "0", ")", "{", "return", "new", "ProblemMethodBinding", "(", "compatible", "[", "0", "]", ",", "TypeConstants", ".", "INIT", ",", "compatible", "[", "0", "]", ".", "parameters", ",", "ProblemReasons", ".", "NotVisible", ")", ";", "}", "return", "mostSpecificClassMethodBinding", "(", "visible", ",", "visibleIndex", ",", "invocationSite", ")", ";", "}", "public", "FieldBinding", "getFieldForCodeSnippet", "(", "TypeBinding", "receiverType", ",", "char", "[", "]", "fieldName", ",", "InvocationSite", "invocationSite", ")", "{", "FieldBinding", "field", "=", "findFieldForCodeSnippet", "(", "receiverType", ",", "fieldName", ",", "invocationSite", ")", ";", "if", "(", "field", "==", "null", ")", "return", "new", "ProblemFieldBinding", "(", "receiverType", "instanceof", "ReferenceBinding", "?", "(", "ReferenceBinding", ")", "receiverType", ":", "null", ",", "fieldName", ",", "ProblemReasons", ".", "NotFound", ")", ";", "else", "return", "field", ";", "}", "public", "MethodBinding", "getImplicitMethod", "(", "ReferenceBinding", "receiverType", ",", "char", "[", "]", "selector", ",", "TypeBinding", "[", "]", "argumentTypes", ",", "InvocationSite", "invocationSite", ")", "{", "MethodBinding", "methodBinding", "=", "findExactMethod", "(", "receiverType", ",", "selector", ",", "argumentTypes", ",", "invocationSite", ")", ";", "if", "(", "methodBinding", "==", "null", ")", "methodBinding", "=", "findMethod", "(", "receiverType", ",", "selector", ",", "argumentTypes", ",", "invocationSite", ")", ";", "if", "(", "methodBinding", "!=", "null", ")", "{", "if", "(", "methodBinding", ".", "isValidBinding", "(", ")", ")", "if", "(", "!", "canBeSeenByForCodeSnippet", "(", "methodBinding", ",", "receiverType", ",", "invocationSite", ",", "this", ")", ")", "return", "new", "ProblemMethodBinding", "(", "methodBinding", ",", "selector", ",", "argumentTypes", ",", "ProblemReasons", ".", "NotVisible", ")", ";", "return", "methodBinding", ";", "}", "return", "new", "ProblemMethodBinding", "(", "selector", ",", "argumentTypes", ",", "ProblemReasons", ".", "NotFound", ")", ";", "}", "}", "</s>" ]
3,994
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CastExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ParameterizedQualifiedTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Wildcard", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "CodeStream", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "Opcodes", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "flow", ".", "FlowInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "Constant", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Binding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "FieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ParameterizedTypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemMethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemReasons", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeConstants", ";", "public", "class", "CodeSnippetAllocationExpression", "extends", "AllocationExpression", "implements", "ProblemReasons", ",", "EvaluationConstants", "{", "EvaluationContext", "evaluationContext", ";", "FieldBinding", "delegateThis", ";", "public", "CodeSnippetAllocationExpression", "(", "EvaluationContext", "evaluationContext", ")", "{", "this", ".", "evaluationContext", "=", "evaluationContext", ";", "}", "public", "void", "generateCode", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "boolean", "valueRequired", ")", "{", "int", "pc", "=", "codeStream", ".", "position", ";", "MethodBinding", "codegenBinding", "=", "this", ".", "binding", ".", "original", "(", ")", ";", "ReferenceBinding", "allocatedType", "=", "codegenBinding", ".", "declaringClass", ";", "if", "(", "codegenBinding", ".", "canBeSeenBy", "(", "allocatedType", ",", "this", ",", "currentScope", ")", ")", "{", "codeStream", ".", "new_", "(", "allocatedType", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "dup", "(", ")", ";", "}", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "this", ".", "type", ".", "sourceStart", ")", ";", "if", "(", "allocatedType", ".", "isNestedType", "(", ")", ")", "{", "codeStream", ".", "generateSyntheticEnclosingInstanceValues", "(", "currentScope", ",", "allocatedType", ",", "enclosingInstance", "(", ")", ",", "this", ")", ";", "}", "if", "(", "this", ".", "arguments", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "count", "=", "this", ".", "arguments", ".", "length", ";", "i", "<", "count", ";", "i", "++", ")", "{", "this", ".", "arguments", "[", "i", "]", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "true", ")", ";", "}", "}", "if", "(", "allocatedType", ".", "isNestedType", "(", ")", ")", "{", "codeStream", ".", "generateSyntheticOuterArgumentValues", "(", "currentScope", ",", "allocatedType", ",", "this", ")", ";", "}", "codeStream", ".", "invoke", "(", "Opcodes", ".", "OPC_invokespecial", ",", "codegenBinding", ",", "null", ")", ";", "}", "else", "{", "codeStream", ".", "generateEmulationForConstructor", "(", "currentScope", ",", "codegenBinding", ")", ";", "if", "(", "this", ".", "arguments", "!=", "null", ")", "{", "int", "argsLength", "=", "this", ".", "arguments", ".", "length", ";", "codeStream", ".", "generateInlinedValue", "(", "argsLength", ")", ";", "codeStream", ".", "newArray", "(", "currentScope", ".", "createArrayType", "(", "currentScope", ".", "getType", "(", "TypeConstants", ".", "JAVA_LANG_OBJECT", ",", "3", ")", ",", "1", ")", ")", ";", "codeStream", ".", "dup", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argsLength", ";", "i", "++", ")", "{", "codeStream", ".", "generateInlinedValue", "(", "i", ")", ";", "this", ".", "arguments", "[", "i", "]", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "true", ")", ";", "TypeBinding", "parameterBinding", "=", "codegenBinding", ".", "parameters", "[", "i", "]", ";", "if", "(", "parameterBinding", ".", "isBaseType", "(", ")", "&&", "parameterBinding", "!=", "TypeBinding", ".", "NULL", ")", "{", "codeStream", ".", "generateBoxingConversion", "(", "codegenBinding", ".", "parameters", "[", "i", "]", ".", "id", ")", ";", "}", "codeStream", ".", "aastore", "(", ")", ";", "if", "(", "i", "<", "argsLength", "-", "1", ")", "{", "codeStream", ".", "dup", "(", ")", ";", "}", "}", "}", "else", "{", "codeStream", ".", "generateInlinedValue", "(", "0", ")", ";", "codeStream", ".", "newArray", "(", "currentScope", ".", "createArrayType", "(", "currentScope", ".", "getType", "(", "TypeConstants", ".", "JAVA_LANG_OBJECT", ",", "3", ")", ",", "1", ")", ")", ";", "}", "codeStream", ".", "invokeJavaLangReflectConstructorNewInstance", "(", ")", ";", "codeStream", ".", "checkcast", "(", "allocatedType", ")", ";", "}", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "this", ".", "sourceStart", ")", ";", "}", "public", "void", "manageEnclosingInstanceAccessIfNecessary", "(", "BlockScope", "currentScope", ",", "FlowInfo", "flowInfo", ")", "{", "}", "public", "void", "manageSyntheticAccessIfNecessary", "(", "BlockScope", "currentScope", ",", "FlowInfo", "flowInfo", ")", "{", "}", "public", "TypeBinding", "resolveType", "(", "BlockScope", "scope", ")", "{", "this", ".", "constant", "=", "Constant", ".", "NotAConstant", ";", "this", ".", "resolvedType", "=", "this", ".", "type", ".", "resolveType", "(", "scope", ",", "true", ")", ";", "checkParameterizedAllocation", ":", "{", "if", "(", "this", ".", "type", "instanceof", "ParameterizedQualifiedTypeReference", ")", "{", "ReferenceBinding", "currentType", "=", "(", "ReferenceBinding", ")", "this", ".", "resolvedType", ";", "if", "(", "currentType", "==", "null", ")", "return", "currentType", ";", "do", "{", "if", "(", "(", "currentType", ".", "modifiers", "&", "ClassFileConstants", ".", "AccStatic", ")", "!=", "0", ")", "break", "checkParameterizedAllocation", ";", "if", "(", "currentType", ".", "isRawType", "(", ")", ")", "break", "checkParameterizedAllocation", ";", "}", "while", "(", "(", "currentType", "=", "currentType", ".", "enclosingType", "(", ")", ")", "!=", "null", ")", ";", "ParameterizedQualifiedTypeReference", "qRef", "=", "(", "ParameterizedQualifiedTypeReference", ")", "this", ".", "type", ";", "for", "(", "int", "i", "=", "qRef", ".", "typeArguments", ".", "length", "-", "2", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "if", "(", "qRef", ".", "typeArguments", "[", "i", "]", "!=", "null", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "illegalQualifiedParameterizedTypeAllocation", "(", "this", ".", "type", ",", "this", ".", "resolvedType", ")", ";", "break", ";", "}", "}", "}", "}", "final", "boolean", "isDiamond", "=", "this", ".", "type", "!=", "null", "&&", "(", "this", ".", "type", ".", "bits", "&", "ASTNode", ".", "IsDiamond", ")", "!=", "0", ";", "if", "(", "this", ".", "typeArguments", "!=", "null", ")", "{", "int", "length", "=", "this", ".", "typeArguments", ".", "length", ";", "boolean", "argHasError", "=", "scope", ".", "compilerOptions", "(", ")", ".", "sourceLevel", "<", "ClassFileConstants", ".", "JDK1_5", ";", "this", ".", "genericTypeArguments", "=", "new", "TypeBinding", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "TypeReference", "typeReference", "=", "this", ".", "typeArguments", "[", "i", "]", ";", "if", "(", "(", "this", ".", "genericTypeArguments", "[", "i", "]", "=", "typeReference", ".", "resolveType", "(", "scope", ",", "true", ")", ")", "==", "null", ")", "{", "argHasError", "=", "true", ";", "}", "if", "(", "argHasError", "&&", "typeReference", "instanceof", "Wildcard", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "illegalUsageOfWildcard", "(", "typeReference", ")", ";", "}", "}", "if", "(", "isDiamond", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "diamondNotWithExplicitTypeArguments", "(", "this", ".", "typeArguments", ")", ";", "return", "null", ";", "}", "if", "(", "argHasError", ")", "{", "if", "(", "this", ".", "arguments", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "this", ".", "arguments", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "this", ".", "arguments", "[", "i", "]", ".", "resolveType", "(", "scope", ")", ";", "}", "}", "return", "null", ";", "}", "}", "boolean", "argsContainCast", "=", "false", ";", "TypeBinding", "[", "]", "argumentTypes", "=", "Binding", ".", "NO_PARAMETERS", ";", "if", "(", "this", ".", "arguments", "!=", "null", ")", "{", "boolean", "argHasError", "=", "false", ";", "int", "length", "=", "this", ".", "arguments", ".", "length", ";", "argumentTypes", "=", "new", "TypeBinding", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "Expression", "argument", "=", "this", ".", "arguments", "[", "i", "]", ";", "if", "(", "argument", "instanceof", "CastExpression", ")", "{", "argument", ".", "bits", "|=", "DisableUnnecessaryCastCheck", ";", "argsContainCast", "=", "true", ";", "}", "if", "(", "(", "argumentTypes", "[", "i", "]", "=", "argument", ".", "resolveType", "(", "scope", ")", ")", "==", "null", ")", "{", "argHasError", "=", "true", ";", "}", "}", "if", "(", "argHasError", ")", "{", "return", "this", ".", "resolvedType", ";", "}", "}", "if", "(", "this", ".", "resolvedType", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "!", "this", ".", "resolvedType", ".", "canBeInstantiated", "(", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "cannotInstantiate", "(", "this", ".", "type", ",", "this", ".", "resolvedType", ")", ";", "return", "this", ".", "resolvedType", ";", "}", "if", "(", "isDiamond", ")", "{", "TypeBinding", "[", "]", "inferredTypes", "=", "inferElidedTypes", "(", "(", "(", "ParameterizedTypeBinding", ")", "this", ".", "resolvedType", ")", ".", "genericType", "(", ")", ",", "null", ",", "argumentTypes", ",", "scope", ")", ";", "if", "(", "inferredTypes", "==", "null", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "cannotInferElidedTypes", "(", "this", ")", ";", "return", "this", ".", "resolvedType", "=", "null", ";", "}", "this", ".", "resolvedType", "=", "this", ".", "type", ".", "resolvedType", "=", "scope", ".", "environment", "(", ")", ".", "createParameterizedType", "(", "(", "(", "ParameterizedTypeBinding", ")", "this", ".", "resolvedType", ")", ".", "genericType", "(", ")", ",", "inferredTypes", ",", "(", "(", "ParameterizedTypeBinding", ")", "this", ".", "resolvedType", ")", ".", "enclosingType", "(", ")", ")", ";", "}", "ReferenceBinding", "allocatedType", "=", "(", "ReferenceBinding", ")", "this", ".", "resolvedType", ";", "if", "(", "!", "(", "this", ".", "binding", "=", "scope", ".", "getConstructor", "(", "allocatedType", ",", "argumentTypes", ",", "this", ")", ")", ".", "isValidBinding", "(", ")", ")", "{", "if", "(", "this", ".", "binding", "instanceof", "ProblemMethodBinding", "&&", "(", "(", "ProblemMethodBinding", ")", "this", ".", "binding", ")", ".", "problemId", "(", ")", "==", "NotVisible", ")", "{", "if", "(", "this", ".", "evaluationContext", ".", "declaringTypeName", "!=", "null", ")", "{", "this", ".", "delegateThis", "=", "scope", ".", "getField", "(", "scope", ".", "enclosingSourceType", "(", ")", ",", "DELEGATE_THIS", ",", "this", ")", ";", "if", "(", "this", ".", "delegateThis", "==", "null", ")", "{", "if", "(", "this", ".", "binding", ".", "declaringClass", "==", "null", ")", "{", "this", ".", "binding", ".", "declaringClass", "=", "allocatedType", ";", "}", "if", "(", "this", ".", "type", "!=", "null", "&&", "!", "this", ".", "type", ".", "resolvedType", ".", "isValidBinding", "(", ")", ")", "{", "return", "null", ";", "}", "scope", ".", "problemReporter", "(", ")", ".", "invalidConstructor", "(", "this", ",", "this", ".", "binding", ")", ";", "return", "this", ".", "resolvedType", ";", "}", "}", "else", "{", "if", "(", "this", ".", "binding", ".", "declaringClass", "==", "null", ")", "{", "this", ".", "binding", ".", "declaringClass", "=", "allocatedType", ";", "}", "if", "(", "this", ".", "type", "!=", "null", "&&", "!", "this", ".", "type", ".", "resolvedType", ".", "isValidBinding", "(", ")", ")", "{", "return", "null", ";", "}", "scope", ".", "problemReporter", "(", ")", ".", "invalidConstructor", "(", "this", ",", "this", ".", "binding", ")", ";", "return", "this", ".", "resolvedType", ";", "}", "CodeSnippetScope", "localScope", "=", "new", "CodeSnippetScope", "(", "scope", ")", ";", "MethodBinding", "privateBinding", "=", "localScope", ".", "getConstructor", "(", "(", "ReferenceBinding", ")", "this", ".", "delegateThis", ".", "type", ",", "argumentTypes", ",", "this", ")", ";", "if", "(", "!", "privateBinding", ".", "isValidBinding", "(", ")", ")", "{", "if", "(", "this", ".", "binding", ".", "declaringClass", "==", "null", ")", "{", "this", ".", "binding", ".", "declaringClass", "=", "allocatedType", ";", "}", "if", "(", "this", ".", "type", "!=", "null", "&&", "!", "this", ".", "type", ".", "resolvedType", ".", "isValidBinding", "(", ")", ")", "{", "return", "null", ";", "}", "scope", ".", "problemReporter", "(", ")", ".", "invalidConstructor", "(", "this", ",", "this", ".", "binding", ")", ";", "return", "this", ".", "resolvedType", ";", "}", "else", "{", "this", ".", "binding", "=", "privateBinding", ";", "}", "}", "else", "{", "if", "(", "this", ".", "binding", ".", "declaringClass", "==", "null", ")", "{", "this", ".", "binding", ".", "declaringClass", "=", "allocatedType", ";", "}", "if", "(", "this", ".", "type", "!=", "null", "&&", "!", "this", ".", "type", ".", "resolvedType", ".", "isValidBinding", "(", ")", ")", "{", "return", "null", ";", "}", "scope", ".", "problemReporter", "(", ")", ".", "invalidConstructor", "(", "this", ",", "this", ".", "binding", ")", ";", "return", "this", ".", "resolvedType", ";", "}", "}", "if", "(", "isMethodUseDeprecated", "(", "this", ".", "binding", ",", "scope", ",", "true", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "deprecatedMethod", "(", "this", ".", "binding", ",", "this", ")", ";", "}", "if", "(", "this", ".", "arguments", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "arguments", ".", "length", ";", "i", "++", ")", "{", "TypeBinding", "parameterType", "=", "this", ".", "binding", ".", "parameters", "[", "i", "]", ";", "TypeBinding", "argumentType", "=", "argumentTypes", "[", "i", "]", ";", "this", ".", "arguments", "[", "i", "]", ".", "computeConversion", "(", "scope", ",", "parameterType", ",", "argumentType", ")", ";", "if", "(", "argumentType", ".", "needsUncheckedConversion", "(", "parameterType", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "unsafeTypeConversion", "(", "this", ".", "arguments", "[", "i", "]", ",", "argumentType", ",", "parameterType", ")", ";", "}", "}", "if", "(", "argsContainCast", ")", "{", "CastExpression", ".", "checkNeedForArgumentCasts", "(", "scope", ",", "null", ",", "allocatedType", ",", "this", ".", "binding", ",", "this", ".", "arguments", ",", "argumentTypes", ",", "this", ")", ";", "}", "}", "if", "(", "allocatedType", ".", "isRawType", "(", ")", "&&", "this", ".", "binding", ".", "hasSubstitutedParameters", "(", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "unsafeRawInvocation", "(", "this", ",", "this", ".", "binding", ")", ";", "}", "if", "(", "this", ".", "typeArguments", "!=", "null", "&&", "this", ".", "binding", ".", "original", "(", ")", ".", "typeVariables", "==", "Binding", ".", "NO_TYPE_VARIABLES", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "unnecessaryTypeArgumentsForMethodInvocation", "(", "this", ".", "binding", ",", "this", ".", "genericTypeArguments", ",", "this", ".", "typeArguments", ")", ";", "}", "return", "allocatedType", ";", "}", "}", "</s>" ]
3,995
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "CompilationResult", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TagBits", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeVariableBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "AbortType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "public", "class", "CodeSnippetTypeDeclaration", "extends", "TypeDeclaration", "{", "public", "CodeSnippetTypeDeclaration", "(", "CompilationResult", "compilationResult", ")", "{", "super", "(", "compilationResult", ")", ";", "}", "public", "void", "generateCode", "(", "ClassFile", "enclosingClassFile", ")", "{", "if", "(", "(", "this", ".", "bits", "&", "ASTNode", ".", "HasBeenGenerated", ")", "!=", "0", ")", "return", ";", "this", ".", "bits", "|=", "ASTNode", ".", "HasBeenGenerated", ";", "if", "(", "this", ".", "ignoreFurtherInvestigation", ")", "{", "if", "(", "this", ".", "binding", "==", "null", ")", "return", ";", "CodeSnippetClassFile", ".", "createProblemType", "(", "this", ",", "this", ".", "scope", ".", "referenceCompilationUnit", "(", ")", ".", "compilationResult", ")", ";", "return", ";", "}", "try", "{", "ClassFile", "classFile", "=", "new", "CodeSnippetClassFile", "(", "this", ".", "binding", ",", "enclosingClassFile", ",", "false", ")", ";", "classFile", ".", "addFieldInfos", "(", ")", ";", "if", "(", "this", ".", "binding", ".", "isMemberType", "(", ")", ")", "{", "classFile", ".", "recordInnerClasses", "(", "this", ".", "binding", ")", ";", "}", "else", "if", "(", "this", ".", "binding", ".", "isLocalType", "(", ")", ")", "{", "enclosingClassFile", ".", "recordInnerClasses", "(", "this", ".", "binding", ")", ";", "classFile", ".", "recordInnerClasses", "(", "this", ".", "binding", ")", ";", "}", "TypeVariableBinding", "[", "]", "typeVariables", "=", "this", ".", "binding", ".", "typeVariables", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "typeVariables", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "TypeVariableBinding", "typeVariableBinding", "=", "typeVariables", "[", "i", "]", ";", "if", "(", "(", "typeVariableBinding", ".", "tagBits", "&", "TagBits", ".", "ContainsNestedTypeReferences", ")", "!=", "0", ")", "{", "Util", ".", "recordNestedType", "(", "classFile", ",", "typeVariableBinding", ")", ";", "}", "}", "if", "(", "this", ".", "memberTypes", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "this", ".", "memberTypes", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "TypeDeclaration", "memberType", "=", "this", ".", "memberTypes", "[", "i", "]", ";", "classFile", ".", "recordInnerClasses", "(", "memberType", ".", "binding", ")", ";", "memberType", ".", "generateCode", "(", "this", ".", "scope", ",", "classFile", ")", ";", "}", "}", "classFile", ".", "setForMethodInfos", "(", ")", ";", "if", "(", "this", ".", "methods", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "this", ".", "methods", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "this", ".", "methods", "[", "i", "]", ".", "generateCode", "(", "this", ".", "scope", ",", "classFile", ")", ";", "}", "}", "classFile", ".", "addSpecialMethods", "(", ")", ";", "if", "(", "this", ".", "ignoreFurtherInvestigation", ")", "{", "throw", "new", "AbortType", "(", "this", ".", "scope", ".", "referenceCompilationUnit", "(", ")", ".", "compilationResult", ",", "null", ")", ";", "}", "classFile", ".", "addAttributes", "(", ")", ";", "this", ".", "scope", ".", "referenceCompilationUnit", "(", ")", ".", "compilationResult", ".", "record", "(", "this", ".", "binding", ".", "constantPoolName", "(", ")", ",", "classFile", ")", ";", "}", "catch", "(", "AbortType", "e", ")", "{", "if", "(", "this", ".", "binding", "==", "null", ")", "return", ";", "CodeSnippetClassFile", ".", "createProblemType", "(", "this", ",", "this", ".", "scope", ".", "referenceCompilationUnit", "(", ")", ".", "compilationResult", ")", ";", "}", "}", "}", "</s>" ]
3,996
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ThisReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "CodeStream", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "Opcodes", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "Constant", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "FieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "InvocationSite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeBinding", ";", "public", "class", "CodeSnippetThisReference", "extends", "ThisReference", "implements", "EvaluationConstants", ",", "InvocationSite", "{", "EvaluationContext", "evaluationContext", ";", "FieldBinding", "delegateThis", ";", "boolean", "isImplicit", ";", "public", "CodeSnippetThisReference", "(", "int", "s", ",", "int", "sourceEnd", ",", "EvaluationContext", "evaluationContext", ",", "boolean", "isImplicit", ")", "{", "super", "(", "s", ",", "sourceEnd", ")", ";", "this", ".", "evaluationContext", "=", "evaluationContext", ";", "this", ".", "isImplicit", "=", "isImplicit", ";", "}", "public", "boolean", "checkAccess", "(", "MethodScope", "methodScope", ")", "{", "if", "(", "this", ".", "evaluationContext", ".", "isConstructorCall", ")", "{", "methodScope", ".", "problemReporter", "(", ")", ".", "fieldsOrThisBeforeConstructorInvocation", "(", "this", ")", ";", "return", "false", ";", "}", "if", "(", "this", ".", "evaluationContext", ".", "declaringTypeName", "==", "null", "||", "this", ".", "evaluationContext", ".", "isStatic", ")", "{", "methodScope", ".", "problemReporter", "(", ")", ".", "errorThisSuperInStatic", "(", "this", ")", ";", "return", "false", ";", "}", "return", "true", ";", "}", "public", "void", "generateCode", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "boolean", "valueRequired", ")", "{", "int", "pc", "=", "codeStream", ".", "position", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "aload_0", "(", ")", ";", "codeStream", ".", "fieldAccess", "(", "Opcodes", ".", "OPC_getfield", ",", "this", ".", "delegateThis", ",", "null", ")", ";", "}", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "this", ".", "sourceStart", ")", ";", "}", "public", "TypeBinding", "[", "]", "genericTypeArguments", "(", ")", "{", "return", "null", ";", "}", "public", "boolean", "isSuperAccess", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isTypeAccess", "(", ")", "{", "return", "false", ";", "}", "public", "StringBuffer", "printExpression", "(", "int", "indent", ",", "StringBuffer", "output", ")", "{", "char", "[", "]", "declaringType", "=", "this", ".", "evaluationContext", ".", "declaringTypeName", ";", "output", ".", "append", "(", "'('", ")", ";", "if", "(", "declaringType", "==", "null", ")", "output", ".", "append", "(", "\"\"", ")", ";", "else", "output", ".", "append", "(", "declaringType", ")", ";", "return", "output", ".", "append", "(", "\")this\"", ")", ";", "}", "public", "TypeBinding", "resolveType", "(", "BlockScope", "scope", ")", "{", "this", ".", "constant", "=", "Constant", ".", "NotAConstant", ";", "TypeBinding", "snippetType", "=", "null", ";", "MethodScope", "methodScope", "=", "scope", ".", "methodScope", "(", ")", ";", "if", "(", "!", "this", ".", "isImplicit", "&&", "!", "checkAccess", "(", "methodScope", ")", ")", "{", "return", "null", ";", "}", "snippetType", "=", "scope", ".", "enclosingSourceType", "(", ")", ";", "this", ".", "delegateThis", "=", "scope", ".", "getField", "(", "snippetType", ",", "DELEGATE_THIS", ",", "this", ")", ";", "if", "(", "this", ".", "delegateThis", "==", "null", "||", "!", "this", ".", "delegateThis", ".", "isValidBinding", "(", ")", ")", "{", "methodScope", ".", "problemReporter", "(", ")", ".", "errorThisSuperInStatic", "(", "this", ")", ";", "return", "null", ";", "}", "return", "this", ".", "resolvedType", "=", "this", ".", "delegateThis", ".", "type", ";", "}", "public", "void", "setActualReceiverType", "(", "ReferenceBinding", "receiverType", ")", "{", "}", "public", "void", "setDepth", "(", "int", "depth", ")", "{", "}", "public", "void", "setFieldIndex", "(", "int", "index", ")", "{", "}", "}", "</s>" ]
3,997
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFormatException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "INameEnvironment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "NameEnvironmentAnswer", ";", "public", "class", "CodeSnippetEnvironment", "implements", "INameEnvironment", ",", "EvaluationConstants", "{", "INameEnvironment", "env", ";", "EvaluationContext", "context", ";", "public", "CodeSnippetEnvironment", "(", "INameEnvironment", "env", ",", "EvaluationContext", "context", ")", "{", "this", ".", "env", "=", "env", ";", "this", ".", "context", "=", "context", ";", "}", "public", "NameEnvironmentAnswer", "findType", "(", "char", "[", "]", "[", "]", "compoundTypeName", ")", "{", "NameEnvironmentAnswer", "result", "=", "this", ".", "env", ".", "findType", "(", "compoundTypeName", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "return", "result", ";", "}", "if", "(", "CharOperation", ".", "equals", "(", "compoundTypeName", ",", "ROOT_COMPOUND_NAME", ")", ")", "{", "IBinaryType", "binary", "=", "this", ".", "context", ".", "getRootCodeSnippetBinary", "(", ")", ";", "if", "(", "binary", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "new", "NameEnvironmentAnswer", "(", "binary", ",", "null", ")", ";", "}", "}", "VariablesInfo", "installedVars", "=", "this", ".", "context", ".", "installedVars", ";", "ClassFile", "[", "]", "classFiles", "=", "installedVars", ".", "classFiles", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classFiles", ".", "length", ";", "i", "++", ")", "{", "ClassFile", "classFile", "=", "classFiles", "[", "i", "]", ";", "if", "(", "CharOperation", ".", "equals", "(", "compoundTypeName", ",", "classFile", ".", "getCompoundName", "(", ")", ")", ")", "{", "ClassFileReader", "binary", "=", "null", ";", "try", "{", "binary", "=", "new", "ClassFileReader", "(", "classFile", ".", "getBytes", "(", ")", ",", "null", ")", ";", "}", "catch", "(", "ClassFormatException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "return", "null", ";", "}", "return", "new", "NameEnvironmentAnswer", "(", "binary", ",", "null", ")", ";", "}", "}", "return", "null", ";", "}", "public", "NameEnvironmentAnswer", "findType", "(", "char", "[", "]", "typeName", ",", "char", "[", "]", "[", "]", "packageName", ")", "{", "NameEnvironmentAnswer", "result", "=", "this", ".", "env", ".", "findType", "(", "typeName", ",", "packageName", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "return", "result", ";", "}", "return", "findType", "(", "CharOperation", ".", "arrayConcat", "(", "packageName", ",", "typeName", ")", ")", ";", "}", "public", "boolean", "isPackage", "(", "char", "[", "]", "[", "]", "parentPackageName", ",", "char", "[", "]", "packageName", ")", "{", "return", "this", ".", "env", ".", "isPackage", "(", "parentPackageName", ",", "packageName", ")", ";", "}", "public", "void", "cleanup", "(", ")", "{", "this", ".", "env", ".", "cleanup", "(", ")", ";", "}", "}", "</s>" ]
3,998
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Assignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompoundAssignment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "IntLiteral", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedNameReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "CodeStream", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "Opcodes", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "flow", ".", "FlowInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "Constant", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Binding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "FieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "LocalVariableBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemFieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemReasons", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeIds", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "VariableBinding", ";", "public", "class", "CodeSnippetQualifiedNameReference", "extends", "QualifiedNameReference", "implements", "EvaluationConstants", ",", "ProblemReasons", "{", "EvaluationContext", "evaluationContext", ";", "FieldBinding", "delegateThis", ";", "public", "CodeSnippetQualifiedNameReference", "(", "char", "[", "]", "[", "]", "sources", ",", "long", "[", "]", "positions", ",", "int", "sourceStart", ",", "int", "sourceEnd", ",", "EvaluationContext", "evaluationContext", ")", "{", "super", "(", "sources", ",", "positions", ",", "sourceStart", ",", "sourceEnd", ")", ";", "this", ".", "evaluationContext", "=", "evaluationContext", ";", "}", "public", "TypeBinding", "checkFieldAccess", "(", "BlockScope", "scope", ")", "{", "FieldBinding", "fieldBinding", "=", "(", "FieldBinding", ")", "this", ".", "binding", ";", "MethodScope", "methodScope", "=", "scope", ".", "methodScope", "(", ")", ";", "TypeBinding", "declaringClass", "=", "fieldBinding", ".", "original", "(", ")", ".", "declaringClass", ";", "if", "(", "(", "this", ".", "indexOfFirstFieldBinding", "==", "1", "||", "declaringClass", ".", "isEnum", "(", ")", ")", "&&", "methodScope", ".", "enclosingSourceType", "(", ")", "==", "declaringClass", "&&", "methodScope", ".", "lastVisibleFieldID", ">=", "0", "&&", "fieldBinding", ".", "id", ">=", "methodScope", ".", "lastVisibleFieldID", "&&", "(", "!", "fieldBinding", ".", "isStatic", "(", ")", "||", "methodScope", ".", "isStatic", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "forwardReference", "(", "this", ",", "this", ".", "indexOfFirstFieldBinding", "-", "1", ",", "fieldBinding", ")", ";", "}", "this", ".", "bits", "&=", "~", "ASTNode", ".", "RestrictiveFlagMASK", ";", "this", ".", "bits", "|=", "Binding", ".", "FIELD", ";", "return", "getOtherFieldBindings", "(", "scope", ")", ";", "}", "public", "void", "generateCode", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "boolean", "valueRequired", ")", "{", "int", "pc", "=", "codeStream", ".", "position", ";", "if", "(", "(", "this", ".", "bits", "&", "Binding", ".", "VARIABLE", ")", "==", "0", ")", "{", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "this", ".", "sourceStart", ")", ";", "return", ";", "}", "FieldBinding", "lastFieldBinding", "=", "this", ".", "otherBindings", "==", "null", "?", "(", "FieldBinding", ")", "this", ".", "binding", ":", "this", ".", "otherBindings", "[", "this", ".", "otherBindings", ".", "length", "-", "1", "]", ";", "if", "(", "lastFieldBinding", ".", "canBeSeenBy", "(", "getFinalReceiverType", "(", ")", ",", "this", ",", "currentScope", ")", ")", "{", "super", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "valueRequired", ")", ";", "return", ";", "}", "lastFieldBinding", "=", "generateReadSequence", "(", "currentScope", ",", "codeStream", ")", ";", "if", "(", "lastFieldBinding", "!=", "null", ")", "{", "boolean", "isStatic", "=", "lastFieldBinding", ".", "isStatic", "(", ")", ";", "Constant", "fieldConstant", "=", "lastFieldBinding", ".", "constant", "(", ")", ";", "if", "(", "fieldConstant", "!=", "Constant", ".", "NotAConstant", ")", "{", "if", "(", "!", "isStatic", ")", "{", "codeStream", ".", "invokeObjectGetClass", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "}", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateConstant", "(", "fieldConstant", ",", "this", ".", "implicitConversion", ")", ";", "}", "}", "else", "{", "boolean", "isFirst", "=", "lastFieldBinding", "==", "this", ".", "binding", "&&", "(", "this", ".", "indexOfFirstFieldBinding", "==", "1", "||", "lastFieldBinding", ".", "declaringClass", "==", "currentScope", ".", "enclosingReceiverType", "(", ")", ")", "&&", "this", ".", "otherBindings", "==", "null", ";", "TypeBinding", "requiredGenericCast", "=", "getGenericCast", "(", "this", ".", "otherBindings", "==", "null", "?", "0", ":", "this", ".", "otherBindings", ".", "length", ")", ";", "if", "(", "valueRequired", "||", "(", "!", "isFirst", "&&", "currentScope", ".", "compilerOptions", "(", ")", ".", "complianceLevel", ">=", "ClassFileConstants", ".", "JDK1_4", ")", "||", "(", "(", "this", ".", "implicitConversion", "&", "TypeIds", ".", "UNBOXING", ")", "!=", "0", ")", "||", "requiredGenericCast", "!=", "null", ")", "{", "int", "lastFieldPc", "=", "codeStream", ".", "position", ";", "if", "(", "lastFieldBinding", ".", "declaringClass", "==", "null", ")", "{", "codeStream", ".", "arraylength", "(", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateImplicitConversion", "(", "this", ".", "implicitConversion", ")", ";", "}", "else", "{", "codeStream", ".", "pop", "(", ")", ";", "}", "}", "else", "{", "codeStream", ".", "generateEmulatedReadAccessForField", "(", "lastFieldBinding", ")", ";", "if", "(", "requiredGenericCast", "!=", "null", ")", "codeStream", ".", "checkcast", "(", "requiredGenericCast", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateImplicitConversion", "(", "this", ".", "implicitConversion", ")", ";", "}", "else", "{", "boolean", "isUnboxing", "=", "(", "this", ".", "implicitConversion", "&", "TypeIds", ".", "UNBOXING", ")", "!=", "0", ";", "if", "(", "isUnboxing", ")", "codeStream", ".", "generateImplicitConversion", "(", "this", ".", "implicitConversion", ")", ";", "switch", "(", "isUnboxing", "?", "postConversionType", "(", "currentScope", ")", ".", "id", ":", "lastFieldBinding", ".", "type", ".", "id", ")", "{", "case", "T_long", ":", "case", "T_double", ":", "codeStream", ".", "pop2", "(", ")", ";", "break", ";", "default", ":", "codeStream", ".", "pop", "(", ")", ";", "}", "}", "}", "int", "fieldPosition", "=", "(", "int", ")", "(", "this", ".", "sourcePositions", "[", "this", ".", "sourcePositions", ".", "length", "-", "1", "]", ">>>", "32", ")", ";", "codeStream", ".", "recordPositionsFrom", "(", "lastFieldPc", ",", "fieldPosition", ")", ";", "}", "else", "{", "if", "(", "!", "isStatic", ")", "{", "codeStream", ".", "invokeObjectGetClass", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "}", "}", "}", "}", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "this", ".", "sourceStart", ")", ";", "}", "public", "void", "generateAssignment", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "Assignment", "assignment", ",", "boolean", "valueRequired", ")", "{", "FieldBinding", "lastFieldBinding", "=", "this", ".", "otherBindings", "==", "null", "?", "(", "FieldBinding", ")", "this", ".", "binding", ":", "this", ".", "otherBindings", "[", "this", ".", "otherBindings", ".", "length", "-", "1", "]", ";", "if", "(", "lastFieldBinding", ".", "canBeSeenBy", "(", "getFinalReceiverType", "(", ")", ",", "this", ",", "currentScope", ")", ")", "{", "super", ".", "generateAssignment", "(", "currentScope", ",", "codeStream", ",", "assignment", ",", "valueRequired", ")", ";", "return", ";", "}", "lastFieldBinding", "=", "generateReadSequence", "(", "currentScope", ",", "codeStream", ")", ";", "codeStream", ".", "generateEmulationForField", "(", "lastFieldBinding", ")", ";", "codeStream", ".", "swap", "(", ")", ";", "assignment", ".", "expression", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "true", ")", ";", "if", "(", "valueRequired", ")", "{", "switch", "(", "lastFieldBinding", ".", "type", ".", "id", ")", "{", "case", "TypeIds", ".", "T_long", ":", "case", "TypeIds", ".", "T_double", ":", "codeStream", ".", "dup2_x2", "(", ")", ";", "break", ";", "default", ":", "codeStream", ".", "dup_x2", "(", ")", ";", "break", ";", "}", "}", "codeStream", ".", "generateEmulatedWriteAccessForField", "(", "lastFieldBinding", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateImplicitConversion", "(", "assignment", ".", "implicitConversion", ")", ";", "}", "}", "public", "void", "generateCompoundAssignment", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "Expression", "expression", ",", "int", "operator", ",", "int", "assignmentImplicitConversion", ",", "boolean", "valueRequired", ")", "{", "FieldBinding", "lastFieldBinding", "=", "this", ".", "otherBindings", "==", "null", "?", "(", "FieldBinding", ")", "this", ".", "binding", ":", "this", ".", "otherBindings", "[", "this", ".", "otherBindings", ".", "length", "-", "1", "]", ";", "if", "(", "lastFieldBinding", ".", "canBeSeenBy", "(", "getFinalReceiverType", "(", ")", ",", "this", ",", "currentScope", ")", ")", "{", "super", ".", "generateCompoundAssignment", "(", "currentScope", ",", "codeStream", ",", "expression", ",", "operator", ",", "assignmentImplicitConversion", ",", "valueRequired", ")", ";", "return", ";", "}", "lastFieldBinding", "=", "generateReadSequence", "(", "currentScope", ",", "codeStream", ")", ";", "if", "(", "lastFieldBinding", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "generateEmulationForField", "(", "lastFieldBinding", ")", ";", "codeStream", ".", "swap", "(", ")", ";", "codeStream", ".", "aconst_null", "(", ")", ";", "codeStream", ".", "swap", "(", ")", ";", "codeStream", ".", "generateEmulatedReadAccessForField", "(", "lastFieldBinding", ")", ";", "}", "else", "{", "codeStream", ".", "generateEmulationForField", "(", "lastFieldBinding", ")", ";", "codeStream", ".", "swap", "(", ")", ";", "codeStream", ".", "dup", "(", ")", ";", "codeStream", ".", "generateEmulatedReadAccessForField", "(", "lastFieldBinding", ")", ";", "}", "int", "operationTypeID", ";", "if", "(", "(", "operationTypeID", "=", "(", "this", ".", "implicitConversion", "&", "IMPLICIT_CONVERSION_MASK", ")", ">>", "4", ")", "==", "T_JavaLangString", ")", "{", "codeStream", ".", "generateStringConcatenationAppend", "(", "currentScope", ",", "null", ",", "expression", ")", ";", "}", "else", "{", "codeStream", ".", "generateImplicitConversion", "(", "this", ".", "implicitConversion", ")", ";", "if", "(", "expression", "==", "IntLiteral", ".", "One", ")", "{", "codeStream", ".", "generateConstant", "(", "expression", ".", "constant", ",", "this", ".", "implicitConversion", ")", ";", "}", "else", "{", "expression", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "true", ")", ";", "}", "codeStream", ".", "sendOperator", "(", "operator", ",", "operationTypeID", ")", ";", "codeStream", ".", "generateImplicitConversion", "(", "assignmentImplicitConversion", ")", ";", "}", "if", "(", "valueRequired", ")", "{", "switch", "(", "lastFieldBinding", ".", "type", ".", "id", ")", "{", "case", "TypeIds", ".", "T_long", ":", "case", "TypeIds", ".", "T_double", ":", "codeStream", ".", "dup2_x2", "(", ")", ";", "break", ";", "default", ":", "codeStream", ".", "dup_x2", "(", ")", ";", "break", ";", "}", "}", "codeStream", ".", "generateEmulatedWriteAccessForField", "(", "lastFieldBinding", ")", ";", "}", "public", "void", "generatePostIncrement", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "CompoundAssignment", "postIncrement", ",", "boolean", "valueRequired", ")", "{", "FieldBinding", "lastFieldBinding", "=", "this", ".", "otherBindings", "==", "null", "?", "(", "FieldBinding", ")", "this", ".", "binding", ":", "this", ".", "otherBindings", "[", "this", ".", "otherBindings", ".", "length", "-", "1", "]", ";", "if", "(", "lastFieldBinding", ".", "canBeSeenBy", "(", "getFinalReceiverType", "(", ")", ",", "this", ",", "currentScope", ")", ")", "{", "super", ".", "generatePostIncrement", "(", "currentScope", ",", "codeStream", ",", "postIncrement", ",", "valueRequired", ")", ";", "return", ";", "}", "lastFieldBinding", "=", "generateReadSequence", "(", "currentScope", ",", "codeStream", ")", ";", "codeStream", ".", "generateEmulatedReadAccessForField", "(", "lastFieldBinding", ")", ";", "if", "(", "valueRequired", ")", "{", "switch", "(", "lastFieldBinding", ".", "type", ".", "id", ")", "{", "case", "TypeIds", ".", "T_long", ":", "case", "TypeIds", ".", "T_double", ":", "codeStream", ".", "dup2", "(", ")", ";", "break", ";", "default", ":", "codeStream", ".", "dup", "(", ")", ";", "break", ";", "}", "}", "codeStream", ".", "generateEmulationForField", "(", "lastFieldBinding", ")", ";", "if", "(", "(", "lastFieldBinding", ".", "type", "==", "TypeBinding", ".", "LONG", ")", "||", "(", "lastFieldBinding", ".", "type", "==", "TypeBinding", ".", "DOUBLE", ")", ")", "{", "codeStream", ".", "dup_x2", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "if", "(", "lastFieldBinding", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "}", "else", "{", "generateReadSequence", "(", "currentScope", ",", "codeStream", ")", ";", "}", "codeStream", ".", "dup_x2", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "}", "else", "{", "codeStream", ".", "dup_x1", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "if", "(", "lastFieldBinding", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "}", "else", "{", "generateReadSequence", "(", "currentScope", ",", "codeStream", ")", ";", "}", "codeStream", ".", "dup_x1", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "}", "codeStream", ".", "generateConstant", "(", "postIncrement", ".", "expression", ".", "constant", ",", "this", ".", "implicitConversion", ")", ";", "codeStream", ".", "sendOperator", "(", "postIncrement", ".", "operator", ",", "lastFieldBinding", ".", "type", ".", "id", ")", ";", "codeStream", ".", "generateImplicitConversion", "(", "postIncrement", ".", "preAssignImplicitConversion", ")", ";", "codeStream", ".", "generateEmulatedWriteAccessForField", "(", "lastFieldBinding", ")", ";", "}", "public", "FieldBinding", "generateReadSequence", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ")", "{", "int", "otherBindingsCount", "=", "this", ".", "otherBindings", "==", "null", "?", "0", ":", "this", ".", "otherBindings", ".", "length", ";", "boolean", "needValue", "=", "otherBindingsCount", "==", "0", "||", "!", "this", ".", "otherBindings", "[", "0", "]", ".", "isStatic", "(", ")", ";", "FieldBinding", "lastFieldBinding", ";", "TypeBinding", "lastGenericCast", ";", "TypeBinding", "lastReceiverType", ";", "boolean", "complyTo14", "=", "currentScope", ".", "compilerOptions", "(", ")", ".", "complianceLevel", ">=", "ClassFileConstants", ".", "JDK1_4", ";", "switch", "(", "this", ".", "bits", "&", "RestrictiveFlagMASK", ")", "{", "case", "Binding", ".", "FIELD", ":", "lastFieldBinding", "=", "(", "(", "FieldBinding", ")", "this", ".", "binding", ")", ".", "original", "(", ")", ";", "lastGenericCast", "=", "this", ".", "genericCast", ";", "lastReceiverType", "=", "this", ".", "actualReceiverType", ";", "if", "(", "lastFieldBinding", ".", "constant", "(", ")", "!=", "Constant", ".", "NotAConstant", ")", "{", "break", ";", "}", "if", "(", "needValue", ")", "{", "if", "(", "lastFieldBinding", ".", "canBeSeenBy", "(", "this", ".", "actualReceiverType", ",", "this", ",", "currentScope", ")", ")", "{", "if", "(", "!", "lastFieldBinding", ".", "isStatic", "(", ")", ")", "{", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "ReferenceBinding", "targetType", "=", "currentScope", ".", "enclosingSourceType", "(", ")", ".", "enclosingTypeAt", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", ">>", "DepthSHIFT", ")", ";", "Object", "[", "]", "emulationPath", "=", "currentScope", ".", "getEmulationPath", "(", "targetType", ",", "true", ",", "false", ")", ";", "codeStream", ".", "generateOuterAccess", "(", "emulationPath", ",", "this", ",", "targetType", ",", "currentScope", ")", ";", "}", "else", "{", "generateReceiver", "(", "codeStream", ")", ";", "}", "}", "}", "else", "{", "if", "(", "!", "lastFieldBinding", ".", "isStatic", "(", ")", ")", "{", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "currentScope", ".", "problemReporter", "(", ")", ".", "needImplementation", "(", "this", ")", ";", "}", "else", "{", "generateReceiver", "(", "codeStream", ")", ";", "}", "}", "else", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "}", "}", "}", "break", ";", "case", "Binding", ".", "LOCAL", ":", "lastFieldBinding", "=", "null", ";", "lastGenericCast", "=", "null", ";", "LocalVariableBinding", "localBinding", "=", "(", "LocalVariableBinding", ")", "this", ".", "binding", ";", "lastReceiverType", "=", "localBinding", ".", "type", ";", "if", "(", "!", "needValue", ")", "break", ";", "Constant", "localConstant", "=", "localBinding", ".", "constant", "(", ")", ";", "if", "(", "localConstant", "!=", "Constant", ".", "NotAConstant", ")", "{", "codeStream", ".", "generateConstant", "(", "localConstant", ",", "0", ")", ";", "}", "else", "{", "if", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", "{", "VariableBinding", "[", "]", "path", "=", "currentScope", ".", "getEmulationPath", "(", "localBinding", ")", ";", "codeStream", ".", "generateOuterAccess", "(", "path", ",", "this", ",", "localBinding", ",", "currentScope", ")", ";", "}", "else", "{", "codeStream", ".", "load", "(", "localBinding", ")", ";", "}", "}", "break", ";", "default", ":", "return", "null", ";", "}", "int", "positionsLength", "=", "this", ".", "sourcePositions", ".", "length", ";", "FieldBinding", "initialFieldBinding", "=", "lastFieldBinding", ";", "if", "(", "this", ".", "otherBindings", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "otherBindingsCount", ";", "i", "++", ")", "{", "int", "pc", "=", "codeStream", ".", "position", ";", "FieldBinding", "nextField", "=", "this", ".", "otherBindings", "[", "i", "]", ".", "original", "(", ")", ";", "TypeBinding", "nextGenericCast", "=", "this", ".", "otherGenericCasts", "==", "null", "?", "null", ":", "this", ".", "otherGenericCasts", "[", "i", "]", ";", "if", "(", "lastFieldBinding", "!=", "null", ")", "{", "needValue", "=", "!", "nextField", ".", "isStatic", "(", ")", ";", "Constant", "fieldConstant", "=", "lastFieldBinding", ".", "constant", "(", ")", ";", "if", "(", "fieldConstant", "!=", "Constant", ".", "NotAConstant", ")", "{", "if", "(", "i", ">", "0", "&&", "!", "lastFieldBinding", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "invokeObjectGetClass", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "}", "if", "(", "needValue", ")", "{", "codeStream", ".", "generateConstant", "(", "fieldConstant", ",", "0", ")", ";", "}", "}", "else", "{", "if", "(", "needValue", "||", "(", "i", ">", "0", "&&", "complyTo14", ")", "||", "lastGenericCast", "!=", "null", ")", "{", "if", "(", "lastFieldBinding", ".", "canBeSeenBy", "(", "lastReceiverType", ",", "this", ",", "currentScope", ")", ")", "{", "MethodBinding", "accessor", "=", "this", ".", "syntheticReadAccessors", "==", "null", "?", "null", ":", "this", ".", "syntheticReadAccessors", "[", "i", "]", ";", "if", "(", "accessor", "==", "null", ")", "{", "TypeBinding", "constantPoolDeclaringClass", "=", "CodeStream", ".", "getConstantPoolDeclaringClass", "(", "currentScope", ",", "lastFieldBinding", ",", "lastReceiverType", ",", "i", "==", "0", "&&", "this", ".", "indexOfFirstFieldBinding", "==", "1", ")", ";", "if", "(", "lastFieldBinding", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "fieldAccess", "(", "Opcodes", ".", "OPC_getstatic", ",", "lastFieldBinding", ",", "constantPoolDeclaringClass", ")", ";", "}", "else", "{", "codeStream", ".", "fieldAccess", "(", "Opcodes", ".", "OPC_getfield", ",", "lastFieldBinding", ",", "constantPoolDeclaringClass", ")", ";", "}", "}", "else", "{", "codeStream", ".", "invoke", "(", "Opcodes", ".", "OPC_invokestatic", ",", "accessor", ",", "null", ")", ";", "}", "}", "else", "{", "codeStream", ".", "generateEmulatedReadAccessForField", "(", "lastFieldBinding", ")", ";", "}", "if", "(", "lastGenericCast", "!=", "null", ")", "{", "codeStream", ".", "checkcast", "(", "lastGenericCast", ")", ";", "lastReceiverType", "=", "lastGenericCast", ";", "}", "else", "{", "lastReceiverType", "=", "lastFieldBinding", ".", "type", ";", "}", "if", "(", "!", "needValue", ")", "codeStream", ".", "pop", "(", ")", ";", "}", "else", "{", "if", "(", "lastFieldBinding", "==", "initialFieldBinding", ")", "{", "if", "(", "lastFieldBinding", ".", "isStatic", "(", ")", ")", "{", "if", "(", "initialFieldBinding", ".", "declaringClass", "!=", "this", ".", "actualReceiverType", ".", "erasure", "(", ")", ")", "{", "if", "(", "lastFieldBinding", ".", "canBeSeenBy", "(", "lastReceiverType", ",", "this", ",", "currentScope", ")", ")", "{", "MethodBinding", "accessor", "=", "this", ".", "syntheticReadAccessors", "==", "null", "?", "null", ":", "this", ".", "syntheticReadAccessors", "[", "i", "]", ";", "if", "(", "accessor", "==", "null", ")", "{", "TypeBinding", "constantPoolDeclaringClass", "=", "CodeStream", ".", "getConstantPoolDeclaringClass", "(", "currentScope", ",", "lastFieldBinding", ",", "lastReceiverType", ",", "i", "==", "0", "&&", "this", ".", "indexOfFirstFieldBinding", "==", "1", ")", ";", "codeStream", ".", "fieldAccess", "(", "Opcodes", ".", "OPC_getstatic", ",", "lastFieldBinding", ",", "constantPoolDeclaringClass", ")", ";", "}", "else", "{", "codeStream", ".", "invoke", "(", "Opcodes", ".", "OPC_invokestatic", ",", "accessor", ",", "null", ")", ";", "}", "}", "else", "{", "codeStream", ".", "generateEmulatedReadAccessForField", "(", "lastFieldBinding", ")", ";", "}", "codeStream", ".", "pop", "(", ")", ";", "}", "}", "}", "else", "if", "(", "!", "lastFieldBinding", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "invokeObjectGetClass", "(", ")", ";", "codeStream", ".", "pop", "(", ")", ";", "}", "lastReceiverType", "=", "lastFieldBinding", ".", "type", ";", "}", "if", "(", "(", "positionsLength", "-", "otherBindingsCount", "+", "i", "-", "1", ")", ">=", "0", ")", "{", "int", "fieldPosition", "=", "(", "int", ")", "(", "this", ".", "sourcePositions", "[", "positionsLength", "-", "otherBindingsCount", "+", "i", "-", "1", "]", ">>>", "32", ")", ";", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "fieldPosition", ")", ";", "}", "}", "}", "lastFieldBinding", "=", "nextField", ";", "lastGenericCast", "=", "nextGenericCast", ";", "if", "(", "lastFieldBinding", "!=", "null", "&&", "!", "lastFieldBinding", ".", "canBeSeenBy", "(", "lastReceiverType", ",", "this", ",", "currentScope", ")", ")", "{", "if", "(", "lastFieldBinding", ".", "isStatic", "(", ")", ")", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "}", "}", "}", "}", "return", "lastFieldBinding", ";", "}", "public", "void", "generateReceiver", "(", "CodeStream", "codeStream", ")", "{", "codeStream", ".", "aload_0", "(", ")", ";", "if", "(", "this", ".", "delegateThis", "!=", "null", ")", "{", "codeStream", ".", "fieldAccess", "(", "Opcodes", ".", "OPC_getfield", ",", "this", ".", "delegateThis", ",", "null", ")", ";", "}", "}", "public", "TypeBinding", "getOtherFieldBindings", "(", "BlockScope", "scope", ")", "{", "int", "length", "=", "this", ".", "tokens", ".", "length", ";", "if", "(", "(", "this", ".", "bits", "&", "Binding", ".", "FIELD", ")", "!=", "0", ")", "{", "if", "(", "!", "(", "(", "FieldBinding", ")", "this", ".", "binding", ")", ".", "isStatic", "(", ")", ")", "{", "if", "(", "this", ".", "indexOfFirstFieldBinding", "==", "1", ")", "{", "if", "(", "scope", ".", "methodScope", "(", ")", ".", "isStatic", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "staticFieldAccessToNonStaticVariable", "(", "this", ",", "(", "FieldBinding", ")", "this", ".", "binding", ")", ";", "return", "null", ";", "}", "}", "else", "{", "scope", ".", "problemReporter", "(", ")", ".", "staticFieldAccessToNonStaticVariable", "(", "this", ",", "(", "FieldBinding", ")", "this", ".", "binding", ")", ";", "return", "null", ";", "}", "}", "if", "(", "isFieldUseDeprecated", "(", "(", "FieldBinding", ")", "this", ".", "binding", ",", "scope", ",", "this", ".", "indexOfFirstFieldBinding", "==", "length", "?", "this", ".", "bits", ":", "0", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "deprecatedField", "(", "(", "FieldBinding", ")", "this", ".", "binding", ",", "this", ")", ";", "}", "}", "TypeBinding", "type", "=", "(", "(", "VariableBinding", ")", "this", ".", "binding", ")", ".", "type", ";", "int", "index", "=", "this", ".", "indexOfFirstFieldBinding", ";", "if", "(", "index", "==", "length", ")", "{", "this", ".", "constant", "=", "(", "(", "FieldBinding", ")", "this", ".", "binding", ")", ".", "constant", "(", ")", ";", "return", "type", ";", "}", "int", "otherBindingsLength", "=", "length", "-", "index", ";", "this", ".", "otherBindings", "=", "new", "FieldBinding", "[", "otherBindingsLength", "]", ";", "this", ".", "constant", "=", "(", "(", "VariableBinding", ")", "this", ".", "binding", ")", ".", "constant", "(", ")", ";", "while", "(", "index", "<", "length", ")", "{", "char", "[", "]", "token", "=", "this", ".", "tokens", "[", "index", "]", ";", "if", "(", "type", "==", "null", ")", "return", "null", ";", "FieldBinding", "field", "=", "scope", ".", "getField", "(", "type", ",", "token", ",", "this", ")", ";", "int", "place", "=", "index", "-", "this", ".", "indexOfFirstFieldBinding", ";", "this", ".", "otherBindings", "[", "place", "]", "=", "field", ";", "if", "(", "!", "field", ".", "isValidBinding", "(", ")", ")", "{", "CodeSnippetScope", "localScope", "=", "new", "CodeSnippetScope", "(", "scope", ")", ";", "if", "(", "this", ".", "delegateThis", "==", "null", ")", "{", "if", "(", "this", ".", "evaluationContext", ".", "declaringTypeName", "!=", "null", ")", "{", "this", ".", "delegateThis", "=", "scope", ".", "getField", "(", "scope", ".", "enclosingSourceType", "(", ")", ",", "DELEGATE_THIS", ",", "this", ")", ";", "if", "(", "this", ".", "delegateThis", "==", "null", ")", "{", "return", "super", ".", "reportError", "(", "scope", ")", ";", "}", "this", ".", "actualReceiverType", "=", "this", ".", "delegateThis", ".", "type", ";", "}", "else", "{", "this", ".", "constant", "=", "Constant", ".", "NotAConstant", ";", "scope", ".", "problemReporter", "(", ")", ".", "invalidField", "(", "this", ",", "field", ",", "index", ",", "type", ")", ";", "return", "null", ";", "}", "}", "field", "=", "localScope", ".", "getFieldForCodeSnippet", "(", "this", ".", "delegateThis", ".", "type", ",", "token", ",", "this", ")", ";", "this", ".", "otherBindings", "[", "place", "]", "=", "field", ";", "}", "if", "(", "field", ".", "isValidBinding", "(", ")", ")", "{", "if", "(", "isFieldUseDeprecated", "(", "field", ",", "scope", ",", "index", "+", "1", "==", "length", "?", "this", ".", "bits", ":", "0", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "deprecatedField", "(", "field", ",", "this", ")", ";", "}", "if", "(", "this", ".", "constant", "!=", "Constant", ".", "NotAConstant", ")", "{", "this", ".", "constant", "=", "field", ".", "constant", "(", ")", ";", "}", "type", "=", "field", ".", "type", ";", "index", "++", ";", "}", "else", "{", "this", ".", "constant", "=", "Constant", ".", "NotAConstant", ";", "scope", ".", "problemReporter", "(", ")", ".", "invalidField", "(", "this", ",", "field", ",", "index", ",", "type", ")", ";", "return", "null", ";", "}", "}", "return", "(", "this", ".", "otherBindings", "[", "otherBindingsLength", "-", "1", "]", ")", ".", "type", ";", "}", "public", "void", "manageSyntheticAccessIfNecessary", "(", "BlockScope", "currentScope", ",", "FieldBinding", "fieldBinding", ",", "int", "index", ",", "FlowInfo", "flowInfo", ")", "{", "}", "public", "TypeBinding", "reportError", "(", "BlockScope", "scope", ")", "{", "if", "(", "this", ".", "evaluationContext", ".", "declaringTypeName", "!=", "null", ")", "{", "this", ".", "delegateThis", "=", "scope", ".", "getField", "(", "scope", ".", "enclosingSourceType", "(", ")", ",", "DELEGATE_THIS", ",", "this", ")", ";", "if", "(", "this", ".", "delegateThis", "==", "null", ")", "{", "return", "super", ".", "reportError", "(", "scope", ")", ";", "}", "this", ".", "actualReceiverType", "=", "this", ".", "delegateThis", ".", "type", ";", "}", "else", "{", "return", "super", ".", "reportError", "(", "scope", ")", ";", "}", "if", "(", "(", "this", ".", "binding", "instanceof", "ProblemFieldBinding", "&&", "(", "(", "ProblemFieldBinding", ")", "this", ".", "binding", ")", ".", "problemId", "(", ")", "==", "NotFound", ")", "||", "(", "this", ".", "binding", "instanceof", "ProblemBinding", "&&", "(", "(", "ProblemBinding", ")", "this", ".", "binding", ")", ".", "problemId", "(", ")", "==", "NotFound", ")", ")", "{", "FieldBinding", "fieldBinding", "=", "scope", ".", "getField", "(", "this", ".", "delegateThis", ".", "type", ",", "this", ".", "tokens", "[", "0", "]", ",", "this", ")", ";", "if", "(", "!", "fieldBinding", ".", "isValidBinding", "(", ")", ")", "{", "if", "(", "(", "(", "ProblemFieldBinding", ")", "fieldBinding", ")", ".", "problemId", "(", ")", "==", "NotVisible", ")", "{", "CodeSnippetScope", "localScope", "=", "new", "CodeSnippetScope", "(", "scope", ")", ";", "this", ".", "binding", "=", "localScope", ".", "getFieldForCodeSnippet", "(", "this", ".", "delegateThis", ".", "type", ",", "this", ".", "tokens", "[", "0", "]", ",", "this", ")", ";", "if", "(", "this", ".", "binding", ".", "isValidBinding", "(", ")", ")", "{", "return", "checkFieldAccess", "(", "scope", ")", ";", "}", "else", "{", "return", "super", ".", "reportError", "(", "scope", ")", ";", "}", "}", "else", "{", "return", "super", ".", "reportError", "(", "scope", ")", ";", "}", "}", "this", ".", "binding", "=", "fieldBinding", ";", "return", "checkFieldAccess", "(", "scope", ")", ";", "}", "TypeBinding", "result", ";", "if", "(", "this", ".", "binding", "instanceof", "ProblemFieldBinding", "&&", "(", "(", "ProblemFieldBinding", ")", "this", ".", "binding", ")", ".", "problemId", "(", ")", "==", "NotVisible", ")", "{", "CodeSnippetScope", "localScope", "=", "new", "CodeSnippetScope", "(", "scope", ")", ";", "if", "(", "(", "this", ".", "binding", "=", "localScope", ".", "getBinding", "(", "this", ".", "tokens", ",", "this", ".", "bits", "&", "RestrictiveFlagMASK", ",", "this", ",", "(", "ReferenceBinding", ")", "this", ".", "delegateThis", ".", "type", ")", ")", ".", "isValidBinding", "(", ")", ")", "{", "this", ".", "bits", "&=", "~", "RestrictiveFlagMASK", ";", "this", ".", "bits", "|=", "Binding", ".", "FIELD", ";", "result", "=", "getOtherFieldBindings", "(", "scope", ")", ";", "}", "else", "{", "return", "super", ".", "reportError", "(", "scope", ")", ";", "}", "if", "(", "result", "!=", "null", "&&", "result", ".", "isValidBinding", "(", ")", ")", "{", "return", "result", ";", "}", "}", "return", "super", ".", "reportError", "(", "scope", ")", ";", "}", "}", "</s>" ]
3,999
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CastExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Expression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MessageSend", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "NameReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "CodeStream", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "codegen", ".", "Opcodes", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "flow", ".", "FlowInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "Constant", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Binding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BlockScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "FieldBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "MethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemMethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemReasons", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeIds", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeVariableBinding", ";", "public", "class", "CodeSnippetMessageSend", "extends", "MessageSend", "{", "EvaluationContext", "evaluationContext", ";", "FieldBinding", "delegateThis", ";", "public", "CodeSnippetMessageSend", "(", "EvaluationContext", "evaluationContext", ")", "{", "this", ".", "evaluationContext", "=", "evaluationContext", ";", "}", "public", "void", "generateCode", "(", "BlockScope", "currentScope", ",", "CodeStream", "codeStream", ",", "boolean", "valueRequired", ")", "{", "int", "pc", "=", "codeStream", ".", "position", ";", "MethodBinding", "codegenBinding", "=", "this", ".", "binding", ".", "original", "(", ")", ";", "if", "(", "codegenBinding", ".", "canBeSeenBy", "(", "this", ".", "actualReceiverType", ",", "this", ",", "currentScope", ")", ")", "{", "boolean", "isStatic", "=", "codegenBinding", ".", "isStatic", "(", ")", ";", "if", "(", "!", "isStatic", "&&", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", ")", "{", "ReferenceBinding", "targetType", "=", "currentScope", ".", "enclosingSourceType", "(", ")", ".", "enclosingTypeAt", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", ">>", "DepthSHIFT", ")", ";", "Object", "[", "]", "path", "=", "currentScope", ".", "getEmulationPath", "(", "targetType", ",", "true", ",", "false", ")", ";", "if", "(", "path", "==", "null", ")", "{", "currentScope", ".", "problemReporter", "(", ")", ".", "needImplementation", "(", "this", ")", ";", "}", "else", "{", "codeStream", ".", "generateOuterAccess", "(", "path", ",", "this", ",", "targetType", ",", "currentScope", ")", ";", "}", "}", "else", "{", "this", ".", "receiver", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "!", "isStatic", ")", ";", "if", "(", "(", "this", ".", "bits", "&", "NeedReceiverGenericCast", ")", "!=", "0", ")", "{", "codeStream", ".", "checkcast", "(", "this", ".", "actualReceiverType", ")", ";", "}", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "this", ".", "sourceStart", ")", ";", "}", "generateArguments", "(", "this", ".", "binding", ",", "this", ".", "arguments", ",", "currentScope", ",", "codeStream", ")", ";", "TypeBinding", "constantPoolDeclaringClass", "=", "CodeStream", ".", "getConstantPoolDeclaringClass", "(", "currentScope", ",", "codegenBinding", ",", "this", ".", "actualReceiverType", ",", "this", ".", "receiver", ".", "isImplicitThis", "(", ")", ")", ";", "if", "(", "isStatic", ")", "{", "codeStream", ".", "invoke", "(", "Opcodes", ".", "OPC_invokestatic", ",", "codegenBinding", ",", "constantPoolDeclaringClass", ")", ";", "}", "else", "if", "(", "(", "this", ".", "receiver", ".", "isSuper", "(", ")", ")", "||", "codegenBinding", ".", "isPrivate", "(", ")", ")", "{", "codeStream", ".", "invoke", "(", "Opcodes", ".", "OPC_invokespecial", ",", "codegenBinding", ",", "constantPoolDeclaringClass", ")", ";", "}", "else", "{", "if", "(", "constantPoolDeclaringClass", ".", "isInterface", "(", ")", ")", "{", "codeStream", ".", "invoke", "(", "Opcodes", ".", "OPC_invokeinterface", ",", "codegenBinding", ",", "constantPoolDeclaringClass", ")", ";", "}", "else", "{", "codeStream", ".", "invoke", "(", "Opcodes", ".", "OPC_invokevirtual", ",", "codegenBinding", ",", "constantPoolDeclaringClass", ")", ";", "}", "}", "}", "else", "{", "codeStream", ".", "generateEmulationForMethod", "(", "currentScope", ",", "codegenBinding", ")", ";", "boolean", "isStatic", "=", "codegenBinding", ".", "isStatic", "(", ")", ";", "if", "(", "!", "isStatic", "&&", "(", "(", "this", ".", "bits", "&", "DepthMASK", ")", "!=", "0", ")", ")", "{", "currentScope", ".", "problemReporter", "(", ")", ".", "needImplementation", "(", "this", ")", ";", "}", "else", "{", "this", ".", "receiver", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "!", "isStatic", ")", ";", "if", "(", "(", "this", ".", "bits", "&", "NeedReceiverGenericCast", ")", "!=", "0", ")", "{", "codeStream", ".", "checkcast", "(", "this", ".", "actualReceiverType", ")", ";", "}", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "this", ".", "sourceStart", ")", ";", "}", "if", "(", "isStatic", ")", "{", "codeStream", ".", "aconst_null", "(", ")", ";", "}", "if", "(", "this", ".", "arguments", "!=", "null", ")", "{", "int", "argsLength", "=", "this", ".", "arguments", ".", "length", ";", "codeStream", ".", "generateInlinedValue", "(", "argsLength", ")", ";", "codeStream", ".", "newArray", "(", "currentScope", ".", "createArrayType", "(", "currentScope", ".", "getType", "(", "TypeConstants", ".", "JAVA_LANG_OBJECT", ",", "3", ")", ",", "1", ")", ")", ";", "codeStream", ".", "dup", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argsLength", ";", "i", "++", ")", "{", "codeStream", ".", "generateInlinedValue", "(", "i", ")", ";", "this", ".", "arguments", "[", "i", "]", ".", "generateCode", "(", "currentScope", ",", "codeStream", ",", "true", ")", ";", "TypeBinding", "parameterBinding", "=", "codegenBinding", ".", "parameters", "[", "i", "]", ";", "if", "(", "parameterBinding", ".", "isBaseType", "(", ")", "&&", "parameterBinding", "!=", "TypeBinding", ".", "NULL", ")", "{", "codeStream", ".", "generateBoxingConversion", "(", "codegenBinding", ".", "parameters", "[", "i", "]", ".", "id", ")", ";", "}", "codeStream", ".", "aastore", "(", ")", ";", "if", "(", "i", "<", "argsLength", "-", "1", ")", "{", "codeStream", ".", "dup", "(", ")", ";", "}", "}", "}", "else", "{", "codeStream", ".", "generateInlinedValue", "(", "0", ")", ";", "codeStream", ".", "newArray", "(", "currentScope", ".", "createArrayType", "(", "currentScope", ".", "getType", "(", "TypeConstants", ".", "JAVA_LANG_OBJECT", ",", "3", ")", ",", "1", ")", ")", ";", "}", "codeStream", ".", "invokeJavaLangReflectMethodInvoke", "(", ")", ";", "if", "(", "codegenBinding", ".", "returnType", ".", "isBaseType", "(", ")", ")", "{", "int", "typeID", "=", "codegenBinding", ".", "returnType", ".", "id", ";", "if", "(", "typeID", "==", "T_void", ")", "{", "codeStream", ".", "pop", "(", ")", ";", "}", "codeStream", ".", "checkcast", "(", "typeID", ")", ";", "codeStream", ".", "getBaseTypeValue", "(", "typeID", ")", ";", "}", "else", "{", "codeStream", ".", "checkcast", "(", "codegenBinding", ".", "returnType", ")", ";", "}", "}", "if", "(", "this", ".", "valueCast", "!=", "null", ")", "codeStream", ".", "checkcast", "(", "this", ".", "valueCast", ")", ";", "if", "(", "valueRequired", ")", "{", "codeStream", ".", "generateImplicitConversion", "(", "this", ".", "implicitConversion", ")", ";", "}", "else", "{", "boolean", "isUnboxing", "=", "(", "this", ".", "implicitConversion", "&", "TypeIds", ".", "UNBOXING", ")", "!=", "0", ";", "if", "(", "isUnboxing", ")", "codeStream", ".", "generateImplicitConversion", "(", "this", ".", "implicitConversion", ")", ";", "switch", "(", "isUnboxing", "?", "postConversionType", "(", "currentScope", ")", ".", "id", ":", "codegenBinding", ".", "returnType", ".", "id", ")", "{", "case", "T_long", ":", "case", "T_double", ":", "codeStream", ".", "pop2", "(", ")", ";", "break", ";", "case", "T_void", ":", "break", ";", "default", ":", "codeStream", ".", "pop", "(", ")", ";", "}", "}", "codeStream", ".", "recordPositionsFrom", "(", "pc", ",", "(", "int", ")", "(", "this", ".", "nameSourcePosition", ">>>", "32", ")", ")", ";", "}", "public", "void", "manageSyntheticAccessIfNecessary", "(", "BlockScope", "currentScope", ",", "FlowInfo", "flowInfo", ")", "{", "if", "(", "(", "flowInfo", ".", "tagBits", "&", "FlowInfo", ".", "UNREACHABLE_OR_DEAD", ")", "==", "0", ")", "{", "MethodBinding", "codegenBinding", "=", "this", ".", "binding", ".", "original", "(", ")", ";", "if", "(", "codegenBinding", "!=", "this", ".", "binding", ")", "{", "if", "(", "codegenBinding", ".", "returnType", ".", "isTypeVariable", "(", ")", ")", "{", "TypeVariableBinding", "variableReturnType", "=", "(", "TypeVariableBinding", ")", "codegenBinding", ".", "returnType", ";", "if", "(", "variableReturnType", ".", "firstBound", "!=", "this", ".", "binding", ".", "returnType", ")", "{", "this", ".", "valueCast", "=", "this", ".", "binding", ".", "returnType", ";", "}", "}", "}", "}", "}", "public", "TypeBinding", "resolveType", "(", "BlockScope", "scope", ")", "{", "this", ".", "constant", "=", "Constant", ".", "NotAConstant", ";", "boolean", "receiverCast", "=", "false", ",", "argsContainCast", "=", "false", ";", "if", "(", "this", ".", "receiver", "instanceof", "CastExpression", ")", "{", "this", ".", "receiver", ".", "bits", "|=", "DisableUnnecessaryCastCheck", ";", "receiverCast", "=", "true", ";", "}", "this", ".", "actualReceiverType", "=", "this", ".", "receiver", ".", "resolveType", "(", "scope", ")", ";", "if", "(", "receiverCast", "&&", "this", ".", "actualReceiverType", "!=", "null", ")", "{", "if", "(", "(", "(", "CastExpression", ")", "this", ".", "receiver", ")", ".", "expression", ".", "resolvedType", "==", "this", ".", "actualReceiverType", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "unnecessaryCast", "(", "(", "CastExpression", ")", "this", ".", "receiver", ")", ";", "}", "}", "if", "(", "this", ".", "typeArguments", "!=", "null", ")", "{", "int", "length", "=", "this", ".", "typeArguments", ".", "length", ";", "boolean", "argHasError", "=", "false", ";", "this", ".", "genericTypeArguments", "=", "new", "TypeBinding", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "(", "this", ".", "genericTypeArguments", "[", "i", "]", "=", "this", ".", "typeArguments", "[", "i", "]", ".", "resolveType", "(", "scope", ",", "true", ")", ")", "==", "null", ")", "{", "argHasError", "=", "true", ";", "}", "}", "if", "(", "argHasError", ")", "{", "return", "null", ";", "}", "}", "TypeBinding", "[", "]", "argumentTypes", "=", "Binding", ".", "NO_PARAMETERS", ";", "if", "(", "this", ".", "arguments", "!=", "null", ")", "{", "boolean", "argHasError", "=", "false", ";", "int", "length", "=", "this", ".", "arguments", ".", "length", ";", "argumentTypes", "=", "new", "TypeBinding", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "Expression", "argument", "=", "this", ".", "arguments", "[", "i", "]", ";", "if", "(", "argument", "instanceof", "CastExpression", ")", "{", "argument", ".", "bits", "|=", "DisableUnnecessaryCastCheck", ";", "argsContainCast", "=", "true", ";", "}", "if", "(", "(", "argumentTypes", "[", "i", "]", "=", "this", ".", "arguments", "[", "i", "]", ".", "resolveType", "(", "scope", ")", ")", "==", "null", ")", "argHasError", "=", "true", ";", "}", "if", "(", "argHasError", ")", "{", "if", "(", "this", ".", "actualReceiverType", "instanceof", "ReferenceBinding", ")", "{", "this", ".", "binding", "=", "scope", ".", "findMethod", "(", "(", "ReferenceBinding", ")", "this", ".", "actualReceiverType", ",", "this", ".", "selector", ",", "new", "TypeBinding", "[", "]", "{", "}", ",", "this", ")", ";", "}", "return", "null", ";", "}", "}", "if", "(", "this", ".", "actualReceiverType", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "this", ".", "actualReceiverType", ".", "isBaseType", "(", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "errorNoMethodFor", "(", "this", ",", "this", ".", "actualReceiverType", ",", "argumentTypes", ")", ";", "return", "null", ";", "}", "this", ".", "binding", "=", "this", ".", "receiver", ".", "isImplicitThis", "(", ")", "?", "scope", ".", "getImplicitMethod", "(", "this", ".", "selector", ",", "argumentTypes", ",", "this", ")", ":", "scope", ".", "getMethod", "(", "this", ".", "actualReceiverType", ",", "this", ".", "selector", ",", "argumentTypes", ",", "this", ")", ";", "if", "(", "!", "this", ".", "binding", ".", "isValidBinding", "(", ")", ")", "{", "if", "(", "this", ".", "binding", "instanceof", "ProblemMethodBinding", "&&", "(", "(", "ProblemMethodBinding", ")", "this", ".", "binding", ")", ".", "problemId", "(", ")", "==", "ProblemReasons", ".", "NotVisible", ")", "{", "if", "(", "this", ".", "evaluationContext", ".", "declaringTypeName", "!=", "null", ")", "{", "this", ".", "delegateThis", "=", "scope", ".", "getField", "(", "scope", ".", "enclosingSourceType", "(", ")", ",", "EvaluationConstants", ".", "DELEGATE_THIS", ",", "this", ")", ";", "if", "(", "this", ".", "delegateThis", "==", "null", ")", "{", "this", ".", "constant", "=", "Constant", ".", "NotAConstant", ";", "scope", ".", "problemReporter", "(", ")", ".", "invalidMethod", "(", "this", ",", "this", ".", "binding", ")", ";", "return", "null", ";", "}", "}", "else", "{", "this", ".", "constant", "=", "Constant", ".", "NotAConstant", ";", "scope", ".", "problemReporter", "(", ")", ".", "invalidMethod", "(", "this", ",", "this", ".", "binding", ")", ";", "return", "null", ";", "}", "CodeSnippetScope", "localScope", "=", "new", "CodeSnippetScope", "(", "scope", ")", ";", "MethodBinding", "privateBinding", "=", "this", ".", "receiver", "instanceof", "CodeSnippetThisReference", "&&", "(", "(", "CodeSnippetThisReference", ")", "this", ".", "receiver", ")", ".", "isImplicit", "?", "localScope", ".", "getImplicitMethod", "(", "(", "ReferenceBinding", ")", "this", ".", "delegateThis", ".", "type", ",", "this", ".", "selector", ",", "argumentTypes", ",", "this", ")", ":", "localScope", ".", "getMethod", "(", "this", ".", "delegateThis", ".", "type", ",", "this", ".", "selector", ",", "argumentTypes", ",", "this", ")", ";", "if", "(", "!", "privateBinding", ".", "isValidBinding", "(", ")", ")", "{", "if", "(", "this", ".", "binding", ".", "declaringClass", "==", "null", ")", "{", "if", "(", "this", ".", "actualReceiverType", "instanceof", "ReferenceBinding", ")", "{", "this", ".", "binding", ".", "declaringClass", "=", "(", "ReferenceBinding", ")", "this", ".", "actualReceiverType", ";", "}", "else", "{", "scope", ".", "problemReporter", "(", ")", ".", "errorNoMethodFor", "(", "this", ",", "this", ".", "actualReceiverType", ",", "argumentTypes", ")", ";", "return", "null", ";", "}", "}", "scope", ".", "problemReporter", "(", ")", ".", "invalidMethod", "(", "this", ",", "this", ".", "binding", ")", ";", "return", "null", ";", "}", "else", "{", "this", ".", "binding", "=", "privateBinding", ";", "}", "}", "else", "{", "if", "(", "this", ".", "binding", ".", "declaringClass", "==", "null", ")", "{", "if", "(", "this", ".", "actualReceiverType", "instanceof", "ReferenceBinding", ")", "{", "this", ".", "binding", ".", "declaringClass", "=", "(", "ReferenceBinding", ")", "this", ".", "actualReceiverType", ";", "}", "else", "{", "scope", ".", "problemReporter", "(", ")", ".", "errorNoMethodFor", "(", "this", ",", "this", ".", "actualReceiverType", ",", "argumentTypes", ")", ";", "return", "null", ";", "}", "}", "scope", ".", "problemReporter", "(", ")", ".", "invalidMethod", "(", "this", ",", "this", ".", "binding", ")", ";", "return", "null", ";", "}", "}", "if", "(", "!", "this", ".", "binding", ".", "isStatic", "(", ")", ")", "{", "if", "(", "this", ".", "receiver", "instanceof", "NameReference", "&&", "(", "(", "(", "NameReference", ")", "this", ".", "receiver", ")", ".", "bits", "&", "Binding", ".", "TYPE", ")", "!=", "0", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "mustUseAStaticMethod", "(", "this", ",", "this", ".", "binding", ")", ";", "}", "else", "{", "TypeBinding", "oldReceiverType", "=", "this", ".", "actualReceiverType", ";", "this", ".", "actualReceiverType", "=", "this", ".", "actualReceiverType", ".", "getErasureCompatibleType", "(", "this", ".", "binding", ".", "declaringClass", ")", ";", "this", ".", "receiver", ".", "computeConversion", "(", "scope", ",", "this", ".", "actualReceiverType", ",", "this", ".", "actualReceiverType", ")", ";", "if", "(", "this", ".", "actualReceiverType", "!=", "oldReceiverType", "&&", "this", ".", "receiver", ".", "postConversionType", "(", "scope", ")", "!=", "this", ".", "actualReceiverType", ")", "{", "this", ".", "bits", "|=", "NeedReceiverGenericCast", ";", "}", "}", "}", "if", "(", "checkInvocationArguments", "(", "scope", ",", "this", ".", "receiver", ",", "this", ".", "actualReceiverType", ",", "this", ".", "binding", ",", "this", ".", "arguments", ",", "argumentTypes", ",", "argsContainCast", ",", "this", ")", ")", "{", "this", ".", "bits", "|=", "ASTNode", ".", "Unchecked", ";", "}", "if", "(", "this", ".", "binding", ".", "isAbstract", "(", ")", ")", "{", "if", "(", "this", ".", "receiver", ".", "isSuper", "(", ")", ")", "{", "scope", ".", "problemReporter", "(", ")", ".", "cannotDireclyInvokeAbstractMethod", "(", "this", ",", "this", ".", "binding", ")", ";", "}", "}", "if", "(", "isMethodUseDeprecated", "(", "this", ".", "binding", ",", "scope", ",", "true", ")", ")", "scope", ".", "problemReporter", "(", ")", ".", "deprecatedMethod", "(", "this", ".", "binding", ",", "this", ")", ";", "if", "(", "this", ".", "actualReceiverType", ".", "isArrayType", "(", ")", "&&", "this", ".", "binding", ".", "parameters", "==", "Binding", ".", "NO_PARAMETERS", "&&", "scope", ".", "compilerOptions", "(", ")", ".", "complianceLevel", ">=", "ClassFileConstants", ".", "JDK1_5", "&&", "CharOperation", ".", "equals", "(", "this", ".", "binding", ".", "selector", ",", "CLONE", ")", ")", "{", "this", ".", "resolvedType", "=", "this", ".", "actualReceiverType", ";", "}", "else", "{", "TypeBinding", "returnType", "=", "this", ".", "binding", ".", "returnType", ";", "if", "(", "returnType", "!=", "null", ")", "{", "if", "(", "(", "this", ".", "bits", "&", "ASTNode", ".", "Unchecked", ")", "!=", "0", "&&", "this", ".", "genericTypeArguments", "==", "null", ")", "{", "returnType", "=", "scope", ".", "environment", "(", ")", ".", "convertToRawType", "(", "returnType", ".", "erasure", "(", ")", ",", "true", ")", ";", "}", "returnType", "=", "returnType", ".", "capture", "(", "scope", ",", "this", ".", "sourceEnd", ")", ";", "}", "this", ".", "resolvedType", "=", "returnType", ";", "}", "return", "this", ".", "resolvedType", ";", "}", "}", "</s>" ]