From 1e37438cb7b2b16b2733693292904d03f1ecd906 Mon Sep 17 00:00:00 2001 From: Thomas Wolf Date: Sun, 7 Nov 2021 00:56:06 +0100 Subject: [PATCH] [6.0 API cleanup] StoredObjectRepresentationNotAvailableException Remove the unused parameter, which had a non-API type anyway. Bug: 576340 Change-Id: Id71c01a643e1f31a8ff61ff69f7915c373db3263 Signed-off-by: Thomas Wolf --- ...ctRepresentationNotAvailableException.java | 20 +++++++------------ .../internal/storage/dfs/DfsPackFile.java | 8 +++----- .../jgit/internal/storage/file/Pack.java | 7 +++---- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/errors/StoredObjectRepresentationNotAvailableException.java b/org.eclipse.jgit/src/org/eclipse/jgit/errors/StoredObjectRepresentationNotAvailableException.java index 0708123e91..de210b01c4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/errors/StoredObjectRepresentationNotAvailableException.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/errors/StoredObjectRepresentationNotAvailableException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010, Google Inc. and others + * Copyright (C) 2010, 2021 Google Inc. and others * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0 which is available at @@ -7,29 +7,23 @@ * * SPDX-License-Identifier: BSD-3-Clause */ - package org.eclipse.jgit.errors; -import org.eclipse.jgit.internal.storage.pack.ObjectToPack; - /** * A previously selected representation is no longer available. */ -public class StoredObjectRepresentationNotAvailableException extends Exception { //TODO remove unused ObjectToPack in 5.0 +public class StoredObjectRepresentationNotAvailableException extends Exception { + private static final long serialVersionUID = 1L; /** - * Construct an error for an object. + * Creates a new instance. * - * @param otp - * the object whose current representation is no longer present. * @param cause - * cause - * @since 4.10 + * {@link Throwable} that caused this exception + * @since 6.0 */ - public StoredObjectRepresentationNotAvailableException(ObjectToPack otp, - Throwable cause) { + public StoredObjectRepresentationNotAvailableException(Throwable cause) { super(cause); - // Do nothing. } } diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java index b5bf03fcbb..bb76df1d5d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java @@ -415,8 +415,7 @@ public final class DfsPackFile extends BlockBasedFile { try { readFully(src.offset, buf, 0, 20, ctx); } catch (IOException ioError) { - throw new StoredObjectRepresentationNotAvailableException(src, - ioError); + throw new StoredObjectRepresentationNotAvailableException(ioError); } int c = buf[0] & 0xff; final int typeCode = (c >> 4) & 7; @@ -537,12 +536,11 @@ public final class DfsPackFile extends BlockBasedFile { Long.valueOf(src.offset), getFileName()), dataFormat); - throw new StoredObjectRepresentationNotAvailableException(src, + throw new StoredObjectRepresentationNotAvailableException( corruptObject); } catch (IOException ioError) { - throw new StoredObjectRepresentationNotAvailableException(src, - ioError); + throw new StoredObjectRepresentationNotAvailableException(ioError); } if (quickCopy != null) { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/Pack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/Pack.java index 5efd4c5bfc..289c732f4e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/Pack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/Pack.java @@ -521,12 +521,11 @@ public class Pack implements Iterable { Long.valueOf(src.offset), getPackFile()), dataFormat); - throw new StoredObjectRepresentationNotAvailableException(src, + throw new StoredObjectRepresentationNotAvailableException( corruptObject); } catch (IOException ioError) { - throw new StoredObjectRepresentationNotAvailableException(src, - ioError); + throw new StoredObjectRepresentationNotAvailableException(ioError); } if (quickCopy != null) { @@ -611,7 +610,7 @@ public class Pack implements Iterable { try { doOpen(); } catch (IOException thisPackNotValid) { - throw new StoredObjectRepresentationNotAvailableException(otp, + throw new StoredObjectRepresentationNotAvailableException( thisPackNotValid); } } -- 2.39.5