aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.ssh.jsch/src/org/eclipse
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.jsch/src/org/eclipse
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.jsch/src/org/eclipse')
-rw-r--r--org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/internal/transport/ssh/jsch/CredentialsProviderUserInfo.java7
-rw-r--r--org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/JschConfigSessionFactory.java11
-rw-r--r--org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/JschSession.java3
-rw-r--r--org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/OpenSshConfig.java1
4 files changed, 9 insertions, 13 deletions
diff --git a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/internal/transport/ssh/jsch/CredentialsProviderUserInfo.java b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/internal/transport/ssh/jsch/CredentialsProviderUserInfo.java
index 5053493005..b40ff5a0b4 100644
--- a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/internal/transport/ssh/jsch/CredentialsProviderUserInfo.java
+++ b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/internal/transport/ssh/jsch/CredentialsProviderUserInfo.java
@@ -59,19 +59,16 @@ public class CredentialsProviderUserInfo implements UserInfo,
return uri;
}
- /** {@inheritDoc} */
@Override
public String getPassword() {
return password;
}
- /** {@inheritDoc} */
@Override
public String getPassphrase() {
return passphrase;
}
- /** {@inheritDoc} */
@Override
public boolean promptPassphrase(String msg) {
CredentialItem.StringType v = newPrompt(msg);
@@ -83,7 +80,6 @@ public class CredentialsProviderUserInfo implements UserInfo,
return false;
}
- /** {@inheritDoc} */
@Override
public boolean promptPassword(String msg) {
CredentialItem.Password p = new CredentialItem.Password(msg);
@@ -99,20 +95,17 @@ public class CredentialsProviderUserInfo implements UserInfo,
return new CredentialItem.StringType(msg, true);
}
- /** {@inheritDoc} */
@Override
public boolean promptYesNo(String msg) {
CredentialItem.YesNoType v = new CredentialItem.YesNoType(msg);
return provider.get(uri, v) && v.getValue();
}
- /** {@inheritDoc} */
@Override
public void showMessage(String msg) {
provider.get(uri, new CredentialItem.InformationalMessage(msg));
}
- /** {@inheritDoc} */
@Override
public String[] promptKeyboardInteractive(String destination, String name,
String instruction, String[] prompt, boolean[] echo) {
diff --git a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/JschConfigSessionFactory.java b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/JschConfigSessionFactory.java
index 77b68bb034..325d0549a5 100644
--- a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/JschConfigSessionFactory.java
+++ b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/JschConfigSessionFactory.java
@@ -92,7 +92,6 @@ public class JschConfigSessionFactory extends SshSessionFactory {
private OpenSshConfig config;
- /** {@inheritDoc} */
@Override
public synchronized RemoteSession getSession(URIish uri,
CredentialsProvider credentialsProvider, FS fs, int tms)
@@ -189,14 +188,22 @@ public class JschConfigSessionFactory extends SshSessionFactory {
* Use for tests only
*
* @param credentialsProvider
+ * credentials provide
* @param fs
+ * FS object to use
* @param user
+ * user
* @param pass
+ * password
* @param host
+ * host name
* @param port
+ * port number
* @param hc
- * @return session
+ * host config
+ * @return session the session
* @throws JSchException
+ * jsch failed
*/
public Session createSession(CredentialsProvider credentialsProvider,
FS fs, String user, final String pass, String host, int port,
diff --git a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/JschSession.java b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/JschSession.java
index 02cdf70812..5f36dadc04 100644
--- a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/JschSession.java
+++ b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/JschSession.java
@@ -68,20 +68,17 @@ public class JschSession implements RemoteSession2 {
this.uri = uri;
}
- /** {@inheritDoc} */
@Override
public Process exec(String command, int timeout) throws IOException {
return exec(command, Collections.emptyMap(), timeout);
}
- /** {@inheritDoc} */
@Override
public Process exec(String command, Map<String, String> environment,
int timeout) throws IOException {
return new JschProcess(command, environment, timeout);
}
- /** {@inheritDoc} */
@Override
public void disconnect() {
if (sock.isConnected())
diff --git a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/OpenSshConfig.java b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/OpenSshConfig.java
index 2873307e07..087e546f22 100644
--- a/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/OpenSshConfig.java
+++ b/org.eclipse.jgit.ssh.jsch/src/org/eclipse/jgit/transport/ssh/jsch/OpenSshConfig.java
@@ -353,7 +353,6 @@ public class OpenSshConfig implements ConfigRepository {
return host.getConfig();
}
- /** {@inheritDoc} */
@Override
public String toString() {
return "OpenSshConfig [configFile=" + configFile + ']'; //$NON-NLS-1$