summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.ssh.apache/src
diff options
context:
space:
mode:
authorAntoine Musso <hashar@free.fr>2023-05-31 17:57:28 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2023-06-16 01:08:13 +0200
commit7b955048eb86e1c12114554beacb27b329252b15 (patch)
tree9cff6f56c696ccff340a7d8bc032301b5df406d6 /org.eclipse.jgit.ssh.apache/src
parentc7960910f0baa0fe7e5b7e24e8681afeffea22a0 (diff)
downloadjgit-7b955048eb86e1c12114554beacb27b329252b15.tar.gz
jgit-7b955048eb86e1c12114554beacb27b329252b15.zip
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>
Diffstat (limited to 'org.eclipse.jgit.ssh.apache/src')
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java3
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java6
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java6
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/IdentityPasswordProvider.java2
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/KeyPasswordProvider.java2
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java1
-rw-r--r--org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/agent/Connector.java2
7 files changed, 12 insertions, 10 deletions
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java
index 5100bc9e54..76175cc5b8 100644
--- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java
+++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/JGitClientSession.java
@@ -88,8 +88,11 @@ public class JGitClientSession extends ClientSessionImpl {
/**
* @param manager
+ * client factory manager
* @param session
+ * the session
* @throws Exception
+ * an error occurred
*/
public JGitClientSession(ClientFactoryManager manager, IoSession session)
throws Exception {
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java
index 7931c76c19..a00e5d96ac 100644
--- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java
+++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/KnownHostEntryReader.java
@@ -34,9 +34,9 @@ import org.slf4j.LoggerFactory;
/**
* Apache MINA sshd 2.0.0 KnownHostEntry cannot read a host entry line like
- * "host:port ssh-rsa <key>"; it complains about an illegal character in the
- * host name (correct would be "[host]:port"). The default known_hosts reader
- * also aborts reading on the first error.
+ * "host:port ssh-rsa &lt;key&gt;"; it complains about an illegal character in
+ * the host name (correct would be "[host]:port"). The default known_hosts
+ * reader also aborts reading on the first error.
* <p>
* This reader is a bit more robust and tries to handle this case if there is
* only one colon (otherwise it might be an IPv6 address (without port)), and it
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java
index d8bf449acf..65ba5be0c5 100644
--- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java
+++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/internal/transport/sshd/OpenSshServerKeyDatabase.java
@@ -74,7 +74,6 @@ import org.slf4j.LoggerFactory;
* ignored.
* <p>
* {@code StrictHostKeyChecking} accepts the following values:
- * </p>
* <dl>
* <dt>ask</dt>
* <dd>Ask the user whether new or changed keys shall be accepted and be added
@@ -91,7 +90,6 @@ import org.slf4j.LoggerFactory;
* <p>
* If {@code StrictHostKeyChecking} is not set, or set to any other value, the
* default value <b>ask</b> is active.
- * </p>
* <p>
* This implementation relies on the {@link ClientSession} being a
* {@link JGitClientSession}. By default Apache MINA sshd does not forward the
@@ -100,23 +98,19 @@ import org.slf4j.LoggerFactory;
* used. If used with some other session type, the implementation assumes
* "<b>ask</b>".
* <p>
- * <p>
* Asking the user is done via a {@link CredentialsProvider} obtained from the
* session. If none is set, the implementation falls back to strict host key
* checking ("<b>yes</b>").
- * </p>
* <p>
* Note that adding a key to the known hosts file may create the file. You can
* specify in the constructor whether the user shall be asked about that, too.
* If the user declines updating the file, but the key was otherwise
* accepted (user confirmed for "<b>ask</b>", or "no" or "accept-new" are
* active), the key is accepted for this session only.
- * </p>
* <p>
* If several known hosts files are specified, a new key is always added to the
* first file (even if it doesn't exist yet; see the note about file creation
* above).
- * </p>
*
* @see <a href="http://man.openbsd.org/OpenBSD-current/man5/ssh_config.5">man
* ssh-config</a>
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/IdentityPasswordProvider.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/IdentityPasswordProvider.java
index 807bda89bc..23f46d8d6c 100644
--- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/IdentityPasswordProvider.java
+++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/IdentityPasswordProvider.java
@@ -247,7 +247,9 @@ public class IdentityPasswordProvider implements KeyPasswordProvider {
* the attempt result - {@code null} for success
* @return how to proceed in case of error
* @throws IOException
+ * if an IO error occurred
* @throws GeneralSecurityException
+ * something went wrong
*/
protected boolean keyLoaded(URIish uri,
State state, char[] password, Exception err)
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/KeyPasswordProvider.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/KeyPasswordProvider.java
index ed9fe37d5c..a80a5d166d 100644
--- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/KeyPasswordProvider.java
+++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/KeyPasswordProvider.java
@@ -77,7 +77,9 @@ public interface KeyPasswordProvider {
* {@code error} exception; Ignored if the key was loaded
* successfully, i.e., if {@code error == null}.
* @throws IOException
+ * if an IO error occurred
* @throws GeneralSecurityException
+ * something went wrong
*/
boolean keyLoaded(URIish uri, int attempt, Exception error)
throws IOException, GeneralSecurityException;
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java
index 7798b80f18..a99847aa91 100644
--- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java
+++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/SshdSessionFactory.java
@@ -471,6 +471,7 @@ public class SshdSessionFactory extends SshSessionFactory implements Closeable {
* {@code UserKnownHostsFile} overrides this default.
*
* @param sshDir
+ * directory containing ssh configurations
* @return the possibly empty list of default known host file paths.
*/
@NonNull
diff --git a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/agent/Connector.java b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/agent/Connector.java
index d8dfbfc94d..b391cf4884 100644
--- a/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/agent/Connector.java
+++ b/org.eclipse.jgit.ssh.apache/src/org/eclipse/jgit/transport/sshd/agent/Connector.java
@@ -26,7 +26,7 @@ public interface Connector extends Closeable {
* connected just returns {@code true}.
*
* @return {@code true} if an SSH agent is available and connected,
- * {@false} if no SSH agent is available
+ * {@code false} if no SSH agent is available
* @throws IOException
* if connecting to the SSH agent failed
*/