aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/api/NameRevCommand.java
Commit message (Collapse)AuthorAgeFilesLines
* [errorprone] Prevent int expression may overflowMatthias Sohn2023-09-251-1/+1
| | | | | | see https://errorprone.info/bugpattern/IntLongMath Change-Id: Id201b7fc49b953d500e88b95e183127fe40ef6cc
* Fix all Javadoc warnings and fail on themAntoine Musso2023-06-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [errorprone] NameRevCommand: remove ignored call of #toStringMatthias Sohn2021-09-291-3/+4
| | | | | | | This fixes errorprone error: [ReturnValueIgnored] Return value of 'toString' must be used. Change-Id: I90d2725ae16725a053179322cfaab18cab7b8e68
* Update EDL 1.0 license headers to new short SPDX compliant formatMatthias Sohn2020-01-041-38/+5
| | | | | | | | | | This is the format given by the Eclipse legal doc generator [1]. [1] https://www.eclipse.org/projects/tools/documentation.php?id=technology.jgit Bug: 548298 Change-Id: I8d8cabc998ba1b083e3f0906a8d558d391ffb6c4 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove trivial cases of using deprecated RefDatabase.getRefs()Matthias Sohn2018-04-251-2/+3
| | | | Change-Id: I2d3e426a3391923f8a690ac68fcc33851f3eb419 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Remove unused code and link to deprecated codeJonathan Tan2018-04-251-2/+1
| | | | | | | Eclipse reports these as errors, so remove them. Change-Id: Ic53d8003f9faef38fe776af5a73794e7bb1dfc49 Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
* Fix javadoc in org.eclipse.jgit annotations and api packagesMatthias Sohn2017-12-181-11/+13
| | | | Change-Id: I2761ea91f8dfed16ea54e7a6646af03a30c15ec9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Enable and fix warnings about redundant specification of type argumentsDavid Pursehouse2017-02-201-6/+6
| | | | | | | | | | Since the introduction of generic type parameter inference in Java 7, it's not necessary to explicitly specify the type of generic parameters. Enable the warning in Eclipse, and fix all occurrences. Change-Id: I9158caf1beca5e4980b6240ac401f3868520aad0 Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
* Ensure that NameRevCommand.call() closes RevWalkMatthias Sohn2015-04-041-2/+2
| | | | Change-Id: Icc35a81081759d664fe9e2b05e962ff3cd9aad92 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* Fix NameRevCommand when repo has no annotated tagsDave Borowitz2014-03-251-5/+10
| | | | | | | | | | | | Previously, calling addAnnotatedTags() did not modify any state when there were no annotated tags in the repository. This caused the code to assume no addFoo() methods had been called, and fell back to the default of adding refs/*. Instead, use null to indicate neither addRefs() nor addAnnotatedTags() was called. Add a test for this behavior. Change-Id: I9926e5ac17e1a983cd399798993031c72bd79c2c
* Fix a possible NPERobin Rosenberg2013-04-041-1/+1
| | | | | | | String.valueOf is an overloaded and the compiler unfortunately picks the wrong one since null contains no type information. Change-Id: Icd197eaa046421f3cfcc5bf3e7601dc5bc7486b6
* Fix @since tags in JGit, version 2.4 never existedTomasz Zarna2013-03-211-1/+3
| | | | Change-Id: Iaca88ec28b412e6b58e7b39a0762ba54b25f9471 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
* NameRevCommand: Don't use merge cost for first parentDave Borowitz2013-03-151-1/+8
| | | | | | | | Treat first parent traversals as 1 and higher parents as MERGE_COST, to match git name-rev. Allow overriding the merge cost during tests to avoid creating 2^16 commits on the fly. Change-Id: I0175e0c3ab1abe6722e4241abe2f106d1fe92a69
* NameRevCommand: Use ~ notation for first parents of mergesDave Borowitz2013-03-141-3/+2
| | | | | | | Prefer ~(N+1) to ^1~N. Although both are correct, the former is cleaner and matches "git name-rev". Change-Id: I772001a219e5eb346f5552c92e6d98c70b2cfa98
* Allow adding single refs or all tags to NameRevCommandDave Borowitz2013-03-131-21/+74
| | | | Change-Id: I90e85bc835d11278631afd0e801425a292578bba
* Add a NameRevCommand for describing IDs in terms of refnamesDave Borowitz2013-03-111-0/+328
The walk logic does not use RevWalk because it needs to walk all paths to each of the requested commits, keeping track of each path along which the commit was found in the RevCommit subclass. From these paths, a single "best" path is chosen based on the total path length, with a penalty applied for paths that traverse merges. This functionality parallels "git name-rev". Change-Id: I92bfb47dd16c898313d2ee525395609c3bf72ebe