svn commit: r892701 - /ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r892701 - /ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj

doogie-3
Author: doogie
Date: Mon Dec 21 06:02:24 2009
New Revision: 892701

URL: http://svn.apache.org/viewvc?rev=892701&view=rev
Log:
Switch all IllegalArgumentException to ParseException.

Modified:
    ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj

Modified: ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj?rev=892701&r1=892700&r2=892701&view=diff
==============================================================================
--- ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj (original)
+++ ofbiz/trunk/framework/sql/src/org/ofbiz/sql/Parser.jj Mon Dec 21 06:02:24 2009
@@ -314,7 +314,7 @@
  keyMaps=KeyMaps("cur", "other")
  {
  Relation relation = new Relation(type, title, entityName, keyMaps);
- if (relations.containsKey(relation.getName())) throw new IllegalArgumentException("Duplicate relation: " + relation);
+ if (relations.containsKey(relation.getName())) throw new ParseException("Duplicate relation: " + relation);
  relations.put(relation.getName(), relation);
  }
 }
@@ -495,13 +495,13 @@
  alias2=NamePart() <PERIOD> field2=NamePart()
  {
  if (alias1.equals(leftAlias)) {
- if (!alias2.equals(rightAlias)) throw new IllegalArgumentException("invalid right alias(" + alias2 + "), expected(" + rightAlias + ")");
+ if (!alias2.equals(rightAlias)) throw new ParseException("invalid right alias(" + alias2 + "), expected(" + rightAlias + ")");
  keyMaps.add(new KeyMap(field1, field2));
  } else if (alias1.equals(rightAlias)) {
- if (!alias2.equals(leftAlias)) throw new IllegalArgumentException("invalid left alias(" + alias2 + "), expected(" + leftAlias + ")");
+ if (!alias2.equals(leftAlias)) throw new ParseException("invalid left alias(" + alias2 + "), expected(" + leftAlias + ")");
  keyMaps.add(new KeyMap(field2, field1));
  } else {
- throw new IllegalArgumentException("invalid aliases, expected(" + leftAlias + " or " + rightAlias + ")");
+ throw new ParseException("invalid aliases, expected(" + leftAlias + " or " + rightAlias + ")");
  }
  }
 }
@@ -536,7 +536,7 @@
  <PERIOD> (
  <STAR>
  (
- { if (fieldAllAliases.contains(n)) throw new IllegalArgumentException("Duplicate aliasAll(" + n + ")"); }
+ { if (fieldAllAliases.contains(n)) throw new ParseException("Duplicate aliasAll(" + n + ")"); }
  <EXCLUDE> <OPEN_PAREN>
  exc=NamePart() { excludeList.add(exc); }
  ( <COMMA> exc=NamePart() { excludeList.add(exc); } )*
@@ -550,7 +550,7 @@
  )
  | v=MathValue() <AS> fieldAlias=NamePart() { def = new FieldDefValue(v, fieldAlias); }
  ) {
- if (fieldDefs.containsKey(def.getAlias())) throw new IllegalArgumentException("duplicate alias(" + def.getAlias() + ")");
+ if (fieldDefs.containsKey(def.getAlias())) throw new ParseException("duplicate alias(" + def.getAlias() + ")");
  fieldDefs.put(def.getAlias(), def);
  }
 }
@@ -570,7 +570,7 @@
  if (operator == null) {
  operator = newOperator;
  } else if (!newOperator.equals(operator)) {
- throw new IllegalArgumentException("Different operators in complex alias(" + operator + ":" + newOperator + ")");
+ throw new ParseException("Different operators in complex alias(" + operator + ":" + newOperator + ")");
  }
  values.add(v);
  }