Fix all Javadoc warnings and fail on them

This fixes all the javadoc warnings, stops ignoring doclint 'missing'
category and fails the build on javadoc warnings for public and
protected classes and class members.

Since javadoc doesn't allow access specifiers when specifying doclint
configuration we cannot set `-Xdoclint:all,-missing/private`
hence there is no simple way to skip private elements from doclint.
Therefore we check javadoc using the Eclipse Java compiler
(which is used by default) and javadoc configuration in
`.settings/org.eclipse.jdt.core.prefs` files.
This allows more fine grained configuration.

We can reconsider this when javadoc starts supporting access specifiers
in the doclint configuration.

Below are detailled explanations for most modifications.

@inheritDoc
===========
doclint complains about explicits `{@inheritDoc}` when the parent does
not have any documentation. As far as I can tell, javadoc defaults to
inherit comments and should only be used when one wants to append extra
documentation from the parent. Given the parent has no documentation,
remove those usages which doclint complains about.

In some case I have moved up the documentation from the concrete class
up to the abstract class.

Remove `{@inheritDoc}` on overriden methods which don't add additional
documentation since javadoc defaults to inherit javadoc of overridden
methods.

@value to @link
===============
In PackConfig, DEFAULT_SEARCH_FOR_REUSE_TIMEOUT and similar are forged
from Integer.MAX_VALUE and are thus not considered constants (I guess
cause the value would depends on the platform). Replace it with a link
to `Integer.MAX_VALUE`.

In `StringUtils.toBoolean`, @value was used to refer to the
`stringValue` parameter. I have replaced it with `{@code stringValue}`.

{@link <url>} to <a>
====================
@link does not support being given an external URL. Replaces them with
HTML `<a>`.

@since: being invalid
=====================

org.eclipse.jgit/src/org/eclipse/jgit/util/Equality.java has an invalid
tag `@since: ` due to the extra `:`. Javadoc does not complain about it
with version 11.0.18+10 but does with 11.0.19.7. It is invalid
regardless.

invalid HTML syntax
===================

- javadoc doesn't allow <br/>, <p/> and </p> anymore, use <br> and <p>
instead
- replace <tt>code</tt> by {@code code}
- <table> tags don't allow summary attribute, specify caption as
<caption>caption</caption> to fix this

doclint visibility issue
========================

In the private abstract classes `BaseDirCacheEditor` and
`BasePackConnection` links to other methods in the abstract class are
inherited in the public subclasses but doclint gets confused and
considers them unreachable. The HTML documentation for the sub classes
shows the relative links in the sub classes, so it is all correct. It
must be a bug somewhere in javadoc.
Mute those warnings with: @SuppressWarnings("doclint:missing")

Misc
====
Replace `<` and `>` with HTML encoded entities (`&lt; and `&gt;`).
In `SshConstants` I went enclosing a serie of -> arrows in @literal.

Additional tags
===============
Configure maven-javad0c-plugin to allow the following additional tags
defined in https://openjdk.org/jeps/8068562:
- apiNote
- implSpec
- implNote

Missing javadoc
===============
Add missing @params and descriptions

Change-Id: I840056389aa59135cfb360da0d5e40463ce35bd0
Also-By: Matthias Sohn <matthias.sohn@sap.com>
This commit is contained in:
Antoine Musso 2023-05-31 17:57:28 +02:00 committed by Matthias Sohn
parent c7960910f0
commit 7b955048eb
627 changed files with 1204 additions and 1653 deletions

View File

@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

@ -75,7 +75,6 @@ private synchronized Union getPath() {
return path; return path;
} }
/** {@inheritDoc} */
@Override @Override
public void execute() throws BuildException { public void execute() throws BuildException {
if (src == null) { if (src == null) {

View File

@ -77,7 +77,6 @@ public void setForce(boolean force) {
this.force = force; this.force = force;
} }
/** {@inheritDoc} */
@Override @Override
public void execute() throws BuildException { public void execute() throws BuildException {
CheckoutCommand checkout; CheckoutCommand checkout;

View File

@ -76,7 +76,6 @@ public void setBranch(String branch) {
this.branch = branch; this.branch = branch;
} }
/** {@inheritDoc} */
@Override @Override
public void execute() throws BuildException { public void execute() throws BuildException {
log("Cloning repository " + uri); log("Cloning repository " + uri);

View File

@ -48,7 +48,6 @@ public void setBare(boolean bare) {
this.bare = bare; this.bare = bare;
} }
/** {@inheritDoc} */
@Override @Override
public void execute() throws BuildException { public void execute() throws BuildException {
if (bare) { if (bare) {

View File

@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

@ -40,6 +40,7 @@ public class BaseFormat {
* options map * options map
* @return stream with option applied * @return stream with option applied
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected ArchiveOutputStream applyFormatOptions(ArchiveOutputStream s, protected ArchiveOutputStream applyFormatOptions(ArchiveOutputStream s,
Map<String, Object> o) throws IOException { Map<String, Object> o) throws IOException {

View File

@ -39,7 +39,6 @@ public final class TarFormat extends BaseFormat implements
private static final List<String> SUFFIXES = Collections private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".tar")); //$NON-NLS-1$ .unmodifiableList(Arrays.asList(".tar")); //$NON-NLS-1$
/** {@inheritDoc} */
@Override @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s) public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException { throws IOException {
@ -47,7 +46,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
Collections.<String, Object> emptyMap()); Collections.<String, Object> emptyMap());
} }
/** {@inheritDoc} */
@Override @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s, public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException { Map<String, Object> o) throws IOException {
@ -58,7 +56,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
return applyFormatOptions(out, o); return applyFormatOptions(out, o);
} }
/** {@inheritDoc} */
@Override @Override
public void putEntry(ArchiveOutputStream out, public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader) ObjectId tree, String path, FileMode mode, ObjectLoader loader)
@ -108,19 +105,16 @@ public void putEntry(ArchiveOutputStream out,
out.closeArchiveEntry(); out.closeArchiveEntry();
} }
/** {@inheritDoc} */
@Override @Override
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;
} }
/** {@inheritDoc} */
@Override @Override
public boolean equals(Object other) { public boolean equals(Object other) {
return (other instanceof TarFormat); return (other instanceof TarFormat);
} }
/** {@inheritDoc} */
@Override @Override
public int hashCode() { public int hashCode() {
return getClass().hashCode(); return getClass().hashCode();

View File

@ -33,7 +33,6 @@ public final class Tbz2Format extends BaseFormat implements
private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat(); private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat();
/** {@inheritDoc} */
@Override @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s) public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException { throws IOException {
@ -41,7 +40,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
Collections.<String, Object> emptyMap()); Collections.<String, Object> emptyMap());
} }
/** {@inheritDoc} */
@Override @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s, public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException { Map<String, Object> o) throws IOException {
@ -55,7 +53,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
return tarFormat.createArchiveOutputStream(out, o); return tarFormat.createArchiveOutputStream(out, o);
} }
/** {@inheritDoc} */
@Override @Override
public void putEntry(ArchiveOutputStream out, public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader) ObjectId tree, String path, FileMode mode, ObjectLoader loader)
@ -63,19 +60,16 @@ public void putEntry(ArchiveOutputStream out,
tarFormat.putEntry(out, tree, path, mode, loader); tarFormat.putEntry(out, tree, path, mode, loader);
} }
/** {@inheritDoc} */
@Override @Override
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;
} }
/** {@inheritDoc} */
@Override @Override
public boolean equals(Object other) { public boolean equals(Object other) {
return (other instanceof Tbz2Format); return (other instanceof Tbz2Format);
} }
/** {@inheritDoc} */
@Override @Override
public int hashCode() { public int hashCode() {
return getClass().hashCode(); return getClass().hashCode();

View File

@ -34,7 +34,6 @@ public final class TgzFormat extends BaseFormat implements
private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat(); private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat();
/** {@inheritDoc} */
@Override @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s) public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException { throws IOException {
@ -42,7 +41,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
Collections.<String, Object> emptyMap()); Collections.<String, Object> emptyMap());
} }
/** {@inheritDoc} */
@Override @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s, public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException { Map<String, Object> o) throws IOException {
@ -58,7 +56,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
return tarFormat.createArchiveOutputStream(out, o); return tarFormat.createArchiveOutputStream(out, o);
} }
/** {@inheritDoc} */
@Override @Override
public void putEntry(ArchiveOutputStream out, public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader) ObjectId tree, String path, FileMode mode, ObjectLoader loader)
@ -66,19 +63,16 @@ public void putEntry(ArchiveOutputStream out,
tarFormat.putEntry(out, tree, path, mode, loader); tarFormat.putEntry(out, tree, path, mode, loader);
} }
/** {@inheritDoc} */
@Override @Override
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;
} }
/** {@inheritDoc} */
@Override @Override
public boolean equals(Object other) { public boolean equals(Object other) {
return (other instanceof TgzFormat); return (other instanceof TgzFormat);
} }
/** {@inheritDoc} */
@Override @Override
public int hashCode() { public int hashCode() {
return getClass().hashCode(); return getClass().hashCode();

View File

@ -33,7 +33,6 @@ public final class TxzFormat extends BaseFormat implements
private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat(); private final ArchiveCommand.Format<ArchiveOutputStream> tarFormat = new TarFormat();
/** {@inheritDoc} */
@Override @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s) public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException { throws IOException {
@ -41,7 +40,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
Collections.<String, Object> emptyMap()); Collections.<String, Object> emptyMap());
} }
/** {@inheritDoc} */
@Override @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s, public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException { Map<String, Object> o) throws IOException {
@ -55,7 +53,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
return tarFormat.createArchiveOutputStream(out, o); return tarFormat.createArchiveOutputStream(out, o);
} }
/** {@inheritDoc} */
@Override @Override
public void putEntry(ArchiveOutputStream out, public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader) ObjectId tree, String path, FileMode mode, ObjectLoader loader)
@ -63,19 +60,16 @@ public void putEntry(ArchiveOutputStream out,
tarFormat.putEntry(out, tree, path, mode, loader); tarFormat.putEntry(out, tree, path, mode, loader);
} }
/** {@inheritDoc} */
@Override @Override
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;
} }
/** {@inheritDoc} */
@Override @Override
public boolean equals(Object other) { public boolean equals(Object other) {
return (other instanceof TxzFormat); return (other instanceof TxzFormat);
} }
/** {@inheritDoc} */
@Override @Override
public int hashCode() { public int hashCode() {
return getClass().hashCode(); return getClass().hashCode();

View File

@ -35,7 +35,6 @@ public final class ZipFormat extends BaseFormat implements
private static final List<String> SUFFIXES = Collections private static final List<String> SUFFIXES = Collections
.unmodifiableList(Arrays.asList(".zip")); //$NON-NLS-1$ .unmodifiableList(Arrays.asList(".zip")); //$NON-NLS-1$
/** {@inheritDoc} */
@Override @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s) public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException { throws IOException {
@ -43,7 +42,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
Collections.<String, Object> emptyMap()); Collections.<String, Object> emptyMap());
} }
/** {@inheritDoc} */
@Override @Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s, public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException { Map<String, Object> o) throws IOException {
@ -55,7 +53,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
return applyFormatOptions(out, o); return applyFormatOptions(out, o);
} }
/** {@inheritDoc} */
@Override @Override
public void putEntry(ArchiveOutputStream out, public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader) ObjectId tree, String path, FileMode mode, ObjectLoader loader)
@ -97,19 +94,16 @@ public void putEntry(ArchiveOutputStream out,
out.closeArchiveEntry(); out.closeArchiveEntry();
} }
/** {@inheritDoc} */
@Override @Override
public Iterable<String> suffixes() { public Iterable<String> suffixes() {
return SUFFIXES; return SUFFIXES;
} }
/** {@inheritDoc} */
@Override @Override
public boolean equals(Object other) { public boolean equals(Object other) {
return (other instanceof ZipFormat); return (other instanceof ZipFormat);
} }
/** {@inheritDoc} */
@Override @Override
public int hashCode() { public int hashCode() {
return getClass().hashCode(); return getClass().hashCode();

View File

@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

@ -324,7 +324,9 @@ private static PGPPublicKey findPublicKeyByUserId(KeyBlob keyBlob,
* @throws IOException * @throws IOException
* in case of problems reading the file * in case of problems reading the file
* @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
* if an algorithm isn't available
* @throws NoSuchProviderException * @throws NoSuchProviderException
* if a provider isn't available
* @throws NoOpenPgpKeyException * @throws NoOpenPgpKeyException
* if the file does not contain any OpenPGP key * if the file does not contain any OpenPGP key
*/ */
@ -368,12 +370,17 @@ private static PGPPublicKey findPublicKeyInKeyBox(Path keyboxFile,
* @throws IOException * @throws IOException
* in case of issues reading key files * in case of issues reading key files
* @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
* algorithm is not available
* @throws NoSuchProviderException * @throws NoSuchProviderException
* provider is not available
* @throws PGPException * @throws PGPException
* in case of issues finding a key, including no key found * in case of issues finding a key, including no key found
* @throws CanceledException * @throws CanceledException
* operation was cancelled
* @throws URISyntaxException * @throws URISyntaxException
* URI is invalid
* @throws UnsupportedCredentialItem * @throws UnsupportedCredentialItem
* credential item is not supported
*/ */
@NonNull @NonNull
public BouncyCastleGpgKey findSecretKey() throws IOException, public BouncyCastleGpgKey findSecretKey() throws IOException,
@ -543,10 +550,11 @@ private BouncyCastleGpgKey findSecretKeyForKeyBoxPublicKey(
/** /**
* Return the first suitable key for signing in the key ring collection. For * Return the first suitable key for signing in the key ring collection. For
* this case we only expect there to be one key available for signing. * this case we only expect there to be one key available for signing.
* </p>
* *
* @param signingkey * @param signingkey
* the signing key
* @param secringFile * @param secringFile
* the secring file
* *
* @return the first suitable PGP secret key found for signing * @return the first suitable PGP secret key found for signing
* @throws IOException * @throws IOException

View File

@ -69,10 +69,13 @@ private URIish createURI(Path keyLocation) throws URISyntaxException {
* the location the key was loaded from * the location the key was loaded from
* @return the passphrase (maybe <code>null</code>) * @return the passphrase (maybe <code>null</code>)
* @throws PGPException * @throws PGPException
* if a PGP problem occurred
* @throws CanceledException * @throws CanceledException
* in case passphrase was not entered by user * in case passphrase was not entered by user
* @throws URISyntaxException * @throws URISyntaxException
* if the URI isn't parseable
* @throws UnsupportedCredentialItem * @throws UnsupportedCredentialItem
* if a credential item isn't supported
*/ */
public char[] getPassphrase(byte[] keyFingerprint, Path keyLocation) public char[] getPassphrase(byte[] keyFingerprint, Path keyLocation)
throws PGPException, CanceledException, UnsupportedCredentialItem, throws PGPException, CanceledException, UnsupportedCredentialItem,

View File

@ -36,8 +36,8 @@
* Utilities to compute the <em>keygrip</em> of a key. A keygrip is a SHA1 hash * Utilities to compute the <em>keygrip</em> of a key. A keygrip is a SHA1 hash
* over the public key parameters and is used internally by the gpg-agent to * over the public key parameters and is used internally by the gpg-agent to
* find the secret key belonging to a public key: the secret key is stored in a * find the secret key belonging to a public key: the secret key is stored in a
* file under ~/.gnupg/private-keys-v1.d/ with a name "&lt;keygrip>.key". While * file under ~/.gnupg/private-keys-v1.d/ with a name "&lt;keygrip&gt;.key".
* this storage organization is an implementation detail of GPG, the way * While this storage organization is an implementation detail of GPG, the way
* keygrips are computed is not; they are computed by libgcrypt and their * keygrips are computed is not; they are computed by libgcrypt and their
* definition is stable. * definition is stable.
*/ */

View File

@ -95,7 +95,9 @@ public SExprParser(PGPDigestCalculatorProvider digestProvider) {
* *
* @return a secret key object. * @return a secret key object.
* @throws IOException * @throws IOException
* if an IO error occurred
* @throws PGPException * @throws PGPException
* if some PGP error occurred
*/ */
public PGPSecretKey parseSecretKey(InputStream inputStream, public PGPSecretKey parseSecretKey(InputStream inputStream,
PBEProtectionRemoverFactory keyProtectionRemoverFactory, PBEProtectionRemoverFactory keyProtectionRemoverFactory,
@ -252,7 +254,9 @@ public PGPSecretKey parseSecretKey(InputStream inputStream,
* *
* @return a secret key object. * @return a secret key object.
* @throws IOException * @throws IOException
* if an IO error occurred
* @throws PGPException * @throws PGPException
* if a PGP error occurred
*/ */
public PGPSecretKey parseSecretKey(InputStream inputStream, public PGPSecretKey parseSecretKey(InputStream inputStream,
PBEProtectionRemoverFactory keyProtectionRemoverFactory, PBEProtectionRemoverFactory keyProtectionRemoverFactory,

View File

@ -373,6 +373,7 @@ && matches(humanForm, start, OCB_PROTECTED)) {
* index of the closing quote in {@code in} * index of the closing quote in {@code in}
* @return the dequoted raw string value * @return the dequoted raw string value
* @throws StreamCorruptedException * @throws StreamCorruptedException
* if object stream is corrupt
*/ */
private static byte[] dequote(byte[] in, int from, int to) private static byte[] dequote(byte[] in, int from, int to)
throws StreamCorruptedException { throws StreamCorruptedException {

View File

@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

@ -203,6 +203,7 @@ private SSLContext getSSLContext() {
* Sets the buffer from which to take the request body * Sets the buffer from which to take the request body
* *
* @param buffer * @param buffer
* the buffer
*/ */
public void setBuffer(TemporaryBuffer buffer) { public void setBuffer(TemporaryBuffer buffer) {
this.entity = new TemporaryBufferEntity(buffer); this.entity = new TemporaryBufferEntity(buffer);
@ -212,7 +213,9 @@ public void setBuffer(TemporaryBuffer buffer) {
* Constructor for HttpClientConnection. * Constructor for HttpClientConnection.
* *
* @param urlStr * @param urlStr
* url string
* @throws MalformedURLException * @throws MalformedURLException
* if url is malformed
*/ */
public HttpClientConnection(String urlStr) throws MalformedURLException { public HttpClientConnection(String urlStr) throws MalformedURLException {
this(urlStr, null); this(urlStr, null);
@ -222,8 +225,11 @@ public HttpClientConnection(String urlStr) throws MalformedURLException {
* Constructor for HttpClientConnection. * Constructor for HttpClientConnection.
* *
* @param urlStr * @param urlStr
* url string
* @param proxy * @param proxy
* proxy
* @throws MalformedURLException * @throws MalformedURLException
* if url is malformed
*/ */
public HttpClientConnection(String urlStr, Proxy proxy) public HttpClientConnection(String urlStr, Proxy proxy)
throws MalformedURLException { throws MalformedURLException {
@ -234,9 +240,13 @@ public HttpClientConnection(String urlStr, Proxy proxy)
* Constructor for HttpClientConnection. * Constructor for HttpClientConnection.
* *
* @param urlStr * @param urlStr
* url string
* @param proxy * @param proxy
* proxy
* @param cl * @param cl
* client
* @throws MalformedURLException * @throws MalformedURLException
* if url is malformed
*/ */
public HttpClientConnection(String urlStr, Proxy proxy, HttpClient cl) public HttpClientConnection(String urlStr, Proxy proxy, HttpClient cl)
throws MalformedURLException { throws MalformedURLException {
@ -245,20 +255,17 @@ public HttpClientConnection(String urlStr, Proxy proxy, HttpClient cl)
this.proxy = proxy; this.proxy = proxy;
} }
/** {@inheritDoc} */
@Override @Override
public int getResponseCode() throws IOException { public int getResponseCode() throws IOException {
execute(); execute();
return resp.getStatusLine().getStatusCode(); return resp.getStatusLine().getStatusCode();
} }
/** {@inheritDoc} */
@Override @Override
public URL getURL() { public URL getURL() {
return url; return url;
} }
/** {@inheritDoc} */
@Override @Override
public String getResponseMessage() throws IOException { public String getResponseMessage() throws IOException {
execute(); execute();
@ -287,7 +294,6 @@ private void execute() throws IOException, ClientProtocolException {
} }
} }
/** {@inheritDoc} */
@Override @Override
public Map<String, List<String>> getHeaderFields() { public Map<String, List<String>> getHeaderFields() {
Map<String, List<String>> ret = new HashMap<>(); Map<String, List<String>> ret = new HashMap<>();
@ -304,13 +310,11 @@ public Map<String, List<String>> getHeaderFields() {
return ret; return ret;
} }
/** {@inheritDoc} */
@Override @Override
public void setRequestProperty(String name, String value) { public void setRequestProperty(String name, String value) {
req.addHeader(name, value); req.addHeader(name, value);
} }
/** {@inheritDoc} */
@Override @Override
public void setRequestMethod(String method) throws ProtocolException { public void setRequestMethod(String method) throws ProtocolException {
this.method = method; this.method = method;
@ -328,25 +332,21 @@ public void setRequestMethod(String method) throws ProtocolException {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void setUseCaches(boolean usecaches) { public void setUseCaches(boolean usecaches) {
// not needed // not needed
} }
/** {@inheritDoc} */
@Override @Override
public void setConnectTimeout(int timeout) { public void setConnectTimeout(int timeout) {
this.timeout = Integer.valueOf(timeout); this.timeout = Integer.valueOf(timeout);
} }
/** {@inheritDoc} */
@Override @Override
public void setReadTimeout(int readTimeout) { public void setReadTimeout(int readTimeout) {
this.readTimeout = Integer.valueOf(readTimeout); this.readTimeout = Integer.valueOf(readTimeout);
} }
/** {@inheritDoc} */
@Override @Override
public String getContentType() { public String getContentType() {
HttpEntity responseEntity = resp.getEntity(); HttpEntity responseEntity = resp.getEntity();
@ -358,7 +358,6 @@ public String getContentType() {
return null; return null;
} }
/** {@inheritDoc} */
@Override @Override
public InputStream getInputStream() throws IOException { public InputStream getInputStream() throws IOException {
execute(); execute();
@ -366,7 +365,6 @@ public InputStream getInputStream() throws IOException {
} }
// will return only the first field // will return only the first field
/** {@inheritDoc} */
@Override @Override
public String getHeaderField(@NonNull String name) { public String getHeaderField(@NonNull String name) {
Header header = resp.getFirstHeader(name); Header header = resp.getFirstHeader(name);
@ -379,7 +377,6 @@ public List<String> getHeaderFields(@NonNull String name) {
.stream().map(Header::getValue).collect(Collectors.toList())); .stream().map(Header::getValue).collect(Collectors.toList()));
} }
/** {@inheritDoc} */
@Override @Override
public int getContentLength() { public int getContentLength() {
Header contentLength = resp.getFirstHeader("content-length"); //$NON-NLS-1$ Header contentLength = resp.getFirstHeader("content-length"); //$NON-NLS-1$
@ -395,19 +392,16 @@ public int getContentLength() {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void setInstanceFollowRedirects(boolean followRedirects) { public void setInstanceFollowRedirects(boolean followRedirects) {
this.followRedirects = Boolean.valueOf(followRedirects); this.followRedirects = Boolean.valueOf(followRedirects);
} }
/** {@inheritDoc} */
@Override @Override
public void setDoOutput(boolean dooutput) { public void setDoOutput(boolean dooutput) {
// TODO: check whether we can really ignore this. // TODO: check whether we can really ignore this.
} }
/** {@inheritDoc} */
@Override @Override
public void setFixedLengthStreamingMode(int contentLength) { public void setFixedLengthStreamingMode(int contentLength) {
if (entity != null) if (entity != null)
@ -416,7 +410,6 @@ public void setFixedLengthStreamingMode(int contentLength) {
entity.setContentLength(contentLength); entity.setContentLength(contentLength);
} }
/** {@inheritDoc} */
@Override @Override
public OutputStream getOutputStream() throws IOException { public OutputStream getOutputStream() throws IOException {
if (entity == null) if (entity == null)
@ -424,7 +417,6 @@ public OutputStream getOutputStream() throws IOException {
return entity.getBuffer(); return entity.getBuffer();
} }
/** {@inheritDoc} */
@Override @Override
public void setChunkedStreamingMode(int chunklen) { public void setChunkedStreamingMode(int chunklen) {
if (entity == null) if (entity == null)
@ -432,31 +424,26 @@ public void setChunkedStreamingMode(int chunklen) {
entity.setChunked(true); entity.setChunked(true);
} }
/** {@inheritDoc} */
@Override @Override
public String getRequestMethod() { public String getRequestMethod() {
return method; return method;
} }
/** {@inheritDoc} */
@Override @Override
public boolean usingProxy() { public boolean usingProxy() {
return isUsingProxy; return isUsingProxy;
} }
/** {@inheritDoc} */
@Override @Override
public void connect() throws IOException { public void connect() throws IOException {
execute(); execute();
} }
/** {@inheritDoc} */
@Override @Override
public void setHostnameVerifier(HostnameVerifier hostnameverifier) { public void setHostnameVerifier(HostnameVerifier hostnameverifier) {
this.hostnameverifier = hostnameverifier; this.hostnameverifier = hostnameverifier;
} }
/** {@inheritDoc} */
@Override @Override
public void configure(KeyManager[] km, TrustManager[] tm, public void configure(KeyManager[] km, TrustManager[] tm,
SecureRandom random) throws KeyManagementException { SecureRandom random) throws KeyManagementException {

View File

@ -33,6 +33,7 @@ public class TemporaryBufferEntity extends AbstractHttpEntity
* content stored in the specified buffer * content stored in the specified buffer
* *
* @param buffer * @param buffer
* the buffer
*/ */
public TemporaryBufferEntity(TemporaryBuffer buffer) { public TemporaryBufferEntity(TemporaryBuffer buffer) {
this.buffer = buffer; this.buffer = buffer;
@ -47,13 +48,11 @@ public TemporaryBuffer getBuffer() {
return buffer; return buffer;
} }
/** {@inheritDoc} */
@Override @Override
public boolean isRepeatable() { public boolean isRepeatable() {
return true; return true;
} }
/** {@inheritDoc} */
@Override @Override
public long getContentLength() { public long getContentLength() {
if (contentLength != null) if (contentLength != null)
@ -61,20 +60,17 @@ public long getContentLength() {
return buffer.length(); return buffer.length();
} }
/** {@inheritDoc} */
@Override @Override
public InputStream getContent() throws IOException, IllegalStateException { public InputStream getContent() throws IOException, IllegalStateException {
return buffer.openInputStream(); return buffer.openInputStream();
} }
/** {@inheritDoc} */
@Override @Override
public void writeTo(OutputStream outstream) throws IOException { public void writeTo(OutputStream outstream) throws IOException {
// TODO: dont we need a progressmonitor // TODO: dont we need a progressmonitor
buffer.writeTo(outstream, null); buffer.writeTo(outstream, null);
} }
/** {@inheritDoc} */
@Override @Override
public boolean isStreaming() { public boolean isStreaming() {
return false; return false;
@ -84,6 +80,7 @@ public boolean isStreaming() {
* Set the <code>contentLength</code> * Set the <code>contentLength</code>
* *
* @param contentLength * @param contentLength
* content length
*/ */
public void setContentLength(int contentLength) { public void setContentLength(int contentLength) {
this.contentLength = Integer.valueOf(contentLength); this.contentLength = Integer.valueOf(contentLength);

View File

@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

@ -37,19 +37,16 @@ class AsIsFileFilter implements Filter {
this.asIs = getAnyFile; this.asIs = getAnyFile;
} }
/** {@inheritDoc} */
@Override @Override
public void init(FilterConfig config) throws ServletException { public void init(FilterConfig config) throws ServletException {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
public void destroy() { public void destroy() {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
public void doFilter(ServletRequest request, ServletResponse response, public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException { FilterChain chain) throws IOException, ServletException {

View File

@ -189,7 +189,6 @@ private void assertNotInitialized() {
throw new IllegalStateException(HttpServerText.get().alreadyInitializedByContainer); throw new IllegalStateException(HttpServerText.get().alreadyInitializedByContainer);
} }
/** {@inheritDoc} */
@Override @Override
public void init(FilterConfig filterConfig) throws ServletException { public void init(FilterConfig filterConfig) throws ServletException {
super.init(filterConfig); super.init(filterConfig);
@ -305,7 +304,6 @@ private static boolean getBoolean(FilterConfig cfg, String param)
} }
} }
/** {@inheritDoc} */
@Override @Override
protected ServletBinder register(ServletBinder binder) { protected ServletBinder register(ServletBinder binder) {
if (resolver == null) if (resolver == null)

View File

@ -170,7 +170,6 @@ public void addReceivePackFilter(Filter filter) {
gitFilter.addReceivePackFilter(filter); gitFilter.addReceivePackFilter(filter);
} }
/** {@inheritDoc} */
@Override @Override
public void init(ServletConfig config) throws ServletException { public void init(ServletConfig config) throws ServletException {
gitFilter.init(new FilterConfig() { gitFilter.init(new FilterConfig() {

View File

@ -27,7 +27,6 @@
class InfoPacksServlet extends HttpServlet { class InfoPacksServlet extends HttpServlet {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** {@inheritDoc} */
@Override @Override
public void doGet(final HttpServletRequest req, public void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException { final HttpServletResponse rsp) throws IOException {

View File

@ -29,7 +29,6 @@
class InfoRefsServlet extends HttpServlet { class InfoRefsServlet extends HttpServlet {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** {@inheritDoc} */
@Override @Override
public void doGet(final HttpServletRequest req, public void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException { final HttpServletResponse rsp) throws IOException {

View File

@ -33,19 +33,16 @@
* downstream servlet can directly access its contents on disk. * downstream servlet can directly access its contents on disk.
*/ */
class IsLocalFilter implements Filter { class IsLocalFilter implements Filter {
/** {@inheritDoc} */
@Override @Override
public void init(FilterConfig config) throws ServletException { public void init(FilterConfig config) throws ServletException {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
public void destroy() { public void destroy() {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
public void doFilter(ServletRequest request, ServletResponse response, public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException { FilterChain chain) throws IOException, ServletException {

View File

@ -26,19 +26,16 @@
/** Add HTTP response headers to prevent caching by proxies/browsers. */ /** Add HTTP response headers to prevent caching by proxies/browsers. */
class NoCacheFilter implements Filter { class NoCacheFilter implements Filter {
/** {@inheritDoc} */
@Override @Override
public void init(FilterConfig config) throws ServletException { public void init(FilterConfig config) throws ServletException {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
public void destroy() { public void destroy() {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
public void doFilter(ServletRequest request, ServletResponse response, public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException { FilterChain chain) throws IOException, ServletException {

View File

@ -87,14 +87,12 @@ static class PackIdx extends PackData {
abstract String etag(FileSender sender) throws IOException; abstract String etag(FileSender sender) throws IOException;
/** {@inheritDoc} */
@Override @Override
public void doGet(final HttpServletRequest req, public void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException { final HttpServletResponse rsp) throws IOException {
serve(req, rsp, true); serve(req, rsp, true);
} }
/** {@inheritDoc} */
@Override @Override
protected void doHead(final HttpServletRequest req, protected void doHead(final HttpServletRequest req,
final HttpServletResponse rsp) throws ServletException, IOException { final HttpServletResponse rsp) throws ServletException, IOException {

View File

@ -42,6 +42,7 @@ public interface ReceivePackErrorHandler {
* @param r * @param r
* A continuation that handles a git-receive-pack request. * A continuation that handles a git-receive-pack request.
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
void receive(HttpServletRequest req, HttpServletResponse rsp, void receive(HttpServletRequest req, HttpServletResponse rsp,
ReceivePackRunnable r) throws IOException; ReceivePackRunnable r) throws IOException;
@ -52,7 +53,9 @@ public interface ReceivePackRunnable {
* See {@link ReceivePack#receiveWithExceptionPropagation}. * See {@link ReceivePack#receiveWithExceptionPropagation}.
* *
* @throws ServiceMayNotContinueException * @throws ServiceMayNotContinueException
* if transport service cannot continue
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
void receive() throws ServiceMayNotContinueException, IOException; void receive() throws ServiceMayNotContinueException, IOException;
} }

View File

@ -136,7 +136,6 @@ public void destroy() {
this.handler = handler; this.handler = handler;
} }
/** {@inheritDoc} */
@Override @Override
public void doPost(final HttpServletRequest req, public void doPost(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException { final HttpServletResponse rsp) throws IOException {

View File

@ -71,19 +71,16 @@ public RepositoryFilter(RepositoryResolver<HttpServletRequest> resolver) {
this.resolver = resolver; this.resolver = resolver;
} }
/** {@inheritDoc} */
@Override @Override
public void init(FilterConfig config) throws ServletException { public void init(FilterConfig config) throws ServletException {
context = config.getServletContext(); context = config.getServletContext();
} }
/** {@inheritDoc} */
@Override @Override
public void destroy() { public void destroy() {
context = null; context = null;
} }
/** {@inheritDoc} */
@Override @Override
public void doFilter(final ServletRequest request, public void doFilter(final ServletRequest request,
final ServletResponse response, final FilterChain chain) final ServletResponse response, final FilterChain chain)

View File

@ -50,7 +50,6 @@ class SmartOutputStream extends TemporaryBuffer {
this.compressStream = compressStream; this.compressStream = compressStream;
} }
/** {@inheritDoc} */
@Override @Override
protected OutputStream overflow() throws IOException { protected OutputStream overflow() throws IOException {
startedOutput = true; startedOutput = true;
@ -63,7 +62,6 @@ protected OutputStream overflow() throws IOException {
return out; return out;
} }
/** {@inheritDoc} */
@Override @Override
public void close() throws IOException { public void close() throws IOException {
super.close(); super.close();

View File

@ -47,19 +47,16 @@ abstract class SmartServiceInfoRefs implements Filter {
this.filters = filters.toArray(new Filter[0]); this.filters = filters.toArray(new Filter[0]);
} }
/** {@inheritDoc} */
@Override @Override
public void init(FilterConfig config) throws ServletException { public void init(FilterConfig config) throws ServletException {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
public void destroy() { public void destroy() {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
public void doFilter(ServletRequest request, ServletResponse response, public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException { FilterChain chain) throws IOException, ServletException {
@ -122,8 +119,12 @@ private void service(ServletRequest request, ServletResponse response)
* @param db * @param db
* repository * repository
* @throws IOException * @throws IOException
* if an IO error occurred
* @throws ServiceNotEnabledException * @throws ServiceNotEnabledException
* if a service is not available
* @throws ServiceNotAuthorizedException * @throws ServiceNotAuthorizedException
* if service requires authentication and the current user
* didn't provide credentials
*/ */
protected abstract void begin(HttpServletRequest req, Repository db) protected abstract void begin(HttpServletRequest req, Repository db)
throws IOException, ServiceNotEnabledException, throws IOException, ServiceNotEnabledException,
@ -135,35 +136,43 @@ protected abstract void begin(HttpServletRequest req, Repository db)
* @param req * @param req
* request * request
* @param pck * @param pck
* used to frame lines in PacketLineOut format
* @throws IOException * @throws IOException
* if an IO error occurred
* @throws ServiceNotEnabledException * @throws ServiceNotEnabledException
* if a service is not available
* @throws ServiceNotAuthorizedException * @throws ServiceNotAuthorizedException
* if service requires authentication and the current user
* didn't provide credentials
*/ */
protected abstract void advertise(HttpServletRequest req, protected abstract void advertise(HttpServletRequest req,
PacketLineOutRefAdvertiser pck) throws IOException, PacketLineOutRefAdvertiser pck) throws IOException,
ServiceNotEnabledException, ServiceNotAuthorizedException; ServiceNotEnabledException, ServiceNotAuthorizedException;
/** /**
* Writes the appropriate response to an info/refs request received by * Writes the appropriate response to an info/refs request received by a
* a smart service. In protocol v0, this starts with "# * smart service. In protocol v0, this starts with "# service=serviceName"
* service=serviceName" followed by a flush packet, but this is not * followed by a flush packet, but this is not necessarily the case in other
* necessarily the case in other protocol versions. * protocol versions.
* <p> * <p>
* The default implementation writes "# service=serviceName" and a * The default implementation writes "# service=serviceName" and a flush
* flush packet, then calls {@link #advertise}. Subclasses should * packet, then calls {@link #advertise}. Subclasses should override this
* override this method if they support protocol versions other than * method if they support protocol versions other than protocol v0.
* protocol v0.
* *
* @param req * @param req
* request * request
* @param pckOut * @param pckOut
* destination of response * destination of response
* @param serviceName * @param serviceName
* service name to be written out in protocol v0; may or may * service name to be written out in protocol v0; may or may not
* not be used in other versions * be used in other versions
* @throws IOException * @throws IOException
* if an IO error occurred
* @throws ServiceNotEnabledException * @throws ServiceNotEnabledException
* if a service is not available
* @throws ServiceNotAuthorizedException * @throws ServiceNotAuthorizedException
* if service requires authentication and the current user
* didn't provide credentials
*/ */
protected void respond(HttpServletRequest req, protected void respond(HttpServletRequest req,
PacketLineOut pckOut, String serviceName) PacketLineOut pckOut, String serviceName)

View File

@ -35,7 +35,6 @@ class TextFileServlet extends HttpServlet {
this.fileName = name; this.fileName = name;
} }
/** {@inheritDoc} */
@Override @Override
public void doGet(final HttpServletRequest req, public void doGet(final HttpServletRequest req,
final HttpServletResponse rsp) throws IOException { final HttpServletResponse rsp) throws IOException {

View File

@ -58,6 +58,7 @@ public static int statusCodeForThrowable(Throwable error) {
} }
return SC_INTERNAL_SERVER_ERROR; return SC_INTERNAL_SERVER_ERROR;
} }
/** /**
* @param req * @param req
* The HTTP request * The HTTP request
@ -66,6 +67,7 @@ public static int statusCodeForThrowable(Throwable error) {
* @param r * @param r
* A continuation that handles a git-upload-pack request. * A continuation that handles a git-upload-pack request.
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
void upload(HttpServletRequest req, HttpServletResponse rsp, void upload(HttpServletRequest req, HttpServletResponse rsp,
UploadPackRunnable r) throws IOException; UploadPackRunnable r) throws IOException;
@ -76,7 +78,9 @@ public interface UploadPackRunnable {
* See {@link UploadPack#uploadWithExceptionPropagation}. * See {@link UploadPack#uploadWithExceptionPropagation}.
* *
* @throws ServiceMayNotContinueException * @throws ServiceMayNotContinueException
* transport service cannot continue
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
void upload() throws ServiceMayNotContinueException, IOException; void upload() throws ServiceMayNotContinueException, IOException;
} }

View File

@ -158,7 +158,6 @@ public void destroy() {
: this::defaultUploadPackHandler; : this::defaultUploadPackHandler;
} }
/** {@inheritDoc} */
@Override @Override
public void doPost(HttpServletRequest req, HttpServletResponse rsp) public void doPost(HttpServletRequest req, HttpServletResponse rsp)
throws IOException { throws IOException {

View File

@ -35,7 +35,6 @@ public ErrorServlet(int status) {
this.status = status; this.status = status;
} }
/** {@inheritDoc} */
@Override @Override
protected void doGet(HttpServletRequest req, HttpServletResponse rsp) protected void doGet(HttpServletRequest req, HttpServletResponse rsp)
throws ServletException, IOException { throws ServletException, IOException {

View File

@ -97,13 +97,11 @@ public ServletBinder serveRegex(Pattern pattern) {
return register(new RegexPipeline.Binder(pattern)); return register(new RegexPipeline.Binder(pattern));
} }
/** {@inheritDoc} */
@Override @Override
public void init(FilterConfig filterConfig) throws ServletException { public void init(FilterConfig filterConfig) throws ServletException {
servletContext = filterConfig.getServletContext(); servletContext = filterConfig.getServletContext();
} }
/** {@inheritDoc} */
@Override @Override
public void destroy() { public void destroy() {
if (pipelines != null) { if (pipelines != null) {
@ -140,7 +138,6 @@ public int size() {
}; };
} }
/** {@inheritDoc} */
@Override @Override
public void doFilter(ServletRequest request, ServletResponse response, public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException { FilterChain chain) throws IOException, ServletException {

View File

@ -88,7 +88,6 @@ public ServletBinder serveRegex(String expression) {
return filter.serveRegex(expression); return filter.serveRegex(expression);
} }
/** {@inheritDoc} */
@Override @Override
public void init(ServletConfig config) throws ServletException { public void init(ServletConfig config) throws ServletException {
String name = filter.getClass().getName(); String name = filter.getClass().getName();
@ -96,13 +95,11 @@ public void init(ServletConfig config) throws ServletException {
filter.init(new NoParameterFilterConfig(name, ctx)); filter.init(new NoParameterFilterConfig(name, ctx));
} }
/** {@inheritDoc} */
@Override @Override
public void destroy() { public void destroy() {
filter.destroy(); filter.destroy();
} }
/** {@inheritDoc} */
@Override @Override
protected void service(HttpServletRequest req, HttpServletResponse res) protected void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException { throws ServletException, IOException {

View File

@ -26,13 +26,11 @@ final class NoParameterFilterConfig implements FilterConfig {
this.context = context; this.context = context;
} }
/** {@inheritDoc} */
@Override @Override
public String getInitParameter(String name) { public String getInitParameter(String name) {
return null; return null;
} }
/** {@inheritDoc} */
@Override @Override
public Enumeration<String> getInitParameterNames() { public Enumeration<String> getInitParameterNames() {
return new Enumeration<>() { return new Enumeration<>() {
@ -49,13 +47,11 @@ public String nextElement() {
}; };
} }
/** {@inheritDoc} */
@Override @Override
public ServletContext getServletContext() { public ServletContext getServletContext() {
return context; return context;
} }
/** {@inheritDoc} */
@Override @Override
public String getFilterName() { public String getFilterName() {
return filterName; return filterName;

View File

@ -49,19 +49,16 @@ public RegexGroupFilter(int groupIdx) {
this.groupIdx = groupIdx - 1; this.groupIdx = groupIdx - 1;
} }
/** {@inheritDoc} */
@Override @Override
public void init(FilterConfig config) throws ServletException { public void init(FilterConfig config) throws ServletException {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
public void destroy() { public void destroy() {
// Do nothing. // Do nothing.
} }
/** {@inheritDoc} */
@Override @Override
public void doFilter(final ServletRequest request, public void doFilter(final ServletRequest request,
final ServletResponse rsp, final FilterChain chain) final ServletResponse rsp, final FilterChain chain)

View File

@ -131,7 +131,6 @@ void service(HttpServletRequest req, HttpServletResponse rsp)
} }
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
return "Pipeline[regex: " + pattern + " ]"; return "Pipeline[regex: " + pattern + " ]";

View File

@ -28,7 +28,6 @@ abstract class ServletBinderImpl implements ServletBinder {
this.filters = new ArrayList<>(); this.filters = new ArrayList<>();
} }
/** {@inheritDoc} */
@Override @Override
public ServletBinder through(Filter filter) { public ServletBinder through(Filter filter) {
if (filter == null) if (filter == null)
@ -37,7 +36,6 @@ public ServletBinder through(Filter filter) {
return this; return this;
} }
/** {@inheritDoc} */
@Override @Override
public void with(HttpServlet servlet) { public void with(HttpServlet servlet) {
if (servlet == null) if (servlet == null)

View File

@ -70,7 +70,6 @@ void service(HttpServletRequest req, HttpServletResponse rsp)
super.service(new WrappedRequest(req, newPath, newInfo), rsp); super.service(new WrappedRequest(req, newPath, newInfo), rsp);
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
return "Pipeline[ *" + suffix + " ]"; return "Pipeline[ *" + suffix + " ]";

View File

@ -38,20 +38,17 @@ public WrappedRequest(final HttpServletRequest originalRequest,
this.pathInfo = pathInfo; this.pathInfo = pathInfo;
} }
/** {@inheritDoc} */
@Override @Override
public String getPathTranslated() { public String getPathTranslated() {
final String p = getPathInfo(); final String p = getPathInfo();
return p != null ? getSession().getServletContext().getRealPath(p) : null; return p != null ? getSession().getServletContext().getRealPath(p) : null;
} }
/** {@inheritDoc} */
@Override @Override
public String getPathInfo() { public String getPathInfo() {
return pathInfo; return pathInfo;
} }
/** {@inheritDoc} */
@Override @Override
public String getServletPath() { public String getServletPath() {
return path; return path;

View File

@ -47,7 +47,6 @@ private static class ServiceConfig {
} }
} }
/** {@inheritDoc} */
@Override @Override
public ReceivePack create(HttpServletRequest req, Repository db) public ReceivePack create(HttpServletRequest req, Repository db)
throws ServiceNotEnabledException, ServiceNotAuthorizedException { throws ServiceNotEnabledException, ServiceNotAuthorizedException {

View File

@ -38,7 +38,6 @@ private static class ServiceConfig {
} }
} }
/** {@inheritDoc} */
@Override @Override
public UploadPack create(HttpServletRequest req, Repository db) public UploadPack create(HttpServletRequest req, Repository db)
throws ServiceNotEnabledException, ServiceNotAuthorizedException { throws ServiceNotEnabledException, ServiceNotAuthorizedException {

View File

@ -36,7 +36,6 @@ class RefsUnreadableInMemoryRepository extends InMemoryRepository {
failing = false; failing = false;
} }
/** {@inheritDoc} */
@Override @Override
public RefDatabase getRefDatabase() { public RefDatabase getRefDatabase() {
return refs; return refs;
@ -54,7 +53,6 @@ void startFailing() {
private class RefsUnreadableRefDatabase extends MemRefDatabase { private class RefsUnreadableRefDatabase extends MemRefDatabase {
/** {@inheritDoc} */
@Override @Override
public Ref exactRef(String name) throws IOException { public Ref exactRef(String name) throws IOException {
if (failing) { if (failing) {
@ -63,7 +61,6 @@ public Ref exactRef(String name) throws IOException {
return super.exactRef(name); return super.exactRef(name);
} }
/** {@inheritDoc} */
@Override @Override
public Map<String, Ref> getRefs(String prefix) throws IOException { public Map<String, Ref> getRefs(String prefix) throws IOException {
if (failing) { if (failing) {
@ -73,7 +70,6 @@ public Map<String, Ref> getRefs(String prefix) throws IOException {
return super.getRefs(prefix); return super.getRefs(prefix);
} }
/** {@inheritDoc} */
@Override @Override
public List<Ref> getRefsByPrefix(String prefix) throws IOException { public List<Ref> getRefsByPrefix(String prefix) throws IOException {
if (failing) { if (failing) {
@ -83,7 +79,6 @@ public List<Ref> getRefsByPrefix(String prefix) throws IOException {
return super.getRefsByPrefix(prefix); return super.getRefsByPrefix(prefix);
} }
/** {@inheritDoc} */
@Override @Override
public List<Ref> getRefsByPrefixWithExclusions(String include, Set<String> excludes) public List<Ref> getRefsByPrefixWithExclusions(String include, Set<String> excludes)
throws IOException { throws IOException {
@ -94,7 +89,6 @@ public List<Ref> getRefsByPrefixWithExclusions(String include, Set<String> exclu
return super.getRefsByPrefixWithExclusions(include, excludes); return super.getRefsByPrefixWithExclusions(include, excludes);
} }
/** {@inheritDoc} */
@Override @Override
public Set<Ref> getTipsWithSha1(ObjectId id) throws IOException { public Set<Ref> getTipsWithSha1(ObjectId id) throws IOException {
if (failing) { if (failing) {

View File

@ -41,7 +41,6 @@ public TestRepositoryResolver(TestRepository<Repository> repo, String repoName)
this.repoName = repoName; this.repoName = repoName;
} }
/** {@inheritDoc} */
@Override @Override
public Repository open(HttpServletRequest req, String name) public Repository open(HttpServletRequest req, String name)
throws RepositoryNotFoundException, ServiceNotEnabledException { throws RepositoryNotFoundException, ServiceNotEnabledException {

View File

@ -146,7 +146,6 @@ public String getResponseHeader(String name) {
return responseHeaders != null ? responseHeaders.get(name) : null; return responseHeaders != null ? responseHeaders.get(name) : null;
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();

View File

@ -260,7 +260,9 @@ public ServletContextHandler addContext(String path) {
* Configure basic authentication. * Configure basic authentication.
* *
* @param ctx * @param ctx
* servlet context handler
* @param methods * @param methods
* the methods
* @return servlet context handler * @return servlet context handler
*/ */
public ServletContextHandler authBasic(ServletContextHandler ctx, public ServletContextHandler authBasic(ServletContextHandler ctx,

View File

@ -45,14 +45,12 @@ public abstract class HttpTestCase extends LocalDiskRepositoryTestCase {
/** In-memory application server; subclass must start. */ /** In-memory application server; subclass must start. */
protected AppServer server; protected AppServer server;
/** {@inheritDoc} */
@Override @Override
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp(); super.setUp();
server = createServer(); server = createServer();
} }
/** {@inheritDoc} */
@Override @Override
public void tearDown() throws Exception { public void tearDown() throws Exception {
server.tearDown(); server.tearDown();
@ -78,6 +76,7 @@ protected AppServer createServer() {
* *
* @return the TestRepository * @return the TestRepository
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected TestRepository<Repository> createTestRepository() protected TestRepository<Repository> createTestRepository()
throws IOException { throws IOException {
@ -90,8 +89,10 @@ protected TestRepository<Repository> createTestRepository()
* Convert path to URIish * Convert path to URIish
* *
* @param path * @param path
* the path
* @return the URIish * @return the URIish
* @throws URISyntaxException * @throws URISyntaxException
* if URI is invalid
*/ */
protected URIish toURIish(String path) throws URISyntaxException { protected URIish toURIish(String path) throws URISyntaxException {
URI u = server.getURI().resolve(path); URI u = server.getURI().resolve(path);
@ -102,9 +103,12 @@ protected URIish toURIish(String path) throws URISyntaxException {
* Convert a path relative to the app's context path to a URIish * Convert a path relative to the app's context path to a URIish
* *
* @param app * @param app
* app name
* @param name * @param name
* context path name
* @return the warnings (if any) from the last execution * @return the warnings (if any) from the last execution
* @throws URISyntaxException * @throws URISyntaxException
* if URI is invalid
*/ */
protected URIish toURIish(ServletContextHandler app, String name) protected URIish toURIish(ServletContextHandler app, String name)
throws URISyntaxException { throws URISyntaxException {
@ -128,7 +132,9 @@ protected List<AccessEvent> getRequests() {
* Get requests. * Get requests.
* *
* @param base * @param base
* base URI
* @param path * @param path
* the request path relative to {@code base}
* *
* @return list of events * @return list of events
*/ */
@ -140,6 +146,7 @@ protected List<AccessEvent> getRequests(URIish base, String path) {
* Get requests. * Get requests.
* *
* @param path * @param path
* request path
* *
* @return list of events * @return list of events
*/ */
@ -151,8 +158,11 @@ protected List<AccessEvent> getRequests(String path) {
* Run fsck * Run fsck
* *
* @param db * @param db
* the repository
* @param tips * @param tips
* tips to start checking from
* @throws Exception * @throws Exception
* if an error occurred
*/ */
protected static void fsck(Repository db, RevObject... tips) protected static void fsck(Repository db, RevObject... tips)
throws Exception { throws Exception {
@ -166,6 +176,7 @@ protected static void fsck(Repository db, RevObject... tips)
* Mirror refs * Mirror refs
* *
* @param refs * @param refs
* the refs
* @return set of RefSpecs * @return set of RefSpecs
*/ */
protected static Set<RefSpec> mirror(String... refs) { protected static Set<RefSpec> mirror(String... refs) {
@ -183,9 +194,12 @@ protected static Set<RefSpec> mirror(String... refs) {
* Push a commit * Push a commit
* *
* @param from * @param from
* repository from which to push
* @param q * @param q
* commit to push
* @return collection of RefUpdates * @return collection of RefUpdates
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected static Collection<RemoteRefUpdate> push(TestRepository from, protected static Collection<RemoteRefUpdate> push(TestRepository from,
RevCommit q) throws IOException { RevCommit q) throws IOException {
@ -205,7 +219,9 @@ protected static Collection<RemoteRefUpdate> push(TestRepository from,
* Create loose object path * Create loose object path
* *
* @param base * @param base
* base URI
* @param id * @param id
* objectId
* @return path of the loose object * @return path of the loose object
*/ */
public static String loose(URIish base, AnyObjectId id) { public static String loose(URIish base, AnyObjectId id) {
@ -219,6 +235,7 @@ public static String loose(URIish base, AnyObjectId id) {
* Join a base URIish and a path * Join a base URIish and a path
* *
* @param base * @param base
* base URI
* @param path * @param path
* a relative path * a relative path
* @return the joined path * @return the joined path
@ -237,8 +254,11 @@ public static String join(URIish base, String path) {
* Rewrite a url * Rewrite a url
* *
* @param url * @param url
* the URL
* @param newProtocol * @param newProtocol
* new protocol
* @param newPort * @param newPort
* new port
* @return the rewritten url * @return the rewritten url
*/ */
protected static String rewriteUrl(String url, String newProtocol, protected static String rewriteUrl(String url, String newProtocol,
@ -263,9 +283,12 @@ protected static String rewriteUrl(String url, String newProtocol,
* Extend a path * Extend a path
* *
* @param uri * @param uri
* the URI
* @param pathComponents * @param pathComponents
* path components
* @return the extended URIish * @return the extended URIish
* @throws URISyntaxException * @throws URISyntaxException
* if URI is invalid
*/ */
protected static URIish extendPath(URIish uri, String pathComponents) protected static URIish extendPath(URIish uri, String pathComponents)
throws URISyntaxException { throws URISyntaxException {

View File

@ -28,19 +28,19 @@ public class MockServletConfig implements ServletConfig {
* Set init parameter. * Set init parameter.
* *
* @param name * @param name
* parameter name
* @param value * @param value
* parameter value
*/ */
public void setInitParameter(String name, String value) { public void setInitParameter(String name, String value) {
parameters.put(name, value); parameters.put(name, value);
} }
/** {@inheritDoc} */
@Override @Override
public String getInitParameter(String name) { public String getInitParameter(String name) {
return parameters.get(name); return parameters.get(name);
} }
/** {@inheritDoc} */
@Override @Override
public Enumeration<String> getInitParameterNames() { public Enumeration<String> getInitParameterNames() {
final Iterator<String> i = parameters.keySet().iterator(); final Iterator<String> i = parameters.keySet().iterator();
@ -58,13 +58,11 @@ public String nextElement() {
}; };
} }
/** {@inheritDoc} */
@Override @Override
public String getServletName() { public String getServletName() {
return "MOCK_SERVLET"; return "MOCK_SERVLET";
} }
/** {@inheritDoc} */
@Override @Override
public ServletContext getServletContext() { public ServletContext getServletContext() {
return null; return null;

View File

@ -70,6 +70,7 @@ public RecordingLogger() {
* Constructor for <code>RecordingLogger</code>. * Constructor for <code>RecordingLogger</code>.
* *
* @param name * @param name
* logger name
*/ */
public RecordingLogger(String name) { public RecordingLogger(String name) {
this.name = name; this.name = name;

View File

@ -40,6 +40,7 @@ public class SimpleHttpServer {
* Constructor for <code>SimpleHttpServer</code>. * Constructor for <code>SimpleHttpServer</code>.
* *
* @param repository * @param repository
* the repository
*/ */
public SimpleHttpServer(Repository repository) { public SimpleHttpServer(Repository repository) {
this(repository, false); this(repository, false);
@ -49,7 +50,9 @@ public SimpleHttpServer(Repository repository) {
* Constructor for <code>SimpleHttpServer</code>. * Constructor for <code>SimpleHttpServer</code>.
* *
* @param repository * @param repository
* the repository
* @param withSsl * @param withSsl
* whether to encrypt the communication
*/ */
public SimpleHttpServer(Repository repository, boolean withSsl) { public SimpleHttpServer(Repository repository, boolean withSsl) {
this.db = repository; this.db = repository;
@ -60,6 +63,7 @@ public SimpleHttpServer(Repository repository, boolean withSsl) {
* Start the server * Start the server
* *
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public void start() throws Exception { public void start() throws Exception {
ServletContextHandler sBasic = server.authBasic(smart("/sbasic")); ServletContextHandler sBasic = server.authBasic(smart("/sbasic"));
@ -76,6 +80,7 @@ public void start() throws Exception {
* Stop the server. * Stop the server.
* *
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public void stop() throws Exception { public void stop() throws Exception {
server.tearDown(); server.tearDown();

View File

@ -72,7 +72,6 @@ List<AccessEvent> getEvents() {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void handle(String target, Request baseRequest, public void handle(String target, Request baseRequest,
HttpServletRequest request, HttpServletResponse response) HttpServletRequest request, HttpServletResponse response)

View File

@ -116,7 +116,9 @@ public class SshTestGitServer {
* @param hostKey * @param hostKey
* the unencrypted private key to use as host key * the unencrypted private key to use as host key
* @throws IOException * @throws IOException
* if an IO error occurred
* @throws GeneralSecurityException * @throws GeneralSecurityException
* if something went wrong
*/ */
public SshTestGitServer(@NonNull String testUser, @NonNull Path testKey, public SshTestGitServer(@NonNull String testUser, @NonNull Path testKey,
@NonNull Repository repository, @NonNull byte[] hostKey) @NonNull Repository repository, @NonNull byte[] hostKey)
@ -138,7 +140,9 @@ public SshTestGitServer(@NonNull String testUser, @NonNull Path testKey,
* @param hostKey * @param hostKey
* the unencrypted private key to use as host key * the unencrypted private key to use as host key
* @throws IOException * @throws IOException
* if an IO error occurred
* @throws GeneralSecurityException * @throws GeneralSecurityException
* if something went wrong
* @since 5.9 * @since 5.9
*/ */
public SshTestGitServer(@NonNull String testUser, @NonNull Path testKey, public SshTestGitServer(@NonNull String testUser, @NonNull Path testKey,
@ -413,6 +417,7 @@ public PropertyResolver getPropertyResolver() {
* @return the port the server listens on; test clients should connect to * @return the port the server listens on; test clients should connect to
* that port * that port
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public int start() throws IOException { public int start() throws IOException {
server.start(); server.start();
@ -423,6 +428,7 @@ public int start() throws IOException {
* Stops the test server. * Stops the test server.
* *
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public void stop() throws IOException { public void stop() throws IOException {
executorService.shutdownNow(); executorService.shutdownNow();

View File

@ -191,6 +191,7 @@ private static void write(BufferedWriter out, byte[] bytes, int lineLength)
* to use * to use
* @return the public-key part of the line * @return the public-key part of the line
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected static String createKnownHostsFile(File file, String host, protected static String createKnownHostsFile(File file, String host,
int port, File publicKey) throws IOException { int port, File publicKey) throws IOException {

View File

@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

@ -107,6 +107,7 @@ private static String s(byte[] raw) {
* Get test resource file. * Get test resource file.
* *
* @param fileName * @param fileName
* file name
* @return the test resource file * @return the test resource file
*/ */
public static File getTestResourceFile(String fileName) { public static File getTestResourceFile(String fileName) {
@ -141,8 +142,11 @@ public static File getTestResourceFile(String fileName) {
* Copy test resource. * Copy test resource.
* *
* @param name * @param name
* resource name
* @param dest * @param dest
* destination file
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public static void copyTestResource(String name, File dest) public static void copyTestResource(String name, File dest)
throws IOException { throws IOException {
@ -165,10 +169,14 @@ private static ClassLoader cl() {
* Write a trash file. * Write a trash file.
* *
* @param db * @param db
* the repository
* @param name * @param name
* file name
* @param data * @param data
* file content
* @return the trash file * @return the trash file
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public static File writeTrashFile(final Repository db, public static File writeTrashFile(final Repository db,
final String name, final String data) throws IOException { final String name, final String data) throws IOException {
@ -181,11 +189,16 @@ public static File writeTrashFile(final Repository db,
* Write a trash file. * Write a trash file.
* *
* @param db * @param db
* the repository
* @param subdir * @param subdir
* under working tree
* @param name * @param name
* file name
* @param data * @param data
* file content
* @return the trash file * @return the trash file
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public static File writeTrashFile(final Repository db, public static File writeTrashFile(final Repository db,
final String subdir, final String subdir,
@ -237,9 +250,12 @@ public static String read(File file) throws IOException {
* Read a file's content * Read a file's content
* *
* @param db * @param db
* the repository
* @param name * @param name
* file name
* @return the content of the file * @return the content of the file
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public static String read(Repository db, String name) public static String read(Repository db, String name)
throws IOException { throws IOException {
@ -251,6 +267,7 @@ public static String read(Repository db, String name)
* Check if file exists * Check if file exists
* *
* @param db * @param db
* the repository
* @param name * @param name
* name of the file * name of the file
* @return {@code true} if the file exists * @return {@code true} if the file exists
@ -264,8 +281,11 @@ public static boolean check(Repository db, String name) {
* Delete a trash file. * Delete a trash file.
* *
* @param db * @param db
* the repository
* @param name * @param name
* file name
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public static void deleteTrashFile(final Repository db, public static void deleteTrashFile(final Repository db,
final String name) throws IOException { final String name) throws IOException {
@ -284,6 +304,7 @@ public static void deleteTrashFile(final Repository db,
* the target of the symbolic link * the target of the symbolic link
* @return the path to the symbolic link * @return the path to the symbolic link
* @throws Exception * @throws Exception
* if an error occurred
* @since 4.2 * @since 4.2
*/ */
public static Path writeLink(Repository db, String link, public static Path writeLink(Repository db, String link,

View File

@ -107,6 +107,7 @@ private String getTestName() {
* Setup test * Setup test
* *
* @throws Exception * @throws Exception
* if an error occurred
*/ */
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
@ -189,6 +190,7 @@ private static String makePath(List<?> objects) {
* Tear down the test * Tear down the test
* *
* @throws Exception * @throws Exception
* if an error occurred
*/ */
@After @After
public void tearDown() throws Exception { public void tearDown() throws Exception {
@ -314,11 +316,11 @@ private static void reportDeleteFailure(boolean failOnError, File f,
* {@link #CONTENT} controlling which info is present in the * {@link #CONTENT} controlling which info is present in the
* resulting string. * resulting string.
* @return a string encoding the index state * @return a string encoding the index state
* @throws IllegalStateException
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public static String indexState(Repository repo, int includedOptions) public static String indexState(Repository repo, int includedOptions)
throws IllegalStateException, IOException { throws IOException {
DirCache dc = repo.readDirCache(); DirCache dc = repo.readDirCache();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
TreeSet<Instant> timeStamps = new TreeSet<>(); TreeSet<Instant> timeStamps = new TreeSet<>();
@ -452,6 +454,7 @@ public void addRepoToClose(Repository r) {
* a subdirectory * a subdirectory
* @return a unique directory for a test * @return a unique directory for a test
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected File createTempDirectory(String name) throws IOException { protected File createTempDirectory(String name) throws IOException {
File directory = new File(createTempFile(), name); File directory = new File(createTempFile(), name);
@ -467,6 +470,7 @@ protected File createTempDirectory(String name) throws IOException {
* working directory * working directory
* @return a unique directory for a test repository * @return a unique directory for a test repository
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected File createUniqueTestGitDir(boolean bare) throws IOException { protected File createUniqueTestGitDir(boolean bare) throws IOException {
String gitdirName = createTempFile().getPath(); String gitdirName = createTempFile().getPath();
@ -487,6 +491,7 @@ protected File createUniqueTestGitDir(boolean bare) throws IOException {
* *
* @return a unique path that does not exist. * @return a unique path that does not exist.
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected File createTempFile() throws IOException { protected File createTempFile() throws IOException {
File p = File.createTempFile("tmp_", "", tmp); File p = File.createTempFile("tmp_", "", tmp);
@ -586,6 +591,7 @@ protected void write(File f, String body) throws IOException {
* the file * the file
* @return the content of the file * @return the content of the file
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected String read(File f) throws IOException { protected String read(File f) throws IOException {
return JGitTestUtil.read(f); return JGitTestUtil.read(f);

View File

@ -144,32 +144,30 @@ public void clearProperties() {
* Set a property * Set a property
* *
* @param key * @param key
* the key
* @param value * @param value
* the value
*/ */
public void setProperty(String key, String value) { public void setProperty(String key, String value) {
values.put(key, value); values.put(key, value);
} }
/** {@inheritDoc} */
@Override @Override
public String getenv(String variable) { public String getenv(String variable) {
return values.get(variable); return values.get(variable);
} }
/** {@inheritDoc} */
@Override @Override
public String getProperty(String key) { public String getProperty(String key) {
return values.get(key); return values.get(key);
} }
/** {@inheritDoc} */
@Override @Override
public FileBasedConfig openUserConfig(Config parent, FS fs) { public FileBasedConfig openUserConfig(Config parent, FS fs) {
assert parent == null || parent == systemGitConfig; assert parent == null || parent == systemGitConfig;
return userGitConfig; return userGitConfig;
} }
/** {@inheritDoc} */
@Override @Override
public FileBasedConfig openSystemConfig(Config parent, FS fs) { public FileBasedConfig openSystemConfig(Config parent, FS fs) {
assert parent == null; assert parent == null;
@ -193,19 +191,16 @@ public StoredConfig getSystemConfig()
return systemGitConfig; return systemGitConfig;
} }
/** {@inheritDoc} */
@Override @Override
public String getHostname() { public String getHostname() {
return "fake.host.example.com"; return "fake.host.example.com";
} }
/** {@inheritDoc} */
@Override @Override
public long getCurrentTime() { public long getCurrentTime() {
return now; return now;
} }
/** {@inheritDoc} */
@Override @Override
public MonotonicClock getClock() { public MonotonicClock getClock() {
return () -> { return () -> {
@ -236,31 +231,26 @@ public void tick(int secDelta) {
now += secDelta * 1000L; now += secDelta * 1000L;
} }
/** {@inheritDoc} */
@Override @Override
public int getTimezone(long when) { public int getTimezone(long when) {
return getTimeZone().getOffset(when) / (60 * 1000); return getTimeZone().getOffset(when) / (60 * 1000);
} }
/** {@inheritDoc} */
@Override @Override
public TimeZone getTimeZone() { public TimeZone getTimeZone() {
return TimeZone.getTimeZone("GMT-03:30"); return TimeZone.getTimeZone("GMT-03:30");
} }
/** {@inheritDoc} */
@Override @Override
public Locale getLocale() { public Locale getLocale() {
return Locale.US; return Locale.US;
} }
/** {@inheritDoc} */
@Override @Override
public SimpleDateFormat getSimpleDateFormat(String pattern) { public SimpleDateFormat getSimpleDateFormat(String pattern) {
return new SimpleDateFormat(pattern, getLocale()); return new SimpleDateFormat(pattern, getLocale());
} }
/** {@inheritDoc} */
@Override @Override
public DateFormat getDateTimeInstance(int dateStyle, int timeStyle) { public DateFormat getDateTimeInstance(int dateStyle, int timeStyle) {
return DateFormat return DateFormat

View File

@ -21,6 +21,8 @@
public @interface Repeat { public @interface Repeat {
/** /**
* Number of repetitions * Number of repetitions
*
* @return number of repetitions
*/ */
public abstract int n(); public abstract int n();

View File

@ -125,7 +125,6 @@ public void evaluate() throws Throwable {
} }
} }
/** {@inheritDoc} */
@Override @Override
public Statement apply(Statement statement, Description description) { public Statement apply(Statement statement, Description description) {
Statement result = statement; Statement result = statement;

View File

@ -62,8 +62,11 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase {
* Copy a file * Copy a file
* *
* @param src * @param src
* file to copy
* @param dst * @param dst
* destination of the copy
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected static void copyFile(File src, File dst) protected static void copyFile(File src, File dst)
throws IOException { throws IOException {
@ -81,9 +84,12 @@ protected static void copyFile(File src, File dst)
* Write a trash file * Write a trash file
* *
* @param name * @param name
* file name
* @param data * @param data
* file content
* @return the trash file * @return the trash file
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected File writeTrashFile(String name, String data) protected File writeTrashFile(String name, String data)
throws IOException { throws IOException {
@ -99,6 +105,7 @@ protected File writeTrashFile(String name, String data)
* the target of the symbolic link * the target of the symbolic link
* @return the path to the symbolic link * @return the path to the symbolic link
* @throws Exception * @throws Exception
* if an error occurred
* @since 4.2 * @since 4.2
*/ */
protected Path writeLink(String link, String target) protected Path writeLink(String link, String target)
@ -110,10 +117,14 @@ protected Path writeLink(String link, String target)
* Write a trash file * Write a trash file
* *
* @param subdir * @param subdir
* in working tree
* @param name * @param name
* file name
* @param data * @param data
* file content
* @return the trash file * @return the trash file
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected File writeTrashFile(final String subdir, final String name, protected File writeTrashFile(final String subdir, final String name,
final String data) final String data)
@ -125,8 +136,10 @@ protected File writeTrashFile(final String subdir, final String name,
* Read content of a file * Read content of a file
* *
* @param name * @param name
* file name
* @return the file's content * @return the file's content
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected String read(String name) throws IOException { protected String read(String name) throws IOException {
return JGitTestUtil.read(db, name); return JGitTestUtil.read(db, name);
@ -149,6 +162,7 @@ protected boolean check(String name) {
* @param name * @param name
* file name * file name
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected void deleteTrashFile(String name) throws IOException { protected void deleteTrashFile(String name) throws IOException {
JGitTestUtil.deleteTrashFile(db, name); JGitTestUtil.deleteTrashFile(db, name);
@ -158,9 +172,11 @@ protected void deleteTrashFile(String name) throws IOException {
* Check content of a file. * Check content of a file.
* *
* @param f * @param f
* file
* @param checkData * @param checkData
* expected content * expected content
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected static void checkFile(File f, String checkData) protected static void checkFile(File f, String checkData)
throws IOException { throws IOException {
@ -181,7 +197,6 @@ protected static void checkFile(File f, String checkData)
/** Working directory of {@link #db}. */ /** Working directory of {@link #db}. */
protected File trash; protected File trash;
/** {@inheritDoc} */
@Override @Override
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
@ -229,11 +244,11 @@ public void tearDown() throws Exception {
* {@link #CONTENT} controlling which info is present in the * {@link #CONTENT} controlling which info is present in the
* resulting string. * resulting string.
* @return a string encoding the index state * @return a string encoding the index state
* @throws IllegalStateException
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public String indexState(int includedOptions) public String indexState(int includedOptions)
throws IllegalStateException, IOException { throws IOException {
return indexState(db, includedOptions); return indexState(db, includedOptions);
} }
@ -251,7 +266,9 @@ public String indexState(int includedOptions)
* a {@link org.eclipse.jgit.treewalk.FileTreeIterator} which * a {@link org.eclipse.jgit.treewalk.FileTreeIterator} which
* determines which files should go into the new index * determines which files should go into the new index
* @throws FileNotFoundException * @throws FileNotFoundException
* file was not found
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected void resetIndex(FileTreeIterator treeItr) protected void resetIndex(FileTreeIterator treeItr)
throws FileNotFoundException, IOException { throws FileNotFoundException, IOException {
@ -339,7 +356,9 @@ public static String slashify(String str) {
* @return return the last measured value of the filesystem timer which is * @return return the last measured value of the filesystem timer which is
* greater than then the lastmodification time of lastfile. * greater than then the lastmodification time of lastfile.
* @throws InterruptedException * @throws InterruptedException
* if thread was interrupted
* @throws IOException * @throws IOException
* if an IO error occurred
* @since 5.1.9 * @since 5.1.9
*/ */
public static Instant fsTick(File lastFile) public static Instant fsTick(File lastFile)
@ -378,8 +397,11 @@ public static Instant fsTick(File lastFile)
* Create a branch * Create a branch
* *
* @param objectId * @param objectId
* new value to create the branch on
* @param branchName * @param branchName
* branch name
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected void createBranch(ObjectId objectId, String branchName) protected void createBranch(ObjectId objectId, String branchName)
throws IOException { throws IOException {
@ -393,6 +415,7 @@ protected void createBranch(ObjectId objectId, String branchName)
* *
* @return list of refs * @return list of refs
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public List<Ref> getRefs() throws IOException { public List<Ref> getRefs() throws IOException {
return db.getRefDatabase().getRefs(); return db.getRefDatabase().getRefs();
@ -402,11 +425,12 @@ public List<Ref> getRefs() throws IOException {
* Checkout a branch * Checkout a branch
* *
* @param branchName * @param branchName
* @throws IllegalStateException * branch name
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
protected void checkoutBranch(String branchName) protected void checkoutBranch(String branchName)
throws IllegalStateException, IOException { throws IOException {
try (RevWalk walk = new RevWalk(db)) { try (RevWalk walk = new RevWalk(db)) {
RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD)); RevCommit head = walk.parseCommit(db.resolve(Constants.HEAD));
RevCommit branch = walk.parseCommit(db.resolve(branchName)); RevCommit branch = walk.parseCommit(db.resolve(branchName));
@ -436,7 +460,9 @@ protected void checkoutBranch(String branchName)
* the contents which should be written into the files * the contents which should be written into the files
* @return the File object associated to the last written file. * @return the File object associated to the last written file.
* @throws IOException * @throws IOException
* if an IO error occurred
* @throws InterruptedException * @throws InterruptedException
* if thread was interrupted
*/ */
protected File writeTrashFiles(boolean ensureDistinctTimestamps, protected File writeTrashFiles(boolean ensureDistinctTimestamps,
String... contents) String... contents)
@ -459,8 +485,11 @@ protected File writeTrashFiles(boolean ensureDistinctTimestamps,
* one. * one.
* *
* @param filename * @param filename
* file name
* @param contents * @param contents
* file content
* @param branch * @param branch
* branch name
* @return the created commit * @return the created commit
*/ */
protected RevCommit commitFile(String filename, String contents, String branch) { protected RevCommit commitFile(String filename, String contents, String branch) {
@ -494,7 +523,9 @@ else if (empty)
* Create <code>DirCacheEntry</code> * Create <code>DirCacheEntry</code>
* *
* @param path * @param path
* file path
* @param mode * @param mode
* file mode
* @return the DirCacheEntry * @return the DirCacheEntry
*/ */
protected DirCacheEntry createEntry(String path, FileMode mode) { protected DirCacheEntry createEntry(String path, FileMode mode) {
@ -505,8 +536,11 @@ protected DirCacheEntry createEntry(String path, FileMode mode) {
* Create <code>DirCacheEntry</code> * Create <code>DirCacheEntry</code>
* *
* @param path * @param path
* file path
* @param mode * @param mode
* file mode
* @param content * @param content
* file content
* @return the DirCacheEntry * @return the DirCacheEntry
*/ */
protected DirCacheEntry createEntry(final String path, final FileMode mode, protected DirCacheEntry createEntry(final String path, final FileMode mode,
@ -518,9 +552,13 @@ protected DirCacheEntry createEntry(final String path, final FileMode mode,
* Create <code>DirCacheEntry</code> * Create <code>DirCacheEntry</code>
* *
* @param path * @param path
* file path
* @param mode * @param mode
* file mode
* @param stage * @param stage
* stage index of the new entry
* @param content * @param content
* file content
* @return the DirCacheEntry * @return the DirCacheEntry
*/ */
protected DirCacheEntry createEntry(final String path, final FileMode mode, protected DirCacheEntry createEntry(final String path, final FileMode mode,
@ -538,7 +576,9 @@ protected DirCacheEntry createEntry(final String path, final FileMode mode,
* Create <code>DirCacheEntry</code> * Create <code>DirCacheEntry</code>
* *
* @param path * @param path
* file path
* @param objectId * @param objectId
* of the entry
* @return the DirCacheEntry * @return the DirCacheEntry
*/ */
protected DirCacheEntry createGitLink(String path, AnyObjectId objectId) { protected DirCacheEntry createGitLink(String path, AnyObjectId objectId) {
@ -553,8 +593,11 @@ protected DirCacheEntry createGitLink(String path, AnyObjectId objectId) {
* Assert files are equal * Assert files are equal
* *
* @param expected * @param expected
* expected file
* @param actual * @param actual
* actual file
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public static void assertEqualsFile(File expected, File actual) public static void assertEqualsFile(File expected, File actual)
throws IOException { throws IOException {

View File

@ -20,32 +20,27 @@
public final class StrictWorkMonitor implements ProgressMonitor { public final class StrictWorkMonitor implements ProgressMonitor {
private int lastWork, totalWork; private int lastWork, totalWork;
/** {@inheritDoc} */
@Override @Override
public void start(int totalTasks) { public void start(int totalTasks) {
// empty // empty
} }
/** {@inheritDoc} */
@Override @Override
public void beginTask(String title, int total) { public void beginTask(String title, int total) {
this.totalWork = total; this.totalWork = total;
lastWork = 0; lastWork = 0;
} }
/** {@inheritDoc} */
@Override @Override
public void update(int completed) { public void update(int completed) {
lastWork += completed; lastWork += completed;
} }
/** {@inheritDoc} */
@Override @Override
public void endTask() { public void endTask() {
assertEquals("Units of work recorded", totalWork, lastWork); assertEquals("Units of work recorded", totalWork, lastWork);
} }
/** {@inheritDoc} */
@Override @Override
public boolean isCancelled() { public boolean isCancelled() {
return false; return false;

View File

@ -115,6 +115,7 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
* @param db * @param db
* the test repository to write into. * the test repository to write into.
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public TestRepository(R db) throws IOException { public TestRepository(R db) throws IOException {
this(db, new RevWalk(db), new MockSystemReader()); this(db, new RevWalk(db), new MockSystemReader());
@ -128,6 +129,7 @@ public TestRepository(R db) throws IOException {
* @param rw * @param rw
* the RevObject pool to use for object lookup. * the RevObject pool to use for object lookup.
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public TestRepository(R db, RevWalk rw) throws IOException { public TestRepository(R db, RevWalk rw) throws IOException {
this(db, rw, new MockSystemReader()); this(db, rw, new MockSystemReader());
@ -144,6 +146,7 @@ public TestRepository(R db, RevWalk rw) throws IOException {
* the MockSystemReader to use for clock and other system * the MockSystemReader to use for clock and other system
* operations. * operations.
* @throws IOException * @throws IOException
* if an IO error occurred
* @since 4.2 * @since 4.2
*/ */
public TestRepository(R db, RevWalk rw, MockSystemReader reader) public TestRepository(R db, RevWalk rw, MockSystemReader reader)
@ -235,6 +238,7 @@ public void setAuthorAndCommitter(org.eclipse.jgit.lib.CommitBuilder c) {
* file content, will be UTF-8 encoded. * file content, will be UTF-8 encoded.
* @return reference to the blob. * @return reference to the blob.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevBlob blob(String content) throws Exception { public RevBlob blob(String content) throws Exception {
return blob(content.getBytes(UTF_8)); return blob(content.getBytes(UTF_8));
@ -247,6 +251,7 @@ public RevBlob blob(String content) throws Exception {
* binary file content. * binary file content.
* @return the new, fully parsed blob. * @return the new, fully parsed blob.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevBlob blob(byte[] content) throws Exception { public RevBlob blob(byte[] content) throws Exception {
ObjectId id; ObjectId id;
@ -266,6 +271,7 @@ public RevBlob blob(byte[] content) throws Exception {
* a blob, previously constructed in the repository. * a blob, previously constructed in the repository.
* @return the entry. * @return the entry.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public DirCacheEntry file(String path, RevBlob blob) public DirCacheEntry file(String path, RevBlob blob)
throws Exception { throws Exception {
@ -284,6 +290,7 @@ public DirCacheEntry file(String path, RevBlob blob)
* a blob, previously constructed in the repository. * a blob, previously constructed in the repository.
* @return the entry. * @return the entry.
* @throws Exception * @throws Exception
* if an error occurred
* @since 6.3 * @since 6.3
*/ */
public DirCacheEntry link(String path, RevBlob blob) throws Exception { public DirCacheEntry link(String path, RevBlob blob) throws Exception {
@ -301,6 +308,7 @@ public DirCacheEntry link(String path, RevBlob blob) throws Exception {
* to be sorted properly and may be empty. * to be sorted properly and may be empty.
* @return the new, fully parsed tree specified by the entry list. * @return the new, fully parsed tree specified by the entry list.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevTree tree(DirCacheEntry... entries) throws Exception { public RevTree tree(DirCacheEntry... entries) throws Exception {
final DirCache dc = DirCache.newInCore(); final DirCache dc = DirCache.newInCore();
@ -326,6 +334,7 @@ public RevTree tree(DirCacheEntry... entries) throws Exception {
* the path to find the entry of. * the path to find the entry of.
* @return the parsed object entry at this path, never null. * @return the parsed object entry at this path, never null.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevObject get(RevTree tree, String path) public RevObject get(RevTree tree, String path)
throws Exception { throws Exception {
@ -357,6 +366,7 @@ public RevObject get(RevTree tree, String path)
* zero or more IDs of the commit's parents. * zero or more IDs of the commit's parents.
* @return the ID of the new commit. * @return the ID of the new commit.
* @throws Exception * @throws Exception
* if an error occurred
* @since 5.5 * @since 5.5
*/ */
public ObjectId unparsedCommit(ObjectId... parents) throws Exception { public ObjectId unparsedCommit(ObjectId... parents) throws Exception {
@ -373,6 +383,7 @@ public ObjectId unparsedCommit(ObjectId... parents) throws Exception {
* zero or more parents of the commit. * zero or more parents of the commit.
* @return the new commit. * @return the new commit.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevCommit commit(RevCommit... parents) throws Exception { public RevCommit commit(RevCommit... parents) throws Exception {
return commit(1, tree(), parents); return commit(1, tree(), parents);
@ -389,6 +400,7 @@ public RevCommit commit(RevCommit... parents) throws Exception {
* zero or more parents of the commit. * zero or more parents of the commit.
* @return the new commit. * @return the new commit.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevCommit commit(RevTree tree, RevCommit... parents) public RevCommit commit(RevTree tree, RevCommit... parents)
throws Exception { throws Exception {
@ -407,6 +419,7 @@ public RevCommit commit(RevTree tree, RevCommit... parents)
* zero or more parents of the commit. * zero or more parents of the commit.
* @return the new commit. * @return the new commit.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevCommit commit(int secDelta, RevCommit... parents) public RevCommit commit(int secDelta, RevCommit... parents)
throws Exception { throws Exception {
@ -428,6 +441,7 @@ public RevCommit commit(int secDelta, RevCommit... parents)
* zero or more parents of the commit. * zero or more parents of the commit.
* @return the new, fully parsed commit. * @return the new, fully parsed commit.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevCommit commit(final int secDelta, final RevTree tree, public RevCommit commit(final int secDelta, final RevTree tree,
final RevCommit... parents) throws Exception { final RevCommit... parents) throws Exception {
@ -450,6 +464,7 @@ public RevCommit commit(final int secDelta, final RevTree tree,
* zero or more IDs of the commit's parents. * zero or more IDs of the commit's parents.
* @return the ID of the new commit. * @return the ID of the new commit.
* @throws Exception * @throws Exception
* if an error occurred
* @since 5.5 * @since 5.5
*/ */
public ObjectId unparsedCommit(final int secDelta, final RevTree tree, public ObjectId unparsedCommit(final int secDelta, final RevTree tree,
@ -496,6 +511,7 @@ public CommitBuilder commit() {
* object the tag should be pointed at. * object the tag should be pointed at.
* @return the new, fully parsed annotated tag object. * @return the new, fully parsed annotated tag object.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevTag tag(String name, RevObject dst) throws Exception { public RevTag tag(String name, RevObject dst) throws Exception {
final TagBuilder t = new TagBuilder(); final TagBuilder t = new TagBuilder();
@ -524,6 +540,7 @@ public RevTag tag(String name, RevObject dst) throws Exception {
* the target object. * the target object.
* @return the target object. * @return the target object.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevCommit update(String ref, CommitBuilder to) throws Exception { public RevCommit update(String ref, CommitBuilder to) throws Exception {
return update(ref, to.create()); return update(ref, to.create());
@ -534,12 +551,13 @@ public RevCommit update(String ref, CommitBuilder to) throws Exception {
* *
* @param ref * @param ref
* the name of the reference to amend, which must already exist. * the name of the reference to amend, which must already exist.
* If {@code ref} does not start with {@code refs/} and is not the * If {@code ref} does not start with {@code refs/} and is not
* magic names {@code HEAD} {@code FETCH_HEAD} or {@code * the magic names {@code HEAD} {@code FETCH_HEAD} or {@code
* MERGE_HEAD}, then {@code refs/heads/} will be prefixed in front * MERGE_HEAD}, then {@code refs/heads/} will be prefixed in
* of the given name, thereby assuming it is a branch. * front of the given name, thereby assuming it is a branch.
* @return commit builder that amends the branch on commit. * @return commit builder that amends the branch on commit.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public CommitBuilder amendRef(String ref) throws Exception { public CommitBuilder amendRef(String ref) throws Exception {
String name = normalizeRef(ref); String name = normalizeRef(ref);
@ -556,6 +574,7 @@ public CommitBuilder amendRef(String ref) throws Exception {
* the id of the commit to amend. * the id of the commit to amend.
* @return commit builder. * @return commit builder.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public CommitBuilder amend(AnyObjectId id) throws Exception { public CommitBuilder amend(AnyObjectId id) throws Exception {
return amend(pool.parseCommit(id), commit()); return amend(pool.parseCommit(id), commit());
@ -610,6 +629,7 @@ public void apply(DirCacheEntry ent) {
* the target object. * the target object.
* @return the target object. * @return the target object.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public <T extends AnyObjectId> T update(String ref, T obj) throws Exception { public <T extends AnyObjectId> T update(String ref, T obj) throws Exception {
ref = normalizeRef(ref); ref = normalizeRef(ref);
@ -632,9 +652,10 @@ public <T extends AnyObjectId> T update(String ref, T obj) throws Exception {
* Delete a reference. * Delete a reference.
* *
* @param ref * @param ref
* the name of the reference to delete. This is normalized * the name of the reference to delete. This is normalized in the
* in the same way as {@link #update(String, AnyObjectId)}. * same way as {@link #update(String, AnyObjectId)}.
* @throws Exception * @throws Exception
* if an error occurred
* @since 4.4 * @since 4.4
*/ */
public void delete(String ref) throws Exception { public void delete(String ref) throws Exception {
@ -674,6 +695,7 @@ private static String normalizeRef(String ref) {
* @param id * @param id
* ID of detached head. * ID of detached head.
* @throws Exception * @throws Exception
* if an error occurred
* @see #reset(String) * @see #reset(String)
*/ */
public void reset(AnyObjectId id) throws Exception { public void reset(AnyObjectId id) throws Exception {
@ -695,13 +717,14 @@ public void reset(AnyObjectId id) throws Exception {
/** /**
* Soft-reset HEAD to a different commit. * Soft-reset HEAD to a different commit.
* <p> * <p>
* This is equivalent to {@code git reset --soft} in that it modifies HEAD but * This is equivalent to {@code git reset --soft} in that it modifies HEAD
* not the index or the working tree of a non-bare repository. * but not the index or the working tree of a non-bare repository.
* *
* @param name * @param name
* revision string; either an existing ref name, or something that * revision string; either an existing ref name, or something
* can be parsed to an object ID. * that can be parsed to an object ID.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public void reset(String name) throws Exception { public void reset(String name) throws Exception {
RefUpdate.Result result; RefUpdate.Result result;
@ -735,6 +758,7 @@ public void reset(String name) throws Exception {
* @return the new, fully parsed commit, or null if no work was done due to * @return the new, fully parsed commit, or null if no work was done due to
* the resulting tree being identical. * the resulting tree being identical.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevCommit cherryPick(AnyObjectId id) throws Exception { public RevCommit cherryPick(AnyObjectId id) throws Exception {
RevCommit commit = pool.parseCommit(id); RevCommit commit = pool.parseCommit(id);
@ -779,6 +803,7 @@ public RevCommit cherryPick(AnyObjectId id) throws Exception {
* Update the dumb client server info files. * Update the dumb client server info files.
* *
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public void updateServerInfo() throws Exception { public void updateServerInfo() throws Exception {
if (db instanceof FileRepository) { if (db instanceof FileRepository) {
@ -816,6 +841,7 @@ protected void writeFile(String name, byte[] bin)
* parsing of. * parsing of.
* @return {@code object} * @return {@code object}
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public <T extends RevObject> T parseBody(T object) throws Exception { public <T extends RevObject> T parseBody(T object) throws Exception {
pool.parseBody(object); pool.parseBody(object);
@ -851,6 +877,7 @@ public BranchBuilder branch(String ref) {
* the object to tag * the object to tag
* @return the tagged object * @return the tagged object
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public ObjectId lightweightTag(String name, ObjectId obj) throws Exception { public ObjectId lightweightTag(String name, ObjectId obj) throws Exception {
if (!name.startsWith(Constants.R_TAGS)) if (!name.startsWith(Constants.R_TAGS))
@ -868,8 +895,11 @@ public ObjectId lightweightTag(String name, ObjectId obj) throws Exception {
* the tips to start checking from; if not supplied the refs of * the tips to start checking from; if not supplied the refs of
* the repository are used instead. * the repository are used instead.
* @throws MissingObjectException * @throws MissingObjectException
* if object is missing
* @throws IncorrectObjectTypeException * @throws IncorrectObjectTypeException
* if object has unexpected type
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public void fsck(RevObject... tips) throws MissingObjectException, public void fsck(RevObject... tips) throws MissingObjectException,
IncorrectObjectTypeException, IOException { IncorrectObjectTypeException, IOException {
@ -922,6 +952,7 @@ private static void assertHash(RevObject id, byte[] bin) {
* not removed. * not removed.
* *
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public void packAndPrune() throws Exception { public void packAndPrune() throws Exception {
if (db.getObjectDatabase() instanceof ObjectDirectory) { if (db.getObjectDatabase() instanceof ObjectDirectory) {
@ -1022,6 +1053,7 @@ public CommitBuilder commit() throws Exception {
* the commit to update to. * the commit to update to.
* @return {@code to}. * @return {@code to}.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevCommit update(CommitBuilder to) throws Exception { public RevCommit update(CommitBuilder to) throws Exception {
return update(to.create()); return update(to.create());
@ -1034,6 +1066,7 @@ public RevCommit update(CommitBuilder to) throws Exception {
* the commit to update to. * the commit to update to.
* @return {@code to}. * @return {@code to}.
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public RevCommit update(RevCommit to) throws Exception { public RevCommit update(RevCommit to) throws Exception {
return TestRepository.this.update(ref, to); return TestRepository.this.update(ref, to);
@ -1041,7 +1074,9 @@ public RevCommit update(RevCommit to) throws Exception {
/** /**
* Delete this branch. * Delete this branch.
*
* @throws Exception * @throws Exception
* if an error occurred
* @since 4.4 * @since 4.4
*/ */
public void delete() throws Exception { public void delete() throws Exception {
@ -1102,6 +1137,7 @@ public class CommitBuilder {
* parent commit * parent commit
* @return this commit builder * @return this commit builder
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public CommitBuilder parent(RevCommit p) throws Exception { public CommitBuilder parent(RevCommit p) throws Exception {
if (parents.isEmpty()) { if (parents.isEmpty()) {
@ -1165,6 +1201,7 @@ public CommitBuilder setTopLevelTree(ObjectId treeId) {
* the file content * the file content
* @return this commit builder * @return this commit builder
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public CommitBuilder add(String path, String content) throws Exception { public CommitBuilder add(String path, String content) throws Exception {
return add(path, blob(content)); return add(path, blob(content));
@ -1179,6 +1216,7 @@ public CommitBuilder add(String path, String content) throws Exception {
* blob for this file * blob for this file
* @return this commit builder * @return this commit builder
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public CommitBuilder add(String path, RevBlob id) public CommitBuilder add(String path, RevBlob id)
throws Exception { throws Exception {
@ -1404,6 +1442,7 @@ private void insertChangeId(org.eclipse.jgit.lib.CommitBuilder c) {
* *
* @return child commit builder * @return child commit builder
* @throws Exception * @throws Exception
* if an error occurred
*/ */
public CommitBuilder child() throws Exception { public CommitBuilder child() throws Exception {
return new CommitBuilder(this); return new CommitBuilder(this);

View File

@ -40,7 +40,6 @@ public void tick(long add, TimeUnit unit) {
now += unit.toMillis(add); now += unit.toMillis(add);
} }
/** {@inheritDoc} */
@Override @Override
public ProposedTimestamp propose() { public ProposedTimestamp propose() {
long t = now++; long t = now++;

View File

@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

@ -60,6 +60,7 @@ public interface LargeFileRepository {
* @return length of the object content in bytes, -1 if the object doesn't * @return length of the object content in bytes, -1 if the object doesn't
* exist * exist
* @throws java.io.IOException * @throws java.io.IOException
* if an IO error occurred
*/ */
long getSize(AnyLongObjectId id) throws IOException; long getSize(AnyLongObjectId id) throws IOException;
} }

View File

@ -164,7 +164,6 @@ public boolean isVerify() {
} }
} }
/** {@inheritDoc} */
@Override @Override
protected void doPost(HttpServletRequest req, HttpServletResponse res) protected void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException { throws ServletException, IOException {

View File

@ -38,13 +38,16 @@ public class FileLfsRepository implements LargeFileRepository {
private final Path dir; private final Path dir;
/** /**
* <p>Constructor for FileLfsRepository.</p> * <p>
* Constructor for FileLfsRepository.
* </p>
* *
* @param url * @param url
* external URL of this repository * external URL of this repository
* @param dir * @param dir
* storage directory * storage directory
* @throws java.io.IOException * @throws java.io.IOException
* if an IO error occurred
*/ */
public FileLfsRepository(String url, Path dir) throws IOException { public FileLfsRepository(String url, Path dir) throws IOException {
this.url = url; this.url = url;
@ -52,26 +55,22 @@ public FileLfsRepository(String url, Path dir) throws IOException {
Files.createDirectories(dir); Files.createDirectories(dir);
} }
/** {@inheritDoc} */
@Override @Override
public Response.Action getDownloadAction(AnyLongObjectId id) { public Response.Action getDownloadAction(AnyLongObjectId id) {
return getAction(id); return getAction(id);
} }
/** {@inheritDoc} */
@Override @Override
public Action getUploadAction(AnyLongObjectId id, long size) { public Action getUploadAction(AnyLongObjectId id, long size) {
return getAction(id); return getAction(id);
} }
/** {@inheritDoc} */
@Override @Override
@Nullable @Nullable
public Action getVerifyAction(AnyLongObjectId id) { public Action getVerifyAction(AnyLongObjectId id) {
return null; return null;
} }
/** {@inheritDoc} */
@Override @Override
public long getSize(AnyLongObjectId id) throws IOException { public long getSize(AnyLongObjectId id) throws IOException {
Path p = getPath(id); Path p = getPath(id);
@ -148,6 +147,8 @@ private static void formatHexChar(char[] dst, int p, int b) {
} }
/** /**
* Get URL of content server
*
* @return the url of the content server * @return the url of the content server
* @since 4.11 * @since 4.11
*/ */
@ -156,6 +157,8 @@ public String getUrl() {
} }
/** /**
* Set the URL of the content server
*
* @param url * @param url
* the url of the content server * the url of the content server
* @since 4.11 * @since 4.11

View File

@ -50,7 +50,9 @@ public class ObjectDownloadListener implements WriteListener {
private ByteBuffer buffer = ByteBuffer.allocateDirect(8192); private ByteBuffer buffer = ByteBuffer.allocateDirect(8192);
/** /**
* <p>Constructor for ObjectDownloadListener.</p> * <p>
* Constructor for ObjectDownloadListener.
* </p>
* *
* @param repository * @param repository
* the repository storing large objects * the repository storing large objects
@ -61,6 +63,7 @@ public class ObjectDownloadListener implements WriteListener {
* @param id * @param id
* id of the object to be downloaded * id of the object to be downloaded
* @throws java.io.IOException * @throws java.io.IOException
* if an IO error occurred
*/ */
public ObjectDownloadListener(FileLfsRepository repository, public ObjectDownloadListener(FileLfsRepository repository,
AsyncContext context, HttpServletResponse response, AsyncContext context, HttpServletResponse response,

View File

@ -92,7 +92,9 @@ public interface Callback {
* @param id * @param id
* a {@link org.eclipse.jgit.lfs.lib.AnyLongObjectId} object. * a {@link org.eclipse.jgit.lfs.lib.AnyLongObjectId} object.
* @throws java.io.FileNotFoundException * @throws java.io.FileNotFoundException
* if file wasn't found
* @throws java.io.IOException * @throws java.io.IOException
* if an IO error occurred
*/ */
public ObjectUploadListener(FileLfsRepository repository, public ObjectUploadListener(FileLfsRepository repository,
AsyncContext context, HttpServletRequest request, AsyncContext context, HttpServletRequest request,
@ -146,7 +148,6 @@ public void onDataAvailable() throws IOException {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void onAllDataRead() throws IOException { public void onAllDataRead() throws IOException {
close(); close();
@ -156,6 +157,7 @@ public void onAllDataRead() throws IOException {
* Close resources held by this listener * Close resources held by this listener
* *
* @throws java.io.IOException * @throws java.io.IOException
* if an IO error occurred
*/ */
protected void close() throws IOException { protected void close() throws IOException {
try { try {
@ -174,7 +176,6 @@ protected void close() throws IOException {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {
try { try {

View File

@ -58,7 +58,6 @@ public S3Repository(S3Config config) {
this.s3Config = config; this.s3Config = config;
} }
/** {@inheritDoc} */
@Override @Override
public Response.Action getDownloadAction(AnyLongObjectId oid) { public Response.Action getDownloadAction(AnyLongObjectId oid) {
URL endpointUrl = getObjectUrl(oid); URL endpointUrl = getObjectUrl(oid);
@ -75,7 +74,6 @@ public Response.Action getDownloadAction(AnyLongObjectId oid) {
return a; return a;
} }
/** {@inheritDoc} */
@Override @Override
public Response.Action getUploadAction(AnyLongObjectId oid, long size) { public Response.Action getUploadAction(AnyLongObjectId oid, long size) {
cacheObjectMetaData(oid, size); cacheObjectMetaData(oid, size);
@ -95,13 +93,11 @@ public Response.Action getUploadAction(AnyLongObjectId oid, long size) {
return a; return a;
} }
/** {@inheritDoc} */
@Override @Override
public Action getVerifyAction(AnyLongObjectId id) { public Action getVerifyAction(AnyLongObjectId id) {
return null; // TODO(ms) implement this return null; // TODO(ms) implement this
} }
/** {@inheritDoc} */
@Override @Override
public long getSize(AnyLongObjectId oid) throws IOException { public long getSize(AnyLongObjectId oid) throws IOException {
URL endpointUrl = getObjectUrl(oid); URL endpointUrl = getObjectUrl(oid);

View File

@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

@ -95,7 +95,6 @@ public CleanFilter(Repository db, InputStream in, OutputStream out)
this.aOut = new AtomicObjectOutputStream(tmpFile.toAbsolutePath()); this.aOut = new AtomicObjectOutputStream(tmpFile.toAbsolutePath());
} }
/** {@inheritDoc} */
@Override @Override
public int run() throws IOException { public int run() throws IOException {
try { try {

View File

@ -136,6 +136,7 @@ public void encode(OutputStream out) {
* @return an {@link org.eclipse.jgit.lfs.LfsPointer} or {@code null} if the * @return an {@link org.eclipse.jgit.lfs.LfsPointer} or {@code null} if the
* stream was not parseable as LfsPointer * stream was not parseable as LfsPointer
* @throws java.io.IOException * @throws java.io.IOException
* if an IO error occurred
*/ */
@Nullable @Nullable
public static LfsPointer parseLfsPointer(InputStream in) public static LfsPointer parseLfsPointer(InputStream in)
@ -264,7 +265,6 @@ private static boolean checkVersionLine(String s) {
return VERSION.equals(rest) || VERSION_LEGACY.equals(rest); return VERSION.equals(rest) || VERSION_LEGACY.equals(rest);
} }
/** {@inheritDoc} */
@Override @Override
public String toString() { public String toString() {
return "LfsPointer: oid=" + oid.name() + ", size=" //$NON-NLS-1$ //$NON-NLS-2$ return "LfsPointer: oid=" + oid.name() + ", size=" //$NON-NLS-1$ //$NON-NLS-2$

View File

@ -127,6 +127,7 @@ private SmudgeFilter(InputStream in, OutputStream out, Repository db)
* the objects to download * the objects to download
* @return the paths of all mediafiles which have been downloaded * @return the paths of all mediafiles which have been downloaded
* @throws IOException * @throws IOException
* if an IO error occurred
* @since 4.11 * @since 4.11
*/ */
public static Collection<Path> downloadLfsResource(Lfs lfs, Repository db, public static Collection<Path> downloadLfsResource(Lfs lfs, Repository db,
@ -217,7 +218,6 @@ public static Collection<Path> downloadLfsResource(Lfs lfs, Repository db,
return downloadedPaths; return downloadedPaths;
} }
/** {@inheritDoc} */
@Override @Override
public int run() throws IOException { public int run() throws IOException {
try { try {

View File

@ -45,6 +45,7 @@ public class AtomicObjectOutputStream extends OutputStream {
* @param id * @param id
* a {@link org.eclipse.jgit.lfs.lib.AnyLongObjectId} object. * a {@link org.eclipse.jgit.lfs.lib.AnyLongObjectId} object.
* @throws java.io.IOException * @throws java.io.IOException
* if an IO error occurred
*/ */
public AtomicObjectOutputStream(Path path, AnyLongObjectId id) public AtomicObjectOutputStream(Path path, AnyLongObjectId id)
throws IOException { throws IOException {
@ -61,6 +62,7 @@ public AtomicObjectOutputStream(Path path, AnyLongObjectId id)
* @param path * @param path
* a {@link java.nio.file.Path} object. * a {@link java.nio.file.Path} object.
* @throws java.io.IOException * @throws java.io.IOException
* if an IO error occurred
*/ */
public AtomicObjectOutputStream(Path path) throws IOException { public AtomicObjectOutputStream(Path path) throws IOException {
this(path, null); this(path, null);
@ -78,25 +80,21 @@ public AnyLongObjectId getId() {
return id; return id;
} }
/** {@inheritDoc} */
@Override @Override
public void write(int b) throws IOException { public void write(int b) throws IOException {
out.write(b); out.write(b);
} }
/** {@inheritDoc} */
@Override @Override
public void write(byte[] b) throws IOException { public void write(byte[] b) throws IOException {
out.write(b); out.write(b);
} }
/** {@inheritDoc} */
@Override @Override
public void write(byte[] b, int off, int len) throws IOException { public void write(byte[] b, int off, int len) throws IOException {
out.write(b, off, len); out.write(b, off, len);
} }
/** {@inheritDoc} */
@Override @Override
public void close() throws IOException { public void close() throws IOException {
out.close(); out.close();

View File

@ -70,6 +70,7 @@ public LfsConfig(Repository db) {
* *
* @return the delegate {@link Config} * @return the delegate {@link Config}
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
private Config getDelegate() throws IOException { private Config getDelegate() throws IOException {
if (delegate == null) { if (delegate == null) {
@ -86,6 +87,7 @@ private Config getDelegate() throws IOException {
* @return The loaded lfs config * @return The loaded lfs config
* *
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
private Config load() throws IOException { private Config load() throws IOException {
Config result = null; Config result = null;
@ -114,6 +116,7 @@ private Config load() throws IOException {
* *
* @return the config, or <code>null</code> * @return the config, or <code>null</code>
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
@Nullable @Nullable
private Config loadFromWorkingTree() private Config loadFromWorkingTree()
@ -139,6 +142,7 @@ private Config loadFromWorkingTree()
* *
* @return the config, or <code>null</code> if the entry does not exist * @return the config, or <code>null</code> if the entry does not exist
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
@Nullable @Nullable
private Config loadFromIndex() private Config loadFromIndex()
@ -162,6 +166,7 @@ private Config loadFromIndex()
* *
* @return the config, or <code>null</code> if the file does not exist * @return the config, or <code>null</code> if the file does not exist
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
@Nullable @Nullable
private Config loadFromHead() throws IOException { private Config loadFromHead() throws IOException {
@ -207,6 +212,7 @@ private Config emptyConfig() {
* the key name * the key name
* @return a String value from the config, <code>null</code> if not found * @return a String value from the config, <code>null</code> if not found
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
@Nullable @Nullable
public String getString(final String section, final String subsection, public String getString(final String section, final String subsection,

View File

@ -67,6 +67,7 @@ public class LfsConnectionFactory {
* @return the connection for the lfs server. e.g. * @return the connection for the lfs server. e.g.
* "https://github.com/github/git-lfs.git/info/lfs" * "https://github.com/github/git-lfs.git/info/lfs"
* @throws IOException * @throws IOException
* if an IO error occurred
*/ */
public static HttpConnection getLfsConnection(Repository db, String method, public static HttpConnection getLfsConnection(Repository db, String method,
String purpose) throws IOException { String purpose) throws IOException {
@ -287,6 +288,7 @@ private static final class AuthCache {
* no timeout can be determined, the token will be used only once. * no timeout can be determined, the token will be used only once.
* *
* @param action * @param action
* action with an additional expiration timestamp
*/ */
public AuthCache(Protocol.ExpiringAction action) { public AuthCache(Protocol.ExpiringAction action) {
this.cachedAction = action; this.cachedAction = action;

View File

@ -314,13 +314,11 @@ private long mask(long word, long v) {
return mask(nibbles, word, v); return mask(nibbles, word, v);
} }
/** {@inheritDoc} */
@Override @Override
public int hashCode() { public int hashCode() {
return (int) (w1 >> 32); return (int) (w1 >> 32);
} }
/** {@inheritDoc} */
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (o instanceof AbbreviatedLongObjectId) { if (o instanceof AbbreviatedLongObjectId) {
@ -355,7 +353,6 @@ public final String name() {
return new String(b, 0, nibbles); return new String(b, 0, nibbles);
} }
/** {@inheritDoc} */
@SuppressWarnings("nls") @SuppressWarnings("nls")
@Override @Override
public String toString() { public String toString() {

View File

@ -249,7 +249,6 @@ public boolean startsWith(AbbreviatedLongObjectId abbr) {
return abbr.prefixCompare(this) == 0; return abbr.prefixCompare(this) == 0;
} }
/** {@inheritDoc} */
@Override @Override
public final int hashCode() { public final int hashCode() {
return (int) (w1 >> 32); return (int) (w1 >> 32);
@ -267,7 +266,6 @@ public final boolean equals(AnyLongObjectId other) {
return other != null ? equals(this, other) : false; return other != null ? equals(this, other) : false;
} }
/** {@inheritDoc} */
@Override @Override
public final boolean equals(Object o) { public final boolean equals(Object o) {
if (o instanceof AnyLongObjectId) { if (o instanceof AnyLongObjectId) {
@ -475,7 +473,6 @@ static void formatHexChar(char[] dst, int p, long w) {
dst[o--] = '0'; dst[o--] = '0';
} }
/** {@inheritDoc} */
@SuppressWarnings("nls") @SuppressWarnings("nls")
@Override @Override
public String toString() { public String toString() {

View File

@ -41,7 +41,6 @@ public LfsPointer getPointer() {
return pointer; return pointer;
} }
/** {@inheritDoc} */
@Override @Override
public boolean include(TreeWalk walk) throws MissingObjectException, public boolean include(TreeWalk walk) throws MissingObjectException,
IncorrectObjectTypeException, IOException { IncorrectObjectTypeException, IOException {
@ -63,13 +62,11 @@ public boolean include(TreeWalk walk) throws MissingObjectException,
} }
} }
/** {@inheritDoc} */
@Override @Override
public boolean shouldBeRecursive() { public boolean shouldBeRecursive() {
return false; return false;
} }
/** {@inheritDoc} */
@Override @Override
public TreeFilter clone() { public TreeFilter clone() {
return new LfsPointerFilter(); return new LfsPointerFilter();

View File

@ -256,7 +256,6 @@ protected LongObjectId(AnyLongObjectId src) {
w4 = src.w4; w4 = src.w4;
} }
/** {@inheritDoc} */
@Override @Override
public LongObjectId toObjectId() { public LongObjectId toObjectId() {
return this; return this;

View File

@ -221,7 +221,6 @@ private void fromHexString(byte[] bs, int p) {
} }
} }
/** {@inheritDoc} */
@Override @Override
public LongObjectId toObjectId() { public LongObjectId toObjectId() {
return new LongObjectId(this); return new LongObjectId(this);

View File

@ -52,7 +52,7 @@ org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=error
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error org.eclipse.jdt.core.compiler.problem.missingJavadocComments=error
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=return_tag org.eclipse.jdt.core.compiler.problem.missingJavadocTagDescription=all_standard_tags
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error org.eclipse.jdt.core.compiler.problem.missingJavadocTags=error
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

@ -38,7 +38,6 @@ public static void install() {
private final Console cons = System.console(); private final Console cons = System.console();
/** {@inheritDoc} */
@Override @Override
protected PasswordAuthentication promptPasswordAuthentication() { protected PasswordAuthentication promptPasswordAuthentication() {
final String realm = formatRealm(); final String realm = formatRealm();

View File

@ -43,13 +43,11 @@ public static void install() {
private final Console cons = System.console(); private final Console cons = System.console();
/** {@inheritDoc} */
@Override @Override
public boolean isInteractive() { public boolean isInteractive() {
return true; return true;
} }
/** {@inheritDoc} */
@Override @Override
public boolean supports(CredentialItem... items) { public boolean supports(CredentialItem... items) {
for (CredentialItem i : items) { for (CredentialItem i : items) {
@ -71,7 +69,6 @@ else if (i instanceof CredentialItem.InformationalMessage)
return true; return true;
} }
/** {@inheritDoc} */
@Override @Override
public boolean get(URIish uri, CredentialItem... items) public boolean get(URIish uri, CredentialItem... items)
throws UnsupportedCredentialItem { throws UnsupportedCredentialItem {

View File

@ -31,7 +31,6 @@ class Add extends TextBuiltin {
@Argument(required = true, metaVar = "metaVar_filepattern", usage = "usage_filesToAddContentFrom") @Argument(required = true, metaVar = "metaVar_filepattern", usage = "usage_filesToAddContentFrom")
private List<String> filepatterns = new ArrayList<>(); private List<String> filepatterns = new ArrayList<>();
/** {@inheritDoc} */
@Override @Override
protected void run() throws Exception { protected void run() throws Exception {
try (Git git = new Git(db)) { try (Git git = new Git(db)) {

View File

@ -42,13 +42,11 @@ class AmazonS3Client extends TextBuiltin {
@Argument(index = 3, metaVar = "metaVar_KEY", required = true) @Argument(index = 3, metaVar = "metaVar_KEY", required = true)
private String key; private String key;
/** {@inheritDoc} */
@Override @Override
protected final boolean requiresRepository() { protected final boolean requiresRepository() {
return false; return false;
} }
/** {@inheritDoc} */
@Override @Override
protected void run() throws Exception { protected void run() throws Exception {
final AmazonS3 s3 = new AmazonS3(properties()); final AmazonS3 s3 = new AmazonS3(properties());

View File

@ -41,7 +41,6 @@ class Archive extends TextBuiltin {
@Option(name = "--output", aliases = { "-o" }, metaVar = "metaVar_file", usage = "usage_archiveOutput") @Option(name = "--output", aliases = { "-o" }, metaVar = "metaVar_file", usage = "usage_archiveOutput")
private String output; private String output;
/** {@inheritDoc} */
@Override @Override
protected void run() throws Exception { protected void run() throws Exception {
if (tree == null) if (tree == null)

View File

@ -104,7 +104,6 @@ void ignoreAllSpace(@SuppressWarnings("unused") boolean on) {
/** Used to get a current time stamp for lines without commit. */ /** Used to get a current time stamp for lines without commit. */
private final PersonIdent dummyDate = new PersonIdent("", ""); //$NON-NLS-1$ //$NON-NLS-2$ private final PersonIdent dummyDate = new PersonIdent("", ""); //$NON-NLS-1$ //$NON-NLS-2$
/** {@inheritDoc} */
@Override @Override
protected void run() { protected void run() {
if (file == null) { if (file == null) {

View File

@ -148,7 +148,6 @@ public void moveRename(List<String> currentAndNew) {
private int maxNameLength; private int maxNameLength;
/** {@inheritDoc} */
@Override @Override
protected void run() { protected void run() {
try { try {

View File

@ -51,7 +51,6 @@ class Checkout extends TextBuiltin {
@Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class) @Option(name = "--", metaVar = "metaVar_paths", handler = RestOfArgumentsHandler.class)
private List<String> paths = new ArrayList<>(); private List<String> paths = new ArrayList<>();
/** {@inheritDoc} */
@Override @Override
protected void run() throws Exception { protected void run() throws Exception {
if (createBranch) { if (createBranch) {

View File

@ -32,7 +32,6 @@ class Clean extends TextBuiltin {
@Option(name = "--dryRun", aliases = { "-n" }) @Option(name = "--dryRun", aliases = { "-n" })
private boolean dryRun = false; private boolean dryRun = false;
/** {@inheritDoc} */
@Override @Override
protected void run() { protected void run() {
try (Git git = new Git(db)) { try (Git git = new Git(db)) {

View File

@ -72,13 +72,11 @@ class Clone extends AbstractFetchCommand implements CloneCommand.Callback {
@Argument(index = 1, metaVar = "metaVar_directory") @Argument(index = 1, metaVar = "metaVar_directory")
private String localName; private String localName;
/** {@inheritDoc} */
@Override @Override
protected final boolean requiresRepository() { protected final boolean requiresRepository() {
return false; return false;
} }
/** {@inheritDoc} */
@Override @Override
protected void run() throws Exception { protected void run() throws Exception {
if (localName != null && gitdir != null) if (localName != null && gitdir != null)
@ -148,7 +146,6 @@ protected void run() throws Exception {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void initializedSubmodules(Collection<String> submodules) { public void initializedSubmodules(Collection<String> submodules) {
try { try {
@ -162,7 +159,6 @@ public void initializedSubmodules(Collection<String> submodules) {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void cloningSubmodule(String path) { public void cloningSubmodule(String path) {
try { try {
@ -174,7 +170,6 @@ public void cloningSubmodule(String path) {
} }
} }
/** {@inheritDoc} */
@Override @Override
public void checkingOut(AnyObjectId commit, String path) { public void checkingOut(AnyObjectId commit, String path) {
try { try {

Some files were not shown because too many files have changed in this diff Show More