db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r448691 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
Date Thu, 21 Sep 2006 21:24:25 GMT
Author: mikem
Date: Thu Sep 21 14:24:25 2006
New Revision: 448691

URL: http://svn.apache.org/viewvc?view=rev&rev=448691
Log:
DERBY-1776
contributed by Army Brown
patch:  d1776_reuseInt.patch

In a review comment for a different issue someone mentioned that instead of creating new Integer()
objects it'd be better to use the Derby ReuseFactory where possible to avoid excessive object
creation. I get the feeling that's not a big deal with the _v1 patch for this issue, but I
nonetheless thought it'd be a good idea to follow that advice with the changes.

So I'm attaching a tiny patch, d1776_reuseInt.patch, that replaces the calls to "new Integer()"
in the _v1 patch (which has already been committed) with calls to ReuseFactory.getInteger().
Functionally, the patch doesn't change anything. 


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?view=diff&rev=448691&r1=448690&r2=448691
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Thu Sep
21 14:24:25 2006
@@ -4219,8 +4219,8 @@
 	{
 		throw StandardException.newException(
 			SQLState.LANG_XML_KEYWORD_MISSING, "DOCUMENT",
-			new Integer(getToken(1).beginLine),
-			new Integer(getToken(1).beginColumn));
+			ReuseFactory.getInteger(getToken(1).beginLine),
+			ReuseFactory.getInteger(getToken(1).beginColumn));
 	}
 |
 	LOOKAHEAD({ getToken(1).kind == CONTENT }) <CONTENT>
@@ -6752,8 +6752,8 @@
 	{
 		throw StandardException.newException(
 			SQLState.LANG_XML_KEYWORD_MISSING, "PRESERVE WHITESPACE",
-			new Integer(getToken(1).beginLine),
-			new Integer(getToken(1).beginColumn));
+			ReuseFactory.getInteger(getToken(1).beginLine),
+			ReuseFactory.getInteger(getToken(1).beginColumn));
 	}
 |
 	<STRIP> <WHITESPACE>
@@ -6818,8 +6818,8 @@
 	{
 		throw StandardException.newException(
 			SQLState.LANG_XML_KEYWORD_MISSING, "AS",
-			new Integer(getToken(1).beginLine),
-			new Integer(getToken(1).beginColumn));
+			ReuseFactory.getInteger(getToken(1).beginLine),
+			ReuseFactory.getInteger(getToken(1).beginColumn));
 	}
 |
 	<AS> targetType = dataTypeDDL()



Mime
View raw message