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.missingJavadocCommentsOverriding=disabled
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.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

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

View File

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

View File

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

View File

@ -48,7 +48,6 @@ public void setBare(boolean bare) {
this.bare = bare;
}
/** {@inheritDoc} */
@Override
public void execute() throws BuildException {
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.missingJavadocCommentsOverriding=disabled
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.missingJavadocTagsMethodTypeParameters=disabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled

View File

@ -40,6 +40,7 @@ public class BaseFormat {
* options map
* @return stream with option applied
* @throws IOException
* if an IO error occurred
*/
protected ArchiveOutputStream applyFormatOptions(ArchiveOutputStream s,
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
.unmodifiableList(Arrays.asList(".tar")); //$NON-NLS-1$
/** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
@ -47,7 +46,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
Collections.<String, Object> emptyMap());
}
/** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
@ -58,7 +56,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
return applyFormatOptions(out, o);
}
/** {@inheritDoc} */
@Override
public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader)
@ -108,19 +105,16 @@ public void putEntry(ArchiveOutputStream out,
out.closeArchiveEntry();
}
/** {@inheritDoc} */
@Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
return (other instanceof TarFormat);
}
/** {@inheritDoc} */
@Override
public int 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();
/** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
@ -41,7 +40,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
Collections.<String, Object> emptyMap());
}
/** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
@ -55,7 +53,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
return tarFormat.createArchiveOutputStream(out, o);
}
/** {@inheritDoc} */
@Override
public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader)
@ -63,19 +60,16 @@ public void putEntry(ArchiveOutputStream out,
tarFormat.putEntry(out, tree, path, mode, loader);
}
/** {@inheritDoc} */
@Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
return (other instanceof Tbz2Format);
}
/** {@inheritDoc} */
@Override
public int 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();
/** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
@ -42,7 +41,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
Collections.<String, Object> emptyMap());
}
/** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
@ -58,7 +56,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
return tarFormat.createArchiveOutputStream(out, o);
}
/** {@inheritDoc} */
@Override
public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader)
@ -66,19 +63,16 @@ public void putEntry(ArchiveOutputStream out,
tarFormat.putEntry(out, tree, path, mode, loader);
}
/** {@inheritDoc} */
@Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
return (other instanceof TgzFormat);
}
/** {@inheritDoc} */
@Override
public int 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();
/** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
throws IOException {
@ -41,7 +40,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s)
Collections.<String, Object> emptyMap());
}
/** {@inheritDoc} */
@Override
public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
Map<String, Object> o) throws IOException {
@ -55,7 +53,6 @@ public ArchiveOutputStream createArchiveOutputStream(OutputStream s,
return tarFormat.createArchiveOutputStream(out, o);
}
/** {@inheritDoc} */
@Override
public void putEntry(ArchiveOutputStream out,
ObjectId tree, String path, FileMode mode, ObjectLoader loader)
@ -63,19 +60,16 @@ public void putEntry(ArchiveOutputStream out,
tarFormat.putEntry(out, tree, path, mode, loader);
}
/** {@inheritDoc} */
@Override
public Iterable<String> suffixes() {
return SUFFIXES;
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
return (other instanceof TxzFormat);
}
/** {@inheritDoc} */
@Override
public int hashCode() {
return getClass().hashCode();

View File

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

View File

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

View File

@ -69,10 +69,13 @@ private URIish createURI(Path keyLocation) throws URISyntaxException {
* the location the key was loaded from
* @return the passphrase (maybe <code>null</code>)
* @throws PGPException
* if a PGP problem occurred
* @throws CanceledException
* in case passphrase was not entered by user
* @throws URISyntaxException
* if the URI isn't parseable
* @throws UnsupportedCredentialItem
* if a credential item isn't supported
*/
public char[] getPassphrase(byte[] keyFingerprint, Path keyLocation)
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
* 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
* file under ~/.gnupg/private-keys-v1.d/ with a name "&lt;keygrip>.key". While
* this storage organization is an implementation detail of GPG, the way
* file under ~/.gnupg/private-keys-v1.d/ with a name "&lt;keygrip&gt;.key".
* While this storage organization is an implementation detail of GPG, the way
* keygrips are computed is not; they are computed by libgcrypt and their
* definition is stable.
*/

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -191,6 +191,7 @@ private static void write(BufferedWriter out, byte[] bytes, int lineLength)
* to use
* @return the public-key part of the line
* @throws IOException
* if an IO error occurred
*/
protected static String createKnownHostsFile(File file, String host,
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.missingJavadocCommentsOverriding=disabled
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.missingJavadocTagsMethodTypeParameters=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.
*
* @param fileName
* file name
* @return the test resource file
*/
public static File getTestResourceFile(String fileName) {
@ -141,8 +142,11 @@ public static File getTestResourceFile(String fileName) {
* Copy test resource.
*
* @param name
* resource name
* @param dest
* destination file
* @throws IOException
* if an IO error occurred
*/
public static void copyTestResource(String name, File dest)
throws IOException {
@ -165,10 +169,14 @@ private static ClassLoader cl() {
* Write a trash file.
*
* @param db
* the repository
* @param name
* file name
* @param data
* file content
* @return the trash file
* @throws IOException
* if an IO error occurred
*/
public static File writeTrashFile(final Repository db,
final String name, final String data) throws IOException {
@ -181,11 +189,16 @@ public static File writeTrashFile(final Repository db,
* Write a trash file.
*
* @param db
* the repository
* @param subdir
* under working tree
* @param name
* file name
* @param data
* file content
* @return the trash file
* @throws IOException
* if an IO error occurred
*/
public static File writeTrashFile(final Repository db,
final String subdir,
@ -237,9 +250,12 @@ public static String read(File file) throws IOException {
* Read a file's content
*
* @param db
* the repository
* @param name
* file name
* @return the content of the file
* @throws IOException
* if an IO error occurred
*/
public static String read(Repository db, String name)
throws IOException {
@ -251,6 +267,7 @@ public static String read(Repository db, String name)
* Check if file exists
*
* @param db
* the repository
* @param name
* name of the file
* @return {@code true} if the file exists
@ -264,8 +281,11 @@ public static boolean check(Repository db, String name) {
* Delete a trash file.
*
* @param db
* the repository
* @param name
* file name
* @throws IOException
* if an IO error occurred
*/
public static void deleteTrashFile(final Repository db,
final String name) throws IOException {
@ -284,6 +304,7 @@ public static void deleteTrashFile(final Repository db,
* the target of the symbolic link
* @return the path to the symbolic link
* @throws Exception
* if an error occurred
* @since 4.2
*/
public static Path writeLink(Repository db, String link,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -40,7 +40,6 @@ public void tick(long add, TimeUnit unit) {
now += unit.toMillis(add);
}
/** {@inheritDoc} */
@Override
public ProposedTimestamp propose() {
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.missingJavadocCommentsOverriding=disabled
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.missingJavadocTagsMethodTypeParameters=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
* exist
* @throws java.io.IOException
* if an IO error occurred
*/
long getSize(AnyLongObjectId id) throws IOException;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -58,7 +58,6 @@ public S3Repository(S3Config config) {
this.s3Config = config;
}
/** {@inheritDoc} */
@Override
public Response.Action getDownloadAction(AnyLongObjectId oid) {
URL endpointUrl = getObjectUrl(oid);
@ -75,7 +74,6 @@ public Response.Action getDownloadAction(AnyLongObjectId oid) {
return a;
}
/** {@inheritDoc} */
@Override
public Response.Action getUploadAction(AnyLongObjectId oid, long size) {
cacheObjectMetaData(oid, size);
@ -95,13 +93,11 @@ public Response.Action getUploadAction(AnyLongObjectId oid, long size) {
return a;
}
/** {@inheritDoc} */
@Override
public Action getVerifyAction(AnyLongObjectId id) {
return null; // TODO(ms) implement this
}
/** {@inheritDoc} */
@Override
public long getSize(AnyLongObjectId oid) throws IOException {
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.missingJavadocCommentsOverriding=disabled
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.missingJavadocTagsMethodTypeParameters=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());
}
/** {@inheritDoc} */
@Override
public int run() throws IOException {
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
* stream was not parseable as LfsPointer
* @throws java.io.IOException
* if an IO error occurred
*/
@Nullable
public static LfsPointer parseLfsPointer(InputStream in)
@ -264,7 +265,6 @@ private static boolean checkVersionLine(String s) {
return VERSION.equals(rest) || VERSION_LEGACY.equals(rest);
}
/** {@inheritDoc} */
@Override
public String toString() {
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
* @return the paths of all mediafiles which have been downloaded
* @throws IOException
* if an IO error occurred
* @since 4.11
*/
public static Collection<Path> downloadLfsResource(Lfs lfs, Repository db,
@ -217,7 +218,6 @@ public static Collection<Path> downloadLfsResource(Lfs lfs, Repository db,
return downloadedPaths;
}
/** {@inheritDoc} */
@Override
public int run() throws IOException {
try {

View File

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

View File

@ -70,6 +70,7 @@ public LfsConfig(Repository db) {
*
* @return the delegate {@link Config}
* @throws IOException
* if an IO error occurred
*/
private Config getDelegate() throws IOException {
if (delegate == null) {
@ -86,6 +87,7 @@ private Config getDelegate() throws IOException {
* @return The loaded lfs config
*
* @throws IOException
* if an IO error occurred
*/
private Config load() throws IOException {
Config result = null;
@ -114,6 +116,7 @@ private Config load() throws IOException {
*
* @return the config, or <code>null</code>
* @throws IOException
* if an IO error occurred
*/
@Nullable
private Config loadFromWorkingTree()
@ -139,6 +142,7 @@ private Config loadFromWorkingTree()
*
* @return the config, or <code>null</code> if the entry does not exist
* @throws IOException
* if an IO error occurred
*/
@Nullable
private Config loadFromIndex()
@ -162,6 +166,7 @@ private Config loadFromIndex()
*
* @return the config, or <code>null</code> if the file does not exist
* @throws IOException
* if an IO error occurred
*/
@Nullable
private Config loadFromHead() throws IOException {
@ -207,6 +212,7 @@ private Config emptyConfig() {
* the key name
* @return a String value from the config, <code>null</code> if not found
* @throws IOException
* if an IO error occurred
*/
@Nullable
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.
* "https://github.com/github/git-lfs.git/info/lfs"
* @throws IOException
* if an IO error occurred
*/
public static HttpConnection getLfsConnection(Repository db, String method,
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.
*
* @param action
* action with an additional expiration timestamp
*/
public AuthCache(Protocol.ExpiringAction action) {
this.cachedAction = action;

View File

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

View File

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

View File

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

View File

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

View File

@ -221,7 +221,6 @@ private void fromHexString(byte[] bs, int p) {
}
}
/** {@inheritDoc} */
@Override
public LongObjectId toObjectId() {
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.missingJavadocCommentsOverriding=disabled
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.missingJavadocTagsMethodTypeParameters=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();
/** {@inheritDoc} */
@Override
protected PasswordAuthentication promptPasswordAuthentication() {
final String realm = formatRealm();

View File

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

View File

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

View File

@ -42,13 +42,11 @@ class AmazonS3Client extends TextBuiltin {
@Argument(index = 3, metaVar = "metaVar_KEY", required = true)
private String key;
/** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
}
/** {@inheritDoc} */
@Override
protected void run() throws Exception {
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")
private String output;
/** {@inheritDoc} */
@Override
protected void run() throws Exception {
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. */
private final PersonIdent dummyDate = new PersonIdent("", ""); //$NON-NLS-1$ //$NON-NLS-2$
/** {@inheritDoc} */
@Override
protected void run() {
if (file == null) {

View File

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

View File

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

View File

@ -32,7 +32,6 @@ class Clean extends TextBuiltin {
@Option(name = "--dryRun", aliases = { "-n" })
private boolean dryRun = false;
/** {@inheritDoc} */
@Override
protected void run() {
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")
private String localName;
/** {@inheritDoc} */
@Override
protected final boolean requiresRepository() {
return false;
}
/** {@inheritDoc} */
@Override
protected void run() throws Exception {
if (localName != null && gitdir != null)
@ -148,7 +146,6 @@ protected void run() throws Exception {
}
}
/** {@inheritDoc} */
@Override
public void initializedSubmodules(Collection<String> submodules) {
try {
@ -162,7 +159,6 @@ public void initializedSubmodules(Collection<String> submodules) {
}
}
/** {@inheritDoc} */
@Override
public void cloningSubmodule(String path) {
try {
@ -174,7 +170,6 @@ public void cloningSubmodule(String path) {
}
}
/** {@inheritDoc} */
@Override
public void checkingOut(AnyObjectId commit, String path) {
try {

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