diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-06-23 20:59:32 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2008-06-23 20:59:32 +0000 |
commit | c4468c342efcd45bdc6cc08ea9c06ea6edd75f69 (patch) | |
tree | ab41d9ebe5fb4fea3c179d70b3e4ed89738c93fc /gnu/xml/xpath/XPathParser.java | |
parent | 7b5f1590c0b002ac59f31c5932977cb1d8d63339 (diff) | |
download | classpath-c4468c342efcd45bdc6cc08ea9c06ea6edd75f69.tar.gz |
2008-06-23 Andrew John Hughes <gnu_andrew@member.fsf.org>
* gnu/xml/xpath/CountFunction.java,
* gnu/xml/xpath/EqualityExpr.java,
* gnu/xml/xpath/Expr.java,
* gnu/xml/xpath/IdFunction.java,
* gnu/xml/xpath/LocalNameFunction.java,
* gnu/xml/xpath/NameFunction.java,
* gnu/xml/xpath/NamespaceUriFunction.java,
* gnu/xml/xpath/ParenthesizedExpr.java,
* gnu/xml/xpath/Steps.java,
* gnu/xml/xpath/SumFunction.java,
* gnu/xml/xpath/UnionExpr.java,
* gnu/xml/xpath/XPathParser.java,
* gnu/xml/xpath/XPathParser.y,
* java/lang/Enum.java,
* java/lang/reflect/Constructor.java,
* java/lang/reflect/Field.java,
* java/lang/reflect/Method.java:
Reduce scope of unchecked warning suppression,
and remove unneeded uses.
Diffstat (limited to 'gnu/xml/xpath/XPathParser.java')
-rw-r--r-- | gnu/xml/xpath/XPathParser.java | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/gnu/xml/xpath/XPathParser.java b/gnu/xml/xpath/XPathParser.java index 300f3161d..e8c8e94da 100644 --- a/gnu/xml/xpath/XPathParser.java +++ b/gnu/xml/xpath/XPathParser.java @@ -391,7 +391,6 @@ public class XPathParser @return result of the last reduction, if any. @throws yyException on irrecoverable parse error. */ - @SuppressWarnings("unchecked") public Object yyparse (yyInput yyLex) throws java.io.IOException, yyException { if (yyMax <= 0) yyMax = 256; // initial size @@ -566,20 +565,25 @@ case 9: case 10: // line 362 "XPathParser.y" { - yyVal = new Selector (Selector.CHILD, (List<Test>) yyVals[0+yyTop]); - } + @SuppressWarnings("unchecked") List<Test> tests = (List<Test>) yyVals[0+yyTop]; + yyVal = new Selector (Selector.CHILD, tests); + } break; case 11: // line 366 "XPathParser.y" { - yyVal = new Selector (Selector.ATTRIBUTE, (List<Test>) yyVals[0+yyTop]); - } + /* This is safe as we create this in one of the other cases */ + @SuppressWarnings("unchecked") List<Test> tests = (List<Test>) yyVals[0+yyTop]; + yyVal = new Selector (Selector.ATTRIBUTE, tests); + } break; case 12: // line 370 "XPathParser.y" { - yyVal = new Selector (((Integer) yyVals[-2+yyTop]).intValue (), (List<Test>) yyVals[0+yyTop]); - } + /* This is safe as we create this in one of the other cases */ + @SuppressWarnings("unchecked") List<Test> tests = (List<Test>) yyVals[0+yyTop]; + yyVal = new Selector (((Integer) yyVals[-2+yyTop]).intValue (), tests); + } break; case 13: // line 374 "XPathParser.y" @@ -606,10 +610,11 @@ case 15: case 16: // line 391 "XPathParser.y" { - List<Test> list = (List<Test>)yyVals[-1+yyTop]; - list.add((Test) yyVals[0+yyTop]); - yyVal = list; - } + /* This is safe as we create this in one of the other cases */ + @SuppressWarnings("unchecked") List<Test> tests = (List<Test>)yyVals[-1+yyTop]; + tests.add((Test) yyVals[0+yyTop]); + yyVal = tests; + } break; case 17: // line 415 "XPathParser.y" @@ -735,8 +740,10 @@ case 39: case 40: // line 512 "XPathParser.y" { - yyVal = lookupFunction((String) yyVals[-3+yyTop], (List) yyVals[-1+yyTop]); - } + /* This is safe as we create this below */ + @SuppressWarnings("unchecked") List<Expr> exprs = (List<Expr>) yyVals[-1+yyTop]; + yyVal = lookupFunction((String) yyVals[-3+yyTop], exprs); + } break; case 41: // line 519 "XPathParser.y" @@ -749,10 +756,11 @@ case 41: case 42: // line 525 "XPathParser.y" { - List<Expr> list = (List<Expr>) yyVals[0+yyTop]; - list.add(0, (Expr) yyVals[-2+yyTop]); - yyVal = list; - } + /* This is safe as we create this above */ + @SuppressWarnings("unchecked") List<Expr> list = (List<Expr>) yyVals[0+yyTop]; + list.add(0, (Expr) yyVals[-2+yyTop]); + yyVal = list; + } break; case 44: // line 535 "XPathParser.y" |