Skip to content

Commit

Permalink
Rename cursor error to cursor exception
Browse files Browse the repository at this point in the history
- checkAndClearCursorError -> checkAndClearCursorException
- setCursorError -> setCursorException
- clearCursorError -> clearCursorException
  • Loading branch information
chrisvest committed May 20, 2016
1 parent 595227a commit 6728dbf
Show file tree
Hide file tree
Showing 19 changed files with 156 additions and 156 deletions.
Expand Up @@ -22,8 +22,8 @@
import java.io.IOException;

/**
* Thrown by {@link PageCursor#checkAndClearCursorError()} if an error condition has been set on the cursor with
* {@link PageCursor#setCursorError(String)}.
* Thrown by {@link PageCursor#checkAndClearCursorException()} if an error condition has been set on the cursor with
* {@link PageCursor#setCursorException(String)}.
*/
public class CursorException extends IOException
{
Expand Down
Expand Up @@ -302,7 +302,7 @@ public abstract class PageCursor implements AutoCloseable
* Check if a cursor error has been set on this or any linked cursor, and if so, remove it from the cursor
* and throw it as a {@link CursorException}.
*/
public abstract void checkAndClearCursorError() throws CursorException;
public abstract void checkAndClearCursorException() throws CursorException;

/**
* Explicitly raise the out-of-bounds flag.
Expand All @@ -314,19 +314,19 @@ public abstract class PageCursor implements AutoCloseable
/**
* Set an error condition on the cursor with the given message.
* <p>
* This will make calls to {@link #checkAndClearCursorError()} throw a {@link CursorException} with the given
* This will make calls to {@link #checkAndClearCursorException()} throw a {@link CursorException} with the given
* message, unless the error has gotten cleared by a {@link #shouldRetry()} call that returned {@code true},
* a call to {@link #next()} or {@link #next(long)}, or the cursor is closed.
*
* @param message The message of the {@link CursorException} that {@link #checkAndClearCursorError()} will throw.
* @param message The message of the {@link CursorException} that {@link #checkAndClearCursorException()} will throw.
*/
public abstract void setCursorError( String message );
public abstract void setCursorException( String message );

/**
* Unconditionally clear any error condition that has been set on this or any linked cursor, without throwing an
* exception.
*/
public abstract void clearCursorError();
public abstract void clearCursorException();

/**
* Open a new page cursor with the same pf_flags as this cursor, as if calling the {@link PagedFile#io(long, int)}
Expand Down
Expand Up @@ -452,10 +452,10 @@ public boolean checkAndClearBoundsFlag()
}

@Override
public void checkAndClearCursorError() throws CursorException
public void checkAndClearCursorException() throws CursorException
{
first.checkAndClearCursorError();
second.checkAndClearCursorError();
first.checkAndClearCursorException();
second.checkAndClearCursorException();
}

@Override
Expand All @@ -465,16 +465,16 @@ public void raiseOutOfBounds()
}

@Override
public void setCursorError( String message )
public void setCursorException( String message )
{
cursor( 0 ).setCursorError( message );
cursor( 0 ).setCursorException( message );
}

@Override
public void clearCursorError()
public void clearCursorException()
{
first.clearCursorError();
second.clearCursorError();
first.clearCursorException();
second.clearCursorException();
}

@Override
Expand Down
Expand Up @@ -138,9 +138,9 @@ public boolean checkAndClearBoundsFlag()
}

@Override
public void checkAndClearCursorError() throws CursorException
public void checkAndClearCursorException() throws CursorException
{
delegate.checkAndClearCursorError();
delegate.checkAndClearCursorException();
}

@Override
Expand All @@ -150,15 +150,15 @@ public void raiseOutOfBounds()
}

@Override
public void setCursorError( String message )
public void setCursorException( String message )
{
delegate.setCursorError( message );
delegate.setCursorException( message );
}

@Override
public void clearCursorError()
public void clearCursorException()
{
delegate.clearCursorError();
delegate.clearCursorException();
}

@Override
Expand Down
Expand Up @@ -710,7 +710,7 @@ public boolean checkAndClearBoundsFlag()
}

@Override
public void checkAndClearCursorError() throws CursorException
public void checkAndClearCursorException() throws CursorException
{
MuninnPageCursor cursor = this;
do
Expand All @@ -734,7 +734,7 @@ public void checkAndClearCursorError() throws CursorException
}

@Override
public void clearCursorError()
public void clearCursorException()
{
clearCursorError( this );
}
Expand All @@ -755,7 +755,7 @@ public void raiseOutOfBounds()
}

@Override
public void setCursorError( String message )
public void setCursorException( String message )
{
Objects.requireNonNull( message );
if ( usePreciseCursorErrorStackTraces )
Expand Down
Expand Up @@ -111,7 +111,7 @@ private void startRetry() throws IOException
{
setOffset( 0 );
checkAndClearBoundsFlag();
clearCursorError();
clearCursorException();
lockStamp = page.tryOptimisticReadLock();
// The page might have been evicted while we held the optimistic
// read lock, so we need to check with page.pin that this is still
Expand Down
Expand Up @@ -388,7 +388,7 @@ private void resetDelegate() throws IOException
delegate.shouldRetry();
delegate.setOffset( 0 );
delegate.checkAndClearBoundsFlag();
delegate.clearCursorError();
delegate.clearCursorException();
}

@Override
Expand All @@ -413,9 +413,9 @@ public boolean checkAndClearBoundsFlag()
}

@Override
public void checkAndClearCursorError() throws CursorException
public void checkAndClearCursorException() throws CursorException
{
delegate.checkAndClearCursorError();
delegate.checkAndClearCursorException();
}

@Override
Expand All @@ -425,15 +425,15 @@ public void raiseOutOfBounds()
}

@Override
public void setCursorError( String message )
public void setCursorException( String message )
{
delegate.setCursorError( message );
delegate.setCursorException( message );
}

@Override
public void clearCursorError()
public void clearCursorException()
{
delegate.clearCursorError();
delegate.clearCursorException();
}

@Override
Expand Down
Expand Up @@ -274,9 +274,9 @@ public boolean checkAndClearBoundsFlag()
}

@Override
public void checkAndClearCursorError() throws CursorException
public void checkAndClearCursorException() throws CursorException
{
delegate.checkAndClearCursorError();
delegate.checkAndClearCursorException();
}

@Override
Expand All @@ -286,15 +286,15 @@ public void raiseOutOfBounds()
}

@Override
public void setCursorError( String message )
public void setCursorException( String message )
{
delegate.setCursorError( message );
delegate.setCursorException( message );
}

@Override
public void clearCursorError()
public void clearCursorException()
{
delegate.clearCursorError();
delegate.clearCursorException();
}

@Override
Expand Down

0 comments on commit 6728dbf

Please sign in to comment.