Author: kristwaa
Date: Fri Feb 1 11:40:50 2013
New Revision: 1441396
URL: http://svn.apache.org/viewvc?rev=1441396&view=rev
Log:
DERBY-6063: Access static variables by class name in TabInfoImpl, InsertResultSet and ControlRow
Replaced occurrences of accessing static variables via instances with access via class names.
Removed unused meothod in ControlRow.
Removed a few unused local variables.
Patch file: derby-6063-1a_statics-by-class_and_unused_method.diff
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java?rev=1441396&r1=1441395&r2=1441396&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/TabInfoImpl.java Fri
Feb 1 11:40:50 2013
@@ -667,8 +667,8 @@ class TabInfoImpl
** is a start key and no stop key or vice versa.
*/
int lockMode = ((startKey != null) && (stopKey != null)) ?
- tc.MODE_RECORD :
- tc.MODE_TABLE;
+ TransactionController.MODE_RECORD :
+ TransactionController.MODE_TABLE;
/*
** Don't use level 3 if we have the same start/stop key.
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java?rev=1441396&r1=1441395&r2=1441396&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/InsertResultSet.java
Fri Feb 1 11:40:50 2013
@@ -920,7 +920,6 @@ class InsertResultSet extends DMLWriteRe
throws StandardException
{
boolean setUserIdentity = constants.hasAutoincrement() && isSingleRowResultSet();
- boolean firstDeferredRow = true;
ExecRow deferredRowBuffer = null;
long user_autoinc=0;
@@ -1566,10 +1565,10 @@ class InsertResultSet extends DMLWriteRe
fkConglom,
false, // hold
0, // read only
- tc.MODE_TABLE, // doesn't matter,
- // already locked
- tc.ISOLATION_READ_COMMITTED, // doesn't matter,
- // already locked
+ // doesn't matter, already locked
+ TransactionController.MODE_TABLE,
+ // doesn't matter, already locked
+ TransactionController.ISOLATION_READ_COMMITTED,
(FormatableBitSet)null, // retrieve all fields
(DataValueDescriptor[])null, // startKeyValue
ScanController.GE, // startSearchOp
@@ -1619,10 +1618,10 @@ class InsertResultSet extends DMLWriteRe
false, // hold
0, // read only
(fkConglom == pkConglom) ?
- tc.MODE_TABLE :
- tc.MODE_RECORD,
- tc.ISOLATION_READ_COMMITTED, // read committed is
- // good enough
+ TransactionController.MODE_TABLE :
+ TransactionController.MODE_RECORD,
+ // read committed is good enough
+ TransactionController.ISOLATION_READ_COMMITTED,
(FormatableBitSet)null, // retrieve all fields
(DataValueDescriptor[])null, // startKeyValue
ScanController.GE, // startSearchOp
@@ -1938,7 +1937,6 @@ class InsertResultSet extends DMLWriteRe
if ((numRows = cCount.getRowCount()) > 0)
{
long[] c = cCount.getCardinality();
- DataDescriptorGenerator ddg = dd.getDataDescriptorGenerator();
for (int i= 0; i < c.length; i++)
{
@@ -2456,9 +2454,9 @@ class InsertResultSet extends DMLWriteRe
false, // for update
-1, // saved object for referenced bitImpl
-1,
- tc.MODE_TABLE,
+ TransactionController.MODE_TABLE,
true, // table locked
- tc.ISOLATION_READ_COMMITTED,
+ TransactionController.ISOLATION_READ_COMMITTED,
LanguageProperties.BULK_FETCH_DEFAULT_INT, // rows per read
false, // never disable bulk fetch
false, // not a 1 row per scan
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java?rev=1441396&r1=1441395&r2=1441396&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/ControlRow.java
Fri Feb 1 11:40:50 2013
@@ -318,14 +318,14 @@ public abstract class ControlRow impleme
// Page numbers start out "invalid". Presumably the caller will
// link the page into a page chain as one of its next steps.
leftSiblingPageNumber =
- new SQLLongint(btree.container.INVALID_PAGE_NUMBER);
+ new SQLLongint(ContainerHandle.INVALID_PAGE_NUMBER);
rightSiblingPageNumber =
- new SQLLongint(btree.container.INVALID_PAGE_NUMBER);
+ new SQLLongint(ContainerHandle.INVALID_PAGE_NUMBER);
// Remember the parent if there is one and we're remembering parents.
parentPageNumber = new SQLLongint(
(parent == null ?
- btree.container.INVALID_PAGE_NUMBER :
+ ContainerHandle.INVALID_PAGE_NUMBER :
parent.page.getPageNumber()));
// All pages start out not being root pages. The caller will setIsRoot
@@ -785,23 +785,6 @@ public abstract class ControlRow impleme
return this.btree;
}
- /**
- * Set the conglomerate field in the btree.
- * <p>
- * Sets the btree field of the control row. Updates just the disk copy.
- *
- * @exception StandardException Standard exception policy.
- **/
- private void setConglom(BTree btree)
- throws StandardException
- {
- // Store the field. Delay faulting value into object until getConlgom()
- // call, which in general only happens during recovery.
-
- // Write the field through to the underlying row.
- this.page.updateFieldAtSlot(CR_SLOT, CR_CONGLOM_COLID, btree, null);
- }
-
/*
** Methods for getting control rows from pages.
*/
|