Use new StoredObjectRepresentationNotAvailableException constructor
In 5e7eed4
a new StoredObjectRepresentationNotAvailableException
constructor was added, that takes a Throwable to initialize the
exception cause.
Update more call sites to use this constructor instead of first
instantiating it and explicitly calling initCause().
All callers now use the new constructor, so annotate the other one as
deprecated.
Change-Id: I6d2a7e289a95f0360ddebf904cfd8b6c18fef10c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
8a6af368c4
commit
365c6cb387
|
@ -56,8 +56,12 @@ public class StoredObjectRepresentationNotAvailableException extends Exception {
|
||||||
*
|
*
|
||||||
* @param otp
|
* @param otp
|
||||||
* the object whose current representation is no longer present.
|
* the object whose current representation is no longer present.
|
||||||
|
* @deprecated use
|
||||||
|
* {@link #StoredObjectRepresentationNotAvailableException(ObjectToPack, Throwable)}
|
||||||
|
* instead.
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public StoredObjectRepresentationNotAvailableException(ObjectToPack otp) {
|
public StoredObjectRepresentationNotAvailableException(ObjectToPack otp) {
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
}
|
}
|
||||||
|
|
|
@ -660,16 +660,12 @@ void copyAsIs(PackOutputStream out, DfsObjectToPack src,
|
||||||
Long.valueOf(src.offset), getFileName()));
|
Long.valueOf(src.offset), getFileName()));
|
||||||
corruptObject.initCause(dataFormat);
|
corruptObject.initCause(dataFormat);
|
||||||
|
|
||||||
StoredObjectRepresentationNotAvailableException gone;
|
throw new StoredObjectRepresentationNotAvailableException(src,
|
||||||
gone = new StoredObjectRepresentationNotAvailableException(src);
|
corruptObject);
|
||||||
gone.initCause(corruptObject);
|
|
||||||
throw gone;
|
|
||||||
|
|
||||||
} catch (IOException ioError) {
|
} catch (IOException ioError) {
|
||||||
StoredObjectRepresentationNotAvailableException gone;
|
throw new StoredObjectRepresentationNotAvailableException(src,
|
||||||
gone = new StoredObjectRepresentationNotAvailableException(src);
|
ioError);
|
||||||
gone.initCause(ioError);
|
|
||||||
throw gone;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quickCopy != null) {
|
if (quickCopy != null) {
|
||||||
|
|
|
@ -518,16 +518,12 @@ private void copyAsIs2(PackOutputStream out, LocalObjectToPack src,
|
||||||
Long.valueOf(src.offset), getPackFile()));
|
Long.valueOf(src.offset), getPackFile()));
|
||||||
corruptObject.initCause(dataFormat);
|
corruptObject.initCause(dataFormat);
|
||||||
|
|
||||||
StoredObjectRepresentationNotAvailableException gone;
|
throw new StoredObjectRepresentationNotAvailableException(src,
|
||||||
gone = new StoredObjectRepresentationNotAvailableException(src);
|
corruptObject);
|
||||||
gone.initCause(corruptObject);
|
|
||||||
throw gone;
|
|
||||||
|
|
||||||
} catch (IOException ioError) {
|
} catch (IOException ioError) {
|
||||||
StoredObjectRepresentationNotAvailableException gone;
|
throw new StoredObjectRepresentationNotAvailableException(src,
|
||||||
gone = new StoredObjectRepresentationNotAvailableException(src);
|
ioError);
|
||||||
gone.initCause(ioError);
|
|
||||||
throw gone;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (quickCopy != null) {
|
if (quickCopy != null) {
|
||||||
|
@ -612,11 +608,8 @@ private synchronized void beginCopyAsIs(ObjectToPack otp)
|
||||||
try {
|
try {
|
||||||
doOpen();
|
doOpen();
|
||||||
} catch (IOException thisPackNotValid) {
|
} catch (IOException thisPackNotValid) {
|
||||||
StoredObjectRepresentationNotAvailableException gone;
|
throw new StoredObjectRepresentationNotAvailableException(otp,
|
||||||
|
thisPackNotValid);
|
||||||
gone = new StoredObjectRepresentationNotAvailableException(otp);
|
|
||||||
gone.initCause(thisPackNotValid);
|
|
||||||
throw gone;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue