]> source.dussan.org Git - jgit.git/commitdiff
[6.0 API cleanup] StoredObjectRepresentationNotAvailableException 47/187447/5
authorThomas Wolf <thomas.wolf@paranor.ch>
Sat, 6 Nov 2021 23:56:06 +0000 (00:56 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Tue, 23 Nov 2021 22:37:19 +0000 (23:37 +0100)
Remove the unused parameter, which had a non-API type anyway.

Bug: 576340
Change-Id: Id71c01a643e1f31a8ff61ff69f7915c373db3263
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.jgit/src/org/eclipse/jgit/errors/StoredObjectRepresentationNotAvailableException.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/Pack.java

index 0708123e91945496e92d2b1e7e3b0dc3cb8e08e9..de210b01c4837e779820b45578323d97906ead85 100644 (file)
@@ -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.
        }
 }
index b5bf03fcbbe4ae88b87b51a4a3df9236f2bcdfd2..bb76df1d5d2f61e07d94c88a0989b9a38bb4fc84 100644 (file)
@@ -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) {
index 5efd4c5bfc7c8bbb0d4dbef4506ee1a926567f9f..289c732f4e2386a5495ffcf9476d0afe941169fa 100644 (file)
@@ -521,12 +521,11 @@ public class Pack implements Iterable<PackIndex.MutableEntry> {
                                                        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<PackIndex.MutableEntry> {
                        try {
                                doOpen();
                        } catch (IOException thisPackNotValid) {
-                               throw new StoredObjectRepresentationNotAvailableException(otp,
+                               throw new StoredObjectRepresentationNotAvailableException(
                                                thisPackNotValid);
                        }
                }