Author: kristwaa
Date: Wed Jul 16 06:18:24 2008
New Revision: 677281
URL: http://svn.apache.org/viewvc?rev=677281&view=rev
Log:
DERBY-3781: PositionedStoreStream.reposition(pos) with pos greater than length leaves the
stream object in an inconsistent state.
Code cleanup, removing an unnecessary convenience variable that can lead to future bugs if
used.
Patch file: derby-3781-2b-remove_convenience_link.diff
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java?rev=677281&r1=677280&r2=677281&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/PositionedStoreStream.java
Wed Jul 16 06:18:24 2008
@@ -60,9 +60,6 @@
/** Underlying store stream serving bytes. */
//@GuardedBy("EmbedConnection.getConnectionSynchronization()")
private final InputStream stream;
- /** Convenience reference to the stream as a resettable stream. */
- //@GuardedBy("EmbedConnection.getConnectionSynchronization()")
- private final Resetable resettable;
/**
* Position of the underlying store stream.
* Note that the position is maintained by this class, not the underlying
@@ -78,12 +75,9 @@
* stream.
*
* @param in a {@link Resetable}-stream
- * @throws ClassCastException if the inputstream does not implement
- * {@link Resetable}
*/
public PositionedStoreStream(InputStream in) {
this.stream = in;
- this.resettable = (Resetable)in;
}
/**
@@ -153,7 +147,7 @@
*/
public void resetStream()
throws IOException, StandardException {
- this.resettable.resetStream();
+ ((Resetable)this.stream).resetStream();
this.pos = 0L;
}
@@ -165,7 +159,7 @@
*/
public void initStream()
throws StandardException {
- this.resettable.initStream();
+ ((Resetable)this.stream).initStream();
this.pos = 0L;
}
@@ -175,7 +169,7 @@
* @see Resetable#closeStream
*/
public void closeStream() {
- this.resettable.closeStream();
+ ((Resetable)this.stream).closeStream();
}
/**
|