121121import com .google .classpath .ClassPathFactory ;
122122import com .google .classpath .RegExpResourceFilter ;
123123
124+ @ SuppressWarnings ({ "deprecation" , "unchecked" })
124125public class ASTGenerator {
125126
126127 protected ErrorCheckerService errorCheckerService ;
@@ -1512,7 +1513,6 @@ public void run() {
15121513*/
15131514 }
15141515
1515- @ SuppressWarnings ("unchecked" )
15161516 protected static ASTNode findClosestParentNode (int lineNumber , ASTNode node ) {
15171517 Iterator <StructuralPropertyDescriptor > it = node
15181518 .structuralPropertiesForType ().iterator ();
@@ -2248,7 +2248,7 @@ protected DefaultMutableTreeNode findAllOccurrences(){
22482248 return defCU ;
22492249 }
22502250
2251- @ SuppressWarnings ({ "unchecked" })
2251+
22522252 /**
22532253 * Generates AST Swing component
22542254 * @param node
@@ -2280,23 +2280,23 @@ public static void visitRecur(ASTNode node, DefaultMutableTreeNode tnode) {
22802280 .getStructuralProperty (prop )));
22812281 }
22822282 }
2283- }
2284-
2285- else if (prop .isChildListProperty ()) {
2286- List <ASTNode > nodelist = (List <ASTNode >) node
2287- .getStructuralProperty (prop );
2283+ } else if (prop .isChildListProperty ()) {
2284+ List <ASTNode > nodelist = (List <ASTNode >)
2285+ node .getStructuralProperty (prop );
22882286 for (ASTNode cnode : nodelist ) {
22892287 if (isAddableASTNode (cnode )) {
22902288 ctnode = new DefaultMutableTreeNode (new ASTNodeWrapper (cnode ));
22912289 tnode .add (ctnode );
22922290 visitRecur (cnode , ctnode );
2293- } else
2291+ } else {
22942292 visitRecur (cnode , tnode );
2293+ }
22952294 }
22962295 }
22972296 }
22982297 }
22992298
2299+
23002300 public void dfsNameOnly (DefaultMutableTreeNode tnode ,ASTNode decl , String name ) {
23012301 Stack <DefaultMutableTreeNode > temp = new Stack <DefaultMutableTreeNode >();
23022302 temp .push (codeTree );
@@ -2356,8 +2356,8 @@ public ASTNode dfsLookForASTNode(ASTNode root, String name, int startOffset,
23562356 }
23572357 }
23582358 else if (prop .isChildListProperty ()) {
2359- List <ASTNode > nodelist = ( List < ASTNode >) node
2360- .getStructuralProperty (prop );
2359+ List <ASTNode > nodelist =
2360+ ( List < ASTNode >) node .getStructuralProperty (prop );
23612361 for (ASTNode temp : nodelist ) {
23622362 if (temp .getStartPosition () <= startOffset
23632363 && (temp .getStartPosition () + temp .getLength ()) >= endOffset ) {
@@ -2552,7 +2552,7 @@ else if (prop.isChildListProperty()) {
25522552 }
25532553 }
25542554
2555- @ SuppressWarnings ( "unchecked" )
2555+
25562556 protected static ASTNode findLineOfNode (ASTNode node , int lineNumber ,
25572557 int offset , String name ) {
25582558
@@ -2610,7 +2610,6 @@ protected static ASTNode findLineOfNode(ASTNode node, int lineNumber,
26102610 * @param root
26112611 * @return
26122612 */
2613- @ SuppressWarnings ("unchecked" )
26142613 public static ASTNode pinpointOnLine (ASTNode node , int offset ,
26152614 int lineStartOffset , String name ) {
26162615 //log("pinpointOnLine node class: " + node.getClass().getSimpleName());
@@ -2669,7 +2668,6 @@ public static ASTNode pinpointOnLine(ASTNode node, int offset,
26692668 * @param findMe
26702669 * @return
26712670 */
2672- @ SuppressWarnings ("unchecked" )
26732671 protected static ASTNode findDeclaration (Name findMe ) {
26742672
26752673 // WARNING: You're entering the Rube Goldberg territory of Experimental Mode.
@@ -3224,7 +3222,8 @@ public static SimpleType extracTypeInfo(ASTNode node) {
32243222 return (SimpleType ) t ;
32253223 }
32263224
3227- public static Type extracTypeInfo2 (ASTNode node ) {
3225+
3226+ static public Type extracTypeInfo2 (ASTNode node ) {
32283227 if (node == null )
32293228 return null ;
32303229 switch (node .getNodeType ()) {
@@ -3245,8 +3244,8 @@ public static Type extracTypeInfo2(ASTNode node) {
32453244 return null ;
32463245 }
32473246
3248- @ SuppressWarnings ( "unchecked" )
3249- protected static ASTNode definedIn (ASTNode node , String name ,
3247+
3248+ static protected ASTNode definedIn (ASTNode node , String name ,
32503249 ArrayList <Integer > constrains ,
32513250 ASTNode declaringClass ) {
32523251 if (node == null )
0 commit comments